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

# contracts: Queries

> Queries: the declaration and description of each of the 12 exports of @eco-incorp/sauce.

The `contracts` namespace describes each registry protocol's contracts: per-chain addresses, each bound to the ABI the registry checked against the deployed code. `contracts.on(chain)` returns typed accessors (`contracts.on("base").Uniswap.UniversalRouter`) whose methods build `ContractCall` objects you run with your own viem client.

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

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

### `contracts.addressOn`

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

The sparse-map accessor, bigint-aware - never index `perChainAddress` by a raw chain id directly.

```typescript theme={null}
export declare function addressOn(descriptor: ContractDescriptor, chain: ChainRef): Address | undefined;
```

### `contracts.contractsOnChain`

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

REVERSE INDEX: every returned descriptor is guaranteed to have an address on `chain`. kind:"interface" descriptors never appear here (reach them via listInterfaces()).

```typescript theme={null}
export declare function contractsOnChain(chain: ChainRef): readonly ContractDescriptor[];
```

### `contracts.describeContract`

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

THE thin resolver: (chain, protocol, contract) -> address + abi + methods for that chain, or undefined.

```typescript theme={null}
export declare function describeContract(chain: ChainRef, protocol: string, contract: string): ResolvedContract | undefined;
```

### `contracts.descriptorChains`

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

Resolved CanonicalChain records (not raw slugs) for every chain this descriptor has an address on.

```typescript theme={null}
export declare function descriptorChains(descriptor: ContractDescriptor): readonly CanonicalChain[];
```

### `contracts.getDescriptor`

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

Chain-free lookup: the descriptor is the chain-INDEPENDENT object; ResolvedContract (describeContract) is its chain-bound view.

```typescript theme={null}
export declare function getDescriptor(protocol: string, contract: string): ContractDescriptor | undefined;
```

### `contracts.listContracts`

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

Forward index: protocol (slug, or normalized ProtocolInfo.name) -> its descriptors.

```typescript theme={null}
export declare function listContracts(protocol: string): readonly ContractDescriptor[];
```

### `contracts.listDescriptors`

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

The whole flat registry, stable order.

```typescript theme={null}
export declare function listDescriptors(): readonly ContractDescriptor[];
```

### `contracts.listInterfaces`

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

kind:"interface" descriptors (erc20, erc4626 in the starter set): ABI + methods, no fixed address.

```typescript theme={null}
export declare function listInterfaces(): readonly ContractDescriptor[];
```

### `contracts.methodOf`

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

Name-keyed method lookup. An overloaded name's overloads take different numbers of arguments
(the linkage test holds every descriptor to that), so `arity` names exactly one of them. Without
it, the first overload the ABI declares is returned.

```typescript theme={null}
export declare function methodOf(descriptor: ContractDescriptor, name: string, arity?: number): DescriptorMethod | undefined;
```

### `contracts.protocolsOnChain`

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

The protocols with a contract that has an address on `chain`, each once, as `ProtocolInfo` records in registry order; an unknown chain returns an empty list. It reads the `contracts` registry's descriptors, where `getProtocolsByChain(chainId)` reads the protocol catalog.

```typescript theme={null}
export declare function protocolsOnChain(chain: ChainRef): readonly ProtocolInfo[];
```

### `contracts.requireContract`

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

Throwing sibling of describeContract, mirroring requireChain's "here is the known set" error style.

```typescript theme={null}
export declare function requireContract(chain: ChainRef, protocol: string, contract: string): ResolvedContract;
```

### `contracts.selectorOf`

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

```typescript theme={null}
export declare function selectorOf(descriptor: ContractDescriptor, name: string, arity?: number): Hex | undefined;
```


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