> ## 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 program

> Token program: 13 exports of the svm module of @eco-incorp/sauce, including classifyMintProgram, resolveTokenProgram, resolveTokenProgramOwned, resolveTokenProgramByOwner, isToken2022Mint, createTokenProgramResolver.

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

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

This page covers `sdk/dist/svm/token-program.d.ts`.

<Note>
  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](/programmable-transactions/sauce/architecture-and-deployments).
</Note>

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

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

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

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

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

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

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

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

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

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

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

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

### `TOKEN_PROGRAM_ID`

*Variable* · `sdk/dist/svm/token-program.d.ts`

Legacy SPL Token program (classic Tokenkeg).

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

### `TOKEN_2022_PROGRAM_ID`

*Variable* · `sdk/dist/svm/token-program.d.ts`

Token-2022 program (extensions).

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

### `SPL_MINT_SIZE`

*Variable* · `sdk/dist/svm/token-program.d.ts`

A classic SPL mint account is exactly this many bytes.

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

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

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

### `T22_ACCOUNT_TYPE_MINT`

*Variable* · `sdk/dist/svm/token-program.d.ts`

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

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

### `T22_TLV_START`

*Variable* · `sdk/dist/svm/token-program.d.ts`

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

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

### `OwnerLoader`

*Type* · `sdk/dist/svm/token-program.d.ts`

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

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