Skip to main content
@eco-incorp/sauce/svm is the Solana side: staging a program through the kitchen, resolving accounts against the compiler’s account manifest, building and sending transactions, and verifying settle programs. Solana execution goes through the Kitchen client here; the SDK’s SVM route helpers emit a legacy instruction that the released engine does not accept.
This page covers sdk/dist/svm/token-program.d.ts.
Generated from the type declarations shipped in @eco-incorp/sauce 0.99.4. Each entry shows the package authors’ JSDoc and declaration for this SDK version. For runtime compatibility and deployed addresses, see architecture and deployments.

classifyMintProgram

Function · sdk/dist/svm/token-program.d.ts Classify a mint’s token program from its raw account data alone (pure, no I/O). Returns TOKEN_PROGRAM_ID for a classic 82-byte mint, TOKEN_2022_PROGRAM_ID for a >=166-byte extension mint with the Mint account-type byte. Throws on a length/type that is not a mint layout. See the file header for the one ambiguous case (extensionless T22 mint → classified legacy).

resolveTokenProgram

Function · sdk/dist/svm/token-program.d.ts Resolve the token program serving mint by reading its account via the AccountLoader and classifying the data shape. Throws a clear error if the mint account is missing. Resolve PER MINT - a pool can mix a legacy mint on one side and a Token-2022 mint on the other.

resolveTokenProgramOwned

Function · sdk/dist/svm/token-program.d.ts Resolve by the mint’s OWNER, the only method that is correct for every mint. Prefer this over resolveTokenProgram wherever an OwnedAccountLoader is available: it settles the extensionless-Token-2022 case that the shape path cannot see, and needs no extra round trip because the owner arrives with the data.

resolveTokenProgramByOwner

Function · sdk/dist/svm/token-program.d.ts Escape hatch for the extensionless-T22 ambiguity: resolve strictly by the mint’s OWNING program, via a lookup that can see the owner (unlike the data-only AccountLoader). Throws if the mint is missing or is owned by neither token program.

isToken2022Mint

Function · sdk/dist/svm/token-program.d.ts True iff the mint data is a Token-2022 mint (>=166 bytes, Mint account-type byte).

createTokenProgramResolver

Function · sdk/dist/svm/token-program.d.ts A caching per-mint resolver: repeated resolves of the same mint within one pool/route read the account once. Returns a resolver function closing over a Map<mintBase58, Address>.

TOKEN_PROGRAM_ID

Variable · sdk/dist/svm/token-program.d.ts Legacy SPL Token program (classic Tokenkeg).

TOKEN_2022_PROGRAM_ID

Variable · sdk/dist/svm/token-program.d.ts Token-2022 program (extensions).

SPL_MINT_SIZE

Variable · sdk/dist/svm/token-program.d.ts A classic SPL mint account is exactly this many bytes.

T22_ACCOUNT_TYPE_OFFSET

Variable · sdk/dist/svm/token-program.d.ts A Token-2022 mint with extensions pads its base region to this size, then writes the account-type discriminator at this offset (the value itself).

T22_ACCOUNT_TYPE_MINT

Variable · sdk/dist/svm/token-program.d.ts account_type == 1 means Mint (2 means token Account).

T22_TLV_START

Variable · sdk/dist/svm/token-program.d.ts First byte of the TLV extension region (right after the account-type byte).

OwnerLoader

Type · sdk/dist/svm/token-program.d.ts Async owner lookup for the escape-hatch resolver - returns the OWNING program id.