UNPKG

@solana-program/token-2022

Version:

JavaScript client for the Token 2022 program

286 lines 18.8 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 ReadonlyUint8Array } from '@solana/kit'; import { type ParsedAmountToUiAmountInstruction, type ParsedApplyConfidentialPendingBalanceInstruction, type ParsedApproveCheckedInstruction, type ParsedApproveConfidentialTransferAccountInstruction, type ParsedApproveInstruction, type ParsedBurnCheckedInstruction, type ParsedBurnInstruction, type ParsedCloseAccountInstruction, type ParsedConfidentialDepositInstruction, type ParsedConfidentialTransferInstruction, type ParsedConfidentialTransferWithFeeInstruction, type ParsedConfidentialWithdrawInstruction, type ParsedConfigureConfidentialTransferAccountInstruction, type ParsedCreateNativeMintInstruction, type ParsedDisableConfidentialCreditsInstruction, type ParsedDisableCpiGuardInstruction, type ParsedDisableHarvestToMintInstruction, type ParsedDisableMemoTransfersInstruction, type ParsedDisableNonConfidentialCreditsInstruction, type ParsedEmitTokenMetadataInstruction, type ParsedEmptyConfidentialTransferAccountInstruction, type ParsedEnableConfidentialCreditsInstruction, type ParsedEnableCpiGuardInstruction, type ParsedEnableHarvestToMintInstruction, type ParsedEnableMemoTransfersInstruction, type ParsedEnableNonConfidentialCreditsInstruction, type ParsedFreezeAccountInstruction, type ParsedGetAccountDataSizeInstruction, type ParsedHarvestWithheldTokensToMintForConfidentialTransferFeeInstruction, type ParsedHarvestWithheldTokensToMintInstruction, type ParsedInitializeAccount2Instruction, type ParsedInitializeAccount3Instruction, type ParsedInitializeAccountInstruction, type ParsedInitializeConfidentialTransferFeeInstruction, type ParsedInitializeConfidentialTransferMintInstruction, type ParsedInitializeDefaultAccountStateInstruction, type ParsedInitializeGroupMemberPointerInstruction, type ParsedInitializeGroupPointerInstruction, type ParsedInitializeImmutableOwnerInstruction, type ParsedInitializeInterestBearingMintInstruction, type ParsedInitializeMetadataPointerInstruction, type ParsedInitializeMint2Instruction, type ParsedInitializeMintCloseAuthorityInstruction, type ParsedInitializeMintInstruction, type ParsedInitializeMultisig2Instruction, type ParsedInitializeMultisigInstruction, type ParsedInitializeNonTransferableMintInstruction, type ParsedInitializePausableConfigInstruction, type ParsedInitializePermanentDelegateInstruction, type ParsedInitializeScaledUiAmountMintInstruction, type ParsedInitializeTokenGroupInstruction, type ParsedInitializeTokenGroupMemberInstruction, type ParsedInitializeTokenMetadataInstruction, type ParsedInitializeTransferFeeConfigInstruction, type ParsedInitializeTransferHookInstruction, type ParsedMintToCheckedInstruction, type ParsedMintToInstruction, type ParsedPauseInstruction, type ParsedReallocateInstruction, type ParsedRemoveTokenMetadataKeyInstruction, type ParsedResumeInstruction, type ParsedRevokeInstruction, type ParsedSetAuthorityInstruction, type ParsedSetTransferFeeInstruction, type ParsedSyncNativeInstruction, type ParsedThawAccountInstruction, type ParsedTransferCheckedInstruction, type ParsedTransferCheckedWithFeeInstruction, type ParsedTransferInstruction, type ParsedUiAmountToAmountInstruction, type ParsedUpdateConfidentialTransferMintInstruction, type ParsedUpdateDefaultAccountStateInstruction, type ParsedUpdateGroupMemberPointerInstruction, type ParsedUpdateGroupPointerInstruction, type ParsedUpdateMetadataPointerInstruction, type ParsedUpdateMultiplierScaledUiMintInstruction, type ParsedUpdateRateInterestBearingMintInstruction, type ParsedUpdateTokenGroupMaxSizeInstruction, type ParsedUpdateTokenGroupUpdateAuthorityInstruction, type ParsedUpdateTokenMetadataFieldInstruction, type ParsedUpdateTokenMetadataUpdateAuthorityInstruction, type ParsedUpdateTransferHookInstruction, type ParsedWithdrawExcessLamportsInstruction, type ParsedWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstruction, type ParsedWithdrawWithheldTokensFromAccountsInstruction, type ParsedWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstruction, type ParsedWithdrawWithheldTokensFromMintInstruction } from '../instructions'; export declare const TOKEN_2022_PROGRAM_ADDRESS: Address<"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb">; export declare enum Token2022Account { Mint = 0, Token = 1, Multisig = 2 } export declare function identifyToken2022Account(account: { data: ReadonlyUint8Array; } | ReadonlyUint8Array): Token2022Account; export declare enum Token2022Instruction { InitializeMint = 0, InitializeAccount = 1, InitializeMultisig = 2, Transfer = 3, Approve = 4, Revoke = 5, SetAuthority = 6, MintTo = 7, Burn = 8, CloseAccount = 9, FreezeAccount = 10, ThawAccount = 11, TransferChecked = 12, ApproveChecked = 13, MintToChecked = 14, BurnChecked = 15, InitializeAccount2 = 16, SyncNative = 17, InitializeAccount3 = 18, InitializeMultisig2 = 19, InitializeMint2 = 20, GetAccountDataSize = 21, InitializeImmutableOwner = 22, AmountToUiAmount = 23, UiAmountToAmount = 24, InitializeMintCloseAuthority = 25, InitializeTransferFeeConfig = 26, TransferCheckedWithFee = 27, WithdrawWithheldTokensFromMint = 28, WithdrawWithheldTokensFromAccounts = 29, HarvestWithheldTokensToMint = 30, SetTransferFee = 31, InitializeConfidentialTransferMint = 32, UpdateConfidentialTransferMint = 33, ConfigureConfidentialTransferAccount = 34, ApproveConfidentialTransferAccount = 35, EmptyConfidentialTransferAccount = 36, ConfidentialDeposit = 37, ConfidentialWithdraw = 38, ConfidentialTransfer = 39, ApplyConfidentialPendingBalance = 40, EnableConfidentialCredits = 41, DisableConfidentialCredits = 42, EnableNonConfidentialCredits = 43, DisableNonConfidentialCredits = 44, ConfidentialTransferWithFee = 45, InitializeDefaultAccountState = 46, UpdateDefaultAccountState = 47, Reallocate = 48, EnableMemoTransfers = 49, DisableMemoTransfers = 50, CreateNativeMint = 51, InitializeNonTransferableMint = 52, InitializeInterestBearingMint = 53, UpdateRateInterestBearingMint = 54, EnableCpiGuard = 55, DisableCpiGuard = 56, InitializePermanentDelegate = 57, InitializeTransferHook = 58, UpdateTransferHook = 59, InitializeConfidentialTransferFee = 60, WithdrawWithheldTokensFromMintForConfidentialTransferFee = 61, WithdrawWithheldTokensFromAccountsForConfidentialTransferFee = 62, HarvestWithheldTokensToMintForConfidentialTransferFee = 63, EnableHarvestToMint = 64, DisableHarvestToMint = 65, WithdrawExcessLamports = 66, InitializeMetadataPointer = 67, UpdateMetadataPointer = 68, InitializeGroupPointer = 69, UpdateGroupPointer = 70, InitializeGroupMemberPointer = 71, UpdateGroupMemberPointer = 72, InitializeScaledUiAmountMint = 73, UpdateMultiplierScaledUiMint = 74, InitializePausableConfig = 75, Pause = 76, Resume = 77, InitializeTokenMetadata = 78, UpdateTokenMetadataField = 79, RemoveTokenMetadataKey = 80, UpdateTokenMetadataUpdateAuthority = 81, EmitTokenMetadata = 82, InitializeTokenGroup = 83, UpdateTokenGroupMaxSize = 84, UpdateTokenGroupUpdateAuthority = 85, InitializeTokenGroupMember = 86 } export declare function identifyToken2022Instruction(instruction: { data: ReadonlyUint8Array; } | ReadonlyUint8Array): Token2022Instruction; export type ParsedToken2022Instruction<TProgram extends string = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'> = ({ instructionType: Token2022Instruction.InitializeMint; } & ParsedInitializeMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeAccount; } & ParsedInitializeAccountInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeMultisig; } & ParsedInitializeMultisigInstruction<TProgram>) | ({ instructionType: Token2022Instruction.Transfer; } & ParsedTransferInstruction<TProgram>) | ({ instructionType: Token2022Instruction.Approve; } & ParsedApproveInstruction<TProgram>) | ({ instructionType: Token2022Instruction.Revoke; } & ParsedRevokeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.SetAuthority; } & ParsedSetAuthorityInstruction<TProgram>) | ({ instructionType: Token2022Instruction.MintTo; } & ParsedMintToInstruction<TProgram>) | ({ instructionType: Token2022Instruction.Burn; } & ParsedBurnInstruction<TProgram>) | ({ instructionType: Token2022Instruction.CloseAccount; } & ParsedCloseAccountInstruction<TProgram>) | ({ instructionType: Token2022Instruction.FreezeAccount; } & ParsedFreezeAccountInstruction<TProgram>) | ({ instructionType: Token2022Instruction.ThawAccount; } & ParsedThawAccountInstruction<TProgram>) | ({ instructionType: Token2022Instruction.TransferChecked; } & ParsedTransferCheckedInstruction<TProgram>) | ({ instructionType: Token2022Instruction.ApproveChecked; } & ParsedApproveCheckedInstruction<TProgram>) | ({ instructionType: Token2022Instruction.MintToChecked; } & ParsedMintToCheckedInstruction<TProgram>) | ({ instructionType: Token2022Instruction.BurnChecked; } & ParsedBurnCheckedInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeAccount2; } & ParsedInitializeAccount2Instruction<TProgram>) | ({ instructionType: Token2022Instruction.SyncNative; } & ParsedSyncNativeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeAccount3; } & ParsedInitializeAccount3Instruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeMultisig2; } & ParsedInitializeMultisig2Instruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeMint2; } & ParsedInitializeMint2Instruction<TProgram>) | ({ instructionType: Token2022Instruction.GetAccountDataSize; } & ParsedGetAccountDataSizeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeImmutableOwner; } & ParsedInitializeImmutableOwnerInstruction<TProgram>) | ({ instructionType: Token2022Instruction.AmountToUiAmount; } & ParsedAmountToUiAmountInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UiAmountToAmount; } & ParsedUiAmountToAmountInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeMintCloseAuthority; } & ParsedInitializeMintCloseAuthorityInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeTransferFeeConfig; } & ParsedInitializeTransferFeeConfigInstruction<TProgram>) | ({ instructionType: Token2022Instruction.TransferCheckedWithFee; } & ParsedTransferCheckedWithFeeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.WithdrawWithheldTokensFromMint; } & ParsedWithdrawWithheldTokensFromMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.WithdrawWithheldTokensFromAccounts; } & ParsedWithdrawWithheldTokensFromAccountsInstruction<TProgram>) | ({ instructionType: Token2022Instruction.HarvestWithheldTokensToMint; } & ParsedHarvestWithheldTokensToMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.SetTransferFee; } & ParsedSetTransferFeeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeConfidentialTransferMint; } & ParsedInitializeConfidentialTransferMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateConfidentialTransferMint; } & ParsedUpdateConfidentialTransferMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.ConfigureConfidentialTransferAccount; } & ParsedConfigureConfidentialTransferAccountInstruction<TProgram>) | ({ instructionType: Token2022Instruction.ApproveConfidentialTransferAccount; } & ParsedApproveConfidentialTransferAccountInstruction<TProgram>) | ({ instructionType: Token2022Instruction.EmptyConfidentialTransferAccount; } & ParsedEmptyConfidentialTransferAccountInstruction<TProgram>) | ({ instructionType: Token2022Instruction.ConfidentialDeposit; } & ParsedConfidentialDepositInstruction<TProgram>) | ({ instructionType: Token2022Instruction.ConfidentialWithdraw; } & ParsedConfidentialWithdrawInstruction<TProgram>) | ({ instructionType: Token2022Instruction.ConfidentialTransfer; } & ParsedConfidentialTransferInstruction<TProgram>) | ({ instructionType: Token2022Instruction.ApplyConfidentialPendingBalance; } & ParsedApplyConfidentialPendingBalanceInstruction<TProgram>) | ({ instructionType: Token2022Instruction.EnableConfidentialCredits; } & ParsedEnableConfidentialCreditsInstruction<TProgram>) | ({ instructionType: Token2022Instruction.DisableConfidentialCredits; } & ParsedDisableConfidentialCreditsInstruction<TProgram>) | ({ instructionType: Token2022Instruction.EnableNonConfidentialCredits; } & ParsedEnableNonConfidentialCreditsInstruction<TProgram>) | ({ instructionType: Token2022Instruction.DisableNonConfidentialCredits; } & ParsedDisableNonConfidentialCreditsInstruction<TProgram>) | ({ instructionType: Token2022Instruction.ConfidentialTransferWithFee; } & ParsedConfidentialTransferWithFeeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeDefaultAccountState; } & ParsedInitializeDefaultAccountStateInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateDefaultAccountState; } & ParsedUpdateDefaultAccountStateInstruction<TProgram>) | ({ instructionType: Token2022Instruction.Reallocate; } & ParsedReallocateInstruction<TProgram>) | ({ instructionType: Token2022Instruction.EnableMemoTransfers; } & ParsedEnableMemoTransfersInstruction<TProgram>) | ({ instructionType: Token2022Instruction.DisableMemoTransfers; } & ParsedDisableMemoTransfersInstruction<TProgram>) | ({ instructionType: Token2022Instruction.CreateNativeMint; } & ParsedCreateNativeMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeNonTransferableMint; } & ParsedInitializeNonTransferableMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeInterestBearingMint; } & ParsedInitializeInterestBearingMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateRateInterestBearingMint; } & ParsedUpdateRateInterestBearingMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.EnableCpiGuard; } & ParsedEnableCpiGuardInstruction<TProgram>) | ({ instructionType: Token2022Instruction.DisableCpiGuard; } & ParsedDisableCpiGuardInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializePermanentDelegate; } & ParsedInitializePermanentDelegateInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeTransferHook; } & ParsedInitializeTransferHookInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateTransferHook; } & ParsedUpdateTransferHookInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeConfidentialTransferFee; } & ParsedInitializeConfidentialTransferFeeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.WithdrawWithheldTokensFromMintForConfidentialTransferFee; } & ParsedWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.WithdrawWithheldTokensFromAccountsForConfidentialTransferFee; } & ParsedWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.HarvestWithheldTokensToMintForConfidentialTransferFee; } & ParsedHarvestWithheldTokensToMintForConfidentialTransferFeeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.EnableHarvestToMint; } & ParsedEnableHarvestToMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.DisableHarvestToMint; } & ParsedDisableHarvestToMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.WithdrawExcessLamports; } & ParsedWithdrawExcessLamportsInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeMetadataPointer; } & ParsedInitializeMetadataPointerInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateMetadataPointer; } & ParsedUpdateMetadataPointerInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeGroupPointer; } & ParsedInitializeGroupPointerInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateGroupPointer; } & ParsedUpdateGroupPointerInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeGroupMemberPointer; } & ParsedInitializeGroupMemberPointerInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateGroupMemberPointer; } & ParsedUpdateGroupMemberPointerInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeScaledUiAmountMint; } & ParsedInitializeScaledUiAmountMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateMultiplierScaledUiMint; } & ParsedUpdateMultiplierScaledUiMintInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializePausableConfig; } & ParsedInitializePausableConfigInstruction<TProgram>) | ({ instructionType: Token2022Instruction.Pause; } & ParsedPauseInstruction<TProgram>) | ({ instructionType: Token2022Instruction.Resume; } & ParsedResumeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeTokenMetadata; } & ParsedInitializeTokenMetadataInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateTokenMetadataField; } & ParsedUpdateTokenMetadataFieldInstruction<TProgram>) | ({ instructionType: Token2022Instruction.RemoveTokenMetadataKey; } & ParsedRemoveTokenMetadataKeyInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateTokenMetadataUpdateAuthority; } & ParsedUpdateTokenMetadataUpdateAuthorityInstruction<TProgram>) | ({ instructionType: Token2022Instruction.EmitTokenMetadata; } & ParsedEmitTokenMetadataInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeTokenGroup; } & ParsedInitializeTokenGroupInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateTokenGroupMaxSize; } & ParsedUpdateTokenGroupMaxSizeInstruction<TProgram>) | ({ instructionType: Token2022Instruction.UpdateTokenGroupUpdateAuthority; } & ParsedUpdateTokenGroupUpdateAuthorityInstruction<TProgram>) | ({ instructionType: Token2022Instruction.InitializeTokenGroupMember; } & ParsedInitializeTokenGroupMemberInstruction<TProgram>); //# sourceMappingURL=token2022.d.ts.map