gill
Version:
a modern javascript/typescript client library for interacting with the Solana blockchain
227 lines (225 loc) • 68.4 kB
JavaScript
import { checkedAddress, checkedTransactionSigner, getMinimumBalanceForRentExemption, createTransaction } from './chunk-HVCY6BNF.node.mjs';
import { findAssociatedTokenPda, TOKEN_2022_PROGRAM_ADDRESS, extension, getMintSize, getInitializeMetadataPointerInstruction, getInitializeMintInstruction, getInitializeTokenMetadataInstruction, getCreateAssociatedTokenIdempotentInstruction, getMintToInstruction, getTransferInstruction } from '@solana-program/token-2022';
export { AMOUNT_TO_UI_AMOUNT_DISCRIMINATOR, APPLY_CONFIDENTIAL_PENDING_BALANCE_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, APPLY_CONFIDENTIAL_PENDING_BALANCE_DISCRIMINATOR, APPROVE_CHECKED_DISCRIMINATOR, APPROVE_CONFIDENTIAL_TRANSFER_ACCOUNT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, APPROVE_CONFIDENTIAL_TRANSFER_ACCOUNT_DISCRIMINATOR, APPROVE_DISCRIMINATOR, ASSOCIATED_TOKEN_ERROR__INVALID_OWNER, ASSOCIATED_TOKEN_PROGRAM_ADDRESS, AccountState, AssociatedTokenInstruction, AuthorityType, BURN_CHECKED_DISCRIMINATOR, BURN_DISCRIMINATOR, CLOSE_ACCOUNT_DISCRIMINATOR, CONFIDENTIAL_DEPOSIT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, CONFIDENTIAL_DEPOSIT_DISCRIMINATOR, CONFIDENTIAL_TRANSFER_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, CONFIDENTIAL_TRANSFER_DISCRIMINATOR, CONFIDENTIAL_TRANSFER_WITH_FEE_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, CONFIDENTIAL_TRANSFER_WITH_FEE_DISCRIMINATOR, CONFIDENTIAL_WITHDRAW_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, CONFIDENTIAL_WITHDRAW_DISCRIMINATOR, CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_DISCRIMINATOR, CREATE_ASSOCIATED_TOKEN_DISCRIMINATOR, CREATE_ASSOCIATED_TOKEN_IDEMPOTENT_DISCRIMINATOR, CREATE_NATIVE_MINT_DISCRIMINATOR, DISABLE_CONFIDENTIAL_CREDITS_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, DISABLE_CONFIDENTIAL_CREDITS_DISCRIMINATOR, DISABLE_CPI_GUARD_CPI_GUARD_DISCRIMINATOR, DISABLE_CPI_GUARD_DISCRIMINATOR, DISABLE_HARVEST_TO_MINT_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR, DISABLE_HARVEST_TO_MINT_DISCRIMINATOR, DISABLE_MEMO_TRANSFERS_DISCRIMINATOR, DISABLE_MEMO_TRANSFERS_MEMO_TRANSFERS_DISCRIMINATOR, DISABLE_NON_CONFIDENTIAL_CREDITS_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, DISABLE_NON_CONFIDENTIAL_CREDITS_DISCRIMINATOR, EMIT_TOKEN_METADATA_DISCRIMINATOR, EMPTY_CONFIDENTIAL_TRANSFER_ACCOUNT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, EMPTY_CONFIDENTIAL_TRANSFER_ACCOUNT_DISCRIMINATOR, ENABLE_CONFIDENTIAL_CREDITS_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, ENABLE_CONFIDENTIAL_CREDITS_DISCRIMINATOR, ENABLE_CPI_GUARD_CPI_GUARD_DISCRIMINATOR, ENABLE_CPI_GUARD_DISCRIMINATOR, ENABLE_HARVEST_TO_MINT_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR, ENABLE_HARVEST_TO_MINT_DISCRIMINATOR, ENABLE_MEMO_TRANSFERS_DISCRIMINATOR, ENABLE_MEMO_TRANSFERS_MEMO_TRANSFERS_DISCRIMINATOR, ENABLE_NON_CONFIDENTIAL_CREDITS_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, ENABLE_NON_CONFIDENTIAL_CREDITS_DISCRIMINATOR, ExtensionType, FREEZE_ACCOUNT_DISCRIMINATOR, GET_ACCOUNT_DATA_SIZE_DISCRIMINATOR, HARVEST_WITHHELD_TOKENS_TO_MINT_DISCRIMINATOR, HARVEST_WITHHELD_TOKENS_TO_MINT_FOR_CONFIDENTIAL_TRANSFER_FEE_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR, HARVEST_WITHHELD_TOKENS_TO_MINT_FOR_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR, HARVEST_WITHHELD_TOKENS_TO_MINT_TRANSFER_FEE_DISCRIMINATOR, INITIALIZE_ACCOUNT2_DISCRIMINATOR, INITIALIZE_ACCOUNT3_DISCRIMINATOR, INITIALIZE_ACCOUNT_DISCRIMINATOR, INITIALIZE_CONFIDENTIAL_TRANSFER_FEE_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR, INITIALIZE_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR, INITIALIZE_CONFIDENTIAL_TRANSFER_MINT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, INITIALIZE_CONFIDENTIAL_TRANSFER_MINT_DISCRIMINATOR, INITIALIZE_DEFAULT_ACCOUNT_STATE_DEFAULT_ACCOUNT_STATE_DISCRIMINATOR, INITIALIZE_DEFAULT_ACCOUNT_STATE_DISCRIMINATOR, INITIALIZE_GROUP_MEMBER_POINTER_DISCRIMINATOR, INITIALIZE_GROUP_MEMBER_POINTER_GROUP_MEMBER_POINTER_DISCRIMINATOR, INITIALIZE_GROUP_POINTER_DISCRIMINATOR, INITIALIZE_GROUP_POINTER_GROUP_POINTER_DISCRIMINATOR, INITIALIZE_IMMUTABLE_OWNER_DISCRIMINATOR, INITIALIZE_INTEREST_BEARING_MINT_DISCRIMINATOR, INITIALIZE_INTEREST_BEARING_MINT_INTEREST_BEARING_MINT_DISCRIMINATOR, INITIALIZE_METADATA_POINTER_DISCRIMINATOR, INITIALIZE_METADATA_POINTER_METADATA_POINTER_DISCRIMINATOR, INITIALIZE_MINT2_DISCRIMINATOR, INITIALIZE_MINT_CLOSE_AUTHORITY_DISCRIMINATOR, INITIALIZE_MINT_DISCRIMINATOR, INITIALIZE_MULTISIG2_DISCRIMINATOR, INITIALIZE_MULTISIG_DISCRIMINATOR, INITIALIZE_NON_TRANSFERABLE_MINT_DISCRIMINATOR, INITIALIZE_PAUSABLE_CONFIG_DISCRIMINATOR, INITIALIZE_PAUSABLE_CONFIG_PAUSABLE_DISCRIMINATOR, INITIALIZE_PERMANENT_DELEGATE_DISCRIMINATOR, INITIALIZE_SCALED_UI_AMOUNT_MINT_DISCRIMINATOR, INITIALIZE_SCALED_UI_AMOUNT_MINT_SCALED_UI_AMOUNT_MINT_DISCRIMINATOR, INITIALIZE_TOKEN_GROUP_DISCRIMINATOR, INITIALIZE_TOKEN_GROUP_MEMBER_DISCRIMINATOR, INITIALIZE_TOKEN_METADATA_DISCRIMINATOR, INITIALIZE_TRANSFER_FEE_CONFIG_DISCRIMINATOR, INITIALIZE_TRANSFER_FEE_CONFIG_TRANSFER_FEE_DISCRIMINATOR, INITIALIZE_TRANSFER_HOOK_DISCRIMINATOR, INITIALIZE_TRANSFER_HOOK_TRANSFER_HOOK_DISCRIMINATOR, MINT_TO_CHECKED_DISCRIMINATOR, MINT_TO_DISCRIMINATOR, PAUSE_DISCRIMINATOR, PAUSE_PAUSABLE_DISCRIMINATOR, REALLOCATE_DISCRIMINATOR, RECOVER_NESTED_ASSOCIATED_TOKEN_DISCRIMINATOR, REMOVE_TOKEN_METADATA_KEY_DISCRIMINATOR, RESUME_DISCRIMINATOR, RESUME_PAUSABLE_DISCRIMINATOR, REVOKE_DISCRIMINATOR, SET_AUTHORITY_DISCRIMINATOR, SET_TRANSFER_FEE_DISCRIMINATOR, SET_TRANSFER_FEE_TRANSFER_FEE_DISCRIMINATOR, SYNC_NATIVE_DISCRIMINATOR, THAW_ACCOUNT_DISCRIMINATOR, TOKEN_2022_ERROR__ACCOUNT_FROZEN, TOKEN_2022_ERROR__ALREADY_IN_USE, TOKEN_2022_ERROR__AUTHORITY_TYPE_NOT_SUPPORTED, TOKEN_2022_ERROR__FIXED_SUPPLY, TOKEN_2022_ERROR__INSUFFICIENT_FUNDS, TOKEN_2022_ERROR__INVALID_INSTRUCTION, TOKEN_2022_ERROR__INVALID_MINT, TOKEN_2022_ERROR__INVALID_NUMBER_OF_PROVIDED_SIGNERS, TOKEN_2022_ERROR__INVALID_NUMBER_OF_REQUIRED_SIGNERS, TOKEN_2022_ERROR__INVALID_STATE, TOKEN_2022_ERROR__MINT_CANNOT_FREEZE, TOKEN_2022_ERROR__MINT_DECIMALS_MISMATCH, TOKEN_2022_ERROR__MINT_MISMATCH, TOKEN_2022_ERROR__NATIVE_NOT_SUPPORTED, TOKEN_2022_ERROR__NON_NATIVE_HAS_BALANCE, TOKEN_2022_ERROR__NON_NATIVE_NOT_SUPPORTED, TOKEN_2022_ERROR__NOT_RENT_EXEMPT, TOKEN_2022_ERROR__OVERFLOW, TOKEN_2022_ERROR__OWNER_MISMATCH, TOKEN_2022_ERROR__UNINITIALIZED_STATE, TOKEN_2022_PROGRAM_ADDRESS, TRANSFER_CHECKED_DISCRIMINATOR, TRANSFER_CHECKED_WITH_FEE_DISCRIMINATOR, TRANSFER_CHECKED_WITH_FEE_TRANSFER_FEE_DISCRIMINATOR, TRANSFER_DISCRIMINATOR, Token2022Account, Token2022Instruction, UI_AMOUNT_TO_AMOUNT_DISCRIMINATOR, UPDATE_CONFIDENTIAL_TRANSFER_MINT_CONFIDENTIAL_TRANSFER_DISCRIMINATOR, UPDATE_CONFIDENTIAL_TRANSFER_MINT_DISCRIMINATOR, UPDATE_DEFAULT_ACCOUNT_STATE_DEFAULT_ACCOUNT_STATE_DISCRIMINATOR, UPDATE_DEFAULT_ACCOUNT_STATE_DISCRIMINATOR, UPDATE_GROUP_MEMBER_POINTER_DISCRIMINATOR, UPDATE_GROUP_MEMBER_POINTER_GROUP_MEMBER_POINTER_DISCRIMINATOR, UPDATE_GROUP_POINTER_DISCRIMINATOR, UPDATE_GROUP_POINTER_GROUP_POINTER_DISCRIMINATOR, UPDATE_METADATA_POINTER_DISCRIMINATOR, UPDATE_METADATA_POINTER_METADATA_POINTER_DISCRIMINATOR, UPDATE_MULTIPLIER_SCALED_UI_MINT_DISCRIMINATOR, UPDATE_MULTIPLIER_SCALED_UI_MINT_SCALED_UI_AMOUNT_MINT_DISCRIMINATOR, UPDATE_RATE_INTEREST_BEARING_MINT_DISCRIMINATOR, UPDATE_RATE_INTEREST_BEARING_MINT_INTEREST_BEARING_MINT_DISCRIMINATOR, UPDATE_TOKEN_GROUP_MAX_SIZE_DISCRIMINATOR, UPDATE_TOKEN_GROUP_UPDATE_AUTHORITY_DISCRIMINATOR, UPDATE_TOKEN_METADATA_FIELD_DISCRIMINATOR, UPDATE_TOKEN_METADATA_UPDATE_AUTHORITY_DISCRIMINATOR, UPDATE_TRANSFER_HOOK_DISCRIMINATOR, UPDATE_TRANSFER_HOOK_TRANSFER_HOOK_DISCRIMINATOR, WITHDRAW_EXCESS_LAMPORTS_DISCRIMINATOR, WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_DISCRIMINATOR, WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_FOR_CONFIDENTIAL_TRANSFER_FEE_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR, WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_FOR_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR, WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_TRANSFER_FEE_DISCRIMINATOR, WITHDRAW_WITHHELD_TOKENS_FROM_MINT_DISCRIMINATOR, WITHDRAW_WITHHELD_TOKENS_FROM_MINT_FOR_CONFIDENTIAL_TRANSFER_FEE_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR, WITHDRAW_WITHHELD_TOKENS_FROM_MINT_FOR_CONFIDENTIAL_TRANSFER_FEE_DISCRIMINATOR, WITHDRAW_WITHHELD_TOKENS_FROM_MINT_TRANSFER_FEE_DISCRIMINATOR, amountToUiAmountForInterestBearingMintWithoutSimulation, amountToUiAmountForMintWithoutSimulation, amountToUiAmountForScaledUiAmountMintWithoutSimulation, decodeMint, decodeMultisig, decodeToken, extension, fetchAllMaybeMint, fetchAllMaybeMultisig, fetchAllMaybeToken, fetchAllMint, fetchAllMultisig, fetchAllToken, fetchMaybeMint, fetchMaybeMultisig, fetchMaybeToken, fetchMint, fetchMultisig, fetchToken, findAssociatedTokenPda, getAccountStateCodec, getAccountStateDecoder, getAccountStateEncoder, getAmountToUiAmountDiscriminatorBytes, getAmountToUiAmountInstruction, getAmountToUiAmountInstructionDataCodec, getAmountToUiAmountInstructionDataDecoder, getAmountToUiAmountInstructionDataEncoder, getApplyConfidentialPendingBalanceConfidentialTransferDiscriminatorBytes, getApplyConfidentialPendingBalanceDiscriminatorBytes, getApplyConfidentialPendingBalanceInstruction, getApplyConfidentialPendingBalanceInstructionDataCodec, getApplyConfidentialPendingBalanceInstructionDataDecoder, getApplyConfidentialPendingBalanceInstructionDataEncoder, getApproveCheckedDiscriminatorBytes, getApproveCheckedInstruction, getApproveCheckedInstructionDataCodec, getApproveCheckedInstructionDataDecoder, getApproveCheckedInstructionDataEncoder, getApproveConfidentialTransferAccountConfidentialTransferDiscriminatorBytes, getApproveConfidentialTransferAccountDiscriminatorBytes, getApproveConfidentialTransferAccountInstruction, getApproveConfidentialTransferAccountInstructionDataCodec, getApproveConfidentialTransferAccountInstructionDataDecoder, getApproveConfidentialTransferAccountInstructionDataEncoder, getApproveDiscriminatorBytes, getApproveInstruction, getApproveInstructionDataCodec, getApproveInstructionDataDecoder, getApproveInstructionDataEncoder, getAssociatedTokenErrorMessage, getAuthorityTypeCodec, getAuthorityTypeDecoder, getAuthorityTypeEncoder, getBurnCheckedDiscriminatorBytes, getBurnCheckedInstruction, getBurnCheckedInstructionDataCodec, getBurnCheckedInstructionDataDecoder, getBurnCheckedInstructionDataEncoder, getBurnDiscriminatorBytes, getBurnInstruction, getBurnInstructionDataCodec, getBurnInstructionDataDecoder, getBurnInstructionDataEncoder, getCloseAccountDiscriminatorBytes, getCloseAccountInstruction, getCloseAccountInstructionDataCodec, getCloseAccountInstructionDataDecoder, getCloseAccountInstructionDataEncoder, getConfidentialDepositConfidentialTransferDiscriminatorBytes, getConfidentialDepositDiscriminatorBytes, getConfidentialDepositInstruction, getConfidentialDepositInstructionDataCodec, getConfidentialDepositInstructionDataDecoder, getConfidentialDepositInstructionDataEncoder, getConfidentialTransferConfidentialTransferDiscriminatorBytes, getConfidentialTransferDiscriminatorBytes, getConfidentialTransferInstruction, getConfidentialTransferInstructionDataCodec, getConfidentialTransferInstructionDataDecoder, getConfidentialTransferInstructionDataEncoder, getConfidentialTransferWithFeeConfidentialTransferDiscriminatorBytes, getConfidentialTransferWithFeeDiscriminatorBytes, getConfidentialTransferWithFeeInstruction, getConfidentialTransferWithFeeInstructionDataCodec, getConfidentialTransferWithFeeInstructionDataDecoder, getConfidentialTransferWithFeeInstructionDataEncoder, getConfidentialWithdrawConfidentialTransferDiscriminatorBytes, getConfidentialWithdrawDiscriminatorBytes, getConfidentialWithdrawInstruction, getConfidentialWithdrawInstructionDataCodec, getConfidentialWithdrawInstructionDataDecoder, getConfidentialWithdrawInstructionDataEncoder, getConfigureConfidentialTransferAccountConfidentialTransferDiscriminatorBytes, getConfigureConfidentialTransferAccountDiscriminatorBytes, getConfigureConfidentialTransferAccountInstruction, getConfigureConfidentialTransferAccountInstructionDataCodec, getConfigureConfidentialTransferAccountInstructionDataDecoder, getConfigureConfidentialTransferAccountInstructionDataEncoder, getCreateAssociatedTokenDiscriminatorBytes, getCreateAssociatedTokenIdempotentDiscriminatorBytes, getCreateAssociatedTokenIdempotentInstruction, getCreateAssociatedTokenIdempotentInstructionAsync, getCreateAssociatedTokenIdempotentInstructionDataCodec, getCreateAssociatedTokenIdempotentInstructionDataDecoder, getCreateAssociatedTokenIdempotentInstructionDataEncoder, getCreateAssociatedTokenInstruction, getCreateAssociatedTokenInstructionAsync, getCreateAssociatedTokenInstructionDataCodec, getCreateAssociatedTokenInstructionDataDecoder, getCreateAssociatedTokenInstructionDataEncoder, getCreateNativeMintDiscriminatorBytes, getCreateNativeMintInstruction, getCreateNativeMintInstructionDataCodec, getCreateNativeMintInstructionDataDecoder, getCreateNativeMintInstructionDataEncoder, getDecryptableBalanceCodec, getDecryptableBalanceDecoder, getDecryptableBalanceEncoder, getDisableConfidentialCreditsConfidentialTransferDiscriminatorBytes, getDisableConfidentialCreditsDiscriminatorBytes, getDisableConfidentialCreditsInstruction, getDisableConfidentialCreditsInstructionDataCodec, getDisableConfidentialCreditsInstructionDataDecoder, getDisableConfidentialCreditsInstructionDataEncoder, getDisableCpiGuardCpiGuardDiscriminatorBytes, getDisableCpiGuardDiscriminatorBytes, getDisableCpiGuardInstruction, getDisableCpiGuardInstructionDataCodec, getDisableCpiGuardInstructionDataDecoder, getDisableCpiGuardInstructionDataEncoder, getDisableHarvestToMintConfidentialTransferFeeDiscriminatorBytes, getDisableHarvestToMintDiscriminatorBytes, getDisableHarvestToMintInstruction, getDisableHarvestToMintInstructionDataCodec, getDisableHarvestToMintInstructionDataDecoder, getDisableHarvestToMintInstructionDataEncoder, getDisableMemoTransfersDiscriminatorBytes, getDisableMemoTransfersInstruction, getDisableMemoTransfersInstructionDataCodec, getDisableMemoTransfersInstructionDataDecoder, getDisableMemoTransfersInstructionDataEncoder, getDisableMemoTransfersMemoTransfersDiscriminatorBytes, getDisableNonConfidentialCreditsConfidentialTransferDiscriminatorBytes, getDisableNonConfidentialCreditsDiscriminatorBytes, getDisableNonConfidentialCreditsInstruction, getDisableNonConfidentialCreditsInstructionDataCodec, getDisableNonConfidentialCreditsInstructionDataDecoder, getDisableNonConfidentialCreditsInstructionDataEncoder, getEmitTokenMetadataDiscriminatorBytes, getEmitTokenMetadataInstruction, getEmitTokenMetadataInstructionDataCodec, getEmitTokenMetadataInstructionDataDecoder, getEmitTokenMetadataInstructionDataEncoder, getEmptyConfidentialTransferAccountConfidentialTransferDiscriminatorBytes, getEmptyConfidentialTransferAccountDiscriminatorBytes, getEmptyConfidentialTransferAccountInstruction, getEmptyConfidentialTransferAccountInstructionDataCodec, getEmptyConfidentialTransferAccountInstructionDataDecoder, getEmptyConfidentialTransferAccountInstructionDataEncoder, getEnableConfidentialCreditsConfidentialTransferDiscriminatorBytes, getEnableConfidentialCreditsDiscriminatorBytes, getEnableConfidentialCreditsInstruction, getEnableConfidentialCreditsInstructionDataCodec, getEnableConfidentialCreditsInstructionDataDecoder, getEnableConfidentialCreditsInstructionDataEncoder, getEnableCpiGuardCpiGuardDiscriminatorBytes, getEnableCpiGuardDiscriminatorBytes, getEnableCpiGuardInstruction, getEnableCpiGuardInstructionDataCodec, getEnableCpiGuardInstructionDataDecoder, getEnableCpiGuardInstructionDataEncoder, getEnableHarvestToMintConfidentialTransferFeeDiscriminatorBytes, getEnableHarvestToMintDiscriminatorBytes, getEnableHarvestToMintInstruction, getEnableHarvestToMintInstructionDataCodec, getEnableHarvestToMintInstructionDataDecoder, getEnableHarvestToMintInstructionDataEncoder, getEnableMemoTransfersDiscriminatorBytes, getEnableMemoTransfersInstruction, getEnableMemoTransfersInstructionDataCodec, getEnableMemoTransfersInstructionDataDecoder, getEnableMemoTransfersInstructionDataEncoder, getEnableMemoTransfersMemoTransfersDiscriminatorBytes, getEnableNonConfidentialCreditsConfidentialTransferDiscriminatorBytes, getEnableNonConfidentialCreditsDiscriminatorBytes, getEnableNonConfidentialCreditsInstruction, getEnableNonConfidentialCreditsInstructionDataCodec, getEnableNonConfidentialCreditsInstructionDataDecoder, getEnableNonConfidentialCreditsInstructionDataEncoder, getEncryptedBalanceCodec, getEncryptedBalanceDecoder, getEncryptedBalanceEncoder, getExtensionCodec, getExtensionDecoder, getExtensionEncoder, getExtensionTypeCodec, getExtensionTypeDecoder, getExtensionTypeEncoder, getFreezeAccountDiscriminatorBytes, getFreezeAccountInstruction, getFreezeAccountInstructionDataCodec, getFreezeAccountInstructionDataDecoder, getFreezeAccountInstructionDataEncoder, getGetAccountDataSizeDiscriminatorBytes, getGetAccountDataSizeInstruction, getGetAccountDataSizeInstructionDataCodec, getGetAccountDataSizeInstructionDataDecoder, getGetAccountDataSizeInstructionDataEncoder, getHarvestWithheldTokensToMintDiscriminatorBytes, getHarvestWithheldTokensToMintForConfidentialTransferFeeConfidentialTransferFeeDiscriminatorBytes, getHarvestWithheldTokensToMintForConfidentialTransferFeeDiscriminatorBytes, getHarvestWithheldTokensToMintForConfidentialTransferFeeInstruction, getHarvestWithheldTokensToMintForConfidentialTransferFeeInstructionDataCodec, getHarvestWithheldTokensToMintForConfidentialTransferFeeInstructionDataDecoder, getHarvestWithheldTokensToMintForConfidentialTransferFeeInstructionDataEncoder, getHarvestWithheldTokensToMintInstruction, getHarvestWithheldTokensToMintInstructionDataCodec, getHarvestWithheldTokensToMintInstructionDataDecoder, getHarvestWithheldTokensToMintInstructionDataEncoder, getHarvestWithheldTokensToMintTransferFeeDiscriminatorBytes, getInitializeAccount2DiscriminatorBytes, getInitializeAccount2Instruction, getInitializeAccount2InstructionDataCodec, getInitializeAccount2InstructionDataDecoder, getInitializeAccount2InstructionDataEncoder, getInitializeAccount3DiscriminatorBytes, getInitializeAccount3Instruction, getInitializeAccount3InstructionDataCodec, getInitializeAccount3InstructionDataDecoder, getInitializeAccount3InstructionDataEncoder, getInitializeAccountDiscriminatorBytes, getInitializeAccountInstruction, getInitializeAccountInstructionDataCodec, getInitializeAccountInstructionDataDecoder, getInitializeAccountInstructionDataEncoder, getInitializeConfidentialTransferFeeConfidentialTransferFeeDiscriminatorBytes, getInitializeConfidentialTransferFeeDiscriminatorBytes, getInitializeConfidentialTransferFeeInstruction, getInitializeConfidentialTransferFeeInstructionDataCodec, getInitializeConfidentialTransferFeeInstructionDataDecoder, getInitializeConfidentialTransferFeeInstructionDataEncoder, getInitializeConfidentialTransferMintConfidentialTransferDiscriminatorBytes, getInitializeConfidentialTransferMintDiscriminatorBytes, getInitializeConfidentialTransferMintInstruction, getInitializeConfidentialTransferMintInstructionDataCodec, getInitializeConfidentialTransferMintInstructionDataDecoder, getInitializeConfidentialTransferMintInstructionDataEncoder, getInitializeDefaultAccountStateDefaultAccountStateDiscriminatorBytes, getInitializeDefaultAccountStateDiscriminatorBytes, getInitializeDefaultAccountStateInstruction, getInitializeDefaultAccountStateInstructionDataCodec, getInitializeDefaultAccountStateInstructionDataDecoder, getInitializeDefaultAccountStateInstructionDataEncoder, getInitializeGroupMemberPointerDiscriminatorBytes, getInitializeGroupMemberPointerGroupMemberPointerDiscriminatorBytes, getInitializeGroupMemberPointerInstruction, getInitializeGroupMemberPointerInstructionDataCodec, getInitializeGroupMemberPointerInstructionDataDecoder, getInitializeGroupMemberPointerInstructionDataEncoder, getInitializeGroupPointerDiscriminatorBytes, getInitializeGroupPointerGroupPointerDiscriminatorBytes, getInitializeGroupPointerInstruction, getInitializeGroupPointerInstructionDataCodec, getInitializeGroupPointerInstructionDataDecoder, getInitializeGroupPointerInstructionDataEncoder, getInitializeImmutableOwnerDiscriminatorBytes, getInitializeImmutableOwnerInstruction, getInitializeImmutableOwnerInstructionDataCodec, getInitializeImmutableOwnerInstructionDataDecoder, getInitializeImmutableOwnerInstructionDataEncoder, getInitializeInterestBearingMintDiscriminatorBytes, getInitializeInterestBearingMintInstruction, getInitializeInterestBearingMintInstructionDataCodec, getInitializeInterestBearingMintInstructionDataDecoder, getInitializeInterestBearingMintInstructionDataEncoder, getInitializeInterestBearingMintInterestBearingMintDiscriminatorBytes, getInitializeMetadataPointerDiscriminatorBytes, getInitializeMetadataPointerInstruction, getInitializeMetadataPointerInstructionDataCodec, getInitializeMetadataPointerInstructionDataDecoder, getInitializeMetadataPointerInstructionDataEncoder, getInitializeMetadataPointerMetadataPointerDiscriminatorBytes, getInitializeMint2DiscriminatorBytes, getInitializeMint2Instruction, getInitializeMint2InstructionDataCodec, getInitializeMint2InstructionDataDecoder, getInitializeMint2InstructionDataEncoder, getInitializeMintCloseAuthorityDiscriminatorBytes, getInitializeMintCloseAuthorityInstruction, getInitializeMintCloseAuthorityInstructionDataCodec, getInitializeMintCloseAuthorityInstructionDataDecoder, getInitializeMintCloseAuthorityInstructionDataEncoder, getInitializeMintDiscriminatorBytes, getInitializeMintInstruction, getInitializeMintInstructionDataCodec, getInitializeMintInstructionDataDecoder, getInitializeMintInstructionDataEncoder, getInitializeMultisig2DiscriminatorBytes, getInitializeMultisig2Instruction, getInitializeMultisig2InstructionDataCodec, getInitializeMultisig2InstructionDataDecoder, getInitializeMultisig2InstructionDataEncoder, getInitializeMultisigDiscriminatorBytes, getInitializeMultisigInstruction, getInitializeMultisigInstructionDataCodec, getInitializeMultisigInstructionDataDecoder, getInitializeMultisigInstructionDataEncoder, getInitializeNonTransferableMintDiscriminatorBytes, getInitializeNonTransferableMintInstruction, getInitializeNonTransferableMintInstructionDataCodec, getInitializeNonTransferableMintInstructionDataDecoder, getInitializeNonTransferableMintInstructionDataEncoder, getInitializePausableConfigDiscriminatorBytes, getInitializePausableConfigInstruction, getInitializePausableConfigInstructionDataCodec, getInitializePausableConfigInstructionDataDecoder, getInitializePausableConfigInstructionDataEncoder, getInitializePausableConfigPausableDiscriminatorBytes, getInitializePermanentDelegateDiscriminatorBytes, getInitializePermanentDelegateInstruction, getInitializePermanentDelegateInstructionDataCodec, getInitializePermanentDelegateInstructionDataDecoder, getInitializePermanentDelegateInstructionDataEncoder, getInitializeScaledUiAmountMintDiscriminatorBytes, getInitializeScaledUiAmountMintInstruction, getInitializeScaledUiAmountMintInstructionDataCodec, getInitializeScaledUiAmountMintInstructionDataDecoder, getInitializeScaledUiAmountMintInstructionDataEncoder, getInitializeScaledUiAmountMintScaledUiAmountMintDiscriminatorBytes, getInitializeTokenGroupDiscriminatorBytes, getInitializeTokenGroupInstruction, getInitializeTokenGroupInstructionDataCodec, getInitializeTokenGroupInstructionDataDecoder, getInitializeTokenGroupInstructionDataEncoder, getInitializeTokenGroupMemberDiscriminatorBytes, getInitializeTokenGroupMemberInstruction, getInitializeTokenGroupMemberInstructionDataCodec, getInitializeTokenGroupMemberInstructionDataDecoder, getInitializeTokenGroupMemberInstructionDataEncoder, getInitializeTokenMetadataDiscriminatorBytes, getInitializeTokenMetadataInstruction, getInitializeTokenMetadataInstructionDataCodec, getInitializeTokenMetadataInstructionDataDecoder, getInitializeTokenMetadataInstructionDataEncoder, getInitializeTransferFeeConfigDiscriminatorBytes, getInitializeTransferFeeConfigInstruction, getInitializeTransferFeeConfigInstructionDataCodec, getInitializeTransferFeeConfigInstructionDataDecoder, getInitializeTransferFeeConfigInstructionDataEncoder, getInitializeTransferFeeConfigTransferFeeDiscriminatorBytes, getInitializeTransferHookDiscriminatorBytes, getInitializeTransferHookInstruction, getInitializeTransferHookInstructionDataCodec, getInitializeTransferHookInstructionDataDecoder, getInitializeTransferHookInstructionDataEncoder, getInitializeTransferHookTransferHookDiscriminatorBytes, getMintCodec, getMintDecoder, getMintEncoder, getMintSize, getMintToCheckedDiscriminatorBytes, getMintToCheckedInstruction, getMintToCheckedInstructionDataCodec, getMintToCheckedInstructionDataDecoder, getMintToCheckedInstructionDataEncoder, getMintToDiscriminatorBytes, getMintToInstruction, getMintToInstructionDataCodec, getMintToInstructionDataDecoder, getMintToInstructionDataEncoder, getMultisigCodec, getMultisigDecoder, getMultisigEncoder, getMultisigSize, getPauseDiscriminatorBytes, getPauseInstruction, getPauseInstructionDataCodec, getPauseInstructionDataDecoder, getPauseInstructionDataEncoder, getPausePausableDiscriminatorBytes, getPostInitializeInstructionsForMintExtensions, getPostInitializeInstructionsForTokenExtensions, getPreInitializeInstructionsForMintExtensions, getReallocateDiscriminatorBytes, getReallocateInstruction, getReallocateInstructionDataCodec, getReallocateInstructionDataDecoder, getReallocateInstructionDataEncoder, getRecoverNestedAssociatedTokenDiscriminatorBytes, getRecoverNestedAssociatedTokenInstruction, getRecoverNestedAssociatedTokenInstructionAsync, getRecoverNestedAssociatedTokenInstructionDataCodec, getRecoverNestedAssociatedTokenInstructionDataDecoder, getRecoverNestedAssociatedTokenInstructionDataEncoder, getRemoveTokenMetadataKeyDiscriminatorBytes, getRemoveTokenMetadataKeyInstruction, getRemoveTokenMetadataKeyInstructionDataCodec, getRemoveTokenMetadataKeyInstructionDataDecoder, getRemoveTokenMetadataKeyInstructionDataEncoder, getResumeDiscriminatorBytes, getResumeInstruction, getResumeInstructionDataCodec, getResumeInstructionDataDecoder, getResumeInstructionDataEncoder, getResumePausableDiscriminatorBytes, getRevokeDiscriminatorBytes, getRevokeInstruction, getRevokeInstructionDataCodec, getRevokeInstructionDataDecoder, getRevokeInstructionDataEncoder, getSetAuthorityDiscriminatorBytes, getSetAuthorityInstruction, getSetAuthorityInstructionDataCodec, getSetAuthorityInstructionDataDecoder, getSetAuthorityInstructionDataEncoder, getSetTransferFeeDiscriminatorBytes, getSetTransferFeeInstruction, getSetTransferFeeInstructionDataCodec, getSetTransferFeeInstructionDataDecoder, getSetTransferFeeInstructionDataEncoder, getSetTransferFeeTransferFeeDiscriminatorBytes, getSyncNativeDiscriminatorBytes, getSyncNativeInstruction, getSyncNativeInstructionDataCodec, getSyncNativeInstructionDataDecoder, getSyncNativeInstructionDataEncoder, getThawAccountDiscriminatorBytes, getThawAccountInstruction, getThawAccountInstructionDataCodec, getThawAccountInstructionDataDecoder, getThawAccountInstructionDataEncoder, getToken2022ErrorMessage, getTokenCodec, getTokenDecoder, getTokenEncoder, getTokenMetadataFieldCodec, getTokenMetadataFieldDecoder, getTokenMetadataFieldEncoder, getTokenSize, getTransferCheckedDiscriminatorBytes, getTransferCheckedInstruction, getTransferCheckedInstructionDataCodec, getTransferCheckedInstructionDataDecoder, getTransferCheckedInstructionDataEncoder, getTransferCheckedWithFeeDiscriminatorBytes, getTransferCheckedWithFeeInstruction, getTransferCheckedWithFeeInstructionDataCodec, getTransferCheckedWithFeeInstructionDataDecoder, getTransferCheckedWithFeeInstructionDataEncoder, getTransferCheckedWithFeeTransferFeeDiscriminatorBytes, getTransferDiscriminatorBytes, getTransferFeeCodec, getTransferFeeDecoder, getTransferFeeEncoder, getTransferInstruction, getTransferInstructionDataCodec, getTransferInstructionDataDecoder, getTransferInstructionDataEncoder, getUiAmountToAmountDiscriminatorBytes, getUiAmountToAmountInstruction, getUiAmountToAmountInstructionDataCodec, getUiAmountToAmountInstructionDataDecoder, getUiAmountToAmountInstructionDataEncoder, getUpdateConfidentialTransferMintConfidentialTransferDiscriminatorBytes, getUpdateConfidentialTransferMintDiscriminatorBytes, getUpdateConfidentialTransferMintInstruction, getUpdateConfidentialTransferMintInstructionDataCodec, getUpdateConfidentialTransferMintInstructionDataDecoder, getUpdateConfidentialTransferMintInstructionDataEncoder, getUpdateDefaultAccountStateDefaultAccountStateDiscriminatorBytes, getUpdateDefaultAccountStateDiscriminatorBytes, getUpdateDefaultAccountStateInstruction, getUpdateDefaultAccountStateInstructionDataCodec, getUpdateDefaultAccountStateInstructionDataDecoder, getUpdateDefaultAccountStateInstructionDataEncoder, getUpdateGroupMemberPointerDiscriminatorBytes, getUpdateGroupMemberPointerGroupMemberPointerDiscriminatorBytes, getUpdateGroupMemberPointerInstruction, getUpdateGroupMemberPointerInstructionDataCodec, getUpdateGroupMemberPointerInstructionDataDecoder, getUpdateGroupMemberPointerInstructionDataEncoder, getUpdateGroupPointerDiscriminatorBytes, getUpdateGroupPointerGroupPointerDiscriminatorBytes, getUpdateGroupPointerInstruction, getUpdateGroupPointerInstructionDataCodec, getUpdateGroupPointerInstructionDataDecoder, getUpdateGroupPointerInstructionDataEncoder, getUpdateMetadataPointerDiscriminatorBytes, getUpdateMetadataPointerInstruction, getUpdateMetadataPointerInstructionDataCodec, getUpdateMetadataPointerInstructionDataDecoder, getUpdateMetadataPointerInstructionDataEncoder, getUpdateMetadataPointerMetadataPointerDiscriminatorBytes, getUpdateMultiplierScaledUiMintDiscriminatorBytes, getUpdateMultiplierScaledUiMintInstruction, getUpdateMultiplierScaledUiMintInstructionDataCodec, getUpdateMultiplierScaledUiMintInstructionDataDecoder, getUpdateMultiplierScaledUiMintInstructionDataEncoder, getUpdateMultiplierScaledUiMintScaledUiAmountMintDiscriminatorBytes, getUpdateRateInterestBearingMintDiscriminatorBytes, getUpdateRateInterestBearingMintInstruction, getUpdateRateInterestBearingMintInstructionDataCodec, getUpdateRateInterestBearingMintInstructionDataDecoder, getUpdateRateInterestBearingMintInstructionDataEncoder, getUpdateRateInterestBearingMintInterestBearingMintDiscriminatorBytes, getUpdateTokenGroupMaxSizeDiscriminatorBytes, getUpdateTokenGroupMaxSizeInstruction, getUpdateTokenGroupMaxSizeInstructionDataCodec, getUpdateTokenGroupMaxSizeInstructionDataDecoder, getUpdateTokenGroupMaxSizeInstructionDataEncoder, getUpdateTokenGroupUpdateAuthorityDiscriminatorBytes, getUpdateTokenGroupUpdateAuthorityInstruction, getUpdateTokenGroupUpdateAuthorityInstructionDataCodec, getUpdateTokenGroupUpdateAuthorityInstructionDataDecoder, getUpdateTokenGroupUpdateAuthorityInstructionDataEncoder, getUpdateTokenMetadataFieldDiscriminatorBytes, getUpdateTokenMetadataFieldInstruction, getUpdateTokenMetadataFieldInstructionDataCodec, getUpdateTokenMetadataFieldInstructionDataDecoder, getUpdateTokenMetadataFieldInstructionDataEncoder, getUpdateTokenMetadataUpdateAuthorityDiscriminatorBytes, getUpdateTokenMetadataUpdateAuthorityInstruction, getUpdateTokenMetadataUpdateAuthorityInstructionDataCodec, getUpdateTokenMetadataUpdateAuthorityInstructionDataDecoder, getUpdateTokenMetadataUpdateAuthorityInstructionDataEncoder, getUpdateTransferHookDiscriminatorBytes, getUpdateTransferHookInstruction, getUpdateTransferHookInstructionDataCodec, getUpdateTransferHookInstructionDataDecoder, getUpdateTransferHookInstructionDataEncoder, getUpdateTransferHookTransferHookDiscriminatorBytes, getWithdrawExcessLamportsDiscriminatorBytes, getWithdrawExcessLamportsInstruction, getWithdrawExcessLamportsInstructionDataCodec, getWithdrawExcessLamportsInstructionDataDecoder, getWithdrawExcessLamportsInstructionDataEncoder, getWithdrawWithheldTokensFromAccountsDiscriminatorBytes, getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeConfidentialTransferFeeDiscriminatorBytes, getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeDiscriminatorBytes, getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstruction, getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionDataCodec, getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionDataDecoder, getWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstructionDataEncoder, getWithdrawWithheldTokensFromAccountsInstruction, getWithdrawWithheldTokensFromAccountsInstructionDataCodec, getWithdrawWithheldTokensFromAccountsInstructionDataDecoder, getWithdrawWithheldTokensFromAccountsInstructionDataEncoder, getWithdrawWithheldTokensFromAccountsTransferFeeDiscriminatorBytes, getWithdrawWithheldTokensFromMintDiscriminatorBytes, getWithdrawWithheldTokensFromMintForConfidentialTransferFeeConfidentialTransferFeeDiscriminatorBytes, getWithdrawWithheldTokensFromMintForConfidentialTransferFeeDiscriminatorBytes, getWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstruction, getWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstructionDataCodec, getWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstructionDataDecoder, getWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstructionDataEncoder, getWithdrawWithheldTokensFromMintInstruction, getWithdrawWithheldTokensFromMintInstructionDataCodec, getWithdrawWithheldTokensFromMintInstructionDataDecoder, getWithdrawWithheldTokensFromMintInstructionDataEncoder, getWithdrawWithheldTokensFromMintTransferFeeDiscriminatorBytes, identifyAssociatedTokenInstruction, identifyToken2022Account, identifyToken2022Instruction, isAssociatedTokenError, isExtension, isToken2022Error, isTokenMetadataField, parseAmountToUiAmountInstruction, parseApplyConfidentialPendingBalanceInstruction, parseApproveCheckedInstruction, parseApproveConfidentialTransferAccountInstruction, parseApproveInstruction, parseBurnCheckedInstruction, parseBurnInstruction, parseCloseAccountInstruction, parseConfidentialDepositInstruction, parseConfidentialTransferInstruction, parseConfidentialTransferWithFeeInstruction, parseConfidentialWithdrawInstruction, parseConfigureConfidentialTransferAccountInstruction, parseCreateAssociatedTokenIdempotentInstruction, parseCreateAssociatedTokenInstruction, parseCreateNativeMintInstruction, parseDisableConfidentialCreditsInstruction, parseDisableCpiGuardInstruction, parseDisableHarvestToMintInstruction, parseDisableMemoTransfersInstruction, parseDisableNonConfidentialCreditsInstruction, parseEmitTokenMetadataInstruction, parseEmptyConfidentialTransferAccountInstruction, parseEnableConfidentialCreditsInstruction, parseEnableCpiGuardInstruction, parseEnableHarvestToMintInstruction, parseEnableMemoTransfersInstruction, parseEnableNonConfidentialCreditsInstruction, parseFreezeAccountInstruction, parseGetAccountDataSizeInstruction, parseHarvestWithheldTokensToMintForConfidentialTransferFeeInstruction, parseHarvestWithheldTokensToMintInstruction, parseInitializeAccount2Instruction, parseInitializeAccount3Instruction, parseInitializeAccountInstruction, parseInitializeConfidentialTransferFeeInstruction, parseInitializeConfidentialTransferMintInstruction, parseInitializeDefaultAccountStateInstruction, parseInitializeGroupMemberPointerInstruction, parseInitializeGroupPointerInstruction, parseInitializeImmutableOwnerInstruction, parseInitializeInterestBearingMintInstruction, parseInitializeMetadataPointerInstruction, parseInitializeMint2Instruction, parseInitializeMintCloseAuthorityInstruction, parseInitializeMintInstruction, parseInitializeMultisig2Instruction, parseInitializeMultisigInstruction, parseInitializeNonTransferableMintInstruction, parseInitializePausableConfigInstruction, parseInitializePermanentDelegateInstruction, parseInitializeScaledUiAmountMintInstruction, parseInitializeTokenGroupInstruction, parseInitializeTokenGroupMemberInstruction, parseInitializeTokenMetadataInstruction, parseInitializeTransferFeeConfigInstruction, parseInitializeTransferHookInstruction, parseMintToCheckedInstruction, parseMintToInstruction, parsePauseInstruction, parseReallocateInstruction, parseRecoverNestedAssociatedTokenInstruction, parseRemoveTokenMetadataKeyInstruction, parseResumeInstruction, parseRevokeInstruction, parseSetAuthorityInstruction, parseSetTransferFeeInstruction, parseSyncNativeInstruction, parseThawAccountInstruction, parseTransferCheckedInstruction, parseTransferCheckedWithFeeInstruction, parseTransferInstruction, parseUiAmountToAmountInstruction, parseUpdateConfidentialTransferMintInstruction, parseUpdateDefaultAccountStateInstruction, parseUpdateGroupMemberPointerInstruction, parseUpdateGroupPointerInstruction, parseUpdateMetadataPointerInstruction, parseUpdateMultiplierScaledUiMintInstruction, parseUpdateRateInterestBearingMintInstruction, parseUpdateTokenGroupMaxSizeInstruction, parseUpdateTokenGroupUpdateAuthorityInstruction, parseUpdateTokenMetadataFieldInstruction, parseUpdateTokenMetadataUpdateAuthorityInstruction, parseUpdateTransferHookInstruction, parseWithdrawExcessLamportsInstruction, parseWithdrawWithheldTokensFromAccountsForConfidentialTransferFeeInstruction, parseWithdrawWithheldTokensFromAccountsInstruction, parseWithdrawWithheldTokensFromMintForConfidentialTransferFeeInstruction, parseWithdrawWithheldTokensFromMintInstruction, tokenMetadataField, uiAmountToAmountForInterestBearingMintWithoutSimulation, uiAmountToAmountForMintWithoutSimulation, uiAmountToAmountForScaledUiAmountMintWithoutSimulation } from '@solana-program/token-2022';
import { isAddress, getStructEncoder, getBooleanEncoder, getAddressEncoder, getStructDecoder, getBooleanDecoder, getAddressDecoder, combineCodec, getDiscriminatedUnionEncoder, getU64Encoder, fixEncoderSize, getBytesEncoder, getDiscriminatedUnionDecoder, getU64Decoder, fixDecoderSize, getBytesDecoder, getU8Encoder, getU8Decoder, addEncoderSizePrefix, getUtf8Encoder, getU32Encoder, getU16Encoder, getOptionEncoder, getArrayEncoder, addDecoderSizePrefix, getUtf8Decoder, getU32Decoder, getU16Decoder, getOptionDecoder, getArrayDecoder, getEnumEncoder, getEnumDecoder, AccountRole, upgradeRoleToSigner, isTransactionSigner as isTransactionSigner$1, getProgramDerivedAddress } from '@solana/kit';
import { getCreateAccountInstruction } from '@solana-program/system';
import { getU8Encoder as getU8Encoder$1, transformEncoder, getStructEncoder as getStructEncoder$1, getBooleanEncoder as getBooleanEncoder$1, getOptionEncoder as getOptionEncoder$1, getStructDecoder as getStructDecoder$1, getU8Decoder as getU8Decoder$1, getBooleanDecoder as getBooleanDecoder$1, getOptionDecoder as getOptionDecoder$1, combineCodec as combineCodec$1 } from '@solana/codecs';
var TOKEN_PROGRAM_ADDRESS = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
async function getAssociatedTokenAccountAddress(mint, owner, tokenProgram) {
return (await findAssociatedTokenPda({
mint: checkedAddress(mint),
owner: checkedAddress(owner),
tokenProgram: checkedTokenProgramAddress(tokenProgram)
}))[0];
}
function parseTokenProgramAddressOrMoniker(tokenProgram) {
if (!isAddress(tokenProgram)) {
tokenProgram = tokenProgram.toLowerCase();
}
switch (tokenProgram) {
case "legacy":
case "token":
case TOKEN_PROGRAM_ADDRESS: {
return TOKEN_PROGRAM_ADDRESS;
}
case "token22":
case "token2022":
case "tokenextension":
case "tokenextensions":
case TOKEN_2022_PROGRAM_ADDRESS: {
return TOKEN_2022_PROGRAM_ADDRESS;
}
default:
throw Error("Unsupported token program. Try 'TOKEN_PROGRAM_ADDRESS' or 'TOKEN_2022_PROGRAM_ADDRESS'");
}
}
function assertIsSupportedTokenProgram(tokenProgram) {
if (tokenProgram !== TOKEN_PROGRAM_ADDRESS && tokenProgram !== TOKEN_2022_PROGRAM_ADDRESS) {
throw Error("Unsupported token program. Try 'TOKEN_PROGRAM_ADDRESS' or 'TOKEN_2022_PROGRAM_ADDRESS'");
}
}
function checkedTokenProgramAddress(tokenProgram) {
if (!tokenProgram) return TOKEN_PROGRAM_ADDRESS;
tokenProgram = parseTokenProgramAddressOrMoniker(tokenProgram);
assertIsSupportedTokenProgram(tokenProgram);
return tokenProgram;
}
function getCollectionEncoder() {
return getStructEncoder([
["verified", getBooleanEncoder()],
["key", getAddressEncoder()]
]);
}
function getCollectionDecoder() {
return getStructDecoder([
["verified", getBooleanDecoder()],
["key", getAddressDecoder()]
]);
}
function getCollectionCodec() {
return combineCodec(getCollectionEncoder(), getCollectionDecoder());
}
function getCollectionDetailsEncoder() {
return getDiscriminatedUnionEncoder([
["V1", getStructEncoder([["size", getU64Encoder()]])],
[
"V2",
getStructEncoder([["padding", fixEncoderSize(getBytesEncoder(), 8)]])
]
]);
}
function getCollectionDetailsDecoder() {
return getDiscriminatedUnionDecoder([
["V1", getStructDecoder([["size", getU64Decoder()]])],
[
"V2",
getStructDecoder([["padding", fixDecoderSize(getBytesDecoder(), 8)]])
]
]);
}
function getCollectionDetailsCodec() {
return combineCodec(
getCollectionDetailsEncoder(),
getCollectionDetailsDecoder()
);
}
function collectionDetails(kind, data) {
return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...data ?? {} };
}
function isCollectionDetails(kind, value) {
return value.__kind === kind;
}
function getCreatorEncoder() {
return getStructEncoder([
["address", getAddressEncoder()],
["verified", getBooleanEncoder()],
["share", getU8Encoder()]
]);
}
function getCreatorDecoder() {
return getStructDecoder([
["address", getAddressDecoder()],
["verified", getBooleanDecoder()],
["share", getU8Decoder()]
]);
}
function getCreatorCodec() {
return combineCodec(getCreatorEncoder(), getCreatorDecoder());
}
function getDataV2Encoder() {
return getStructEncoder([
["name", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
["symbol", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
["uri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
["sellerFeeBasisPoints", getU16Encoder()],
["creators", getOptionEncoder(getArrayEncoder(getCreatorEncoder()))],
["collection", getOptionEncoder(getCollectionEncoder())],
["uses", getOptionEncoder(getUsesEncoder())]
]);
}
function getDataV2Decoder() {
return getStructDecoder([
["name", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
["symbol", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
["uri", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
["sellerFeeBasisPoints", getU16Decoder()],
["creators", getOptionDecoder(getArrayDecoder(getCreatorDecoder()))],
["collection", getOptionDecoder(getCollectionDecoder())],
["uses", getOptionDecoder(getUsesDecoder())]
]);
}
function getDataV2Codec() {
return combineCodec(getDataV2Encoder(), getDataV2Decoder());
}
function getUsesEncoder() {
return getStructEncoder([
["useMethod", getUseMethodEncoder()],
["remaining", getU64Encoder()],
["total", getU64Encoder()]
]);
}
function getUsesDecoder() {
return getStructDecoder([
["useMethod", getUseMethodDecoder()],
["remaining", getU64Decoder()],
["total", getU64Decoder()]
]);
}
function getUsesCodec() {
return combineCodec(getUsesEncoder(), getUsesDecoder());
}
var UseMethod = /* @__PURE__ */ ((UseMethod2) => {
UseMethod2[UseMethod2["Burn"] = 0] = "Burn";
UseMethod2[UseMethod2["Multiple"] = 1] = "Multiple";
UseMethod2[UseMethod2["Single"] = 2] = "Single";
return UseMethod2;
})(UseMethod || {});
function getUseMethodEncoder() {
return getEnumEncoder(UseMethod);
}
function getUseMethodDecoder() {
return getEnumDecoder(UseMethod);
}
function getUseMethodCodec() {
return combineCodec(getUseMethodEncoder(), getUseMethodDecoder());
}
// src/programs/token-metadata/generated/programs/tokenMetadata.ts
var TOKEN_METADATA_PROGRAM_ADDRESS = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s";
var TokenMetadataAccount = /* @__PURE__ */ ((TokenMetadataAccount2) => {
TokenMetadataAccount2[TokenMetadataAccount2["CollectionAuthorityRecord"] = 0] = "CollectionAuthorityRecord";
TokenMetadataAccount2[TokenMetadataAccount2["MetadataDelegateRecord"] = 1] = "MetadataDelegateRecord";
TokenMetadataAccount2[TokenMetadataAccount2["HolderDelegateRecord"] = 2] = "HolderDelegateRecord";
TokenMetadataAccount2[TokenMetadataAccount2["Edition"] = 3] = "Edition";
TokenMetadataAccount2[TokenMetadataAccount2["EditionMarker"] = 4] = "EditionMarker";
TokenMetadataAccount2[TokenMetadataAccount2["EditionMarkerV2"] = 5] = "EditionMarkerV2";
TokenMetadataAccount2[TokenMetadataAccount2["TokenOwnedEscrow"] = 6] = "TokenOwnedEscrow";
TokenMetadataAccount2[TokenMetadataAccount2["MasterEditionV2"] = 7] = "MasterEditionV2";
TokenMetadataAccount2[TokenMetadataAccount2["MasterEditionV1"] = 8] = "MasterEditionV1";
TokenMetadataAccount2[TokenMetadataAccount2["Metadata"] = 9] = "Metadata";
TokenMetadataAccount2[TokenMetadataAccount2["TokenRecord"] = 10] = "TokenRecord";
TokenMetadataAccount2[TokenMetadataAccount2["ReservationListV2"] = 11] = "ReservationListV2";
TokenMetadataAccount2[TokenMetadataAccount2["ReservationListV1"] = 12] = "ReservationListV1";
TokenMetadataAccount2[TokenMetadataAccount2["UseAuthorityRecord"] = 13] = "UseAuthorityRecord";
return TokenMetadataAccount2;
})(TokenMetadataAccount || {});
var TokenMetadataInstruction = /* @__PURE__ */ ((TokenMetadataInstruction2) => {
TokenMetadataInstruction2[TokenMetadataInstruction2["CreateMetadataAccount"] = 0] = "CreateMetadataAccount";
TokenMetadataInstruction2[TokenMetadataInstruction2["UpdateMetadataAccount"] = 1] = "UpdateMetadataAccount";
TokenMetadataInstruction2[TokenMetadataInstruction2["DeprecatedCreateMasterEdition"] = 2] = "DeprecatedCreateMasterEdition";
TokenMetadataInstruction2[TokenMetadataInstruction2["DeprecatedMintNewEditionFromMasterEditionViaPrintingToken"] = 3] = "DeprecatedMintNewEditionFromMasterEditionViaPrintingToken";
TokenMetadataInstruction2[TokenMetadataInstruction2["UpdatePrimarySaleHappenedViaToken"] = 4] = "UpdatePrimarySaleHappenedViaToken";
TokenMetadataInstruction2[TokenMetadataInstruction2["DeprecatedSetReservationList"] = 5] = "DeprecatedSetReservationList";
TokenMetadataInstruction2[TokenMetadataInstruction2["DeprecatedCreateReservationList"] = 6] = "DeprecatedCreateReservationList";
TokenMetadataInstruction2[TokenMetadataInstruction2["SignMetadata"] = 7] = "SignMetadata";
TokenMetadataInstruction2[TokenMetadataInstruction2["DeprecatedMintPrintingTokensViaToken"] = 8] = "DeprecatedMintPrintingTokensViaToken";
TokenMetadataInstruction2[TokenMetadataInstruction2["DeprecatedMintPrintingTokens"] = 9] = "DeprecatedMintPrintingTokens";
TokenMetadataInstruction2[TokenMetadataInstruction2["CreateMasterEdition"] = 10] = "CreateMasterEdition";
TokenMetadataInstruction2[TokenMetadataInstruction2["MintNewEditionFromMasterEditionViaToken"] = 11] = "MintNewEditionFromMasterEditionViaToken";
TokenMetadataInstruction2[TokenMetadataInstruction2["ConvertMasterEditionV1ToV2"] = 12] = "ConvertMasterEditionV1ToV2";
TokenMetadataInstruction2[TokenMetadataInstruction2["MintNewEditionFromMasterEditionViaVaultProxy"] = 13] = "MintNewEditionFromMasterEditionViaVaultProxy";
TokenMetadataInstruction2[TokenMetadataInstruction2["PuffMetadata"] = 14] = "PuffMetadata";
TokenMetadataInstruction2[TokenMetadataInstruction2["UpdateMetadataAccountV2"] = 15] = "UpdateMetadataAccountV2";
TokenMetadataInstruction2[TokenMetadataInstruction2["CreateMetadataAccountV2"] = 16] = "CreateMetadataAccountV2";
TokenMetadataInstruction2[TokenMetadataInstruction2["CreateMasterEditionV3"] = 17] = "CreateMasterEditionV3";
TokenMetadataInstruction2[TokenMetadataInstruction2["VerifyCollection"] = 18] = "VerifyCollection";
TokenMetadataInstruction2[TokenMetadataInstruction2["Utilize"] = 19] = "Utilize";
TokenMetadataInstruction2[TokenMetadataInstruction2["ApproveUseAuthority"] = 20] = "ApproveUseAuthority";
TokenMetadataInstruction2[TokenMetadataInstruction2["RevokeUseAuthority"] = 21] = "RevokeUseAuthority";
TokenMetadataInstruction2[TokenMetadataInstruction2["UnverifyCollection"] = 22] = "UnverifyCollection";
TokenMetadataInstruction2[TokenMetadataInstruction2["ApproveCollectionAuthority"] = 23] = "ApproveCollectionAuthority";
TokenMetadataInstruction2[TokenMetadataInstruction2["RevokeCollectionAuthority"] = 24] = "RevokeCollectionAuthority";
TokenMetadataInstruction2[TokenMetadataInstruction2["SetAndVerifyCollection"] = 25] = "SetAndVerifyCollection";
TokenMetadataInstruction2[TokenMetadataInstruction2["FreezeDelegatedAccount"] = 26] = "FreezeDelegatedAccount";
TokenMetadataInstruction2[TokenMetadataInstruction2["ThawDelegatedAccount"] = 27] = "ThawDelegatedAccount";
TokenMetadataInstruction2[TokenMetadataInstruction2["RemoveCreatorVerification"] = 28] = "RemoveCreatorVerification";
TokenMetadataInstruction2[TokenMetadataInstruction2["BurnNft"] = 29] = "BurnNft";
TokenMetadataInstruction2[TokenMetadataInstruction2["VerifySizedCollectionItem"] = 30] = "VerifySizedCollectionItem";
TokenMetadataInstruction2[TokenMetadataInstruction2["UnverifySizedCollectionItem"] = 31] = "UnverifySizedCollectionItem";
TokenMetadataInstruction2[TokenMetadataInstruction2["SetAndVerifySizedCollectionItem"] = 32] = "SetAndVerifySizedCollectionItem";
TokenMetadataInstruction2[TokenMetadataInstruction2["CreateMetadataAccountV3"] = 33] = "CreateMetadataAccountV3";
TokenMetadataInstruction2[TokenMetadataInstruction2["SetCollectionSize"] = 34] = "SetCollectionSize";
TokenMetadataInstruction2[TokenMetadataInstruction2["SetTokenStandard"] = 35] = "SetTokenStandard";
TokenMetadataInstruction2[TokenMetadataInstruction2["BubblegumSetCollectionSize"] = 36] = "BubblegumSetCollectionSize";
TokenMetadataInstruction2[TokenMetadataInstruction2["BurnEditionNft"] = 37] = "BurnEditionNft";
TokenMetadataInstruction2[TokenMetadataInstruction2["CreateEscrowAccount"] = 38] = "CreateEscrowAccount";
TokenMetadataInstruction2[TokenM