49: Migrate position decrease alarm to high-level operation
This commit is contained in:
+4
-11
@@ -5,8 +5,6 @@ import com.r35157.cryptowallet.solana.impl.ref.SolanaWalletImpl;
|
|||||||
import com.r35157.libs.jupiter.perps.JupiterPerpsPosition;
|
import com.r35157.libs.jupiter.perps.JupiterPerpsPosition;
|
||||||
import com.r35157.libs.jupiter.perps.JupiterPerpsService;
|
import com.r35157.libs.jupiter.perps.JupiterPerpsService;
|
||||||
import com.r35157.libs.solana.SolanaBlockChain;
|
import com.r35157.libs.solana.SolanaBlockChain;
|
||||||
import com.r35157.libs.solana.SolanaSignedTransaction;
|
|
||||||
import com.r35157.libs.solana.SolanaUnsignedTransaction;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -73,8 +71,9 @@ public final class JupiterPerpsPositionDecreaseAlarmAction
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SolanaUnsignedTransaction utrans =
|
ΩSolanaTransactionSignatureΩ signature =
|
||||||
jupiter.buildPositionDecreaseTransaction(
|
jupiter.executePositionDecrease(
|
||||||
|
wallet,
|
||||||
position.positionAccount(),
|
position.positionAccount(),
|
||||||
positionDecrease.receiveToken()
|
positionDecrease.receiveToken()
|
||||||
.receiveTokenMint(),
|
.receiveTokenMint(),
|
||||||
@@ -82,12 +81,6 @@ public final class JupiterPerpsPositionDecreaseAlarmAction
|
|||||||
positionDecrease.maxSlippageBps()
|
positionDecrease.maxSlippageBps()
|
||||||
);
|
);
|
||||||
|
|
||||||
SolanaSignedTransaction strans =
|
|
||||||
wallet.signTransaction(utrans);
|
|
||||||
|
|
||||||
ΩSolanaTransactionSignatureΩ signature =
|
|
||||||
jupiter.executePositionDecreaseTransaction(strans);
|
|
||||||
|
|
||||||
System.out.println(
|
System.out.println(
|
||||||
"Position Decrease Signature: " + signature
|
"Position Decrease Signature: " + signature
|
||||||
);
|
);
|
||||||
@@ -180,4 +173,4 @@ public final class JupiterPerpsPositionDecreaseAlarmAction
|
|||||||
private final SolanaWallet wallet;
|
private final SolanaWallet wallet;
|
||||||
private final JupiterPerpsService jupiter;
|
private final JupiterPerpsService jupiter;
|
||||||
private final AlarmVariableResolver variableResolver;
|
private final AlarmVariableResolver variableResolver;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user