Base(body, options).reward(reward) compiles a program for Base and packages it as an Eco intent: the solver delivers the route assets, and the destination fulfillment runs your program through a Pot. Every chain global (Base, Arbitrum, Ethereum, one per canonical chain) forwards to routes.openRoute(chain, body, options). This page is the guided tour of that API; every export is in the SDK reference.
Anatomy of a Sauce intent
Building an intent publishes, funds and fulfills nothing. Your application sends the source transactions; a solver fulfills on the destination.
Fees and deadlines
Every EVMcook pays the Kitchen’s current executionFee() in native value, so execution.value is the fee plus any native value the program spends, and nativeAmount must cover every call value in the route; Getting started shows the reads.
route.deadline limits destination fulfillment. reward.deadline allows source refunds when no valid proof exists; leave time for fulfillment and proof delivery. Both are absolute Unix seconds.
Callbacks are compiled source
A callback body is read withFunction.prototype.toString(), parsed and compiled as SauceScript. It is never invoked as JavaScript and captures no outer variables. Pass application values through defines (scalar bigint, number or boolean; use bigint for addresses and amounts) or write a source string. Callbacks must be synchronous, take no parameters, and survive your bundler unchanged; ship an explicit source string when a build step rewrites function text.
Token and protocol globals
Inside an EVM route body, token symbols and protocol names resolve against the destination chain:USDCresolves to the chain’s registered token address. The registry carriesUSDC,USDT,WETHand wrapped natives on six EVM chains (Ethereum, Optimism, Polygon, Monad, Base, Arbitrum); a missing symbol means no verified row, andtokenDefinesadds or overrides one. Amounts are integers in the token’s smallest unit.- The token member syntax supports
transfer,approveandbalanceOf.selfis the executing contract, the Pot.Token(address)wraps any ERC-20. - Protocol names are versioned:
UniswapV4.UniversalRouter,UniswapV3.SwapRouter02,AaveV3.Pool,Cctp.TokenMessenger. A family alias such asUniswap.UniversalRouterresolves only when one member owns the name;Uniswap.Factoryis ambiguous and fails. Compilation checks for a destination-chain registry entry; it does not check live deployed code. - A qualified reference such as
Ethereum.UniswapV4.UniversalRouterselects Ethereum’s address but still executes on the route’s own chain. Cross-chain execution is separate intents, composed with nesting. - For a contract outside the registry, pass an ABI through
compile.contractsand callBinding.at(address).method(...).
USDC object. Import the root package with a side-effect import (import "@eco-incorp/sauce") so the chain globals are installed. The full list of namespaces and tokens is the SDK’s coverage page.
Builders
For programs constructed from data, the SDK emits SauceScript for you. None of these selects a market route or sends a transaction.
Compile emitted source with
routes.compileSauceRoute(destination, source, execution, { baseDirs }), passing the builder’s base directories (swap.SWAP_BASE_DIRS, deposit.DEPOSIT_BASE_DIRS) so its ABI imports resolve.
Nested intents
.nest(child, options) adds a child intent whose source is the parent’s destination. When the parent fulfills, its route funds the child’s reward; a solver fulfills the child in a later transaction. Each leg is a separate intent, so a failed child does not roll back a completed parent.
via: "transfer", appends a Sauce program that reads the Pot’s balance and transfers up to the declared child reward to the child’s vault, for one more cook and fee. Set requireCap: true to revert the parent when the Pot cannot cover the child. The alternative, via: "publishAndFund", inserts approvals and a Portal publishAndFund call instead. Child deadlines must be at least as late as the parent’s route deadline, and children must use distinct salts to be distinct intents.
Submit and inspect
The helpers perform no RPC and require an EVM source. Set
sourcePortal in the options or pass { portal } to each helper; the destination Portal is never reused as the submission target.
Solana destinations
The route model can represent an SVM destination, but the SDK’s SVM route helpers emit a legacy engine instruction that the released engine does not accept. Execute Solana programs through the Kitchen client from@eco-incorp/sauce/svm, as in Getting started.
Package entry points
There is no
/routes, /token, /swap or /deposit subpath; import those namespaces from the root. The complete manual ships in the package under docs/, readable on unpkg.
