@eco-incorp/sauce

中文文档
1.0.0发布于 2026/10/28SEE LICENSE IN LICENSE.mdTypeScriptES Module近 30 天下载 3629

Sauce protocol tooling: the SDK, action primitives, the sauce command and the Sauce MCP server.

原始使用文档
文档目录9 节
  1. What Sauce is, and is not
  2. What you can do with it
  3. Start
  4. The learning path
  5. Three words you will see
  6. Supported chains
  7. From your application
  8. With a coding agent
  9. License

Sauce

Sauce lets you write a short program in SauceScript, a subset of TypeScript, that reads live onchain state, chooses a path and composes contract calls in one transaction. Swap, then pay. Borrow, then repay. Check a price, then trade. Your program enforces the conditions you write, an unhandled failure reverts every step, and it runs through your own Pot, so you deploy no contract for each program.

This README is for developers who know TypeScript and the basic ideas of a blockchain (a wallet, a transaction, a token) and have never used Sauce. You need nothing else to start.

What Sauce is, and is not

You write the program in a small, safe slice of TypeScript called SauceScript. Sauce turns it into one transaction on Ethereum, Base, Arc or Solana (or the testnets Arc Testnet, Base Sepolia, Ethereum Sepolia, Solana Devnet and Solana Testnet), and an engine already on chain runs every step of it inside that transaction. Here is a whole program, the one the quick start runs:

// Pays `amount` of USDC from your Pot to `to`, and stops if the Pot holds less.
// The same file runs on Base and on Solana.
//
// Try it on a copy of the chain first: no password, no money, nothing sent.
//
//   sauce simulate pay.sauce.ts --chain base --wallet me --assume-balance USDC:5 --args <recipient> 1000000
//
// Then run it for real: your wallet signs and pays the fee, and your Pot pays the USDC.
//
//   sauce run pay.sauce.ts --chain base --wallet me --args <recipient> 1000000
//
// On Solana, the same way, with a Solana wallet:
//
//   sauce simulate pay.sauce.ts --chain solana --wallet me-solana --assume-balance USDC:5 --args <recipient> 1000000
//   sauce run pay.sauce.ts --chain solana --wallet me-solana --args <recipient> 1000000
//
//   to: Address       who gets the USDC, an address on the chain it runs on
//   amount: Uint256   how much, in USDC's smallest unit: USDC has 6 decimals, so 1000000 is 1 USDC
function main(to: Address, amount: Uint256) {
  require(pot.USDC >= amount, "not enough USDC");
  USDC.transfer(to, amount);
}

main is where the program starts, and its parameters are the inputs you give each time you run it. require stops the whole transaction when its check fails, so nothing moves. USDC needs no address and no import: Sauce knows it on each chain.

What Sauce is not:

  • Not a contract you write. You never write, audit or deploy a smart contract of your own. Your program runs on your Pot, a small account on chain that belongs to your wallet.
  • Not one protocol. Sauce is not a wrapper around a single exchange or lender. A program calls any of the protocols Sauce knows, by name, and mixes them in one transaction.
  • Not a custodian. Your keys stay with you. Sauce builds the transaction, and your wallet signs it.

What you can do with it

  • Do many steps as one. A swap and a payment in a single transaction. If the swap gives too little, nothing moves at all.
  • Use protocols by name. UniswapV3.Factory, AaveV3.Pool, USDC: Sauce knows 133 protocols across 41 chains, and the main tokens of 14 of those chains, with no address to copy. On a chain with no named token, a program writes the token's address once.
  • Try before you pay. sauce simulate runs your program on a copy of the chain as it is right now. It needs no key and no money, and shows you what would move.
  • Hand it to a coding agent. The agent in your editor can write, simulate and run programs for you, with Sauce's own tools.

Start

npm install -g @eco-incorp/sauce
sauce --version

You need Node.js 24 or newer. Then do the quick start: write the program above, try it for free, and run it on Base, in about ten minutes. Only the last step spends money: a little ETH for the fee and 1 USDC, on Base.

The learning path

The documentation is written to be followed in order. Read What Sauce is for the picture, then do the seven tutorials:

  1. Quick start: install, try a program for free, run it on Base.
  2. Write your first program: inputs, checks and transfers of your own.
  3. Swap by name: trade through protocols you name, and set the least you will accept.
  4. Solana quick start: the same program on Solana.
  5. Sauce from TypeScript: compile programs and build their transactions in your own code.
  6. Test your first program: run a program in your tests, on a local copy of a chain.
  7. Your first agent session: let a coding agent write and simulate a program.

Each tutorial ends with a link to the next one. After the path, the manual's how-to guides each get one task done, its concepts explain how Sauce works, and its reference lists every chain, protocol, token, command and import. The glossary puts each Sauce word next to one you already know.

When something fails, Troubleshooting says what an error means and what to do. The changelog records what each SDK release changed in SauceScript, the compiler and the engines.

Upgrading an existing project? Move from compiler 2.5 to 2.6 covers signed Int256 values, ABI-only inputs, EVM atomic try/catch, and the engine/Kitchen pairing. The language reference is the source for exact semantics.

Three words you will see

Sauce borrows its words from a kitchen. Your program is a recipe.

  • Pot: your own smart account on chain. It belongs to your wallet, holds the tokens your programs spend, and makes every call they make. Every program needs your authorization.
  • Cook: the transaction that runs one program on your Pot. Every step happens, or none does.
  • Kitchen: the contract that makes Pots and charges a small flat fee for each cook.

Your Pot's address is known before it exists, but fund it once it is deployed: a Kitchen release with new Pot code derives another address. sauce run creates it the first time it needs it, and sauce run --fund creates it, then moves your tokens in, in one go.

Supported chains

Sauce sends transactions on Ethereum, Base, Arc and Solana. Every other chain it knows is a preview chain: programs compile there and simulate wherever the release is deployed on the chain, but the sauce command builds and sends no transaction. Chains lists them all, and how to ask for one.

From your application

Install it in a project instead, and the same compiler and registries are a TypeScript library. It runs in Node.js and in a browser.

npm install @eco-incorp/sauce

This compiles a program for Base offline: it approves Aave V3's pool for amount of USDC and supplies it. Nothing is sent.

import { routes } from "@eco-incorp/sauce";

const program = routes.compileSauceProgram(
  "base",
  `function main(amount: Uint256) {
    USDC.approve(AaveV3.Pool, amount);
    AaveV3.Pool.supply(USDC, amount, pot, 0);
  }`,
);

// What a Pot cooks: the bytecode, with main's argument appended.
const args = routes.encodeEntryArguments(program, [1_000_000n]);
console.log(`${program.bytecode.length} bytes, plus ${args.length} of arguments`);
console.log(program.entryParams.map((p) => `${p.name}: ${p.type}`).join(", "));

USDC and AaveV3 are not imports: the compiler finds them on Base. entryParams is what main takes, and the bytecode with its encoded arguments is what your Pot runs. Sauce from TypeScript walks through it, the API reference lists every import, and the examples run on every release.

With a coding agent

A coding agent uses Sauce through its MCP server, sauce mcp, a plugin the agent starts on your machine that gives it Sauce's commands as tools. Add it to your project once:

sauce mcp setup

That writes the server into the configuration file of each coding agent the command knows. The server installs the few packages it needs the first time it starts; sauce runtime install does that ahead of time, and is optional.

Your first agent session walks through a session, and the MCP server covers each agent and the wallets it can keep for one. sauce skills install copies the package's agent skills, instructions written for an agent, into your project.

License

Sauce is licensed under the Eco, Inc. Proprietary License 1.1, which is not an open source license. The third-party material in the package, and its licenses, are listed in THIRD_PARTY_NOTICES.md.

版本与发布记录

@eco-incorp/sauce 共发布 21 个版本,首次发布于 2026/09/18;过去 12 个月发布了 21 个版本。

版本发布日期距今
1.0.0latest2026/10/2816 天前
0.99.182026/10/2816 天前
0.99.172026/10/2816 天前
0.99.162026/10/2717 天前
0.99.152026/10/2222 天前
0.99.142026/10/121 个月前

关于 @eco-incorp/sauce 的常见问题

@eco-incorp/sauce 是什么?

Sauce protocol tooling: the SDK, action primitives, the sauce command and the Sauce MCP server.

如何安装 @eco-incorp/sauce?

在项目目录运行 npm install @eco-incorp/sauce,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 sauce,可以用 npx sauce 直接运行。

@eco-incorp/sauce 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@eco-incorp/sauce 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@eco-incorp/sauce 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@eco-incorp/sauce 可以商用吗?

@eco-incorp/sauce 使用 SEE LICENSE IN LICENSE.md 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@eco-incorp/sauce 的下载量有多少?

根据 npm 官方下载统计,@eco-incorp/sauce 在 2026/10/13 – 2026/11/11 这 30 天内被下载 3,629 次,日均约 121 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@eco-incorp/sauce 还在维护吗?

最新版本 1.0.0 发布于 2026/10/28(16 天前);至今共发布 21 个版本,其中过去 12 个月发布了 21 个;首次发布于 2026/09/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。