> ## 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: 12 exports of the contracts module of @eco-incorp/sauce, including addressOn, contractsOnChain, describeContract, descriptorChains, getDescriptor, listContracts.

The `contracts` namespace describes protocol contracts as descriptors (ABI, methods, per-chain addresses) and exposes them as typed accessors route bodies can call.

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

This page covers `sdk/dist/descriptors/query.d.ts`.

<Note>
  Generated from the type declarations shipped in `@eco-incorp/sauce` 0.99.4. Each entry shows the package authors' JSDoc and declaration for this SDK version. For runtime compatibility and deployed addresses, see [architecture and deployments](/programmable-transactions/sauce/architecture-and-deployments).
</Note>

### `contracts.addressOn`

*Function* · `sdk/dist/descriptors/query.d.ts`

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* · `sdk/dist/descriptors/query.d.ts`

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* · `sdk/dist/descriptors/query.d.ts`

THE thin resolver: (chain, protocol, contract) -> address + abi + methods for that chain, or undefined. E2.3's typed accessor tree is a walk over this, not a reimplementation of it.

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

### `contracts.descriptorChains`

*Function* · `sdk/dist/descriptors/query.d.ts`

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* · `sdk/dist/descriptors/query.d.ts`

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* · `sdk/dist/descriptors/query.d.ts`

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

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

### `contracts.listDescriptors`

*Function* · `sdk/dist/descriptors/query.d.ts`

The whole flat registry, stable order.

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

### `contracts.listInterfaces`

*Function* · `sdk/dist/descriptors/query.d.ts`

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* · `sdk/dist/descriptors/query.d.ts`

Name-keyed method lookup. Safe for this dataset: zero overloaded function names across every starter-set ABI (see the linkage test).

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

### `contracts.protocolsOnChain`

*Function* · `sdk/dist/descriptors/query.d.ts`

Reverse index at protocol granularity, deduped, over the STARTER SET only - deliberately narrower than protocols/index.ts's getProtocolsByChain (all \~128 protocols, no descriptor behind it).

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

### `contracts.requireContract`

*Function* · `sdk/dist/descriptors/query.d.ts`

Throwing sibling of describeContract, mirroring requireChain/requireV12Deployment'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* · `sdk/dist/descriptors/query.d.ts`

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