flash-sdk 12.1.2-alpha.0 → 13.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PerpetualsClient.d.ts +30 -26
- package/dist/PerpetualsClient.js +979 -744
- package/dist/PoolConfig.json +6 -6
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +2 -1
- package/dist/idl/perpetuals.d.ts +234 -127
- package/dist/idl/perpetuals.json +234 -127
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/generated.d.ts +7 -10
- package/package.json +3 -4
|
@@ -751,47 +751,47 @@ export declare class PerpetualsClient {
|
|
|
751
751
|
getLiquidationPriceView: (positionAccountKey: PublicKey, poolConfig: PoolConfig) => Promise<any>;
|
|
752
752
|
getLiquidationStateView: (positionAccount: PublicKey, poolName: string, tokenMint: PublicKey, collateralMint: PublicKey, poolConfig: PoolConfig) => Promise<any>;
|
|
753
753
|
getCompoundingTokenDataView: (poolConfig: PoolConfig) => Promise<any>;
|
|
754
|
-
openPosition: (targetSymbol: string, collateralSymbol: string, priceWithSlippage: ContractOraclePrice, collateralWithfee: BN, size: BN, side: Side, poolConfig: PoolConfig, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey, skipBalanceChecks?: boolean, ephemeralSignerPubkey?:
|
|
754
|
+
openPosition: (targetSymbol: string, collateralSymbol: string, priceWithSlippage: ContractOraclePrice, collateralWithfee: BN, size: BN, side: Side, poolConfig: PoolConfig, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey, skipBalanceChecks?: boolean, ephemeralSignerPubkey?: any) => Promise<{
|
|
755
755
|
instructions: TransactionInstruction[];
|
|
756
756
|
additionalSigners: Signer[];
|
|
757
757
|
}>;
|
|
758
|
-
closePosition: (marketSymbol: string, collateralSymbol: string, priceWithSlippage: ContractOraclePrice, side: Side, poolConfig: PoolConfig, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey, createUserATA?: boolean, closeUsersWSOLATA?: boolean, ephemeralSignerPubkey?:
|
|
758
|
+
closePosition: (marketSymbol: string, collateralSymbol: string, priceWithSlippage: ContractOraclePrice, side: Side, poolConfig: PoolConfig, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey, createUserATA?: boolean, closeUsersWSOLATA?: boolean, ephemeralSignerPubkey?: any) => Promise<{
|
|
759
759
|
instructions: TransactionInstruction[];
|
|
760
760
|
additionalSigners: Signer[];
|
|
761
761
|
}>;
|
|
762
|
-
swapAndOpen: (targetTokenSymbol: string, collateralTokenSymbol: string, userInputTokenSymbol: string, amountIn: BN, priceWithSlippage: ContractOraclePrice, sizeAmount: BN, side: Side, poolConfig: PoolConfig, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey, skipBalanceChecks?: boolean, ephemeralSignerPubkey?:
|
|
762
|
+
swapAndOpen: (targetTokenSymbol: string, collateralTokenSymbol: string, userInputTokenSymbol: string, amountIn: BN, priceWithSlippage: ContractOraclePrice, sizeAmount: BN, side: Side, poolConfig: PoolConfig, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey, skipBalanceChecks?: boolean, ephemeralSignerPubkey?: any) => Promise<{
|
|
763
763
|
instructions: TransactionInstruction[];
|
|
764
764
|
additionalSigners: Signer[];
|
|
765
765
|
}>;
|
|
766
|
-
closeAndSwap: (targetTokenSymbol: string, userOutputTokenSymbol: string, collateralTokenSymbol: string, priceWithSlippage: ContractOraclePrice, side: Side, poolConfig: PoolConfig, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey, ephemeralSignerPubkey?:
|
|
766
|
+
closeAndSwap: (targetTokenSymbol: string, userOutputTokenSymbol: string, collateralTokenSymbol: string, priceWithSlippage: ContractOraclePrice, side: Side, poolConfig: PoolConfig, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey, ephemeralSignerPubkey?: any) => Promise<{
|
|
767
767
|
instructions: TransactionInstruction[];
|
|
768
768
|
additionalSigners: Signer[];
|
|
769
769
|
}>;
|
|
770
|
-
addCollateral: (collateralWithFee: BN, targetSymbol: string, collateralSymbol: string, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, skipBalanceChecks?: boolean, ephemeralSignerPubkey?:
|
|
770
|
+
addCollateral: (collateralWithFee: BN, targetSymbol: string, collateralSymbol: string, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, skipBalanceChecks?: boolean, ephemeralSignerPubkey?: any) => Promise<{
|
|
771
771
|
instructions: TransactionInstruction[];
|
|
772
772
|
additionalSigners: Signer[];
|
|
773
773
|
}>;
|
|
774
|
-
swapAndAddCollateral: (targetSymbol: string, inputSymbol: string, collateralSymbol: string, amountIn: BN, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, skipBalanceChecks?: boolean, ephemeralSignerPubkey?:
|
|
774
|
+
swapAndAddCollateral: (targetSymbol: string, inputSymbol: string, collateralSymbol: string, amountIn: BN, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, skipBalanceChecks?: boolean, ephemeralSignerPubkey?: any) => Promise<{
|
|
775
775
|
instructions: TransactionInstruction[];
|
|
776
776
|
additionalSigners: Signer[];
|
|
777
777
|
}>;
|
|
778
|
-
removeCollateral: (collateralDeltaUsd: BN, marketSymbol: string, collateralSymbol: string, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, createUserATA?: boolean, closeUsersWSOLATA?: boolean, ephemeralSignerPubkey?:
|
|
778
|
+
removeCollateral: (collateralDeltaUsd: BN, marketSymbol: string, collateralSymbol: string, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, createUserATA?: boolean, closeUsersWSOLATA?: boolean, ephemeralSignerPubkey?: any) => Promise<{
|
|
779
779
|
instructions: TransactionInstruction[];
|
|
780
780
|
additionalSigners: Signer[];
|
|
781
781
|
}>;
|
|
782
|
-
removeCollateralAndSwap: (targetSymbol: string, collateralSymbol: string, outputSymbol: string, collateralDeltaUsd: BN, side: Side, poolConfig: PoolConfig, ephemeralSignerPubkey?:
|
|
782
|
+
removeCollateralAndSwap: (targetSymbol: string, collateralSymbol: string, outputSymbol: string, collateralDeltaUsd: BN, side: Side, poolConfig: PoolConfig, ephemeralSignerPubkey?: any) => Promise<{
|
|
783
783
|
instructions: TransactionInstruction[];
|
|
784
784
|
additionalSigners: Signer[];
|
|
785
785
|
}>;
|
|
786
|
-
increaseSize: (targetSymbol: string, collateralSymbol: string, positionPubKey: PublicKey, side: Side, poolConfig: PoolConfig, priceWithSlippage: ContractOraclePrice, sizeDelta: BN, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey
|
|
786
|
+
increaseSize: (targetSymbol: string, collateralSymbol: string, positionPubKey: PublicKey, side: Side, poolConfig: PoolConfig, priceWithSlippage: ContractOraclePrice, sizeDelta: BN, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey) => Promise<{
|
|
787
787
|
instructions: TransactionInstruction[];
|
|
788
788
|
additionalSigners: Signer[];
|
|
789
789
|
}>;
|
|
790
|
-
decreaseSize: (targetSymbol: string, collateralSymbol: string, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, priceWithSlippage: ContractOraclePrice, sizeDelta: BN, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey
|
|
790
|
+
decreaseSize: (targetSymbol: string, collateralSymbol: string, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, priceWithSlippage: ContractOraclePrice, sizeDelta: BN, privilege: Privilege, tokenStakeAccount?: PublicKey, userReferralAccount?: PublicKey) => Promise<{
|
|
791
791
|
instructions: TransactionInstruction[];
|
|
792
792
|
additionalSigners: Signer[];
|
|
793
793
|
}>;
|
|
794
|
-
addLiquidity: (payTokenSymbol: string, tokenAmountIn: BN, minLpAmountOut: BN, poolConfig: PoolConfig, skipBalanceChecks?: boolean, ephemeralSignerPubkey?:
|
|
794
|
+
addLiquidity: (payTokenSymbol: string, tokenAmountIn: BN, minLpAmountOut: BN, poolConfig: PoolConfig, skipBalanceChecks?: boolean, ephemeralSignerPubkey?: any, isWhitelistedUser?: boolean, includeRemainingAccounts?: boolean) => Promise<{
|
|
795
795
|
instructions: TransactionInstruction[];
|
|
796
796
|
additionalSigners: Signer[];
|
|
797
797
|
}>;
|
|
@@ -818,7 +818,7 @@ export declare class PerpetualsClient {
|
|
|
818
818
|
additionalSigners: Signer[];
|
|
819
819
|
}>;
|
|
820
820
|
setFeeShareBps: (poolConfig: PoolConfig, flpStakeAccountPks: PublicKey[]) => Promise<TransactionInstruction>;
|
|
821
|
-
unstakeRequest: (unstakeAmount: BN, poolConfig: PoolConfig
|
|
821
|
+
unstakeRequest: (unstakeAmount: BN, poolConfig: PoolConfig) => Promise<{
|
|
822
822
|
instructions: TransactionInstruction[];
|
|
823
823
|
additionalSigners: Signer[];
|
|
824
824
|
}>;
|
|
@@ -838,11 +838,15 @@ export declare class PerpetualsClient {
|
|
|
838
838
|
instructions: TransactionInstruction[];
|
|
839
839
|
additionalSigners: Signer[];
|
|
840
840
|
}>;
|
|
841
|
-
migrateStake: (amount: BN, rewardTokenMint: PublicKey, poolConfig: PoolConfig, createUserATA?: boolean
|
|
841
|
+
migrateStake: (amount: BN, rewardTokenMint: PublicKey, poolConfig: PoolConfig, createUserATA?: boolean) => Promise<{
|
|
842
842
|
instructions: TransactionInstruction[];
|
|
843
843
|
additionalSigners: Signer[];
|
|
844
844
|
}>;
|
|
845
|
-
|
|
845
|
+
migrateTokenStake: (tokenStakeAccounts: PublicKey[]) => Promise<{
|
|
846
|
+
instructions: TransactionInstruction[];
|
|
847
|
+
additionalSigners: Signer[];
|
|
848
|
+
}>;
|
|
849
|
+
migrateFlp: (amount: BN, rewardTokenMint: PublicKey, poolConfig: PoolConfig) => Promise<{
|
|
846
850
|
instructions: TransactionInstruction[];
|
|
847
851
|
additionalSigners: Signer[];
|
|
848
852
|
}>;
|
|
@@ -870,7 +874,7 @@ export declare class PerpetualsClient {
|
|
|
870
874
|
instructions: TransactionInstruction[];
|
|
871
875
|
additionalSigners: Signer[];
|
|
872
876
|
}>;
|
|
873
|
-
collectTokenReward: (owner: PublicKey, poolConfig: PoolConfig, createUserATA?: boolean
|
|
877
|
+
collectTokenReward: (owner: PublicKey, poolConfig: PoolConfig, createUserATA?: boolean) => Promise<{
|
|
874
878
|
instructions: TransactionInstruction[];
|
|
875
879
|
additionalSigners: Signer[];
|
|
876
880
|
}>;
|
|
@@ -886,11 +890,11 @@ export declare class PerpetualsClient {
|
|
|
886
890
|
instructions: TransactionInstruction[];
|
|
887
891
|
additionalSigners: Signer[];
|
|
888
892
|
}>;
|
|
889
|
-
placeLimitOrder: (targetSymbol: string, collateralSymbol: string, reserveSymbol: string, receiveSymbol: string, side: Side, limitPrice: ContractOraclePrice, reserveAmount: BN, sizeAmount: BN, stopLossPrice: ContractOraclePrice, takeProfitPrice: ContractOraclePrice, poolConfig: PoolConfig, skipBalanceChecks?: boolean, ephemeralSignerPubkey?:
|
|
893
|
+
placeLimitOrder: (targetSymbol: string, collateralSymbol: string, reserveSymbol: string, receiveSymbol: string, side: Side, limitPrice: ContractOraclePrice, reserveAmount: BN, sizeAmount: BN, stopLossPrice: ContractOraclePrice, takeProfitPrice: ContractOraclePrice, poolConfig: PoolConfig, skipBalanceChecks?: boolean, ephemeralSignerPubkey?: any) => Promise<{
|
|
890
894
|
instructions: TransactionInstruction[];
|
|
891
895
|
additionalSigners: Signer[];
|
|
892
896
|
}>;
|
|
893
|
-
editLimitOrder: (targetSymbol: string, collateralSymbol: string, reserveSymbol: string, receiveSymbol: string, side: Side, orderId: number, limitPrice: ContractOraclePrice, sizeAmount: BN, stopLossPrice: ContractOraclePrice, takeProfitPrice: ContractOraclePrice, poolConfig: PoolConfig, createUserATA?: boolean, ephemeralSignerPubkey?:
|
|
897
|
+
editLimitOrder: (targetSymbol: string, collateralSymbol: string, reserveSymbol: string, receiveSymbol: string, side: Side, orderId: number, limitPrice: ContractOraclePrice, sizeAmount: BN, stopLossPrice: ContractOraclePrice, takeProfitPrice: ContractOraclePrice, poolConfig: PoolConfig, createUserATA?: boolean, ephemeralSignerPubkey?: any) => Promise<{
|
|
894
898
|
instructions: TransactionInstruction[];
|
|
895
899
|
additionalSigners: Signer[];
|
|
896
900
|
}>;
|
|
@@ -902,19 +906,19 @@ export declare class PerpetualsClient {
|
|
|
902
906
|
instructions: TransactionInstruction[];
|
|
903
907
|
additionalSigners: Signer[];
|
|
904
908
|
}>;
|
|
905
|
-
placeTriggerOrder: (targetSymbol: string, collateralSymbol: string, receiveSymbol: string, side: Side, triggerPrice: ContractOraclePrice, deltaSizeAmount: BN, isStopLoss: boolean, poolConfig: PoolConfig
|
|
909
|
+
placeTriggerOrder: (targetSymbol: string, collateralSymbol: string, receiveSymbol: string, side: Side, triggerPrice: ContractOraclePrice, deltaSizeAmount: BN, isStopLoss: boolean, poolConfig: PoolConfig) => Promise<{
|
|
906
910
|
instructions: TransactionInstruction[];
|
|
907
911
|
additionalSigners: Signer[];
|
|
908
912
|
}>;
|
|
909
|
-
editTriggerOrder: (targetSymbol: string, collateralSymbol: string, receiveSymbol: string, side: Side, orderId: number, triggerPrice: ContractOraclePrice, deltaSizeAmount: BN, isStopLoss: boolean, poolConfig: PoolConfig
|
|
913
|
+
editTriggerOrder: (targetSymbol: string, collateralSymbol: string, receiveSymbol: string, side: Side, orderId: number, triggerPrice: ContractOraclePrice, deltaSizeAmount: BN, isStopLoss: boolean, poolConfig: PoolConfig) => Promise<{
|
|
910
914
|
instructions: TransactionInstruction[];
|
|
911
915
|
additionalSigners: Signer[];
|
|
912
916
|
}>;
|
|
913
|
-
cancelTriggerOrder: (targetSymbol: string, collateralSymbol: string, side: Side, orderId: number, isStopLoss: boolean, poolConfig: PoolConfig
|
|
917
|
+
cancelTriggerOrder: (targetSymbol: string, collateralSymbol: string, side: Side, orderId: number, isStopLoss: boolean, poolConfig: PoolConfig) => Promise<{
|
|
914
918
|
instructions: TransactionInstruction[];
|
|
915
919
|
additionalSigners: Signer[];
|
|
916
920
|
}>;
|
|
917
|
-
cancelAllTriggerOrders: (targetSymbol: string, collateralSymbol: string, side: Side, poolConfig: PoolConfig
|
|
921
|
+
cancelAllTriggerOrders: (targetSymbol: string, collateralSymbol: string, side: Side, poolConfig: PoolConfig) => Promise<{
|
|
918
922
|
instructions: TransactionInstruction[];
|
|
919
923
|
additionalSigners: Signer[];
|
|
920
924
|
}>;
|
|
@@ -931,7 +935,7 @@ export declare class PerpetualsClient {
|
|
|
931
935
|
signature: string;
|
|
932
936
|
versionedTransaction: VersionedTransaction;
|
|
933
937
|
}>;
|
|
934
|
-
swap: (userInputTokenSymbol: string, userOutputTokenSymbol: string, amountIn: BN, minAmountOut: BN, poolConfig: PoolConfig, useFeesPool?: boolean, createUserATA?: boolean, unWrapSol?: boolean, skipBalanceChecks?: boolean, ephemeralSignerPubkey?:
|
|
938
|
+
swap: (userInputTokenSymbol: string, userOutputTokenSymbol: string, amountIn: BN, minAmountOut: BN, poolConfig: PoolConfig, useFeesPool?: boolean, createUserATA?: boolean, unWrapSol?: boolean, skipBalanceChecks?: boolean, ephemeralSignerPubkey?: any, isWhitelistedUser?: boolean) => Promise<{
|
|
935
939
|
instructions: TransactionInstruction[];
|
|
936
940
|
additionalSigners: Signer[];
|
|
937
941
|
}>;
|
|
@@ -967,11 +971,11 @@ export declare class PerpetualsClient {
|
|
|
967
971
|
instructions: TransactionInstruction[];
|
|
968
972
|
additionalSigners: Signer[];
|
|
969
973
|
}>;
|
|
970
|
-
|
|
974
|
+
setInternalOraclePriceBatch: (useCurrentTime: number, tokenMintList: PublicKey[], tokenInternalPrices: InternalPrice[], POOL_CONFIGS: PoolConfig[]) => Promise<{
|
|
971
975
|
instructions: TransactionInstruction[];
|
|
972
976
|
additionalSigners: Signer[];
|
|
973
977
|
}>;
|
|
974
|
-
|
|
978
|
+
setInternalLazerPriceBatch: (messageData: Buffer, tokenMintList: PublicKey[], pythStorage: PublicKey, pythTreasury: PublicKey, POOL_CONFIGS: PoolConfig[]) => Promise<{
|
|
975
979
|
instructions: TransactionInstruction[];
|
|
976
980
|
additionalSigners: Signer[];
|
|
977
981
|
}>;
|
|
@@ -1031,7 +1035,7 @@ export declare class PerpetualsClient {
|
|
|
1031
1035
|
instructions: TransactionInstruction[];
|
|
1032
1036
|
additionalSigners: Signer[];
|
|
1033
1037
|
}>;
|
|
1034
|
-
resizeInternalOracle: (
|
|
1038
|
+
resizeInternalOracle: (lazerFeedId: number, tokenMint: PublicKey, intOracleAccount: PublicKey) => Promise<{
|
|
1035
1039
|
instructions: TransactionInstruction[];
|
|
1036
1040
|
additionalSigners: Signer[];
|
|
1037
1041
|
}>;
|
|
@@ -1063,7 +1067,7 @@ export declare class PerpetualsClient {
|
|
|
1063
1067
|
instructions: TransactionInstruction[];
|
|
1064
1068
|
additionalSigners: Signer[];
|
|
1065
1069
|
}>;
|
|
1066
|
-
addInternalOracle: (exponent: number,
|
|
1070
|
+
addInternalOracle: (exponent: number, lazerFeedId: number, tokenMint: PublicKey, intOracleAccount: PublicKey) => Promise<{
|
|
1067
1071
|
instructions: TransactionInstruction[];
|
|
1068
1072
|
additionalSigners: Signer[];
|
|
1069
1073
|
}>;
|