@orca-so/wavebreak
Version:
The wavebreak JS client for interacting with the wavebreak program.
70 lines (69 loc) • 6.86 kB
TypeScript
import { Address, Codec, Decoder, Encoder, IAccountMeta, IAccountSignerMeta, IInstruction, IInstructionWithAccounts, IInstructionWithData, Option, OptionOrNullable, ReadonlyAccount, TransactionSigner, WritableAccount, WritableSignerAccount } from '@solana/kit';
import { WAVEBREAK_PROGRAM_ADDRESS } from '../programs';
export declare const TOKEN_SELL_EXACT_IN_DISCRIMINATOR = 10;
export declare function getTokenSellExactInDiscriminatorBytes(): import('@solana/kit').ReadonlyUint8Array;
export type TokenSellExactInInstruction<TProgram extends string = typeof WAVEBREAK_PROGRAM_ADDRESS, TAccountSeller extends string | IAccountMeta<string> = string, TAccountBondingCurve extends string | IAccountMeta<string> = string, TAccountBaseMint extends string | IAccountMeta<string> = string, TAccountBaseAta extends string | IAccountMeta<string> = string, TAccountQuoteMint extends string | IAccountMeta<string> = string, TAccountQuoteVault extends string | IAccountMeta<string> = string, TAccountQuoteAta extends string | IAccountMeta<string> = string, TAccountSystemProgram extends string | IAccountMeta<string> = "11111111111111111111111111111111", TAccountAtaProgram extends string | IAccountMeta<string> = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", TAccountBaseTokenProgram extends string | IAccountMeta<string> = string, TAccountQuoteTokenProgram extends string | IAccountMeta<string> = string, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
TAccountSeller extends string ? WritableSignerAccount<TAccountSeller> & IAccountSignerMeta<TAccountSeller> : TAccountSeller,
TAccountBondingCurve extends string ? WritableAccount<TAccountBondingCurve> : TAccountBondingCurve,
TAccountBaseMint extends string ? WritableAccount<TAccountBaseMint> : TAccountBaseMint,
TAccountBaseAta extends string ? WritableAccount<TAccountBaseAta> : TAccountBaseAta,
TAccountQuoteMint extends string ? ReadonlyAccount<TAccountQuoteMint> : TAccountQuoteMint,
TAccountQuoteVault extends string ? WritableAccount<TAccountQuoteVault> : TAccountQuoteVault,
TAccountQuoteAta extends string ? WritableAccount<TAccountQuoteAta> : TAccountQuoteAta,
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
TAccountAtaProgram extends string ? ReadonlyAccount<TAccountAtaProgram> : TAccountAtaProgram,
TAccountBaseTokenProgram extends string ? ReadonlyAccount<TAccountBaseTokenProgram> : TAccountBaseTokenProgram,
TAccountQuoteTokenProgram extends string ? ReadonlyAccount<TAccountQuoteTokenProgram> : TAccountQuoteTokenProgram,
...TRemainingAccounts
]>;
export type TokenSellExactInInstructionData = {
discriminator: number;
amountIn: bigint;
allowPartialFill: boolean;
priceThreshold: Option<readonly [bigint, bigint]>;
};
export type TokenSellExactInInstructionDataArgs = {
amountIn: number | bigint;
allowPartialFill: boolean;
priceThreshold: OptionOrNullable<readonly [number | bigint, number | bigint]>;
};
export declare function getTokenSellExactInInstructionDataEncoder(): Encoder<TokenSellExactInInstructionDataArgs>;
export declare function getTokenSellExactInInstructionDataDecoder(): Decoder<TokenSellExactInInstructionData>;
export declare function getTokenSellExactInInstructionDataCodec(): Codec<TokenSellExactInInstructionDataArgs, TokenSellExactInInstructionData>;
export type TokenSellExactInInput<TAccountSeller extends string = string, TAccountBondingCurve extends string = string, TAccountBaseMint extends string = string, TAccountBaseAta extends string = string, TAccountQuoteMint extends string = string, TAccountQuoteVault extends string = string, TAccountQuoteAta extends string = string, TAccountSystemProgram extends string = string, TAccountAtaProgram extends string = string, TAccountBaseTokenProgram extends string = string, TAccountQuoteTokenProgram extends string = string> = {
seller: TransactionSigner<TAccountSeller>;
bondingCurve: Address<TAccountBondingCurve>;
baseMint: Address<TAccountBaseMint>;
baseAta: Address<TAccountBaseAta>;
quoteMint: Address<TAccountQuoteMint>;
quoteVault: Address<TAccountQuoteVault>;
quoteAta: Address<TAccountQuoteAta>;
systemProgram?: Address<TAccountSystemProgram>;
ataProgram?: Address<TAccountAtaProgram>;
baseTokenProgram: Address<TAccountBaseTokenProgram>;
quoteTokenProgram: Address<TAccountQuoteTokenProgram>;
amountIn: TokenSellExactInInstructionDataArgs["amountIn"];
allowPartialFill: TokenSellExactInInstructionDataArgs["allowPartialFill"];
priceThreshold: TokenSellExactInInstructionDataArgs["priceThreshold"];
};
export declare function getTokenSellExactInInstruction<TAccountSeller extends string, TAccountBondingCurve extends string, TAccountBaseMint extends string, TAccountBaseAta extends string, TAccountQuoteMint extends string, TAccountQuoteVault extends string, TAccountQuoteAta extends string, TAccountSystemProgram extends string, TAccountAtaProgram extends string, TAccountBaseTokenProgram extends string, TAccountQuoteTokenProgram extends string, TProgramAddress extends Address = typeof WAVEBREAK_PROGRAM_ADDRESS>(input: TokenSellExactInInput<TAccountSeller, TAccountBondingCurve, TAccountBaseMint, TAccountBaseAta, TAccountQuoteMint, TAccountQuoteVault, TAccountQuoteAta, TAccountSystemProgram, TAccountAtaProgram, TAccountBaseTokenProgram, TAccountQuoteTokenProgram>, config?: {
programAddress?: TProgramAddress;
}): TokenSellExactInInstruction<TProgramAddress, TAccountSeller, TAccountBondingCurve, TAccountBaseMint, TAccountBaseAta, TAccountQuoteMint, TAccountQuoteVault, TAccountQuoteAta, TAccountSystemProgram, TAccountAtaProgram, TAccountBaseTokenProgram, TAccountQuoteTokenProgram>;
export type ParsedTokenSellExactInInstruction<TProgram extends string = typeof WAVEBREAK_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
programAddress: Address<TProgram>;
accounts: {
seller: TAccountMetas[0];
bondingCurve: TAccountMetas[1];
baseMint: TAccountMetas[2];
baseAta: TAccountMetas[3];
quoteMint: TAccountMetas[4];
quoteVault: TAccountMetas[5];
quoteAta: TAccountMetas[6];
systemProgram: TAccountMetas[7];
ataProgram: TAccountMetas[8];
baseTokenProgram: TAccountMetas[9];
quoteTokenProgram: TAccountMetas[10];
};
data: TokenSellExactInInstructionData;
};
export declare function parseTokenSellExactInInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedTokenSellExactInInstruction<TProgram, TAccountMetas>;