contracts namespace describes protocol contracts as descriptors (ABI, methods, per-chain addresses) and exposes them as typed accessors route bodies can call.
sdk/dist/descriptors/derive.d.ts, sdk/dist/descriptors/accessors.d.ts, sdk/dist/descriptors/call.d.ts, sdk/dist/descriptors/names.d.ts.
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.contracts.buildDescriptor
Function · sdk/dist/descriptors/derive.d.ts
Assembles one full ContractDescriptor from a link entry plus the protocol’s already-resolved data.
contracts.buildMethods
Function · sdk/dist/descriptors/derive.d.ts
ABI -> ordered DescriptorMethod[] (no name-collapse - an overloaded name would appear twice, see the linkage test’s zero-overload invariant).
contracts.buildPerChainAddress
Function · sdk/dist/descriptors/derive.d.ts
role key -> sparse, EIP-55-checksummed per-chain address map. undefined roleKey (kind:“interface”) -> {}.
contracts.deriveChainSlugs
Function · sdk/dist/descriptors/derive.d.ts
Sparse per-chain address map -> the chain slugs it resolves to, id-ascending. Fails closed (throws) on an id the canonical registry doesn’t know - see test invariant #6.
contracts.deriveContractName
Function · sdk/dist/descriptors/derive.d.ts
Default contract-name derivation: abiExport minus its trailing “ABI”
minus the protocol-name prefix, e.g. “UniswapV4UniversalRouterABI” with
protocol name “Uniswap V4” -> “UniversalRouter”. Only used when the link
carries no explicit contract override (see links.ts’s module comment for
why 6 of the 29 starter entries need one).
contracts.chainContracts
Function · sdk/dist/descriptors/accessors.d.ts
Builds the whole lazy tree for one resolved chain. Every canonical
protocol namespace is memoised once per chainContracts call, so a family
alias resolving a non-ambiguous name (Base.Uniswap.UniversalRouter)
forwards to the EXACT SAME accessor object as the canonical path
(Base.UniswapV4.UniversalRouter) - verified by identity in
test/descriptors-accessors.test.ts.
contracts.on
Function · sdk/dist/descriptors/accessors.d.ts
Import-based front door (option-b): contracts.on('base').Uniswap.UniversalRouter.execute(...).
Escape hatch for __ECO_ROUTES_NO_GLOBALS__ hosts and for the TS2451 own-const Base caveat.
contracts.ChainContracts
Type · sdk/dist/descriptors/accessors.d.ts
The whole typed tree chainContracts(...) returns - chain-INDEPENDENT by
design (per-chain address presence is runtime data, not literally typed;
see the design doc’s ChainContracts note), so it instantiates once
regardless of how many chain globals intersect it.
contracts.ContractAccessor
Interface · sdk/dist/descriptors/accessors.d.ts
One leaf: a bound (protocol, contract) on a specific chain, plus every
real ABI method as a callable producing a ContractCall. Method names are
NOT part of the static type (kept loose as unknown via the index
signature below) - they are derived from the descriptor’s real ABI at
BUILD time, so Base.UniswapV4.UniversalRouter.execute(...) resolves a
real method and .exactIn is undefined, matching E2.2’s “surface what
exists, invent nothing” stance.
contracts.makeContractCall
Function · sdk/dist/descriptors/call.d.ts
contracts.CONTRACT_BASE_DIRS
Variable · sdk/dist/descriptors/call.d.ts
baseDirs for compiling a toSauceScript() program - same two-entry
shape (dist root + shipped sdk/src) and rationale as
deposit/source.ts’s DEPOSIT_BASE_DIRS: a contract’s .json import
resolves against the SDK’s protocol registry, not the engine-vendored
dist/artifacts.
contracts.ContractCall
Interface · sdk/dist/descriptors/call.d.ts
contracts.EncodeOptions
Interface · sdk/dist/descriptors/call.d.ts
contracts.SauceScriptOptions
Interface · sdk/dist/descriptors/call.d.ts
contracts.ContractNameOf
Type · sdk/dist/descriptors/names.d.ts
Every contract literally linked under protocol P, e.g. ContractNameOf<"uniswap-v4"> = “PoolManager” | “UniversalRouter” | “PositionManager”.
contracts.FamilyContracts
Type · sdk/dist/descriptors/names.d.ts
Contract names safely exposed on family alias F - a strict ALLOWLIST:
a name owned by exactly ONE family member passes through; a name owned by
two or more (e.g. “Factory” under “Uniswap”, present in both uniswap-v2
and uniswap-v3) resolves its own mapped-type branch to never and is
dropped from the union entirely. Fail-closed by construction, not by
enumerating known-bad names.
contracts.FamilyKey
Type · sdk/dist/descriptors/names.d.ts
Every family alias key actually present in the starter set, e.g. “Uniswap” | “Aave” | “Compound” | …
contracts.FamilyOf
Type · sdk/dist/descriptors/names.d.ts
The PascalCase family alias a protocol slug belongs to, or never if it has none.
contracts.ProtocolNamespaceKey
Type · sdk/dist/descriptors/names.d.ts
PascalOf<ProtocolSlug> - the CANONICAL namespace key, e.g. “UniswapV4”. Always unambiguous.
contracts.ProtocolSlug
Type · sdk/dist/descriptors/names.d.ts
The literal protocol-slug union underlying the starter set, e.g. “uniswap-v4” | … | “erc4626”.
