Skip to main content
The swap namespace emits a complete function main() { ... } program with one ISauceRouter.swap(...) statement per spec. Compile with baseDirs: [...swap.SWAP_BASE_DIRS].
This page covers sdk/dist/swap/source.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.

swap.swapCallStatement

Function · sdk/dist/swap/source.d.ts One ISauceRouter.at(ctx.self()).swap({...}) statement for spec - for splicing into a larger, hand-written program. Runs the FULL toSwapParams normalization/guard pass (a "balance" amountIn reuses every other field’s normalization, only the amount itself is emitted as a runtime expression instead of a literal).

swap.swapSource

Function · sdk/dist/swap/source.d.ts A complete, compilable function main() { ... } program: one ISauceRouter.swap(...) statement per spec, in the given order, inside ONE function - because V12Pot.cook takes exactly one program (its own doc), a multi-hop route is ONE program with N swap statements, not N separate cooks. See sdk/src/swap/index.ts for the full compile → routes.buildSauceEvmCall seam.

swap.swapImportLines

Function · sdk/dist/swap/source.d.ts The import lines a swapSource(specs) program needs - ISauceRouter always, plus IERC20 iff any spec uses amountIn: "balance". Extracted so swapThenDepositSource (E4.2’s composition seam) can union these with the deposit side’s own import lines instead of duplicating this rule; swapSource itself just calls this, so its own output is unaffected byte-for-byte.

swap.SWAP_BASE_DIRS

Variable · sdk/dist/swap/source.d.ts baseDirs for compiling any program swapSource/swapCallStatement produces - resolves the generated import { ISauceRouter } from "./artifacts/ISauceRouter.json" (and, for a "balance" leg, ./artifacts/IERC20.json) against this installed package’s dist root. Same value/pattern as sdk/src/recipes/index.ts’s SAUCE_BASE_DIRS.

swap.SwapSourceOptions

Interface · sdk/dist/swap/source.d.ts