> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# svm: Token programs

> Token programs: the declaration and description of each of the 13 exports of @eco-incorp/sauce/svm.

`@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.

```typescript theme={null}
import { createSauceSvmClient, SOLANA_CLUSTERS } from "@eco-incorp/sauce/svm";
```

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).

```typescript theme={null}
export declare function classifyMintProgram(mint: Address, data: Uint8Array, owner?: Address): Address;
```

### `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.

```typescript theme={null}
export declare function resolveTokenProgram(load: AccountLoader, mint: Address): Promise<Address>;
```

### `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.

```typescript theme={null}
export declare function resolveTokenProgramOwned(load: OwnedAccountLoader, mint: Address): Promise<Address>;
```

### `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.

```typescript theme={null}
export declare function resolveTokenProgramByOwner(mint: Address, ownerOf: OwnerLoader): Promise<Address>;
```

### `isToken2022Mint`

*Function* · `@eco-incorp/sauce/svm`

True iff the mint data is a Token-2022 mint (>=166 bytes, Mint account-type byte).

```typescript theme={null}
export declare function isToken2022Mint(data: Uint8Array): boolean;
```

### `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>.

```typescript theme={null}
export declare function createTokenProgramResolver(load: AccountLoader): (mint: Address) => Promise<Address>;
```

### `TOKEN_PROGRAM_ID`

*Variable* · `@eco-incorp/sauce/svm`

Legacy SPL Token program (classic Tokenkeg).

```typescript theme={null}
TOKEN_PROGRAM_ID: Address
```

### `TOKEN_2022_PROGRAM_ID`

*Variable* · `@eco-incorp/sauce/svm`

Token-2022 program (extensions).

```typescript theme={null}
TOKEN_2022_PROGRAM_ID: Address
```

### `SPL_MINT_SIZE`

*Variable* · `@eco-incorp/sauce/svm`

A classic SPL mint account is exactly this many bytes.

```typescript theme={null}
SPL_MINT_SIZE = 82
```

### `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).

```typescript theme={null}
T22_ACCOUNT_TYPE_OFFSET = 165
```

### `T22_ACCOUNT_TYPE_MINT`

*Variable* · `@eco-incorp/sauce/svm`

account\_type == 1 means Mint (2 means token Account).

```typescript theme={null}
T22_ACCOUNT_TYPE_MINT = 1
```

### `T22_TLV_START`

*Variable* · `@eco-incorp/sauce/svm`

First byte of the TLV extension region (right after the account-type byte).

```typescript theme={null}
T22_TLV_START = 166
```

### `OwnerLoader`

*Type* · `@eco-incorp/sauce/svm`

Async owner lookup for the escape-hatch resolver - returns the OWNING program id.

```typescript theme={null}
export type OwnerLoader = (mint: Address) => Promise<Address | null>;
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.