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.
Generated from the type declarations of @eco-incorp/sauce.

routes.buildSauceCall

Function · @eco-incorp/sauce Forks on kindOf(chain) (bigint-aware; throws for an unregistered chain id rather than defaulting to evm) to build one Sauce-executing Call for either engine.

routes.buildSauceCalls

Function · @eco-incorp/sauce Plural fork of buildSauceCall.

routes.buildSauceEvmCall

Function · @eco-incorp/sauce One cook(engine, program) call on pot. data is produced by v12Pot.encodeCook - the exact EVM engine encoder, not re-implemented here.

routes.buildSauceEvmCalls

Function · @eco-incorp/sauce One Call per element of cooks, in the given order, all targeting the same pot.

routes.buildSauceSvmCall

Function · @eco-incorp/sauce Builds ONE staged SVM route call. Merges account flags within its own instruction only - use buildSauceSvmCalls for the cross-call merge over a whole leg.

routes.buildSauceSvmCalls

Function · @eco-incorp/sauce RECOMMENDED entry point: builds one staged route call per executions element, with account flags OR-merged across the whole leg by default.

routes.mergeSvmAccountFlags

Function · @eco-incorp/sauce Cross-call OR-merge of isSigner/isWritable per pubkey across every given instruction’s accounts - the Solana runtime dedupes a repeated pubkey in one transaction to the union of its flags, so a leg’s own two staged calls (e.g. swap half + settle half) sharing an account must agree on the more-permissive flags before either is built, not just within itself.

routes.sauceEvmDeployPotCall

Function · @eco-incorp/sauce Builds the Kitchen’s deployPot(owner, salt) call, which creates the Pot at its CREATE2 address: send it before the first cook() on a Pot that may not exist yet. kitchen defaults to the pinned release’s Kitchen (v12KitchenAddress()). It reads no chain, so it does not know whether that Kitchen has code where the call is sent: check the chain first. Returns a SauceEvmCall, { to, data, value } with value 0.

routes.SauceEvmCall

Interface · @eco-incorp/sauce An EVM call these builders return, in both of the shapes it is used in:
  • a transaction or eth_call, { to, data, value } - the shape every other request the SDK builds has (kitchenExecutionFee()), and what a wallet or client.call takes as it is;
  • a call record, { target, data, value }.
to and target name the same contract: to as its checksummed 20-byte address, target as the route records it. target stays for route calls and every caller that already reads it.

routes.SauceEvmCallParams

Interface · @eco-incorp/sauce The input of buildSauceEvmCall: the Pot to cook() on, the engine that runs the program (named per cook, since a Pot holds no engine), one compiled program, and an optional native value to send with the call (0 when left out).

routes.SauceEvmCallsParams

Interface · @eco-incorp/sauce

routes.SauceEvmDeployPotCallParams

Interface · @eco-incorp/sauce

routes.SauceSvmAccountMeta

Interface · @eco-incorp/sauce One account meta as the caller supplies it - pre-merge, pre-executor-flattening.

routes.SauceSvmCallParams

Interface · @eco-incorp/sauce

routes.SauceSvmCallsParams

Interface · @eco-incorp/sauce

routes.SauceSvmExecution

Interface · @eco-incorp/sauce

routes.StagedBufferRef

Interface · @eco-incorp/sauce A buffer this module did NOT stage - only the RESOLVED facts about it. Deliberately carries no bytecode/seed/authority/payer: see the module doc’s “SVM STAGING IS A PREREQUISITE” section for why, and where those pieces actually come from.

routes.SvmAddressInput

Type · @eco-incorp/sauce A base58 string, a kit Address, or anything duck-typed like a web3.js PublicKey - see the module doc’s “WHY THIS FILE … NEVER @solana/web3.js” note.