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

# routes: Addresses and call inputs

> Addresses and call inputs: the declaration and description of each of the 8 exports of @eco-incorp/sauce.

The `routes` namespace compiles a SauceScript program for one chain by name and builds the calls that run it. `routes.compileSauceProgram(chain, source, options?)` compiles with the chain's token symbols, protocol namespaces and `@sauce/token` in scope; `routes.encodeEntryArguments(program, values)` encodes `main`'s run-time arguments; `routes.buildSauceEvmCall(params)` builds one `cook(engine, program)` call on a Pot. The chain exports (`Base`, `Solana`, ...), `chain` and `Token` are named exports of the root, and importing the package puts nothing on `globalThis`.

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

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

* `@eco-incorp/sauce`: `WasmSource`, `routes.Hex`

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

### `routes.toBigInt`

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

Accepts `bigint | number | string`; rejects negative or non-integer values.

A `number` goes through `toExactBigInt`, so it must also be a SAFE integer. Pass a large
value as a `bigint` (`10n ** 18n`) or as a PLAIN DECIMAL string (`'1000000000000000000'`) - exponent notation like `'1e21'` is rejected too, being no more an integer string than `1e21` as
a `number` is a safe one.

```typescript theme={null}
export declare function toBigInt(value: bigint | number | string): bigint;
```

### `routes.toUniversalAddress`

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

Coerces an address into the 32-byte `UniversalAddress` format:
a 20-byte EVM address is left-padded to 32 bytes; an already-32-byte value
passes through unchanged. Anything else throws.

```typescript theme={null}
export declare function toUniversalAddress(input: AddressInput): UniversalAddress;
```

### `routes.denormalizeToEvm`

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

Narrows a 32-byte `UniversalAddress` to a 20-byte EVM address. Throws
(rather than silently truncating) if the leading 12 bytes aren't zero - that shape means the address is not EVM-representable (e.g. a real SVM
pubkey), and truncating it would produce a plausible-looking but wrong address.

```typescript theme={null}
export declare function denormalizeToEvm(u: UniversalAddress): Hex;
```

### `routes.kindOf`

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

Resolves a `ChainKindRef` to a `ChainKind`. An explicit `"evm"`/`"svm"`
literal is returned as-is (the escape hatch for a chain id not yet in the
canonical registry). Anything else is looked up via `requireChain`, which
THROWS for an unregistered id - this never silently defaults to `"evm"`.

```typescript theme={null}
export declare function kindOf(ref: ChainKindRef): ChainKind;
```

### `routes.ChainKindRef`

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

Anything that can select which fork to use: an explicit kind, or anything `resolveChain`
accepts - including a native `bigint` chain id, so a caller can pass one straight through
without a silent evm mis-classification.

```typescript theme={null}
export type ChainKindRef = ChainKind | number | bigint | string | CanonicalChain;
```

### `routes.AddressInput`

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

Loosened address input: 20-byte EVM hex, 32-byte hex, or an already-typed UniversalAddress.

```typescript theme={null}
export type AddressInput = Hex | UniversalAddress;
```

### `routes.CallInput`

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

One call: its target, its data and the native value it carries.

```typescript theme={null}
export interface CallInput {
    readonly target: AddressInput;
    readonly data: Hex;
    readonly value?: bigint | number | string;
}
```

### `routes.UniversalAddress`

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

bytes32-normalized 0x-hex address, the cross-VM address format. An EVM 20-byte address is
left-padded to 32 bytes; an SVM 32-byte pubkey passes through unchanged. See
`normalize.ts#toUniversalAddress`.

```typescript theme={null}
export type UniversalAddress = Hex;
```


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