.sauce.ts program describes the operations that run onchain. See Program layout for the language’s supported syntax.
The library has no built-in RPC endpoint and reads no environment variables. Supply a viem client or endpoint URL to functions that read a chain. Compilation and argument encoding do not require a network connection.
Prerequisites
- Node.js 24 or newer for Node-based applications.
- The SDK and viem installed in your project. Follow Installation. The library’s EVM interfaces use viem types such as
Address,HexandPublicClient. - ES modules. Set
"type": "module"in your project’spackage.jsonand useimport.
@sauce/* libraries that programs import. Local testing has additional dependencies; see Testing.
Build your first integration
Follow these pages in order for an EVM integration:- Compile a program for your chain and inspect its inputs.
- Encode entry arguments for the program’s
mainfunction. - Build a cook transaction, including Pot deployment and fees, then simulate it before signing.
- Test the integration on a local or forked chain.
Import paths
Import from the package name or from one of its subpaths. In the table,. is @eco-incorp/sauce itself. There is no /routes, /token, /deposit or /contracts subpath: routes, token, deposit and contracts are namespaces of the root, as in import { routes } from "@eco-incorp/sauce".
The generated API reference lists every export of every subpath.
In a browser
The library supports browser use except for two Node-only subpaths:/svm/engine-artifacts, which returns filesystem paths, and /testing, which starts local chains.
A browser loads the compiler’s WebAssembly asynchronously. Call ready() once before the first compile; until it resolves, every compile throws. In Node, ready() resolves at once and no compile needs it, so code shared by both can always call it.
browser.ts
ready and what it accepts.
Related guides
Compiling
compileSauceProgram, compileSauceRoute and the raw compile(), their options, results and errors.Entry arguments
Encode and decode
main’s ABI-v1 arguments, and append them to the bytecode.Cook transactions
Predict and deploy a Pot, read the Kitchen fee, build the cook and simulate it with viem.
Chains and registries
Chains, tokens and the protocol registry from TypeScript.
Actions
Compile JSON action programs with
/actions.Solana
Compile for Solana and cook through the Kitchen client.
Verification
Check a settle payload against the settle program the package ships.
Testing
Run programs as cooks on a local or forked chain from your tests.
Next steps
- @eco-incorp/sauce API reference: every export, generated from the package’s types.
- CLI overview: the same steps from a terminal.
- Pot and cook: what the transactions on these pages do.
