UNPKG

@gorbchain-xyz/chaindecode

Version:

GorbchainSDK V1.3+ - Complete Solana development toolkit with advanced cryptography, messaging, and collaboration features. Build secure applications with blockchain, DeFi, and end-to-end encryption.

81 lines (80 loc) 2.2 kB
import type { DecodedInstruction } from './registry.js'; interface Token2022InstructionData { programId: string; data: Uint8Array; accounts: string[]; } 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, TransferFeeExtension = 26, ConfidentialTransferExtension = 27, DefaultAccountStateExtension = 28, Reallocate = 29, MemoTransferExtension = 30, CreateNativeMint = 31, InitializeNonTransferableMint = 32, InterestBearingMintExtension = 33, CpiGuardExtension = 34, InitializePermanentDelegate = 35, TransferHookExtension = 36, ConfidentialTransferFeeExtension = 37, WithdrawExcessLamports = 38, MetadataPointerExtension = 39, InitializeNFTMetadata = 210 } export declare enum AuthorityType { MintTokens = 0, FreezeAccount = 1, AccountOwner = 2, CloseAccount = 3, TransferFeeConfig = 4, WithheldWithdraw = 5, CloseMint = 6, InterestRate = 7, PermanentDelegate = 8, ConfidentialTransferMint = 9, TransferHookProgramId = 10, ConfidentialTransferFeeConfig = 11, MetadataPointer = 12 } /** * Main Token-2022 decoder function */ export declare function decodeToken2022Instruction(instruction: Token2022InstructionData): DecodedInstruction; /** * Enhanced Token-2022 instruction decoder with amount extraction */ export declare function decodeToken2022InstructionWithDetails(data: Uint8Array): { type: string; instruction: string; amount?: bigint; decimals?: number; accounts: any[]; extensions?: string[]; }; export {};