flash-sdk 9.0.3 → 9.9.0-alpha.0
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 +27 -19
- package/dist/PerpetualsClient.js +460 -530
- package/dist/PoolConfig.d.ts +2 -1
- package/dist/PoolConfig.js +10 -2
- package/dist/PoolConfig.json +1605 -396
- package/dist/idl/perpetuals.d.ts +226 -524
- package/dist/idl/perpetuals.js +225 -523
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { Program, AnchorProvider, BN } from "@coral-xyz/anchor";
|
|
|
2
2
|
import { PublicKey, TransactionInstruction, Commitment, Signer, AddressLookupTableAccount, VersionedTransaction } from "@solana/web3.js";
|
|
3
3
|
import { PoolAccount } from "./PoolAccount";
|
|
4
4
|
import { PositionAccount } from "./PositionAccount";
|
|
5
|
-
import { AddLiquidityAmountAndFee, InternalPrice, BorrowRateParams, ExitPriceAndFee, Fees, OracleParams, Permissions, PricingParams, RemoveCollateralData, RemoveLiquidityAmountAndFee, Side, TokenRatios, FeesAction, ContractOraclePrice, Privilege, PerpetualsAccount, Trading, EntryPriceAndFeeV2, TokenPermissions, TokenStake, InternalEmaPrice } from "./types";
|
|
5
|
+
import { AddLiquidityAmountAndFee, InternalPrice, BorrowRateParams, ExitPriceAndFee, Fees, OracleParams, Permissions, PricingParams, RemoveCollateralData, RemoveLiquidityAmountAndFee, Side, TokenRatios, MinAndMaxPrice, FeesAction, ContractOraclePrice, Privilege, PerpetualsAccount, Trading, EntryPriceAndFeeV2, EntryPriceAndFee, TokenPermissions, TokenStake, InternalEmaPrice } from "./types";
|
|
6
6
|
import { OraclePrice } from "./OraclePrice";
|
|
7
7
|
import { CustodyAccount } from "./CustodyAccount";
|
|
8
8
|
import { Perpetuals } from "./idl/perpetuals";
|
|
@@ -41,6 +41,7 @@ export declare class PerpetualsClient {
|
|
|
41
41
|
bump: number;
|
|
42
42
|
};
|
|
43
43
|
addressLookupTables: AddressLookupTableAccount[];
|
|
44
|
+
pusherAddressLookupTables: AddressLookupTableAccount;
|
|
44
45
|
eventAuthority: {
|
|
45
46
|
publicKey: PublicKey;
|
|
46
47
|
bump: number;
|
|
@@ -259,6 +260,7 @@ export declare class PerpetualsClient {
|
|
|
259
260
|
conf: BN;
|
|
260
261
|
ema: BN;
|
|
261
262
|
publishTime: BN;
|
|
263
|
+
extOracleAccount: PublicKey;
|
|
262
264
|
market: PublicKey;
|
|
263
265
|
limitOrders: unknown;
|
|
264
266
|
takeProfitOrders: unknown;
|
|
@@ -600,6 +602,7 @@ export declare class PerpetualsClient {
|
|
|
600
602
|
conf: BN;
|
|
601
603
|
ema: BN;
|
|
602
604
|
publishTime: BN;
|
|
605
|
+
extOracleAccount: PublicKey;
|
|
603
606
|
market: PublicKey;
|
|
604
607
|
limitOrders: unknown;
|
|
605
608
|
takeProfitOrders: unknown;
|
|
@@ -940,6 +943,7 @@ export declare class PerpetualsClient {
|
|
|
940
943
|
conf: BN;
|
|
941
944
|
ema: BN;
|
|
942
945
|
publishTime: BN;
|
|
946
|
+
extOracleAccount: PublicKey;
|
|
943
947
|
market: PublicKey;
|
|
944
948
|
limitOrders: unknown;
|
|
945
949
|
takeProfitOrders: unknown;
|
|
@@ -1284,6 +1288,7 @@ export declare class PerpetualsClient {
|
|
|
1284
1288
|
conf: BN;
|
|
1285
1289
|
ema: BN;
|
|
1286
1290
|
publishTime: BN;
|
|
1291
|
+
extOracleAccount: PublicKey;
|
|
1287
1292
|
market: PublicKey;
|
|
1288
1293
|
limitOrders: unknown;
|
|
1289
1294
|
takeProfitOrders: unknown;
|
|
@@ -1627,6 +1632,7 @@ export declare class PerpetualsClient {
|
|
|
1627
1632
|
conf: BN;
|
|
1628
1633
|
ema: BN;
|
|
1629
1634
|
publishTime: BN;
|
|
1635
|
+
extOracleAccount: PublicKey;
|
|
1630
1636
|
market: PublicKey;
|
|
1631
1637
|
limitOrders: unknown;
|
|
1632
1638
|
takeProfitOrders: unknown;
|
|
@@ -1968,6 +1974,7 @@ export declare class PerpetualsClient {
|
|
|
1968
1974
|
conf: BN;
|
|
1969
1975
|
ema: BN;
|
|
1970
1976
|
publishTime: BN;
|
|
1977
|
+
extOracleAccount: PublicKey;
|
|
1971
1978
|
market: PublicKey;
|
|
1972
1979
|
limitOrders: unknown;
|
|
1973
1980
|
takeProfitOrders: unknown;
|
|
@@ -2308,6 +2315,7 @@ export declare class PerpetualsClient {
|
|
|
2308
2315
|
conf: BN;
|
|
2309
2316
|
ema: BN;
|
|
2310
2317
|
publishTime: BN;
|
|
2318
|
+
extOracleAccount: PublicKey;
|
|
2311
2319
|
market: PublicKey;
|
|
2312
2320
|
limitOrders: unknown;
|
|
2313
2321
|
takeProfitOrders: unknown;
|
|
@@ -2648,6 +2656,7 @@ export declare class PerpetualsClient {
|
|
|
2648
2656
|
conf: BN;
|
|
2649
2657
|
ema: BN;
|
|
2650
2658
|
publishTime: BN;
|
|
2659
|
+
extOracleAccount: PublicKey;
|
|
2651
2660
|
market: PublicKey;
|
|
2652
2661
|
limitOrders: unknown;
|
|
2653
2662
|
takeProfitOrders: unknown;
|
|
@@ -3035,6 +3044,7 @@ export declare class PerpetualsClient {
|
|
|
3035
3044
|
conf: BN;
|
|
3036
3045
|
ema: BN;
|
|
3037
3046
|
publishTime: BN;
|
|
3047
|
+
extOracleAccount: PublicKey;
|
|
3038
3048
|
market: PublicKey;
|
|
3039
3049
|
limitOrders: unknown;
|
|
3040
3050
|
takeProfitOrders: unknown;
|
|
@@ -3375,6 +3385,7 @@ export declare class PerpetualsClient {
|
|
|
3375
3385
|
conf: BN;
|
|
3376
3386
|
ema: BN;
|
|
3377
3387
|
publishTime: BN;
|
|
3388
|
+
extOracleAccount: PublicKey;
|
|
3378
3389
|
market: PublicKey;
|
|
3379
3390
|
limitOrders: unknown;
|
|
3380
3391
|
takeProfitOrders: unknown;
|
|
@@ -3715,6 +3726,7 @@ export declare class PerpetualsClient {
|
|
|
3715
3726
|
conf: BN;
|
|
3716
3727
|
ema: BN;
|
|
3717
3728
|
publishTime: BN;
|
|
3729
|
+
extOracleAccount: PublicKey;
|
|
3718
3730
|
market: PublicKey;
|
|
3719
3731
|
limitOrders: unknown;
|
|
3720
3732
|
takeProfitOrders: unknown;
|
|
@@ -4055,6 +4067,7 @@ export declare class PerpetualsClient {
|
|
|
4055
4067
|
conf: BN;
|
|
4056
4068
|
ema: BN;
|
|
4057
4069
|
publishTime: BN;
|
|
4070
|
+
extOracleAccount: PublicKey;
|
|
4058
4071
|
market: PublicKey;
|
|
4059
4072
|
limitOrders: unknown;
|
|
4060
4073
|
takeProfitOrders: unknown;
|
|
@@ -4395,6 +4408,7 @@ export declare class PerpetualsClient {
|
|
|
4395
4408
|
conf: BN;
|
|
4396
4409
|
ema: BN;
|
|
4397
4410
|
publishTime: BN;
|
|
4411
|
+
extOracleAccount: PublicKey;
|
|
4398
4412
|
market: PublicKey;
|
|
4399
4413
|
limitOrders: unknown;
|
|
4400
4414
|
takeProfitOrders: unknown;
|
|
@@ -4563,10 +4577,12 @@ export declare class PerpetualsClient {
|
|
|
4563
4577
|
min: OraclePrice;
|
|
4564
4578
|
max: OraclePrice;
|
|
4565
4579
|
};
|
|
4580
|
+
getMinAndMaxPriceSync: (price: OraclePrice, emaPrice: OraclePrice, custodyAccount: CustodyAccount) => MinAndMaxPrice;
|
|
4566
4581
|
checkIfPriceStaleOrCustom: (price: OraclePrice, emaPrice: OraclePrice, custodyAccount: CustodyAccount, timestampInSeconds: BN) => boolean;
|
|
4567
4582
|
getAveragePriceSync: (price1: BN, size1: BN, price2: BN, size2: BN) => BN;
|
|
4568
4583
|
getLeverageSync: (sizeUsd: BN, collateralAmount: BN, collateralMinOraclePrice: OraclePrice, collateralTokenDecimals: number, pnlUsd: BN) => BN;
|
|
4569
4584
|
getLeverageAtAmountEntryWithSwapSync: (positionAccount: PositionAccount | null, inputDeltaAmount: BN, sizeDeltaAmount: BN, side: Side, poolAccount: PoolAccount, inputTokenPrice: OraclePrice, inputTokenEmaPrice: OraclePrice, inputTokenCustodyAccount: CustodyAccount, swapOutTokenPrice: OraclePrice, swapOutTokenEmaPrice: OraclePrice, swapOutTokenCustodyAccount: CustodyAccount, collateralTokenPrice: OraclePrice, collateralTokenEmaPrice: OraclePrice, collateralTokenCustodyAccount: CustodyAccount, targetTokenPrice: OraclePrice, targetTokenEmaPrice: OraclePrice, targetTokenCustodyAccount: CustodyAccount, swapPoolAumUsdMax: BN, poolConfigPosition: PoolConfig, poolConfigSwap: PoolConfig, pnlUsd: BN) => BN;
|
|
4585
|
+
getEntryPriceAndFeeSync: (positionAccount: PositionAccount | null, marketCorrelation: boolean, collateralDeltaAmount: BN, sizeDeltaAmount: BN, side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN, discountBps?: BN) => EntryPriceAndFee;
|
|
4570
4586
|
getEntryPriceAndFeeSyncV2: (positionAccount: PositionAccount | null, marketCorrelation: boolean, collateralDeltaAmount: BN, sizeDeltaAmount: BN, side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN, discountBps?: BN, enableLogs?: boolean) => EntryPriceAndFeeV2;
|
|
4571
4587
|
getEntryPriceUsdSync: (side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, sizeUsd: BN) => OraclePrice;
|
|
4572
4588
|
getPriceAfterSlippage(isEntry: boolean, slippageBps: BN, targetPrice: OraclePrice, side: Side): ContractOraclePrice;
|
|
@@ -4706,14 +4722,6 @@ export declare class PerpetualsClient {
|
|
|
4706
4722
|
instructions: TransactionInstruction[];
|
|
4707
4723
|
additionalSigners: Signer[];
|
|
4708
4724
|
}>;
|
|
4709
|
-
updateNftAccount: (nftMint: PublicKey, updateReferer: boolean, updateBooster: boolean, flpStakeAccounts: PublicKey[]) => Promise<{
|
|
4710
|
-
instructions: TransactionInstruction[];
|
|
4711
|
-
additionalSigners: Signer[];
|
|
4712
|
-
}>;
|
|
4713
|
-
levelUp: (poolConfig: PoolConfig, nftMint: PublicKey, authorizationRulesAccount: PublicKey) => Promise<{
|
|
4714
|
-
instructions: TransactionInstruction[];
|
|
4715
|
-
additionalSigners: Signer[];
|
|
4716
|
-
}>;
|
|
4717
4725
|
depositStake: (owner: PublicKey, feePayer: PublicKey, depositAmount: BN, poolConfig: PoolConfig) => Promise<{
|
|
4718
4726
|
instructions: TransactionInstruction[];
|
|
4719
4727
|
additionalSigners: Signer[];
|
|
@@ -4757,14 +4765,6 @@ export declare class PerpetualsClient {
|
|
|
4757
4765
|
instructions: TransactionInstruction[];
|
|
4758
4766
|
additionalSigners: Signer[];
|
|
4759
4767
|
}>;
|
|
4760
|
-
burnAndClaim: (owner: PublicKey, nftMint: PublicKey, poolConfig: PoolConfig, createAta: boolean) => Promise<{
|
|
4761
|
-
instructions: TransactionInstruction[];
|
|
4762
|
-
additionalSigners: Signer[];
|
|
4763
|
-
}>;
|
|
4764
|
-
burnAndStake: (owner: PublicKey, feePayer: PublicKey, nftMint: PublicKey, poolConfig: PoolConfig) => Promise<{
|
|
4765
|
-
instructions: TransactionInstruction[];
|
|
4766
|
-
additionalSigners: Signer[];
|
|
4767
|
-
}>;
|
|
4768
4768
|
depositTokenStake: (owner: PublicKey, feePayer: PublicKey, depositAmount: BN, poolConfig: PoolConfig) => Promise<{
|
|
4769
4769
|
instructions: TransactionInstruction[];
|
|
4770
4770
|
additionalSigners: Signer[];
|
|
@@ -4890,11 +4890,11 @@ export declare class PerpetualsClient {
|
|
|
4890
4890
|
instructions: TransactionInstruction[];
|
|
4891
4891
|
additionalSigners: Signer[];
|
|
4892
4892
|
}>;
|
|
4893
|
-
setInternalOraclePrice: (tokenMint: PublicKey, price: BN, expo: number, conf: BN, ema: BN, publishTime: BN, poolConfig: PoolConfig) => Promise<{
|
|
4893
|
+
setInternalOraclePrice: (tokenMint: PublicKey, useCurrentTime: number, price: BN, expo: number, conf: BN, ema: BN, publishTime: BN, poolConfig: PoolConfig) => Promise<{
|
|
4894
4894
|
instructions: TransactionInstruction[];
|
|
4895
4895
|
additionalSigners: Signer[];
|
|
4896
4896
|
}>;
|
|
4897
|
-
setInternalOraclePriceBatch: (tokenMintList: PublicKey[], tokenInternalPrices: InternalPrice[], POOL_CONFIGS: PoolConfig[]) => Promise<{
|
|
4897
|
+
setInternalOraclePriceBatch: (useCurrentTime: number, tokenMintList: PublicKey[], tokenInternalPrices: InternalPrice[], POOL_CONFIGS: PoolConfig[]) => Promise<{
|
|
4898
4898
|
instructions: TransactionInstruction[];
|
|
4899
4899
|
additionalSigners: Signer[];
|
|
4900
4900
|
}>;
|
|
@@ -4926,6 +4926,10 @@ export declare class PerpetualsClient {
|
|
|
4926
4926
|
instructions: TransactionInstruction[];
|
|
4927
4927
|
additionalSigners: Signer[];
|
|
4928
4928
|
}>;
|
|
4929
|
+
withdrawUnclaimedTokens: (poolConfig: PoolConfig) => Promise<{
|
|
4930
|
+
instructions: TransactionInstruction[];
|
|
4931
|
+
additionalSigners: Signer[];
|
|
4932
|
+
}>;
|
|
4929
4933
|
initRevenueTokenAccount: (feeShareBps: BN, rewardSymbol: string, poolConfig: PoolConfig) => Promise<{
|
|
4930
4934
|
instructions: TransactionInstruction[];
|
|
4931
4935
|
additionalSigners: Signer[];
|
|
@@ -4942,4 +4946,8 @@ export declare class PerpetualsClient {
|
|
|
4942
4946
|
instructions: TransactionInstruction[];
|
|
4943
4947
|
additionalSigners: Signer[];
|
|
4944
4948
|
}>;
|
|
4949
|
+
resizeInternalOracle: (extOracle: PublicKey, tokenMint: PublicKey, intOracleAccount: PublicKey) => Promise<{
|
|
4950
|
+
instructions: TransactionInstruction[];
|
|
4951
|
+
additionalSigners: Signer[];
|
|
4952
|
+
}>;
|
|
4945
4953
|
}
|