UNPKG

@solana-program/token-2022

Version:

JavaScript client for the Token 2022 program

45 lines 2.95 kB
/** * 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 Address, type Codec, type Decoder, type Encoder, type IAccountMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount } from '@solana/kit'; import { TOKEN_2022_PROGRAM_ADDRESS } from '../programs'; export declare const AMOUNT_TO_UI_AMOUNT_DISCRIMINATOR = 23; export declare function getAmountToUiAmountDiscriminatorBytes(): import("@solana/kit").ReadonlyUint8Array; export type AmountToUiAmountInstruction<TProgram extends string = typeof TOKEN_2022_PROGRAM_ADDRESS, TAccountMint extends string | IAccountMeta<string> = string, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[ TAccountMint extends string ? ReadonlyAccount<TAccountMint> : TAccountMint, ...TRemainingAccounts ]>; export type AmountToUiAmountInstructionData = { discriminator: number; /** The amount of tokens to reformat. */ amount: bigint; }; export type AmountToUiAmountInstructionDataArgs = { /** The amount of tokens to reformat. */ amount: number | bigint; }; export declare function getAmountToUiAmountInstructionDataEncoder(): Encoder<AmountToUiAmountInstructionDataArgs>; export declare function getAmountToUiAmountInstructionDataDecoder(): Decoder<AmountToUiAmountInstructionData>; export declare function getAmountToUiAmountInstructionDataCodec(): Codec<AmountToUiAmountInstructionDataArgs, AmountToUiAmountInstructionData>; export type AmountToUiAmountInput<TAccountMint extends string = string> = { /** The mint to calculate for. */ mint: Address<TAccountMint>; amount: AmountToUiAmountInstructionDataArgs['amount']; }; export declare function getAmountToUiAmountInstruction<TAccountMint extends string, TProgramAddress extends Address = typeof TOKEN_2022_PROGRAM_ADDRESS>(input: AmountToUiAmountInput<TAccountMint>, config?: { programAddress?: TProgramAddress; }): AmountToUiAmountInstruction<TProgramAddress, TAccountMint>; export type ParsedAmountToUiAmountInstruction<TProgram extends string = typeof TOKEN_2022_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = { programAddress: Address<TProgram>; accounts: { /** The mint to calculate for. */ mint: TAccountMetas[0]; }; data: AmountToUiAmountInstructionData; }; export declare function parseAmountToUiAmountInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedAmountToUiAmountInstruction<TProgram, TAccountMetas>; //# sourceMappingURL=amountToUiAmount.d.ts.map