flash-sdk 9.0.3 → 10.0.0-alpha.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.
@@ -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";
@@ -259,6 +259,7 @@ export declare class PerpetualsClient {
259
259
  conf: BN;
260
260
  ema: BN;
261
261
  publishTime: BN;
262
+ extOracleAccount: PublicKey;
262
263
  market: PublicKey;
263
264
  limitOrders: unknown;
264
265
  takeProfitOrders: unknown;
@@ -600,6 +601,7 @@ export declare class PerpetualsClient {
600
601
  conf: BN;
601
602
  ema: BN;
602
603
  publishTime: BN;
604
+ extOracleAccount: PublicKey;
603
605
  market: PublicKey;
604
606
  limitOrders: unknown;
605
607
  takeProfitOrders: unknown;
@@ -940,6 +942,7 @@ export declare class PerpetualsClient {
940
942
  conf: BN;
941
943
  ema: BN;
942
944
  publishTime: BN;
945
+ extOracleAccount: PublicKey;
943
946
  market: PublicKey;
944
947
  limitOrders: unknown;
945
948
  takeProfitOrders: unknown;
@@ -1284,6 +1287,7 @@ export declare class PerpetualsClient {
1284
1287
  conf: BN;
1285
1288
  ema: BN;
1286
1289
  publishTime: BN;
1290
+ extOracleAccount: PublicKey;
1287
1291
  market: PublicKey;
1288
1292
  limitOrders: unknown;
1289
1293
  takeProfitOrders: unknown;
@@ -1627,6 +1631,7 @@ export declare class PerpetualsClient {
1627
1631
  conf: BN;
1628
1632
  ema: BN;
1629
1633
  publishTime: BN;
1634
+ extOracleAccount: PublicKey;
1630
1635
  market: PublicKey;
1631
1636
  limitOrders: unknown;
1632
1637
  takeProfitOrders: unknown;
@@ -1968,6 +1973,7 @@ export declare class PerpetualsClient {
1968
1973
  conf: BN;
1969
1974
  ema: BN;
1970
1975
  publishTime: BN;
1976
+ extOracleAccount: PublicKey;
1971
1977
  market: PublicKey;
1972
1978
  limitOrders: unknown;
1973
1979
  takeProfitOrders: unknown;
@@ -2308,6 +2314,7 @@ export declare class PerpetualsClient {
2308
2314
  conf: BN;
2309
2315
  ema: BN;
2310
2316
  publishTime: BN;
2317
+ extOracleAccount: PublicKey;
2311
2318
  market: PublicKey;
2312
2319
  limitOrders: unknown;
2313
2320
  takeProfitOrders: unknown;
@@ -2648,6 +2655,7 @@ export declare class PerpetualsClient {
2648
2655
  conf: BN;
2649
2656
  ema: BN;
2650
2657
  publishTime: BN;
2658
+ extOracleAccount: PublicKey;
2651
2659
  market: PublicKey;
2652
2660
  limitOrders: unknown;
2653
2661
  takeProfitOrders: unknown;
@@ -3035,6 +3043,7 @@ export declare class PerpetualsClient {
3035
3043
  conf: BN;
3036
3044
  ema: BN;
3037
3045
  publishTime: BN;
3046
+ extOracleAccount: PublicKey;
3038
3047
  market: PublicKey;
3039
3048
  limitOrders: unknown;
3040
3049
  takeProfitOrders: unknown;
@@ -3375,6 +3384,7 @@ export declare class PerpetualsClient {
3375
3384
  conf: BN;
3376
3385
  ema: BN;
3377
3386
  publishTime: BN;
3387
+ extOracleAccount: PublicKey;
3378
3388
  market: PublicKey;
3379
3389
  limitOrders: unknown;
3380
3390
  takeProfitOrders: unknown;
@@ -3715,6 +3725,7 @@ export declare class PerpetualsClient {
3715
3725
  conf: BN;
3716
3726
  ema: BN;
3717
3727
  publishTime: BN;
3728
+ extOracleAccount: PublicKey;
3718
3729
  market: PublicKey;
3719
3730
  limitOrders: unknown;
3720
3731
  takeProfitOrders: unknown;
@@ -4055,6 +4066,7 @@ export declare class PerpetualsClient {
4055
4066
  conf: BN;
4056
4067
  ema: BN;
4057
4068
  publishTime: BN;
4069
+ extOracleAccount: PublicKey;
4058
4070
  market: PublicKey;
4059
4071
  limitOrders: unknown;
4060
4072
  takeProfitOrders: unknown;
@@ -4395,6 +4407,7 @@ export declare class PerpetualsClient {
4395
4407
  conf: BN;
4396
4408
  ema: BN;
4397
4409
  publishTime: BN;
4410
+ extOracleAccount: PublicKey;
4398
4411
  market: PublicKey;
4399
4412
  limitOrders: unknown;
4400
4413
  takeProfitOrders: unknown;
@@ -4563,10 +4576,12 @@ export declare class PerpetualsClient {
4563
4576
  min: OraclePrice;
4564
4577
  max: OraclePrice;
4565
4578
  };
4579
+ getMinAndMaxPriceSync: (price: OraclePrice, emaPrice: OraclePrice, custodyAccount: CustodyAccount) => MinAndMaxPrice;
4566
4580
  checkIfPriceStaleOrCustom: (price: OraclePrice, emaPrice: OraclePrice, custodyAccount: CustodyAccount, timestampInSeconds: BN) => boolean;
4567
4581
  getAveragePriceSync: (price1: BN, size1: BN, price2: BN, size2: BN) => BN;
4568
4582
  getLeverageSync: (sizeUsd: BN, collateralAmount: BN, collateralMinOraclePrice: OraclePrice, collateralTokenDecimals: number, pnlUsd: BN) => BN;
4569
4583
  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;
4584
+ 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
4585
  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
4586
  getEntryPriceUsdSync: (side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, sizeUsd: BN) => OraclePrice;
4572
4587
  getPriceAfterSlippage(isEntry: boolean, slippageBps: BN, targetPrice: OraclePrice, side: Side): ContractOraclePrice;
@@ -4706,14 +4721,6 @@ export declare class PerpetualsClient {
4706
4721
  instructions: TransactionInstruction[];
4707
4722
  additionalSigners: Signer[];
4708
4723
  }>;
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
4724
  depositStake: (owner: PublicKey, feePayer: PublicKey, depositAmount: BN, poolConfig: PoolConfig) => Promise<{
4718
4725
  instructions: TransactionInstruction[];
4719
4726
  additionalSigners: Signer[];
@@ -4757,14 +4764,6 @@ export declare class PerpetualsClient {
4757
4764
  instructions: TransactionInstruction[];
4758
4765
  additionalSigners: Signer[];
4759
4766
  }>;
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
4767
  depositTokenStake: (owner: PublicKey, feePayer: PublicKey, depositAmount: BN, poolConfig: PoolConfig) => Promise<{
4769
4768
  instructions: TransactionInstruction[];
4770
4769
  additionalSigners: Signer[];
@@ -4890,11 +4889,11 @@ export declare class PerpetualsClient {
4890
4889
  instructions: TransactionInstruction[];
4891
4890
  additionalSigners: Signer[];
4892
4891
  }>;
4893
- setInternalOraclePrice: (tokenMint: PublicKey, price: BN, expo: number, conf: BN, ema: BN, publishTime: BN, poolConfig: PoolConfig) => Promise<{
4892
+ setInternalOraclePrice: (tokenMint: PublicKey, useCurrentTime: number, price: BN, expo: number, conf: BN, ema: BN, publishTime: BN, poolConfig: PoolConfig) => Promise<{
4894
4893
  instructions: TransactionInstruction[];
4895
4894
  additionalSigners: Signer[];
4896
4895
  }>;
4897
- setInternalOraclePriceBatch: (tokenMintList: PublicKey[], tokenInternalPrices: InternalPrice[], POOL_CONFIGS: PoolConfig[]) => Promise<{
4896
+ setInternalOraclePriceBatch: (useCurrentTime: number, tokenMintList: PublicKey[], tokenInternalPrices: InternalPrice[], POOL_CONFIGS: PoolConfig[]) => Promise<{
4898
4897
  instructions: TransactionInstruction[];
4899
4898
  additionalSigners: Signer[];
4900
4899
  }>;
@@ -4926,6 +4925,10 @@ export declare class PerpetualsClient {
4926
4925
  instructions: TransactionInstruction[];
4927
4926
  additionalSigners: Signer[];
4928
4927
  }>;
4928
+ withdrawUnclaimedTokens: (poolConfig: PoolConfig) => Promise<{
4929
+ instructions: TransactionInstruction[];
4930
+ additionalSigners: Signer[];
4931
+ }>;
4929
4932
  initRevenueTokenAccount: (feeShareBps: BN, rewardSymbol: string, poolConfig: PoolConfig) => Promise<{
4930
4933
  instructions: TransactionInstruction[];
4931
4934
  additionalSigners: Signer[];
@@ -4942,4 +4945,8 @@ export declare class PerpetualsClient {
4942
4945
  instructions: TransactionInstruction[];
4943
4946
  additionalSigners: Signer[];
4944
4947
  }>;
4948
+ resizeInternalOracle: (extOracle: PublicKey, tokenMint: PublicKey, intOracleAccount: PublicKey) => Promise<{
4949
+ instructions: TransactionInstruction[];
4950
+ additionalSigners: Signer[];
4951
+ }>;
4945
4952
  }