flash-sdk 15.4.4-alpha.0 → 15.4.4
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 +3 -60
- package/dist/PerpetualsClient.js +347 -651
- package/dist/PoolConfig.d.ts +2 -1
- package/dist/PoolConfig.js +17 -2
- package/dist/PoolConfig.json +16 -6
- package/dist/ViewHelper.js +15 -9
- package/dist/idl/perpetuals.d.ts +74 -2
- package/dist/idl/perpetuals.json +74 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -4,12 +4,12 @@ import { Program, AnchorProvider, BN } from "@coral-xyz/anchor";
|
|
|
4
4
|
import { PublicKey, TransactionInstruction, Commitment, Signer, AddressLookupTableAccount, VersionedTransaction } from "@solana/web3.js";
|
|
5
5
|
import { PoolAccount } from "./PoolAccount";
|
|
6
6
|
import { PositionAccount } from "./PositionAccount";
|
|
7
|
-
import { AddLiquidityAmountAndFee, InternalPrice, BorrowRateParams, ExitPriceAndFee, Fees, OracleParams, Permissions, PricingParams, RemoveCollateralData, RemoveLiquidityAmountAndFee, Side, TokenRatios, MinAndMaxPrice, FeesAction, ContractOraclePrice, Privilege, PerpetualsAccount, EntryPriceAndFeeV2, TokenPermissions, TokenStake, InternalEmaPrice, Whitelist, VoltageMultiplier, MarketPermissions
|
|
7
|
+
import { AddLiquidityAmountAndFee, InternalPrice, BorrowRateParams, ExitPriceAndFee, Fees, OracleParams, Permissions, PricingParams, RemoveCollateralData, RemoveLiquidityAmountAndFee, Side, TokenRatios, MinAndMaxPrice, FeesAction, ContractOraclePrice, Privilege, PerpetualsAccount, EntryPriceAndFeeV2, TokenPermissions, TokenStake, InternalEmaPrice, Whitelist, VoltageMultiplier, MarketPermissions } from "./types";
|
|
8
8
|
import { OraclePrice } from "./OraclePrice";
|
|
9
9
|
import { CustodyAccount } from "./CustodyAccount";
|
|
10
10
|
import type { Perpetuals } from './idl/perpetuals';
|
|
11
11
|
import { SendTransactionOpts } from "./utils/rpc";
|
|
12
|
-
import {
|
|
12
|
+
import { MarketConfig, PoolConfig, Token } from "./PoolConfig";
|
|
13
13
|
import { MarketAccount } from "./MarketAccount";
|
|
14
14
|
import { TokenStakeAccount } from "./TokenStakeAccount";
|
|
15
15
|
export type PerpClientOptions = {
|
|
@@ -190,17 +190,7 @@ export declare class PerpetualsClient {
|
|
|
190
190
|
bump: number;
|
|
191
191
|
padding: number[];
|
|
192
192
|
}>;
|
|
193
|
-
getPositionData: (position: PositionAccount, poolConfig: PoolConfig
|
|
194
|
-
getOpenPositionQuote: (amountIn: BN, leverage: BN, marketConfig: MarketConfig, poolConfig: PoolConfig, privilege?: Privilege, receivingCustodyConfig?: CustodyConfig, existingPositionPk?: PublicKey, discountIndex?: number | null, limitPrice?: {
|
|
195
|
-
price: BN;
|
|
196
|
-
exponent: number;
|
|
197
|
-
} | null, userPublicKey?: PublicKey | undefined) => Promise<OpenPositionQuoteData>;
|
|
198
|
-
getClosePositionQuote: (positionPk: PublicKey, positionAccount: PositionAccount, poolConfig: PoolConfig, sizeDeltaUsd?: BN, privilege?: Privilege, dispensingCustodyConfig?: CustodyConfig, discountIndex?: number | null, triggerPrice?: {
|
|
199
|
-
price: BN;
|
|
200
|
-
exponent: number;
|
|
201
|
-
} | null, userPublicKey?: PublicKey | undefined) => Promise<ClosePositionQuoteData>;
|
|
202
|
-
getAddCollateralQuote: (amountIn: BN, positionPk: PublicKey, positionAccount: PositionAccount, poolConfig: PoolConfig, receivingCustodyConfig?: CustodyConfig, userPublicKey?: PublicKey | undefined) => Promise<AddCollateralQuoteData>;
|
|
203
|
-
getRemoveCollateralQuote: (collateralDeltaUsd: BN, positionPk: PublicKey, positionAccount: PositionAccount, poolConfig: PoolConfig, dispensingCustodyConfig?: CustodyConfig, userPublicKey?: PublicKey | undefined) => Promise<RemoveCollateralQuoteData>;
|
|
193
|
+
getPositionData: (position: PositionAccount, poolConfig: PoolConfig) => Promise<any>;
|
|
204
194
|
getOrderAccount: (orderAccountKey: PublicKey) => Promise<{
|
|
205
195
|
owner: PublicKey;
|
|
206
196
|
market: PublicKey;
|
|
@@ -301,34 +291,6 @@ export declare class PerpetualsClient {
|
|
|
301
291
|
padding: number[];
|
|
302
292
|
pubkey: PublicKey;
|
|
303
293
|
}[]>;
|
|
304
|
-
getUserPositionsMultiPool: (wallet: PublicKey, poolConfigs: PoolConfig[]) => Promise<{
|
|
305
|
-
owner: PublicKey;
|
|
306
|
-
market: PublicKey;
|
|
307
|
-
delegate: PublicKey;
|
|
308
|
-
openTime: BN;
|
|
309
|
-
updateTime: BN;
|
|
310
|
-
entryPrice: ContractOraclePrice;
|
|
311
|
-
sizeAmount: BN;
|
|
312
|
-
sizeUsd: BN;
|
|
313
|
-
lockedAmount: BN;
|
|
314
|
-
lockedUsd: BN;
|
|
315
|
-
priceImpactUsd: BN;
|
|
316
|
-
collateralUsd: BN;
|
|
317
|
-
unsettledValueUsd: BN;
|
|
318
|
-
unsettledFeesUsd: BN;
|
|
319
|
-
cumulativeLockFeeSnapshot: BN;
|
|
320
|
-
degenSizeUsd: BN;
|
|
321
|
-
referencePrice: ContractOraclePrice;
|
|
322
|
-
isActive: boolean;
|
|
323
|
-
buffer: number[];
|
|
324
|
-
priceImpactSet: number;
|
|
325
|
-
sizeDecimals: number;
|
|
326
|
-
lockedDecimals: number;
|
|
327
|
-
collateralDecimals: number;
|
|
328
|
-
bump: number;
|
|
329
|
-
padding: number[];
|
|
330
|
-
pubkey: PublicKey;
|
|
331
|
-
}[]>;
|
|
332
294
|
getUserOrderAccounts: (wallet: PublicKey, poolConfig: PoolConfig) => Promise<{
|
|
333
295
|
owner: PublicKey;
|
|
334
296
|
market: PublicKey;
|
|
@@ -348,25 +310,6 @@ export declare class PerpetualsClient {
|
|
|
348
310
|
padding: BN[];
|
|
349
311
|
pubkey: PublicKey;
|
|
350
312
|
}[]>;
|
|
351
|
-
getUserOrderAccountsMultiPool: (wallet: PublicKey, poolConfigs: PoolConfig[]) => Promise<{
|
|
352
|
-
owner: PublicKey;
|
|
353
|
-
market: PublicKey;
|
|
354
|
-
limitOrders: import("./types").LimitOrder[];
|
|
355
|
-
takeProfitOrders: import("./types").TriggerOrder[];
|
|
356
|
-
stopLossOrders: import("./types").TriggerOrder[];
|
|
357
|
-
isInitialised: boolean;
|
|
358
|
-
isActive: boolean;
|
|
359
|
-
openSl: number;
|
|
360
|
-
openTp: number;
|
|
361
|
-
inactiveSl: number;
|
|
362
|
-
inactiveTp: number;
|
|
363
|
-
activeOrders: number;
|
|
364
|
-
bump: number;
|
|
365
|
-
referenceTimestamp: BN;
|
|
366
|
-
executionCount: BN;
|
|
367
|
-
padding: BN[];
|
|
368
|
-
pubkey: PublicKey;
|
|
369
|
-
}[]>;
|
|
370
313
|
getAllPositions: () => Promise<import("@coral-xyz/anchor").ProgramAccount<{
|
|
371
314
|
owner: PublicKey;
|
|
372
315
|
market: PublicKey;
|