/** * 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, AccountSignerMeta, Address, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlyAccount, ReadonlySignerAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount } from "@solana/kit"; import { WHIRLPOOL_PROGRAM_ADDRESS } from "../programs/index.js"; export declare const SWAP_DISCRIMINATOR: ReadonlyUint8Array; export declare function getSwapDiscriminatorBytes(): ReadonlyUint8Array; export type SwapInstruction = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, TAccountTokenAuthority extends string ? ReadonlySignerAccount & AccountSignerMeta : TAccountTokenAuthority, TAccountWhirlpool extends string ? WritableAccount : TAccountWhirlpool, TAccountTokenOwnerAccountA extends string ? WritableAccount : TAccountTokenOwnerAccountA, TAccountTokenVaultA extends string ? WritableAccount : TAccountTokenVaultA, TAccountTokenOwnerAccountB extends string ? WritableAccount : TAccountTokenOwnerAccountB, TAccountTokenVaultB extends string ? WritableAccount : TAccountTokenVaultB, TAccountTickArray0 extends string ? WritableAccount : TAccountTickArray0, TAccountTickArray1 extends string ? WritableAccount : TAccountTickArray1, TAccountTickArray2 extends string ? WritableAccount : TAccountTickArray2, TAccountOracle extends string ? ReadonlyAccount : TAccountOracle, ...TRemainingAccounts ]>; export interface SwapInstructionData { discriminator: ReadonlyUint8Array; amount: bigint; otherAmountThreshold: bigint; sqrtPriceLimit: bigint; amountSpecifiedIsInput: boolean; aToB: boolean; } export interface SwapInstructionDataArgs { amount: number | bigint; otherAmountThreshold: number | bigint; sqrtPriceLimit: number | bigint; amountSpecifiedIsInput: boolean; aToB: boolean; } export declare function getSwapInstructionDataEncoder(): FixedSizeEncoder; export declare function getSwapInstructionDataDecoder(): FixedSizeDecoder; export declare function getSwapInstructionDataCodec(): FixedSizeCodec; export interface SwapInput { tokenProgram?: Address; tokenAuthority: TransactionSigner; whirlpool: Address; tokenOwnerAccountA: Address; tokenVaultA: Address; tokenOwnerAccountB: Address; tokenVaultB: Address; tickArray0: Address; tickArray1: Address; tickArray2: Address; oracle: Address; amount: SwapInstructionDataArgs["amount"]; otherAmountThreshold: SwapInstructionDataArgs["otherAmountThreshold"]; sqrtPriceLimit: SwapInstructionDataArgs["sqrtPriceLimit"]; amountSpecifiedIsInput: SwapInstructionDataArgs["amountSpecifiedIsInput"]; aToB: SwapInstructionDataArgs["aToB"]; } export declare function getSwapInstruction(input: SwapInput, config?: { programAddress?: TProgramAddress; }): SwapInstruction; export interface ParsedSwapInstruction { programAddress: Address; accounts: { tokenProgram: TAccountMetas[0]; tokenAuthority: TAccountMetas[1]; whirlpool: TAccountMetas[2]; tokenOwnerAccountA: TAccountMetas[3]; tokenVaultA: TAccountMetas[4]; tokenOwnerAccountB: TAccountMetas[5]; tokenVaultB: TAccountMetas[6]; tickArray0: TAccountMetas[7]; tickArray1: TAccountMetas[8]; tickArray2: TAccountMetas[9]; oracle: TAccountMetas[10]; }; data: SwapInstructionData; } export declare function parseSwapInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedSwapInstruction; //# sourceMappingURL=swap.d.ts.map