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

# chains: Core types

> Core types: the declaration and description of each of the 8 exports of @eco-incorp/sauce, @eco-incorp/sauce/chains.

Two registries. `CANONICAL_CHAINS` holds every chain a program can name, EVM chains and Solana, and is read by `requireChain`, `resolveChain` and the slug, id and alias lookups. The `chains` record, read by `getChain`, holds native-currency and explorer metadata for most EVM chains. The same exports come from the root and from `@eco-incorp/sauce/chains`.

```typescript theme={null}
import { requireChain, getChain } from "@eco-incorp/sauce/chains";
```

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

### `NativeErc20`

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

A native coin that is ALSO an ERC-20: one balance, read two ways. `eth_getBalance`, `msg.value`
and gas use the native scale; `balanceOf` and `transfer` at `address` use `decimals`. Sending
native value and calling `transfer` move the same money. Nothing needs wrapping, so such a chain
has no canonical wrapped native, and a WETH9-style call has no canonical target there.

```typescript theme={null}
export interface NativeErc20 {
    address: `0x${string}`;
    decimals: number;
}
```

### `ChainDeployment`

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

Chain ID to deployment addresses mapping

```typescript theme={null}
export interface ChainDeployment {
    chainId: number;
    chainName: string;
    addresses: Record<string, Address>;
}
```

### `ProtocolInfo`

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

Protocol metadata

```typescript theme={null}
export interface ProtocolInfo {
    name: string;
    slug: string;
    description: string;
    website: string;
    github?: string;
    npm?: string;
    category: ProtocolCategory;
    chains: ChainDeployment[];
    audited: boolean;
    tvl?: string;
    deprecated?: boolean;
}
```

### `ProtocolCategory`

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

```typescript theme={null}
export type ProtocolCategory = "dex" | "lending" | "bridge" | "yield" | "derivatives" | "staking" | "oracle" | "cdp" | "insurance" | "launchpad" | "nft-marketplace" | "liquid-staking" | "restaking" | "rwa" | "payments" | "privacy" | "governance" | "options" | "perpetuals" | "synthetics" | "aggregator" | "cross-chain" | "infrastructure";
```

### `ContractABI`

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

ABI entry for a protocol contract

```typescript theme={null}
export interface ContractABI {
    contractName: string;
    abi: readonly object[];
    address?: Address;
}
```

### `SauceFunction`

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

A Sauce function that interacts with a protocol

```typescript theme={null}
export interface SauceFunction {
    name: string;
    description: string;
    params: SauceParam[];
    returns?: string;
    sauceScript: string;
}
```

### `SauceParam`

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

```typescript theme={null}
export interface SauceParam {
    name: string;
    type: "Address" | "Uint256" | "Bytes" | "Bytes32" | "Bool";
    description: string;
}
```

### `Chain`

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

EVM chain definition.

Carries no RPC endpoint: the SDK ships none. Whatever reads a chain takes its URL, or a client,
from the caller.

```typescript theme={null}
export interface Chain {
    id: number;
    name: string;
    nativeCurrency: {
        name: string;
        symbol: string;
        decimals: number;
        erc20?: NativeErc20;
    };
    blockExplorerUrls: string[];
    testnet: boolean;
    minBaseFeePerGas?: bigint;
}
```


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