15: Add getOpenPositions() to Jupiter Perps API (dummy)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.r35157.libs.jupiter.perps;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Service for reading Jupiter Perps positions.
|
||||
@@ -27,4 +28,18 @@ public interface JupiterPerpsPositionService {
|
||||
*/
|
||||
JupiterPerpsPosition getPosition(ΩJupiterPerpsPositionAccountΩ positionAccount)
|
||||
throws IOException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Finds open Jupiter Perps positions owned by a wallet.
|
||||
*
|
||||
* <p>This method returns decoded Jupiter Perps position objects. It does not return
|
||||
* raw Solana accounts or account ids.</p>
|
||||
*
|
||||
* @param owner the wallet address that owns the Jupiter Perps positions
|
||||
* @return the open Jupiter Perps positions owned by the wallet
|
||||
* @throws IOException if the position accounts could not be fetched or decoded
|
||||
* @throws InterruptedException if the calling thread is interrupted while fetching positions
|
||||
*/
|
||||
Set<JupiterPerpsPosition> getOpenPositions(ΩSolanaWalletIdΩ owner)
|
||||
throws IOException, InterruptedException;
|
||||
}
|
||||
+10
@@ -6,6 +6,7 @@ import com.r35157.libs.solana.SolanaAccountInfo;
|
||||
import com.r35157.libs.solana.SolanaBlockChain;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
public class AnchorIdlJupiterPerpsPositionServiceImpl implements JupiterPerpsPositionService {
|
||||
|
||||
@@ -35,6 +36,15 @@ public class AnchorIdlJupiterPerpsPositionServiceImpl implements JupiterPerpsPos
|
||||
return pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<JupiterPerpsPosition> getOpenPositions(
|
||||
ΩSolanaWalletIdΩ owner
|
||||
) throws IOException, InterruptedException {
|
||||
throw new UnsupportedOperationException(
|
||||
"Finding Jupiter Perps positions by owner is not implemented yet."
|
||||
);
|
||||
}
|
||||
|
||||
private static final ΩJupiterPerpsProgramIdΩ JUPITER_PERPS_PROGRAM_ID =
|
||||
"PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user