Options
All
  • Public
  • Public/Protected
  • All
Menu

@raydium-io/raydium-sdk

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AmountSide: "base" | "quote"
BigNumberish: BN | string | number | bigint
BitStructure<T, P>: Layout<T, P>

Type parameters

  • T = unknown

  • P = ""

Blob<P>: Layout<Buffer, P>

Type parameters

  • P: string = ""

ExtensionKey: "coingeckoId" | "website" | "whitepaper"
Extensions: { [ key in ExtensionKey]?: string }
FarmCreateInstructionParams: FarmCreateInstructionParamsV6
FarmCreatorAddRewardTokenInstructionParams: FarmCreatorAddRewardTokenInstructionParamsV6
FarmCreatorWithdrawRewardInstructionParams: FarmCreatorWithdrawRewardInstructionParamsV6
FarmLedgerLayoutV3_1: typeof FARM_LEDGER_LAYOUT_V3_1
FarmLedgerLayoutV3_2: typeof FARM_LEDGER_LAYOUT_V3_2
FarmLedgerLayoutV5_1: typeof FARM_LEDGER_LAYOUT_V5_1
FarmLedgerLayoutV5_2: typeof FARM_LEDGER_LAYOUT_V5_2
FarmLedgerLayoutV6_1: typeof FARM_LEDGER_LAYOUT_V6_1
FarmPoolKeys: { authority: PublicKey; id: PublicKey; lpMint: PublicKey; lpVault: PublicKey; programId: PublicKey; rewardInfos: ({ rewardMint: PublicKey; rewardVault: PublicKey } | { rewardEndTime: number; rewardMint: PublicKey; rewardOpenTime: number; rewardPerSecond: number; rewardType: keyof typeof poolTypeV6; rewardVault: PublicKey })[]; upcoming: boolean; version: number }

Type declaration

  • Readonly authority: PublicKey
  • Readonly id: PublicKey
  • Readonly lpMint: PublicKey
  • Readonly lpVault: PublicKey
  • Readonly programId: PublicKey
  • Readonly rewardInfos: ({ rewardMint: PublicKey; rewardVault: PublicKey } | { rewardEndTime: number; rewardMint: PublicKey; rewardOpenTime: number; rewardPerSecond: number; rewardType: keyof typeof poolTypeV6; rewardVault: PublicKey })[]
  • Readonly upcoming: boolean
  • Readonly version: number
FarmRestartInstructionParams: FarmRestartInstructionParamsV6
FarmStateLayoutV3: typeof FARM_STATE_LAYOUT_V3
FarmStateLayoutV5: typeof FARM_STATE_LAYOUT_V5
FarmStateLayoutV6: typeof FARM_STATE_LAYOUT_V6
FarmVersion: 3 | 4 | 5 | 6
FarmWithdrawInstructionParams: FarmDepositInstructionParams
GetLayoutSchemaFromStructure<T>: T extends Structure<any, any, infer S> ? S : any

Type parameters

GetStructureFromLayoutSchema<S>: Structure<any, any, S>

Type parameters

  • S

GetStructureSchema<T>: T extends Structure<any, any, infer S> ? S : unknown

Type parameters

  • T: Structure

LiquidityAddInstructionParams: LiquidityAddInstructionParamsV4

Add liquidity instruction params

LiquidityAssociatedPoolKeys: LiquidityAssociatedPoolKeysV4

Associated liquidity pool keys

remarks

without partial markets keys

LiquidityCreatePoolInstructionParams: LiquidityCreatePoolInstructionParamsV4

Create pool instruction params

LiquidityCreatePoolTransactionParams: LiquidityCreatePoolInstructionParams

Create pool transaction params

LiquidityInitPoolInstructionParams: LiquidityInitPoolInstructionParamsV4

Init pool instruction params

LiquidityPoolKeys: LiquidityPoolKeysV4

Full liquidity pool keys that build transaction need

LiquidityPoolKeysV4: { [ T in keyof LiquidityPoolJsonInfo]: string extends LiquidityPoolJsonInfo[T] ? PublicKey : LiquidityPoolJsonInfo[T] }
LiquidityRemoveInstructionParams: LiquidityRemoveInstructionParamsV4

Remove liquidity instruction params

LiquiditySide: "a" | "b"
LiquidityStateLayoutV4: typeof LIQUIDITY_STATE_LAYOUT_V4
LiquidityStateLayoutV5: typeof LIQUIDITY_STATE_LAYOUT_V5
LiquidityVersion: 4 | 5
LpTokens: { [iterator]: any } & { [ T in string]: LpTokenInfo }
LpTokensJsonInfo: { [iterator]: any } & { [ T in string]: LpTokenJsonInfo }
MarketState: MarketStateV3
MarketStateLayout: MarketStateLayoutV3
MarketStateLayoutV3: typeof MARKET_STATE_LAYOUT_V3
PublicKeyish: PublicKey | string
ReplaceType<Old, From, To>: { [ T in keyof Old]: Old[T] extends From ? Exclude<Old[T], From> | To : Old[T] extends Primitive ? From extends Old[T] ? Exclude<Old[T], From> | To : Old[T] : ReplaceType<Old[T], From, To> }
example
interface A {
keyA: string;
keyB: string;
map: {
hello: string;
i: number;
};
list: (string | number)[];
keyC: number;
}

type WrappedA = ReplaceType<A, string, boolean> // {
keyA: boolean;
keyB: boolean;
map: {
hello: boolean;
i: number;
};
list: (number | boolean)[];
keyC: number;
}

Type parameters

  • Old

  • From

  • To

RouteType: "amm" | "serum" | "route"
RouteVersion: 1
SerumVersion: 3
SplAccountLayout: typeof SPL_ACCOUNT_LAYOUT
SplMintLayout: typeof SPL_MINT_LAYOUT
SplTokens: { [iterator]: any } & { [ T in string]: SplTokenInfo }
SplTokensJsonInfo: { [iterator]: any } & { [ T in string]: SplTokenJsonInfo }
SwapSide: "in" | "out"
TradeSource: "amm" | "serum" | "stable"
UInt<T, P>: Layout<T, P>

Type parameters

  • T = any

  • P = ""

Without<T, U>: { [ P in Exclude<keyof T, keyof U>]?: never }

Type parameters

  • T

  • U

XOR<T, U>: (T | U) extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U

Type parameters

  • T

  • U

makeCreateFarmInstructionParams: makeCreateFarmInstructionParamsV6

Variables

ASSOCIATED_TOKEN_PROGRAM_ID: PublicKey
BitStructure: BitStructureConstructor
Blob: BlobConstructor
DEVNET_FARM_POOLS: FarmPoolBaseInfo[] = []
DEVNET_LP_TOKENS: LpTokens = ...
DEVNET_OFFICIAL_LIQUIDITY_POOLS: never[] = []
DEVNET_SPL_TOKENS: SplTokens = ...
FARM_LEDGER_LAYOUT_V3_1: Structure<PublicKey | BN | BN[], "", { deposited: BN; id: PublicKey; owner: PublicKey; rewardDebts: BN[]; state: BN }> = ...
FARM_LEDGER_LAYOUT_V3_2: Structure<PublicKey | BN | BN[], "", { deposited: BN; id: PublicKey; owner: PublicKey; rewardDebts: BN[]; state: BN }> = ...
FARM_LEDGER_LAYOUT_V5_1: Structure<PublicKey | BN | BN[], "", { deposited: BN; id: PublicKey; owner: PublicKey; rewardDebts: BN[]; state: BN }> = ...
FARM_LEDGER_LAYOUT_V5_2: Structure<PublicKey | BN | BN[], "", { deposited: BN; id: PublicKey; owner: PublicKey; rewardDebts: BN[]; state: BN }> = ...
FARM_LEDGER_LAYOUT_V6_1: Structure<PublicKey | BN | BN[], "", { deposited: BN; id: PublicKey; owner: PublicKey; rewardDebts: BN[]; state: BN }> = ...
FARM_PROGRAMID_TO_VERSION: {} = ...

Type declaration

FARM_PROGRAM_ID_V3: PublicKey = ...
FARM_PROGRAM_ID_V5: PublicKey = ...
FARM_PROGRAM_ID_V6: PublicKey = ...
FARM_STATE_LAYOUT_V3: GetStructureFromLayoutSchema<{ rewardInfos: { perShareReward: BN; perSlotReward: BN; rewardVault: PublicKey; totalReward: BN }[]; version: 3 } & { lastSlot: BN; lpVault: PublicKey; nonce: BN; perShareReward: BN; perSlotReward: BN; rewardVault: PublicKey; state: BN; totalReward: BN }> = ...
FARM_STATE_LAYOUT_V5: GetStructureFromLayoutSchema<{ rewardInfos: { perShareReward: BN; perSlotReward: BN; rewardVault: PublicKey; totalReward: BN }[]; version: 5 } & { lastSlot: BN; lpVault: PublicKey; nonce: BN; option: number; perShareRewardA: BN; perShareRewardB: BN; perSlotRewardA: BN; perSlotRewardB: BN; rewardVaultA: PublicKey; rewardVaultB: PublicKey; state: BN; totalRewardA: BN; totalRewardB: BN }> = ...
FARM_STATE_LAYOUT_V6: GetStructureFromLayoutSchema<{ rewardInfos: { accRewardPerShare: BN; rewardClaimed: BN; rewardEndTime: BN; rewardLastUpdateTime: BN; rewardMint: PublicKey; rewardOpenTime: BN; rewardPerSecond: BN; rewardSender: PublicKey; rewardState: BN; rewardType: "Standard SPL" | "Option tokens"; rewardVault: PublicKey; totalReward: BN; totalRewardEmissioned: BN }[]; version: 6 } & { creator: PublicKey; lpMint: PublicKey; lpVault: PublicKey; nonce: BN; padding: BN[]; rewardInfos: { padding: BN[]; rewardVault: PublicKey; totalReward: BN; rewardState: BN; rewardOpenTime: BN; rewardEndTime: BN; rewardLastUpdateTime: BN; totalRewardEmissioned: BN; ... 5 more ...; rewardType: BN; }[]; rewardMultiplier: BN; rewardPeriodExtend: BN; rewardPeriodMax: BN; rewardPeriodMin: BN; state: BN; validRewardTokenNum: BN }> = ...
FARM_VERSION_TO_LEDGER_LAYOUT: { [ version in FarmVersion]?: FarmLedgerLayout } & {} = ...
FARM_VERSION_TO_PROGRAMID: { [ key in FarmVersion]?: PublicKey } & {} = ...
FARM_VERSION_TO_STATE_LAYOUT: { [ version in FarmVersion]?: FarmStateLayout } & {} = ...
FIVE: BN = ...
LIQUIDITY_FEES_DENOMINATOR: BN = ...
LIQUIDITY_FEES_NUMERATOR: BN = ...
LIQUIDITY_PROGRAMID_TO_VERSION: {} = ...

Type declaration

LIQUIDITY_PROGRAM_ID_V4: PublicKey = ...
LIQUIDITY_PROGRAM_ID_V5: PublicKey = ...
LIQUIDITY_STATE_LAYOUT_V4: Structure<PublicKey | BN | BN[], "", { amountWaveRatio: BN; baseDecimal: BN; baseLotSize: BN; baseMint: PublicKey; baseNeedTakePnl: BN; baseTotalDeposited: BN; baseTotalPnl: BN; baseVault: PublicKey; depth: BN; lpMint: PublicKey; lpReserve: BN; lpVault: PublicKey; marketId: PublicKey; marketProgramId: PublicKey; maxOrder: BN; maxPriceMultiplier: BN; minPriceMultiplier: BN; minSeparateDenominator: BN; minSeparateNumerator: BN; minSize: BN; nonce: BN; openOrders: PublicKey; owner: PublicKey; padding: BN[]; pnlDenominator: BN; pnlNumerator: BN; quoteDecimal: BN; quoteLotSize: BN; quoteMint: PublicKey; quoteNeedTakePnl: BN; quoteTotalDeposited: BN; quoteTotalPnl: BN; quoteVault: PublicKey; resetFlag: BN; state: BN; status: BN; swapBase2QuoteFee: BN; swapBaseInAmount: BN; swapBaseOutAmount: BN; swapFeeDenominator: BN; swapFeeNumerator: BN; swapQuote2BaseFee: BN; swapQuoteInAmount: BN; swapQuoteOutAmount: BN; systemDecimalValue: BN; targetOrders: PublicKey; tradeFeeDenominator: BN; tradeFeeNumerator: BN; volMaxCutRatio: BN; withdrawQueue: PublicKey }> = ...
LIQUIDITY_STATE_LAYOUT_V5: Structure<PublicKey | BN | BN[], "", { abortTradeFactor: BN; accountType: BN; amountWaveRatio: BN; baseDecimal: BN; baseLotSize: BN; baseMint: PublicKey; baseNeedTakePnl: BN; baseTotalPnl: BN; baseVault: PublicKey; depth: BN; lpMint: PublicKey; marketId: PublicKey; marketProgramId: PublicKey; maxOrder: BN; maxPriceMultiplier: BN; minPriceMultiplier: BN; minSeparateDenominator: BN; minSeparateNumerator: BN; minSize: BN; modelDataAccount: PublicKey; nonce: BN; openOrders: PublicKey; orderbookToInitTime: BN; owner: PublicKey; padding: BN[]; pnlDenominator: BN; pnlNumerator: BN; poolOpenTime: BN; priceTick: BN; priceTickMultiplier: BN; punishCoinAmount: BN; punishPcAmount: BN; quoteDecimal: BN; quoteLotSize: BN; quoteMint: PublicKey; quoteNeedTakePnl: BN; quoteTotalPnl: BN; quoteVault: PublicKey; resetFlag: BN; state: BN; status: BN; swapBase2QuoteFee: BN; swapBaseInAmount: BN; swapBaseOutAmount: BN; swapFeeDenominator: BN; swapFeeNumerator: BN; swapQuote2BaseFee: BN; swapQuoteInAmount: BN; swapQuoteOutAmount: BN; systemDecimalsValue: BN; targetOrders: PublicKey; tradeFeeDenominator: BN; tradeFeeNumerator: BN; volMaxCutRatio: BN }> = ...
LIQUIDITY_VERSION_TO_PROGRAMID: { [ key in LiquidityVersion]?: PublicKey } & {} = ...
LIQUIDITY_VERSION_TO_SERUM_VERSION: { [ key in LiquidityVersion]?: SerumVersion } & {} = ...
LIQUIDITY_VERSION_TO_STATE_LAYOUT: {} = ...

Type declaration

MAINNET_FARM_POOLS: FarmPoolBaseInfo[] = ...
MAINNET_LP_TOKENS: LpTokens = ...
MAINNET_OFFICIAL_LIQUIDITY_POOLS: string[] = ...
MAINNET_SPL_TOKENS: SplTokens = ...
MARKET_STATE_LAYOUT_V3: Structure<PublicKey | Buffer | BN, "", { asks: PublicKey; baseDepositsTotal: BN; baseFeesAccrued: BN; baseLotSize: BN; baseMint: PublicKey; baseVault: PublicKey; bids: PublicKey; eventQueue: PublicKey; feeRateBps: BN; ownAddress: PublicKey; quoteDepositsTotal: BN; quoteDustThreshold: BN; quoteFeesAccrued: BN; quoteLotSize: BN; quoteMint: PublicKey; quoteVault: PublicKey; referrerRebatesAccrued: BN; requestQueue: PublicKey; vaultSignerNonce: BN }> = ...
MARKET_VERSION_TO_STATE_LAYOUT: {} = ...

Type declaration

MEMO_PROGRAM_ID: PublicKey = ...
ONE: BN = ...
REAL_FARM_STATE_LAYOUT_V3: Structure<PublicKey | BN, "", { lastSlot: BN; lpVault: PublicKey; nonce: BN; perShareReward: BN; perSlotReward: BN; rewardVault: PublicKey; state: BN; totalReward: BN }> = ...
REAL_FARM_STATE_LAYOUT_V5: Structure<number | PublicKey | Buffer | BN, "", { lastSlot: BN; lpVault: PublicKey; nonce: BN; option: number; perShareRewardA: BN; perShareRewardB: BN; perSlotRewardA: BN; perSlotRewardB: BN; rewardVaultA: PublicKey; rewardVaultB: PublicKey; state: BN; totalRewardA: BN; totalRewardB: BN }> = ...
REAL_FARM_STATE_LAYOUT_V6: Structure<PublicKey | BN | BN[] | { accRewardPerShare: BN; padding: BN[]; rewardClaimed: BN; rewardEndTime: BN; rewardLastUpdateTime: BN; rewardMint: PublicKey; rewardOpenTime: BN; rewardPerSecond: BN; rewardSender: PublicKey; rewardState: BN; rewardType: BN; rewardVault: PublicKey; totalReward: BN; totalRewardEmissioned: BN }[], "", { creator: PublicKey; lpMint: PublicKey; lpVault: PublicKey; nonce: BN; padding: BN[]; rewardInfos: { padding: BN[]; rewardVault: PublicKey; totalReward: BN; rewardState: BN; rewardOpenTime: BN; rewardEndTime: BN; rewardLastUpdateTime: BN; totalRewardEmissioned: BN; ... 5 more ...; rewardType: BN; }[]; rewardMultiplier: BN; rewardPeriodExtend: BN; rewardPeriodMax: BN; rewardPeriodMin: BN; state: BN; validRewardTokenNum: BN }> = ...
ROUTE_PROGRAMID_TO_VERSION: {} = ...

Type declaration

ROUTE_PROGRAM_ID_V1: PublicKey = ...
ROUTE_VERSION_TO_LIQUIDITY_VERSION: { [ key in RouteVersion]?: LiquidityVersion } & {} = ...
ROUTE_VERSION_TO_PROGRAMID: { [ key in RouteVersion]?: PublicKey } & {} = ...
SERUM_PROGRAMID_TO_VERSION: {} = ...

Type declaration

SERUM_PROGRAM_ID_V3: PublicKey = ...
SERUM_VERSION_TO_PROGRAMID: { [ key in SerumVersion]?: PublicKey } & {} = ...
SOL: NativeTokenInfo = ...
SPL_ACCOUNT_LAYOUT: Structure<number | PublicKey | BN, "", { amount: BN; closeAuthority: PublicKey; closeAuthorityOption: number; delegate: PublicKey; delegateOption: number; delegatedAmount: BN; isNative: BN; isNativeOption: number; mint: PublicKey; owner: PublicKey; state: number }> = ...
SPL_MINT_LAYOUT: Structure<number | PublicKey | BN, "", { decimals: number; freezeAuthority: PublicKey; freezeAuthorityOption: number; isInitialized: number; mintAuthority: PublicKey; mintAuthorityOption: number; supply: BN }> = ...
SYSTEM_PROGRAM_ID: PublicKey = SystemProgram.programId
SYSVAR_CLOCK_PUBKEY: PublicKey
SYSVAR_RENT_PUBKEY: PublicKey
TEN: BN = ...
TESTNET_FARM_POOLS: FarmPoolBaseInfo[] = []
TESTNET_LP_TOKENS: LpTokens = ...
TESTNET_OFFICIAL_LIQUIDITY_POOLS: never[] = []
TESTNET_SPL_TOKENS: SplTokens = ...
THREE: BN = ...
TOKEN_PROGRAM_ID: PublicKey
TWO: BN = ...
UInt: UIntConstructor
WSOL: SplTokenInfo = ...
ZERO: BN = ...
_100: BN = ...
_1000: BN = ...
_10000: BN = ...
_100_PERCENT: Fraction = ...
_FARM_PROGRAM_ID_V3: "EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q" = "EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"
_FARM_PROGRAM_ID_V5: "9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z" = "9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"
_FARM_PROGRAM_ID_V6: "FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG" = "FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"
_LIQUIDITY_PROGRAM_ID_V4: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8" = "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"
_LIQUIDITY_PROGRAM_ID_V5: "5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h" = "5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"
_ROUTE_PROGRAM_ID_V1: "routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS" = "routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"
_SERUM_PROGRAM_ID_V3: "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin" = "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"
poolTypeV6: { Option tokens: 1; Standard SPL: 0 } = ...

Type declaration

  • Option tokens: 1
  • Standard SPL: 0

Functions

  • AccountMeta(publicKey: PublicKey, isSigner: boolean): { isSigner: boolean; isWritable: boolean; pubkey: PublicKey }
  • Parameters

    • publicKey: PublicKey
    • isSigner: boolean

    Returns { isSigner: boolean; isWritable: boolean; pubkey: PublicKey }

    • isSigner: boolean
    • isWritable: boolean
    • pubkey: PublicKey
  • AccountMetaReadonly(publicKey: PublicKey, isSigner: boolean): { isSigner: boolean; isWritable: boolean; pubkey: PublicKey }
  • Parameters

    • publicKey: PublicKey
    • isSigner: boolean

    Returns { isSigner: boolean; isWritable: boolean; pubkey: PublicKey }

    • isSigner: boolean
    • isWritable: boolean
    • pubkey: PublicKey
  • array<T, P>(elementLayout: Layout<T, "">, length: number, property?: P): Layout<T[], P>
  • Type parameters

    • T

    • P: string = ""

    Parameters

    • elementLayout: Layout<T, "">
    • length: number
    • Optional property: P

    Returns Layout<T[], P>

  • Type parameters

    • T

    • P: string = ""

    Parameters

    • word: Layout<T, "">
    • Optional msb: boolean
    • Optional property: P

    Returns BitStructure<T, P>

  • blob<P>(length: number | Layout<number, P>, property?: P): Blob<P>
  • Type parameters

    • P: string = ""

    Parameters

    • length: number | Layout<number, P>
    • Optional property: P

    Returns Blob<P>

  • bool<P>(property?: P): Layout<boolean, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<boolean, P>

  • chunkArray<T>(arr: T[], chunkSize?: number, cache?: T[][]): T[][]
  • cstr<P>(property?: P): Layout<string, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<string, P>

  • Compares two currencies for equality

    Parameters

    Returns boolean

  • decodeBool(value: number): boolean
  • Parameters

    • value: number

    Returns boolean

  • divCeil(a: BN, b: BN): BN
  • Parameters

    • a: BN
    • b: BN

    Returns BN

  • encodeBool(value: boolean): number
  • Parameters

    • value: boolean

    Returns number

  • f32<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • f32be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • f64<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • f64be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • findProgramAddress(seeds: (Uint8Array | Buffer)[], programId: PublicKey): Promise<{ nonce: number; publicKey: PublicKey }>
  • Parameters

    • seeds: (Uint8Array | Buffer)[]
    • programId: PublicKey

    Returns Promise<{ nonce: number; publicKey: PublicKey }>

  • forecastTransactionSize(instructions: TransactionInstruction[], signers: PublicKey[]): number
  • Forecast transaction size

    Parameters

    • instructions: TransactionInstruction[]
    • signers: PublicKey[]

    Returns number

  • getMultipleAccountsInfo(connection: Connection, publicKeys: PublicKey[], config?: GetMultipleAccountsInfoConfig): Promise<(AccountInfo<Buffer> | null)[]>
  • Parameters

    Returns Promise<(AccountInfo<Buffer> | null)[]>

  • getMultipleAccountsInfoWithCustomFlags<T>(connection: Connection, publicKeysWithCustomFlag: T[], config?: GetMultipleAccountsInfoConfig): Promise<({ accountInfo: AccountInfo<Buffer> | null } & T)[]>
  • Type parameters

    • T: { pubkey: PublicKey }

    Parameters

    Returns Promise<({ accountInfo: AccountInfo<Buffer> | null } & T)[]>

  • greedy<P>(elementSpan?: number, property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional elementSpan: number
    • Optional property: P

    Returns Layout<number, P>

  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns BNLayout<P>

  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns BNLayout<P>

  • inspectAll(): void
  • Returns void

  • inspectBN(): void
  • Returns void

  • inspectCurrency(): void
  • Returns void

  • inspectPublicKey(): void
  • Returns void

  • inspectToken(): void
  • Returns void

  • intersection<T>(arr: T[], ...args: T[][]): T[]
  • Type parameters

    • T

    Parameters

    • arr: T[]
    • Rest ...args: T[][]

    Returns T[]

  • jsonInfo2PoolKeys<T>(jsonInfo: T): ReplaceType<T, string, PublicKey>
  • Type parameters

    • T

    Parameters

    • jsonInfo: T

    Returns ReplaceType<T, string, PublicKey>

  • ns64<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • ns64be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • nu64<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • nu64be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • offset<T, P>(layout: Layout<T, P>, offset?: number, property?: P): Layout<T, P>
  • Type parameters

    • T

    • P: string = ""

    Parameters

    • layout: Layout<T, P>
    • Optional offset: number
    • Optional property: P

    Returns Layout<T, P>

  • option<T, P>(layout: Layout<T, "">, property?: P): Layout<T | null, P>
  • Type parameters

    • T

    • P: string = ""

    Parameters

    • layout: Layout<T, "">
    • Optional property: P

    Returns Layout<T | null, P>

  • Parameters

    Returns BN

  • parseSimulateLogToJson(log: string, keyword: string): string
  • Parameters

    • log: string
    • keyword: string

    Returns string

  • parseSimulateValue(log: string, key: string): string
  • Parameters

    • log: string
    • key: string

    Returns string

  • poolKeys2JsonInfo<T>(jsonInfo: T): ReplaceType<T, PublicKey, string>
  • Type parameters

    • T

    Parameters

    • jsonInfo: T

    Returns ReplaceType<T, PublicKey, string>

  • publicKey<P>(property?: P): Layout<PublicKey, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<PublicKey, P>

  • Type parameters

    • T

    • P: string = ""

    Parameters

    • variants: Layout<any, "">[]
    • Optional property: P

    Returns EnumLayout<T, P>

  • s16<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • s16be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • s24<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • s24be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • s32<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • s32be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • s40<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • s40be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • s48<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • s48be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • s8<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • seq<T, P, AnotherP>(elementLayout: Layout<T, P>, count: number | BN | Layout<number | BN, P>, property?: AnotherP): Layout<T[], AnotherP>
  • Type parameters

    • T

    • P: string = ""

    • AnotherP: string = ""

    Parameters

    • elementLayout: Layout<T, P>
    • count: number | BN | Layout<number | BN, P>
    • Optional property: AnotherP

    Returns Layout<T[], AnotherP>

  • simulateMultipleInstruction(connection: Connection, instructions: TransactionInstruction[], keyword: string): Promise<string[]>
  • Simulates multiple instruction

    Parameters

    • connection: Connection
    • instructions: TransactionInstruction[]
    • keyword: string

    Returns Promise<string[]>

  • splitNumber(num: string, decimals: number): string[]
  • Parameters

    • num: string
    • decimals: number

    Returns string[]

  • str<P>(property?: P): Layout<string, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<string, P>

  • struct<T, P>(fields: T, property?: P, decodePrefixes?: boolean): T extends Layout<infer Value, infer Property>[] ? Structure<Value, P, { [ K in Exclude<Extract<Property, string>, "">]: Extract<T[number], Layout<any, K>> extends Layout<infer V, any> ? V : any }> : any
  • Type parameters

    • T

    • P: string = ""

    Parameters

    • fields: T
    • Optional property: P
    • Optional decodePrefixes: boolean

    Returns T extends Layout<infer Value, infer Property>[] ? Structure<Value, P, { [ K in Exclude<Extract<Property, string>, "">]: Extract<T[number], Layout<any, K>> extends Layout<infer V, any> ? V : any }> : any

  • tagged<T, P>(tag: BN, layout: Layout<T, "">, property?: P): Layout<T, P>
  • Type parameters

    • T

    • P: string = ""

    Parameters

    • tag: BN
    • layout: Layout<T, "">
    • Optional property: P

    Returns Layout<T, P>

  • Parameters

    Returns BN

  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns BNLayout<P>

  • u16<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • u16be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • u24<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • u24be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • u32<P>(property?: P): UInt<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns UInt<number, P>

  • u32be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • u40<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • u40be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • u48<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • u48be<P>(property?: P): Layout<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<number, P>

  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns BNLayout<P>

  • u8<P>(property?: P): UInt<number, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns UInt<number, P>

  • union<UnionSchema>(discr: any, defaultLayout?: any, property?: string): Union<UnionSchema>
  • Type parameters

    • UnionSchema: {} = any

    Parameters

    • discr: any
    • Optional defaultLayout: any
    • Optional property: string

    Returns Union<UnionSchema>

  • unionLayoutDiscriminator<P>(layout: Layout<any, P>, property?: P): any
  • Type parameters

    • P: string = ""

    Parameters

    • layout: Layout<any, P>
    • Optional property: P

    Returns any

  • uniq<T>(arr: T[]): T[]
  • Type parameters

    • T

    Parameters

    • arr: T[]

    Returns T[]

  • utf8<P>(maxSpan: number, property?: P): Layout<string, P>
  • Type parameters

    • P: string = ""

    Parameters

    • maxSpan: number
    • Optional property: P

    Returns Layout<string, P>

  • validateAndParsePublicKey(publicKey: PublicKeyish): PublicKey
  • Parameters

    Returns PublicKey

  • vec<T, P>(elementLayout: Layout<T, "">, property?: P): Layout<T[], P>
  • Type parameters

    • T

    • P: string = ""

    Parameters

    • elementLayout: Layout<T, "">
    • Optional property: P

    Returns Layout<T[], P>

  • vecU8<P>(property?: P): Layout<Buffer, P>
  • Type parameters

    • P: string = ""

    Parameters

    • Optional property: P

    Returns Layout<Buffer, P>

  • xor<T>(arr: T[], ...args: T[][]): T[]
  • Type parameters

    • T

    Parameters

    • arr: T[]
    • Rest ...args: T[][]

    Returns T[]

  • zeros(length: number): Zeros
  • Parameters

    • length: number

    Returns Zeros