> ## 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-2022 extensions

> Token-2022 extensions: the declaration and description of each of the 21 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`.

### `parseMintExtensions`

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

Parse the Token-2022 TLV extension region of a mint. Returns
`{ blocking: [], advisories: [] }` for a legacy 82-byte mint (or any non-T22
shape). For a Token-2022 mint, recognizes TransferFeeConfig and TransferHook
(returned as structured fields), the un-routable set (NonTransferable,
DefaultAccountState frozen, Pausable paused), each pushed as a reason string
into `blocking`, and the routable trust flags (PermanentDelegate,
ConfidentialTransferMint, Pausable not paused, ScaledUiAmount, MemoTransfer),
each pushed into `advisories`.

```typescript theme={null}
export declare function parseMintExtensions(mintData: Uint8Array): MintExtensions;
```

### `associatedTokenAccountLength`

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

The size of the associated token account the Associated Token Account program creates for a
mint, which its rent is for: SPL Token's 165 bytes; under Token-2022, the account type byte and
every extension the mint requires of an account, with the ImmutableOwner the ATA program adds.

```typescript theme={null}
export declare function associatedTokenAccountLength(mintData: Uint8Array, token2022: boolean): number;
```

### `getEpochFee`

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

```typescript theme={null}
export declare function getEpochFee(cfg: TransferFeeConfig, epoch: bigint): TransferFee;
```

### `calcTransferFee`

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

The transfer fee withheld from `amount` under `cfg` at `epoch`, EXACTLY as
spl-token-2022 computes it: 0 when bps or amount is 0, else
min(maximum\_fee, ceil(amount \* bps / 10\_000)).

```typescript theme={null}
export declare function calcTransferFee(amount: bigint, cfg: TransferFeeConfig, epoch: bigint): bigint;
```

### `netTransferAmount`

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

The amount the recipient actually receives: `amount - calcTransferFee(...)`.

```typescript theme={null}
export declare function netTransferAmount(amount: bigint, cfg: TransferFeeConfig, epoch: bigint): bigint;
```

### `grossTransferAmount`

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

The amount to send under `cfg` at `epoch` for the recipient to receive exactly `received`, as
spl-token-2022's `calculate_pre_fee_amount` computes it (the formula is in this file's header):
`netTransferAmount(grossTransferAmount(r, cfg, e), cfg, e) === r`.

```typescript theme={null}
export declare function grossTransferAmount(received: bigint, cfg: TransferFeeConfig, epoch: bigint): bigint;
```

### `ONE_IN_BASIS_POINTS`

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

Basis-points denominator (spl-token-2022 ONE\_IN\_BASIS\_POINTS).

```typescript theme={null}
ONE_IN_BASIS_POINTS = 10000n
```

### `EXT_UNINITIALIZED`

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

```typescript theme={null}
EXT_UNINITIALIZED = 0
```

### `EXT_TRANSFER_FEE_CONFIG`

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

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

### `EXT_CONFIDENTIAL_TRANSFER_MINT`

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

```typescript theme={null}
EXT_CONFIDENTIAL_TRANSFER_MINT = 4
```

### `EXT_DEFAULT_ACCOUNT_STATE`

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

```typescript theme={null}
EXT_DEFAULT_ACCOUNT_STATE = 6
```

### `EXT_MEMO_TRANSFER`

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

```typescript theme={null}
EXT_MEMO_TRANSFER = 8
```

### `EXT_NON_TRANSFERABLE`

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

```typescript theme={null}
EXT_NON_TRANSFERABLE = 9
```

### `EXT_PERMANENT_DELEGATE`

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

```typescript theme={null}
EXT_PERMANENT_DELEGATE = 12
```

### `EXT_TRANSFER_HOOK`

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

```typescript theme={null}
EXT_TRANSFER_HOOK = 14
```

### `EXT_SCALED_UI_AMOUNT`

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

```typescript theme={null}
EXT_SCALED_UI_AMOUNT = 25
```

### `EXT_PAUSABLE`

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

```typescript theme={null}
EXT_PAUSABLE = 26
```

### `TransferFee`

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

One transfer-fee schedule, valid from `epoch` onward until superseded.

```typescript theme={null}
export interface TransferFee {
    epoch: bigint;
    maximumFee: bigint;
    transferFeeBasisPoints: number;
}
```

### `TransferFeeConfig`

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

A mint's TransferFeeConfig: the older and newer fee schedules. A caller picks
the one effective at the current epoch (see `getEpochFee`) - the config
carries both so a quote computed near an epoch boundary stays exact.

```typescript theme={null}
export interface TransferFeeConfig {
    olderTransferFee: TransferFee;
    newerTransferFee: TransferFee;
}
```

### `TransferHookInfo`

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

A mint's TransferHook extension (non-nil program only).

```typescript theme={null}
export interface TransferHookInfo {
    programId: Address;
    extraAccountMetaListPda?: Address;
}
```

### `MintExtensions`

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

Parsed mint extensions relevant to routing.

```typescript theme={null}
export interface MintExtensions {
    transferFee?: TransferFeeConfig;
    transferHook?: TransferHookInfo;
    permanentDelegate?: Address;
    blocking: string[];
    advisories: string[];
}
```


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