/** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from "@solana/kit"; import { PERPETUALS_PROGRAM_ADDRESS } from "../programs"; export declare const SWAP_DISCRIMINATOR: Uint8Array; export declare function getSwapDiscriminatorBytes(): ReadonlyUint8Array; export type SwapInstruction = string, TAccountFundingAccount extends string | AccountMeta = string, TAccountReceivingAccount extends string | AccountMeta = string, TAccountTransferAuthority extends string | AccountMeta = string, TAccountPerpetuals extends string | AccountMeta = string, TAccountPool extends string | AccountMeta = string, TAccountReceivingCustody extends string | AccountMeta = string, TAccountReceivingCustodyOracleAccount extends string | AccountMeta = string, TAccountReceivingCustodyTokenAccount extends string | AccountMeta = string, TAccountDispensingCustody extends string | AccountMeta = string, TAccountDispensingCustodyOracleAccount extends string | AccountMeta = string, TAccountDispensingCustodyTokenAccount extends string | AccountMeta = string, TAccountTokenProgram extends string | AccountMeta = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TAccountEventAuthority extends string | AccountMeta = string, TAccountProgram extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountOwner extends string ? WritableSignerAccount & AccountSignerMeta : TAccountOwner, TAccountFundingAccount extends string ? WritableAccount : TAccountFundingAccount, TAccountReceivingAccount extends string ? WritableAccount : TAccountReceivingAccount, TAccountTransferAuthority extends string ? ReadonlyAccount : TAccountTransferAuthority, TAccountPerpetuals extends string ? ReadonlyAccount : TAccountPerpetuals, TAccountPool extends string ? WritableAccount : TAccountPool, TAccountReceivingCustody extends string ? WritableAccount : TAccountReceivingCustody, TAccountReceivingCustodyOracleAccount extends string ? ReadonlyAccount : TAccountReceivingCustodyOracleAccount, TAccountReceivingCustodyTokenAccount extends string ? WritableAccount : TAccountReceivingCustodyTokenAccount, TAccountDispensingCustody extends string ? WritableAccount : TAccountDispensingCustody, TAccountDispensingCustodyOracleAccount extends string ? ReadonlyAccount : TAccountDispensingCustodyOracleAccount, TAccountDispensingCustodyTokenAccount extends string ? WritableAccount : TAccountDispensingCustodyTokenAccount, TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, TAccountEventAuthority extends string ? ReadonlyAccount : TAccountEventAuthority, TAccountProgram extends string ? ReadonlyAccount : TAccountProgram, ...TRemainingAccounts ]>; export type SwapInstructionData = { discriminator: ReadonlyUint8Array; amountIn: bigint; minAmountOut: bigint; }; export type SwapInstructionDataArgs = { amountIn: number | bigint; minAmountOut: number | bigint; }; export declare function getSwapInstructionDataEncoder(): FixedSizeEncoder; export declare function getSwapInstructionDataDecoder(): FixedSizeDecoder; export declare function getSwapInstructionDataCodec(): FixedSizeCodec; export type SwapInput = { owner: TransactionSigner; fundingAccount: Address; receivingAccount: Address; transferAuthority: Address; perpetuals: Address; pool: Address; receivingCustody: Address; receivingCustodyOracleAccount: Address; receivingCustodyTokenAccount: Address; dispensingCustody: Address; dispensingCustodyOracleAccount: Address; dispensingCustodyTokenAccount: Address; tokenProgram?: Address; eventAuthority: Address; program: Address; amountIn: SwapInstructionDataArgs["amountIn"]; minAmountOut: SwapInstructionDataArgs["minAmountOut"]; }; export declare function getSwapInstruction(input: SwapInput, config?: { programAddress?: TProgramAddress; }): SwapInstruction; export type ParsedSwapInstruction = { programAddress: Address; accounts: { owner: TAccountMetas[0]; fundingAccount: TAccountMetas[1]; receivingAccount: TAccountMetas[2]; transferAuthority: TAccountMetas[3]; perpetuals: TAccountMetas[4]; pool: TAccountMetas[5]; receivingCustody: TAccountMetas[6]; receivingCustodyOracleAccount: TAccountMetas[7]; receivingCustodyTokenAccount: TAccountMetas[8]; dispensingCustody: TAccountMetas[9]; dispensingCustodyOracleAccount: TAccountMetas[10]; dispensingCustodyTokenAccount: TAccountMetas[11]; tokenProgram: TAccountMetas[12]; eventAuthority: TAccountMetas[13]; program: TAccountMetas[14]; }; data: SwapInstructionData; }; export declare function parseSwapInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedSwapInstruction; //# sourceMappingURL=swap.d.ts.map