> ## 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: Client

> Client: the declaration and description of each of the 17 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";
```

Also re-exported from dependencies, documented by those packages:

* `@eco-incorp/sauce/svm`: `AccountRole`, `address`, `blockhash`, `generateKeyPairSigner`, `getAddressEncoder`, `getProgramDerivedAddress`, `getTransactionSize`

Generated from the type declarations of `@eco-incorp/sauce`.

### `createSauceSvmClient`

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

```typescript theme={null}
export declare function createSauceSvmClient({ rpcUrl, wsUrl, programId, kitchen, payer, potSalt, maxExecutionFee, via, }: SauceSvmClientConfig): Promise<SauceSvmClient>;
```

### `CookVia`

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

How a cook reaches the engine.

* `"kitchen"`: the Kitchen's `cook` (or `cook_from_account`), which CPIs the engine and signs the
  owner's Pot. The program can act as its Pot - hold assets in it, write its storage - and the
  Kitchen charges the execution fee first. The engine runs one level down the invoke stack.
* `"engine"`: the engine's own `cookAndPay` (or the staged, pinned `cookAndPayFromAccountPinned`).
  The engine charges the same fee, into the same treasury, then runs the program as the top-level
  instruction: no Pot, nothing signed for one - the program acts with the transaction's own
  signatures, such as the wallet's - and one more level of CPI depth for what it calls.

```typescript theme={null}
export type CookVia = "kitchen" | "engine";
```

### `SauceSvmClientConfig`

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

```typescript theme={null}
export interface SauceSvmClientConfig {
    rpcUrl: string;
    wsUrl?: string;
    programId: Address;
    kitchen: Address;
    payer: TransactionSigner;
    potSalt?: Uint8Array;
    maxExecutionFee?: bigint;
    via?: CookVia;
}
```

### `SimulateOpts`

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

```typescript theme={null}
export interface SimulateOpts {
    prepends?: readonly Instruction[];
    lookupTables?: AddressesByLookupTableAddress;
    appendPayerSigner?: boolean;
    maxExecutionFee?: bigint;
    accounts?: readonly Address[];
}
```

### `ExecuteOpts`

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

```typescript theme={null}
export interface ExecuteOpts extends SimulateOpts {
    computeUnitLimit?: number | "auto";
}
```

### `LookupTableOpts`

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

How `execute` and `executeStaged` fit a cook whose accounts do not fit one transaction: through
an address lookup table, where each account costs one byte rather than 32.

```typescript theme={null}
export interface LookupTableOpts {
    lookupTable?: Address | false;
}
```

### `SendOpts`

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

`execute`'s options: a cook's, and the lookup table it may go through.

```typescript theme={null}
export interface SendOpts extends ExecuteOpts, LookupTableOpts {
}
```

### `CookLookupTableOpts`

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

What `cookLookupTable` makes ready: the cook's options, and the table's.

```typescript theme={null}
export type CookLookupTableOpts = ExecuteOpts & EnsureLookupTableOpts;
```

### `StagedBuffer`

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

A buffer staged by this client - carries the SDK-computed content hash (the execute pin).

```typescript theme={null}
export interface StagedBuffer {
    address: Address;
    seed: Uint8Array;
    sha256: Uint8Array;
    signatures: Signature[];
}
```

### `StagedArgs`

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

Per-execution args for a staged program. The layout is CALLER-SUPPLIED: neither `CompileResult`
carries one - the compiler's is `{ bytecode, manifest? }`, the route seam's is
`{ bytecode: Uint8Array[], warnings }` - so `ArgsLayout` is the SDK's own type (`./layout.ts`)
describing where each value sits in the payload tail.

```typescript theme={null}
export interface StagedArgs {
    layout: ArgsLayout;
    values: readonly ArgValue[];
}
```

### `SimulateStagedOpts`

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

```typescript theme={null}
export interface SimulateStagedOpts extends SimulateOpts {
    expectedSha256?: Uint8Array;
}
```

### `ExecuteStagedOpts`

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

```typescript theme={null}
export interface ExecuteStagedOpts extends SimulateStagedOpts {
    computeUnitLimit?: number | "auto";
}
```

### `SendStagedOpts`

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

`executeStaged`'s options: a staged cook's, and the lookup table it may go through.

```typescript theme={null}
export interface SendStagedOpts extends ExecuteStagedOpts, LookupTableOpts {
}
```

### `StagedCookLookupTableOpts`

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

What `stagedCookLookupTable` makes ready: the staged cook's options, and the table's.

```typescript theme={null}
export type StagedCookLookupTableOpts = ExecuteStagedOpts & EnsureLookupTableOpts;
```

### `EnsuredLookupTable`

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

An address lookup table this client created/extended, ready to compress a v0 transaction against.

```typescript theme={null}
export interface EnsuredLookupTable {
    lookupTableAddress: Address;
    lookupTables: AddressesByLookupTableAddress;
}
```

### `EnsureLookupTableOpts`

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

```typescript theme={null}
export interface EnsureLookupTableOpts {
    existing?: Address;
    commitment?: Commitment;
}
```

### `SauceSvmClient`

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

```typescript theme={null}
export interface SauceSvmClient {
    readonly payerAddress: Address;
    readonly via: CookVia;
    executionFee(): Promise<bigint>;
    ensureLookupTable(addresses: readonly Address[], opts?: EnsureLookupTableOpts): Promise<EnsuredLookupTable>;
    cookLookupTable(bytecode: Uint8Array, manifest: AccountManifest, resolution: AccountResolution, opts?: CookLookupTableOpts): Promise<EnsuredLookupTable | undefined>;
    stagedCookLookupTable(buffer: Address | StagedBuffer, manifest: AccountManifest, resolution: AccountResolution, opts?: StagedCookLookupTableOpts): Promise<EnsuredLookupTable | undefined>;
    simulate(bytecode: Uint8Array, manifest: AccountManifest, resolution: AccountResolution, opts?: SimulateOpts): Promise<SimulateExecuteResult>;
    execute(bytecode: Uint8Array, manifest: AccountManifest, resolution: AccountResolution, opts?: SendOpts): Promise<SendExecuteResult>;
    cookTransaction(bytecode: Uint8Array, manifest: AccountManifest, resolution: AccountResolution, opts?: ExecuteOpts): Promise<SignedExecuteTransaction>;
    simulateStaged(buffer: Address | StagedBuffer, manifest: AccountManifest, resolution: AccountResolution, opts?: SimulateStagedOpts): Promise<SimulateExecuteResult>;
    executeStaged(buffer: Address | StagedBuffer, manifest: AccountManifest, resolution: AccountResolution, opts?: SendStagedOpts): Promise<SendExecuteResult>;
    stagedCookTransaction(buffer: Address | StagedBuffer, manifest: AccountManifest, resolution: AccountResolution, opts?: ExecuteStagedOpts): Promise<SignedExecuteTransaction>;
}
```


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