routes namespace packages a Sauce program as an Eco intent. Base(body, options) and the other chain globals (installed by importing the root package) forward to routes.openRoute(destination, body, options), which returns a PendingSauceRoute; .nest(...) adds child intents and .reward(...) returns a BuiltIntent.
sdk/dist/routes/accessors.d.ts, sdk/dist/routes/sauce-route.d.ts, sdk/dist/routes/closure.d.ts, sdk/dist/routes/ambient.d.ts, sdk/dist/routes/token-rewrite.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.routes.chain
Function · sdk/dist/routes/accessors.d.ts
Dynamic front door for a runtime-resolved chain (chain('eth'),
chain(8453), chain('BNB Chain')) - delegates to requireChain, so it
inherits the registry’s alias resolution and unknown-chain throw.
routes.chainAccessors
Variable · sdk/dist/routes/accessors.d.ts
The generated record: const { Base, Solana, Ethereum } = chainAccessors; — each entry is
BOTH callable (Base(sauce, opts)) and a namespace (Base.chain/Base.route).
routes.compileSauceRoute
Function · sdk/dist/routes/sauce-route.d.ts
Compiles sauce (a complete function main(){...} program, or a bare body auto-wrapped by
wrapSauceBody) for destination’s ChainKind, and slots the result into exactly one
CallInput via the existing buildSauceEvmCall/buildSauceSvmCall fork - never a new encoder.
routes.wrapSauceBody
Function · sdk/dist/routes/sauce-route.d.ts
routes.CompiledSauceRoute
Interface · sdk/dist/routes/sauce-route.d.ts
routes.SauceCompileOptions
Interface · sdk/dist/routes/sauce-route.d.ts
routes.SauceEvmExecutionInput
Interface · sdk/dist/routes/sauce-route.d.ts
routes.SauceSvmExecutionInput
Type · sdk/dist/routes/sauce-route.d.ts
Staged SVM execution settings from the route call builder. The caller supplies a finalized CODE
account and its execution accounts. expectedSha256 is rejected because the engine instruction
does not carry a pin; see svm/instructions.ts#assertNoExecutePin.
routes.isSauceClosure
Function · sdk/dist/routes/closure.d.ts
True for anything sauceBodyToSource (rather than the plain string path) should handle.
routes.sauceBodyToSource
Function · sdk/dist/routes/closure.d.ts
Extracts a complete function main(){...} program from a closure’s own declared source text.
Fails closed (never silently falls back) on anything this first cut doesn’t support.
routes.chainAmbient
Function · sdk/dist/routes/ambient.d.ts
The ambient-MODULE half of a chain bundle (chainDefines above is the scalar-DEFINES half - two
distinct mechanisms, see plugin/index.ts’s note). Returns the ambient module specifier list
active for chain: whole SauceScript library modules whose exported functions/consts are
broadcast into a chain’s compiled program with no import line (see
sauce-route.ts#SauceCompileOptions.ambient/rs-compile.ts).
Currently a SINGLE source of truth, not yet chain-specific: every chain gets the same list, the
plugin manifest’s own ambient array (plugin/index.ts#loadPlugin) - ["@sauce/token"] by
default, resolved to the SDK’s own vendored copy on the route path. Extensible to a genuinely
per-chain bundle later (e.g. an SVM destination activating an SVM-only ambient module an EVM one
shouldn’t see) without changing this function’s signature - a caller already threads chain
through.
routes.chainDefines
Function · sdk/dist/routes/ambient.d.ts
The chain-scoped ambient defines map for chain: chainId/CHAIN_ID, every EVM protocol
contract address that has a real entry on chain.id, and any caller-supplied token symbols.
P8: protocolAddresses/tokens are read through loadPluginData() (plugin/index.ts) rather
than importing descriptors/registry.ts/token-registry.ts directly - the SAME underlying
array/function, re-exposed through the plugin accessor as the single point the SDK reads
Layer-B data through. Byte-identical output: loadPluginData().protocolAddresses IS
DESCRIPTORS and .tokens IS resolveTokenMap, not a copy.
routes.AmbientDefinesOptions
Interface · sdk/dist/routes/ambient.d.ts
routes.rewriteTokenMembers
Function · sdk/dist/routes/token-rewrite.d.ts
Rewrites every <Sym>.transfer/.approve/.balanceOf(...) call (U4) and every <holder>.<Sym>
value-position read (balance sugar) whose <Sym> is in tokens (and not shadowed anywhere in
source) - see the module doc for the full disjointness argument. Purely textual surgery over
the ORIGINAL source, driven by acorn ranges - never a re-print of the AST, so everything else
(formatting, comments, unrelated code) survives byte-for-byte.
routes.REWRITABLE_METHODS
Variable · sdk/dist/routes/token-rewrite.d.ts
routes.TokenRewriteResult
Interface · sdk/dist/routes/token-rewrite.d.ts
routes.TokenSymbols
Type · sdk/dist/routes/token-rewrite.d.ts
Either the full registry-resolved symbol -> address map (enables BOTH rewrites), or a bare set
of symbols with no addresses (U4 only — the sugar has no address to inline, so it yields no
sites; documented, not a silent surprise — see the module doc).
routes.SauceBody
Type · sdk/dist/routes/closure.d.ts
