flash-sdk 15.4.8-alpha.0 → 15.5.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 +3 -66
- package/dist/PerpetualsClient.js +343 -653
- package/dist/PoolConfig.json +514 -0
- package/dist/ViewHelper.js +15 -9
- 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,23 +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, takeProfitPrice?: {
|
|
198
|
-
price: BN;
|
|
199
|
-
exponent: number;
|
|
200
|
-
} | null, stopLossPrice?: {
|
|
201
|
-
price: BN;
|
|
202
|
-
exponent: number;
|
|
203
|
-
} | null) => Promise<OpenPositionQuoteData>;
|
|
204
|
-
getClosePositionQuote: (positionPk: PublicKey, positionAccount: PositionAccount, poolConfig: PoolConfig, sizeDeltaUsd?: BN, privilege?: Privilege, dispensingCustodyConfig?: CustodyConfig, discountIndex?: number | null, triggerPrice?: {
|
|
205
|
-
price: BN;
|
|
206
|
-
exponent: number;
|
|
207
|
-
} | null, userPublicKey?: PublicKey | undefined) => Promise<ClosePositionQuoteData>;
|
|
208
|
-
getAddCollateralQuote: (amountIn: BN, positionPk: PublicKey, positionAccount: PositionAccount, poolConfig: PoolConfig, receivingCustodyConfig?: CustodyConfig, userPublicKey?: PublicKey | undefined) => Promise<AddCollateralQuoteData>;
|
|
209
|
-
getRemoveCollateralQuote: (collateralDeltaUsd: BN, positionPk: PublicKey, positionAccount: PositionAccount, poolConfig: PoolConfig, dispensingCustodyConfig?: CustodyConfig, userPublicKey?: PublicKey | undefined) => Promise<RemoveCollateralQuoteData>;
|
|
193
|
+
getPositionData: (position: PositionAccount, poolConfig: PoolConfig) => Promise<any>;
|
|
210
194
|
getOrderAccount: (orderAccountKey: PublicKey) => Promise<{
|
|
211
195
|
owner: PublicKey;
|
|
212
196
|
market: PublicKey;
|
|
@@ -307,34 +291,6 @@ export declare class PerpetualsClient {
|
|
|
307
291
|
padding: number[];
|
|
308
292
|
pubkey: PublicKey;
|
|
309
293
|
}[]>;
|
|
310
|
-
getUserPositionsMultiPool: (wallet: PublicKey, poolConfigs: PoolConfig[]) => Promise<{
|
|
311
|
-
owner: PublicKey;
|
|
312
|
-
market: PublicKey;
|
|
313
|
-
delegate: PublicKey;
|
|
314
|
-
openTime: BN;
|
|
315
|
-
updateTime: BN;
|
|
316
|
-
entryPrice: ContractOraclePrice;
|
|
317
|
-
sizeAmount: BN;
|
|
318
|
-
sizeUsd: BN;
|
|
319
|
-
lockedAmount: BN;
|
|
320
|
-
lockedUsd: BN;
|
|
321
|
-
priceImpactUsd: BN;
|
|
322
|
-
collateralUsd: BN;
|
|
323
|
-
unsettledValueUsd: BN;
|
|
324
|
-
unsettledFeesUsd: BN;
|
|
325
|
-
cumulativeLockFeeSnapshot: BN;
|
|
326
|
-
degenSizeUsd: BN;
|
|
327
|
-
referencePrice: ContractOraclePrice;
|
|
328
|
-
isActive: boolean;
|
|
329
|
-
buffer: number[];
|
|
330
|
-
priceImpactSet: number;
|
|
331
|
-
sizeDecimals: number;
|
|
332
|
-
lockedDecimals: number;
|
|
333
|
-
collateralDecimals: number;
|
|
334
|
-
bump: number;
|
|
335
|
-
padding: number[];
|
|
336
|
-
pubkey: PublicKey;
|
|
337
|
-
}[]>;
|
|
338
294
|
getUserOrderAccounts: (wallet: PublicKey, poolConfig: PoolConfig) => Promise<{
|
|
339
295
|
owner: PublicKey;
|
|
340
296
|
market: PublicKey;
|
|
@@ -354,25 +310,6 @@ export declare class PerpetualsClient {
|
|
|
354
310
|
padding: BN[];
|
|
355
311
|
pubkey: PublicKey;
|
|
356
312
|
}[]>;
|
|
357
|
-
getUserOrderAccountsMultiPool: (wallet: PublicKey, poolConfigs: PoolConfig[]) => Promise<{
|
|
358
|
-
owner: PublicKey;
|
|
359
|
-
market: PublicKey;
|
|
360
|
-
limitOrders: import("./types").LimitOrder[];
|
|
361
|
-
takeProfitOrders: import("./types").TriggerOrder[];
|
|
362
|
-
stopLossOrders: import("./types").TriggerOrder[];
|
|
363
|
-
isInitialised: boolean;
|
|
364
|
-
isActive: boolean;
|
|
365
|
-
openSl: number;
|
|
366
|
-
openTp: number;
|
|
367
|
-
inactiveSl: number;
|
|
368
|
-
inactiveTp: number;
|
|
369
|
-
activeOrders: number;
|
|
370
|
-
bump: number;
|
|
371
|
-
referenceTimestamp: BN;
|
|
372
|
-
executionCount: BN;
|
|
373
|
-
padding: BN[];
|
|
374
|
-
pubkey: PublicKey;
|
|
375
|
-
}[]>;
|
|
376
313
|
getAllPositions: () => Promise<import("@coral-xyz/anchor").ProgramAccount<{
|
|
377
314
|
owner: PublicKey;
|
|
378
315
|
market: PublicKey;
|