Skip to main content
Sauce lets you write transaction logic in SauceScript, a TypeScript subset, compile it to bytecode, and execute it atomically against live onchain state in one transaction. The SDK reference groups exported declarations by namespace, with the package authors’ JSDoc reproduced as written. The compiler has a separate API reference. Dependency re-exports and protocol-specific subpaths are covered by the linked package documentation and representative subpath reference. The guided path is under Programmable Transactions.

Packages

This documentation uses SDK 0.99.4 and compiler 2.3.0. The SDK also bundles its own Markdown manual and checked examples under docs/, readable on unpkg or in node_modules/@eco-incorp/sauce/docs after installation.

Install

Install the compiler separately when you need compilation without the SDK, including in a browser:

Node and browsers

The root SDK, its /compiler export, route compilation, recipe and skill loaders and artifact resolvers use Node APIs. /verify depends on viem only and validates EVM settlement payloads in a browser or edge runtime without loading the compiler. The compiler package has its own browser build, initialized with ready() from @eco-incorp/sauce-compiler/ready.

Import forms

Importing the root package installs one global per canonical chain (Base, Ethereum, Solana, …) plus Token on globalThis. They are not named exports, so import { Base } fails; use a side-effect import, since a type-only import does not install them. Opt out with globalThis.__ECO_ROUTES_NO_GLOBALS__ = true before the first import, or call uninstallRouteGlobals(); routes.openRoute and contracts.on(chain) are the import-based equivalents. Bare route names such as USDC and Uniswap are compiled route syntax with generated TypeScript declarations, not host objects.

Subpaths

There is no /routes, /token, /swap, /deposit or /contracts subpath; import those namespaces from the root.

Versioning

On a 0.x SDK version the API is not stable and a breaking change is a minor bump, so pin exactly. The compiler follows semver: on 1.x and later a breaking change to the JS API or to accepted SauceScript syntax is a major bump; new language features, options and exports are minor. A compiler release can change the bytecode a program compiles to without changing the API, so recompile and re-pin cached programs after upgrading. Current pins: compiler 2.3.0, EVM engine 1.0.1, SVM engine 1.2.0, both Kitchens 1.0.0.

How to read the reference

Each namespace or subpath is a sidebar section with one page per source module; a page lists that module’s exports in declaration order. An entry has the export name, its kind, the declaration file inside the package, the JSDoc the package authors wrote, and the TypeScript declaration. Declarations longer than a few thousand characters (large ABI constants) are truncated with a marker. The generated reference omits declarations owned by dependencies. Compiler types are documented in the compiler API; protocol subpaths share the shape shown for Uniswap V3.

Next steps

Getting started

Compile a standalone program and inspect deployment registries.

routes

openRoute, IntentOptions, PendingSauceRoute, BuiltIntent, Portal helpers.

Compiler package

compile, ready, CompileOptions, CompileResult, AccountManifest.