Skip to main content
Archived documentation for @eco-incorp/sauce@0.99.16. Install this release with npm install --save-exact @eco-incorp/sauce@0.99.16. Links to guides outside this tab open current documentation.
@eco-incorp/sauce/svm is the Solana side: the client (createSauceSvmClient), clusters, PDAs, account resolution against the compilerโ€™s account manifest, Kitchen and engine instructions, transactions and sending, token accounts, and compute planning for @sauce/routerโ€™s Solana venues. @eco-incorp/sauce/svm/engine exports the engineโ€™s wire format and instruction builders, @eco-incorp/sauce/svm/verify verifies settle programs and engine CPI data, and @eco-incorp/sauce/svm/engine-artifacts (Node only) returns file paths to the packaged engine and Kitchen binaries.
Generated from the type declarations of @eco-incorp/sauce.

classifyMintProgram

Function ยท @eco-incorp/sauce/svm 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 ยท @eco-incorp/sauce/svm 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 ยท @eco-incorp/sauce/svm 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 ยท @eco-incorp/sauce/svm 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 ยท @eco-incorp/sauce/svm True iff the mint data is a Token-2022 mint (>=166 bytes, Mint account-type byte).

createTokenProgramResolver

Function ยท @eco-incorp/sauce/svm 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 ยท @eco-incorp/sauce/svm Legacy SPL Token program (classic Tokenkeg).

TOKEN_2022_PROGRAM_ID

Variable ยท @eco-incorp/sauce/svm Token-2022 program (extensions).

SPL_MINT_SIZE

Variable ยท @eco-incorp/sauce/svm A classic SPL mint account is exactly this many bytes.

T22_ACCOUNT_TYPE_OFFSET

Variable ยท @eco-incorp/sauce/svm 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 ยท @eco-incorp/sauce/svm account_type == 1 means Mint (2 means token Account).

T22_TLV_START

Variable ยท @eco-incorp/sauce/svm First byte of the TLV extension region (right after the account-type byte).

OwnerLoader

Type ยท @eco-incorp/sauce/svm Async owner lookup for the escape-hatch resolver - returns the OWNING program id.