flash-sdk 1.0.15 → 1.0.17
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/lib/PerpetualsClient.d.ts +11 -5
- package/lib/PerpetualsClient.js +344 -139
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/PerpetualsClient.ts +294 -22
- package/src/PoolConfig.ts +6 -6
@@ -1,7 +1,5 @@
|
|
1
|
-
/// <reference types="bn.js" />
|
2
|
-
/// <reference types="node" />
|
3
1
|
import { Program, AnchorProvider, BN } from "@coral-xyz/anchor";
|
4
|
-
import { PublicKey, TransactionInstruction, Commitment } from "@solana/web3.js";
|
2
|
+
import { PublicKey, TransactionInstruction, Commitment, Signer } from "@solana/web3.js";
|
5
3
|
import { PoolAccount } from "./PoolAccount";
|
6
4
|
import { AumCalcMode, BorrowRateParams, Fees, OracleParams, Permissions, Position, PositionSide, PricingParams, Side, TokenRatios } from "./types";
|
7
5
|
import { OraclePrice } from "./OraclePrice";
|
@@ -1951,8 +1949,16 @@ export declare class PerpetualsClient {
|
|
1951
1949
|
getAumView: (poolName: string) => Promise<any>;
|
1952
1950
|
getAumTrx: (poolName: string) => Promise<string>;
|
1953
1951
|
getAumSdk: (poolAccount: PoolAccount, token_prices: OraclePrice[], token_ema_prices: OraclePrice[], custodies: CustodyAccount[], aum_calc_mode: AumCalcMode, currentTime: BN) => BN;
|
1954
|
-
openPosition: (payTokenSymbol: string, priceAfterSlippage: BN,
|
1955
|
-
|
1952
|
+
openPosition: (payTokenSymbol: string, priceAfterSlippage: BN, collateralWithfee: BN, fee: BN, size: BN, side: Side, poolConfig: PoolConfig, createUserWSOLATA?: boolean, skipBalanceChecks?: boolean) => Promise<{
|
1953
|
+
instructions: TransactionInstruction[];
|
1954
|
+
additionalSigners: Signer[];
|
1955
|
+
}>;
|
1956
|
+
closePosition: (receivingTokenSymbol: string, priceAfterSlippage: BN, side: Side, poolConfig: PoolConfig, createUserATA?: boolean, closeUsersWSOLATA?: boolean) => Promise<{
|
1957
|
+
instructions: TransactionInstruction[];
|
1958
|
+
additionalSigners: Signer[];
|
1959
|
+
}>;
|
1960
|
+
openPositionOld: (payTokenSymbol: string, priceAfterSlippage: BN, collateral: BN, fee: BN, size: BN, side: Side, poolConfig: PoolConfig, createUserWSOLATA?: boolean) => Promise<TransactionInstruction[]>;
|
1961
|
+
closePositionOld: (receivingTokenSymbol: string, priceAfterSlippage: BN, side: Side, poolConfig: PoolConfig) => Promise<TransactionInstruction[]>;
|
1956
1962
|
swap: (poolReceivingTokenSymbol: string, poolDispensingTokenSymbol: string, amountIn: BN, minAmountOut: BN, poolConfig: PoolConfig, unWrapSol?: boolean) => Promise<TransactionInstruction[]>;
|
1957
1963
|
addLiquidity: (payTokenSymbol: string, tokenAmountIn: BN, minLpAmountOut: BN, poolConfig: PoolConfig) => Promise<TransactionInstruction[]>;
|
1958
1964
|
removeLiquidity: (recieveTokenSymbol: string, liquidityAmountIn: BN, minTokenAmountOut: BN, poolConfig: PoolConfig, closeLpATA?: boolean) => Promise<TransactionInstruction[]>;
|