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

# token: SVM (SPL Token) target

> SVM (SPL Token) target: 15 exports of the token module of @eco-incorp/sauce, including tokenProgramValueExpr, assertRefIsIdentifier, newSvmEmitState, accountParamType, svmAccountParams, svmAccountParamList.

The `token` namespace emits SauceScript for token operations: ERC-20 on an EVM compile target, SPL Token on `svm`. `token.Token` is also installed as the default global `Token`.

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

This page covers `sdk/dist/token/svm.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>

### `token.tokenProgramValueExpr`

*Function* · `sdk/dist/token/svm.d.ts`

The SauceScript expression for a `SvmTokenProgramInput` CPI-target VALUE. Defaults to `"spl"`.

```typescript theme={null}
export declare function tokenProgramValueExpr(input: SvmTokenProgramInput | undefined): string;
```

### `token.assertRefIsIdentifier`

*Function* · `sdk/dist/token/svm.d.ts`

```typescript theme={null}
export declare function assertRefIsIdentifier(ref: string, label: string): void;
```

### `token.newSvmEmitState`

*Function* · `sdk/dist/token/svm.d.ts`

```typescript theme={null}
export declare function newSvmEmitState(): SvmEmitState;
```

### `token.accountParamType`

*Function* · `sdk/dist/token/svm.d.ts`

`Account`, `Account<Writable>`, `Account<Signer>` or `Account<Writable, Signer>`.

```typescript theme={null}
export declare function accountParamType({ writable, signer }: Role): string;
```

### `token.svmAccountParams`

*Function* · `sdk/dist/token/svm.d.ts`

Every account the program's specs touch, in FIRST-USE order - the order a caller attaches them
and the order the manifest reports. A ref shared across ops (`owner`/`tokenProgram` by design)
appears once, holding the strongest role any op demanded of it.

```typescript theme={null}
export declare function svmAccountParams(specs: readonly TokenSpec[]): readonly SvmAccountParam[];
```

### `token.svmAccountParamList`

*Function* · `sdk/dist/token/svm.d.ts`

The `main(...)` parameter list for `specs`, annotated with each slot's required role.

```typescript theme={null}
export declare function svmAccountParamList(specs: readonly TokenSpec[]): string;
```

### `token.svmTransferLines`

*Function* · `sdk/dist/token/svm.d.ts`

```typescript theme={null}
export declare function svmTransferLines(spec: TokenTransferSpec, index: number, state: SvmEmitState): readonly string[];
```

### `token.svmApproveLines`

*Function* · `sdk/dist/token/svm.d.ts`

```typescript theme={null}
export declare function svmApproveLines(spec: TokenApproveSpec, index: number, state: SvmEmitState): readonly string[];
```

### `token.svmBalanceExpression`

*Function* · `sdk/dist/token/svm.d.ts`

```typescript theme={null}
export declare function svmBalanceExpression(spec: TokenBalanceSpec): string;
```

### `token.accountRefsForTransfer`

*Function* · `sdk/dist/token/svm.d.ts`

The account manifest refs, in attach order, for `transfer`/`approve` with the given refs.

```typescript theme={null}
export declare function accountRefsForTransfer(refs: SvmTokenRefs): readonly string[];
```

### `token.accountRefsForApprove`

*Function* · `sdk/dist/token/svm.d.ts`

```typescript theme={null}
export declare function accountRefsForApprove(refs: SvmTokenRefs): readonly string[];
```

### `token.TOKEN_PROGRAM_BIGINT`

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

Well-known SPL program ids, converted once to the bigint literal the identity check wants.

```typescript theme={null}
TOKEN_PROGRAM_BIGINT: bigint
```

### `token.TOKEN_2022_PROGRAM_BIGINT`

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

```typescript theme={null}
TOKEN_2022_PROGRAM_BIGINT: bigint
```

### `token.SvmEmitState`

*Interface* · `sdk/dist/token/svm.d.ts`

Per-program emission state: a token program is pinned at most once per ref per program.

```typescript theme={null}
export interface SvmEmitState {
    pinnedTokenPrograms: Map<string, string>;
}
```

### `token.SvmAccountParam`

*Interface* · `sdk/dist/token/svm.d.ts`

One `main` account parameter: the ref name and the role its annotation asserts.

```typescript theme={null}
export interface SvmAccountParam {
    ref: string;
    writable: boolean;
    signer: boolean;
}
```
