Skip to main content
The routes namespace compiles a SauceScript program for one chain by name and builds the calls that run it. routes.compileSauceProgram(chain, source, options?) compiles with the chain’s token symbols, protocol namespaces and @sauce/token in scope; routes.encodeEntryArguments(program, values) encodes main’s run-time arguments; routes.buildSauceEvmCall(params) builds one cook(engine, program) call on a Pot. The chain exports (Base, Solana, …), chain and Token are named exports of the root, and importing the package puts nothing on globalThis.
Also re-exported from dependencies, documented by those packages:
  • @eco-incorp/sauce: WasmSource, routes.Hex
Generated from the type declarations of @eco-incorp/sauce.

routes.toBigInt

Function · @eco-incorp/sauce Accepts bigint | number | string; rejects negative or non-integer values. A number goes through toExactBigInt, so it must also be a SAFE integer. Pass a large value as a bigint (10n ** 18n) or as a PLAIN DECIMAL string ('1000000000000000000') - exponent notation like '1e21' is rejected too, being no more an integer string than 1e21 as a number is a safe one.

routes.toUniversalAddress

Function · @eco-incorp/sauce Coerces an address into the 32-byte UniversalAddress format: a 20-byte EVM address is left-padded to 32 bytes; an already-32-byte value passes through unchanged. Anything else throws.

routes.denormalizeToEvm

Function · @eco-incorp/sauce Narrows a 32-byte UniversalAddress to a 20-byte EVM address. Throws (rather than silently truncating) if the leading 12 bytes aren’t zero - that shape means the address is not EVM-representable (e.g. a real SVM pubkey), and truncating it would produce a plausible-looking but wrong address.

routes.kindOf

Function · @eco-incorp/sauce Resolves a ChainKindRef to a ChainKind. An explicit "evm"/"svm" literal is returned as-is (the escape hatch for a chain id not yet in the canonical registry). Anything else is looked up via requireChain, which THROWS for an unregistered id - this never silently defaults to "evm".

routes.ChainKindRef

Type · @eco-incorp/sauce Anything that can select which fork to use: an explicit kind, or anything resolveChain accepts - including a native bigint chain id, so a caller can pass one straight through without a silent evm mis-classification.

routes.AddressInput

Type · @eco-incorp/sauce Loosened address input: 20-byte EVM hex, 32-byte hex, or an already-typed UniversalAddress.

routes.CallInput

Interface · @eco-incorp/sauce One call: its target, its data and the native value it carries.

routes.UniversalAddress

Type · @eco-incorp/sauce bytes32-normalized 0x-hex address, the cross-VM address format. An EVM 20-byte address is left-padded to 32 bytes; an SVM 32-byte pubkey passes through unchanged. See normalize.ts#toUniversalAddress.