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/builder.d.ts, sdk/dist/routes/intent-dsl.d.ts, sdk/dist/routes/globals.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.pascalOfSlug
Function · sdk/dist/routes/builder.d.ts
PascalOf’s runtime mirror: split on -, upper-case each segment’s first
character, join. Agrees with the type-level PascalOf by construction
(both reduce to Capitalize<S> per --separated segment) as long as a
slug matches ^[a-z0-9]+(-[a-z0-9]+)*$ — pinned by
chains-canonical.test.ts.
routes.PascalOf
Type · sdk/dist/routes/builder.d.ts
PascalOf<"bnb-chain"> = "BnbChain". Matches the runtime pascal()
derivation in accessors.ts by construction (both reduce to
Capitalize<S> composed across --separated segments) — re-exported from
accessors.ts so callers only need one import site.
routes.createChainGlobals
Function · sdk/dist/routes/builder.d.ts
Generates the top-level chain globals from ../chains/canonical.js —
adding a chain to CANONICAL_CHAINS adds a global here with zero code
changes; a duplicate PascalCase key (two slugs colliding after casing)
throws at module-eval time rather than silently overwriting one with
another.
routes.makeChainGlobal
Function · sdk/dist/routes/builder.d.ts
Builds the callable ChainGlobal for chain — what a generated global
(Base) or chain(ref) returns. An ARROW function (no own prototype to
collide with) forwarding to openRoute, with chain/route defined onto
it as enumerable so Object.keys(chainAccessors.Base) stays exactly
["chain","route"].
routes.ChainGlobal
Interface · sdk/dist/routes/builder.d.ts
A chain global: callable (the SAME behavior as .route), plus .chain/.route.
routes.ChainGlobals
Type · sdk/dist/routes/builder.d.ts
One generated ChainGlobal per canonical chain slug, PascalCase-keyed.
routes.ChainRoute
Interface · sdk/dist/routes/builder.d.ts
The call signature: Chain(sauce, options) -> a pending route awaiting .reward(...).
routes.openRoute
Function · sdk/dist/routes/intent-dsl.d.ts
Opens a route on chain (the DESTINATION) - what every chain global’s callable AND .route
forward to, so Base(sauce, opts) and Base.route(sauce, opts) are behaviorally identical by
construction (both call this exact function).
routes.BuiltIntent
Interface · sdk/dist/routes/intent-dsl.d.ts
routes.IntentOptions
Type · sdk/dist/routes/intent-dsl.d.ts
Everything a route needs beyond the Sauce program body itself. Supply an explicit destination
execution, or both pot and engine as the EVM shorthand. When execution is supplied it takes
precedence over any redundant shorthand fields, matching openRoute’s runtime behavior.
routes.NestChildOrThunk
Type · sdk/dist/routes/intent-dsl.d.ts
.nest(childOrThunk, opts?)’s first argument: either an already-built child BuiltIntent
(checked against child.source.id === parent.destination.id, so a mismatched leg is rejected
rather than silently accepted), or - the documented PREFERRED form - a thunk receiving the
parent’s own destination chain (which IS the child’s source, by construction, so there is
nothing to get wrong).
routes.NestOptions
Interface · sdk/dist/routes/intent-dsl.d.ts
routes.PendingSauceRoute
Interface · sdk/dist/routes/intent-dsl.d.ts
routes.RewardArg
Type · sdk/dist/routes/intent-dsl.d.ts
.reward(...)’s argument: the full object form, a bare bigint (the single unambiguous
reading - NATIVE amount only; a token reward must name its token), or a bare token-amount array
(reward.tokens).
routes.SauceRewardSpec
Interface · sdk/dist/routes/intent-dsl.d.ts
The object form of a reward argument - every field optional, since a missing one falls back to
the matching IntentOptions field (and a STILL-missing required field throws, naming exactly
which one).
installRouteGlobals
Function · sdk/dist/routes/globals.d.ts
uninstallRouteGlobals
Function · sdk/dist/routes/globals.d.ts
Removes every name this module has installed (across all calls) from
target (default globalThis) and clears the internal bookkeeping, so a
later installRouteGlobals() reinstalls cleanly rather than skipping.
routeGlobals
Variable · sdk/dist/routes/globals.d.ts
Install-on-import result — this IS the default-globals behavior. A host
that must not have globalThis mutated can opt out before the SDK is
ever imported: globalThis.__ECO_ROUTES_NO_GLOBALS__ = true.
