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

# verify: Decoding cook calls

> Decoding cook calls: the declaration and description of each of the 5 exports of @eco-incorp/sauce/verify.

`@eco-incorp/sauce/verify` checks an EVM settle payload: its program bytes against accepted program pins (by default, the settle program this package pins), and its argument tail `(tokens, minOut, recipient)` against the canonical encoding. It imports viem only, so it runs in a browser or an edge runtime without loading the compiler.

```typescript theme={null}
import { validateSettleProgram, encodeSettleProgram } from "@eco-incorp/sauce/verify";
```

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

### `decodeSettleCall`

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

Decodes one `Pot.cook(address,bytes)` call and returns the settle payload it carries, or `null` if the calldata is not a `cook` call or the program is not the settle payload. Never throws for a non-cook or non-settle input: a mismatched selector, malformed ABI or another program all return `null`.

The detection is `validateSettleProgram`: the program matches an accepted program pin (by default, the settle program this package pins) and the argument tail is canonical, so a returned `(tokens, minOut, recipient)` is the unique byte encoding of those values. It does not check the call's target: compare it against a Pot you trust.

```typescript theme={null}
export declare function decodeSettleCall(callData: Hex, accepted?: readonly (Hex | ProgramPin)[]): DecodedSettleCall | null;
```

### `extractEvmSettleFromCalls`

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

Reads the settle program out of a batch of EVM calls: returns the parameters of the first `cook` call whose program matches an accepted program pin (by default, the settle program this package pins; checked by `validateSettleProgram`), with that call's index, or `null` if no call carries one. It finds the settle by content, not by position.

Every call in a batch executes, and this examines only the first one that matches. A non-null result says the batch contains the pinned settle program with these parameters, not that the batch does nothing else: check `callIndex` against your expectation and inspect the other calls.

Matching uses the `cook` selector and the program bytes only. Compare `target` against a Pot you trust, and `engine` against the engines you accept, case-insensitively: it is reported lower-cased.

```typescript theme={null}
export declare function extractEvmSettleFromCalls(calls: readonly CallLike[], accepted?: readonly (Hex | ProgramPin)[]): ExtractedEvmSettle | null;
```

### `DecodedSettleCall`

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

```typescript theme={null}
export interface DecodedSettleCall extends DecodedSettleProgram {
    ingredientIndex: number;
    ingredientCount: number;
    engine?: `0x${string}`;
}
```

### `ExtractedEvmSettle`

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

What `extractEvmSettleFromCalls` returns: the decoded settle call, the index of the call that carried it, and that call's `target`.

```typescript theme={null}
export interface ExtractedEvmSettle extends DecodedSettleCall {
    callIndex: number;
    target?: `0x${string}`;
}
```

### `CallLike`

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

One EVM call. `data`, the cook calldata, is required; `target`, the Pot address, is carried into the result when present.

```typescript theme={null}
export interface CallLike {
    data: Hex;
    target?: `0x${string}`;
}
```


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