@eco-incorp/sauce 0.99.6 → 0.99.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1159) hide show
  1. package/README.md +58 -16
  2. package/actions/action-program.schema.json +480 -379
  3. package/actions/dist/abis.d.ts +19 -18
  4. package/actions/dist/abis.d.ts.map +1 -1
  5. package/actions/dist/abis.js +29 -29
  6. package/actions/dist/compile.d.ts +4 -4
  7. package/actions/dist/compile.d.ts.map +1 -1
  8. package/actions/dist/compile.js +3 -1
  9. package/actions/dist/compose.d.ts +63 -6
  10. package/actions/dist/compose.d.ts.map +1 -1
  11. package/actions/dist/compose.js +100 -16
  12. package/actions/dist/index.d.ts +1 -1
  13. package/actions/dist/index.d.ts.map +1 -1
  14. package/actions/dist/names.d.ts +88 -0
  15. package/actions/dist/names.d.ts.map +1 -0
  16. package/actions/dist/names.js +334 -0
  17. package/actions/dist/program.d.ts.map +1 -1
  18. package/actions/dist/program.js +115 -5
  19. package/actions/dist/registry.d.ts +10 -8
  20. package/actions/dist/registry.d.ts.map +1 -1
  21. package/actions/dist/registry.js +10 -8
  22. package/actions/dist/schema.d.ts.map +1 -1
  23. package/actions/dist/schema.js +99 -12
  24. package/actions/dist/semantics.d.ts +12 -2
  25. package/actions/dist/semantics.d.ts.map +1 -1
  26. package/actions/dist/semantics.js +78 -8
  27. package/actions/dist/spec.d.ts +30 -0
  28. package/actions/dist/spec.d.ts.map +1 -1
  29. package/actions/dist/spec.js +151 -138
  30. package/actions/dist/split-swap.d.ts +10 -5
  31. package/actions/dist/split-swap.d.ts.map +1 -1
  32. package/actions/dist/split-swap.js +48 -7
  33. package/actions/dist/to-quote.d.ts +14 -5
  34. package/actions/dist/to-quote.d.ts.map +1 -1
  35. package/actions/dist/to-quote.js +210 -244
  36. package/actions/dist/to-sauce.d.ts +18 -4
  37. package/actions/dist/to-sauce.d.ts.map +1 -1
  38. package/actions/dist/to-sauce.js +232 -205
  39. package/actions/dist/types.d.ts +245 -147
  40. package/actions/dist/types.d.ts.map +1 -1
  41. package/actions/dist/types.js +4 -0
  42. package/docs/README.md +38 -0
  43. package/docs/api/README.md +37 -23
  44. package/docs/api/compiler.md +53 -12
  45. package/docs/api/contracts.md +105 -0
  46. package/docs/api/coverage.md +96 -57
  47. package/docs/api/router.md +238 -0
  48. package/docs/api/routes.md +31 -22
  49. package/docs/concepts/architecture.md +26 -3
  50. package/docs/concepts/saucescript.md +35 -55
  51. package/docs/examples/README.md +21 -14
  52. package/docs/examples/action-program.ts +51 -35
  53. package/docs/examples/cross-chain-cascade.sauce.ts +4 -0
  54. package/docs/examples/cross-chain-intent.sauce.ts +2 -1
  55. package/docs/examples/evm-execution.ts +2 -4
  56. package/docs/examples/first-intent.ts +7 -2
  57. package/docs/examples/pot-router.ts +19 -0
  58. package/docs/examples/registry-names.ts +52 -0
  59. package/docs/examples/router-route.sauce.ts +31 -0
  60. package/docs/examples/router-route.ts +72 -0
  61. package/docs/examples/router-swap.sauce.ts +16 -0
  62. package/docs/examples/router-swap.ts +47 -0
  63. package/docs/examples/venue-where-deployed.sauce.ts +14 -0
  64. package/docs/guides/actions.md +230 -120
  65. package/docs/guides/builders-and-actions.md +20 -14
  66. package/docs/guides/cli.md +1446 -0
  67. package/docs/guides/compiling.md +19 -7
  68. package/docs/guides/intents.md +228 -15
  69. package/docs/guides/mcp.md +540 -0
  70. package/docs/guides/nested-intents.md +21 -6
  71. package/docs/guides/protocols-and-tokens.md +218 -39
  72. package/docs/guides/quick-start.md +5 -0
  73. package/docs/guides/solana.md +199 -52
  74. package/docs/guides/verification.md +2 -2
  75. package/mcp/dist/config.js +78 -0
  76. package/mcp/dist/config.js.map +1 -0
  77. package/mcp/dist/entry.js +112 -0
  78. package/mcp/dist/entry.js.map +1 -0
  79. package/mcp/dist/files.js +64 -0
  80. package/mcp/dist/files.js.map +1 -0
  81. package/mcp/dist/guard.js +262 -0
  82. package/mcp/dist/guard.js.map +1 -0
  83. package/mcp/dist/http.js +111 -0
  84. package/mcp/dist/http.js.map +1 -0
  85. package/mcp/dist/intents.js +579 -0
  86. package/mcp/dist/intents.js.map +1 -0
  87. package/mcp/dist/prompts.js +153 -0
  88. package/mcp/dist/prompts.js.map +1 -0
  89. package/mcp/dist/reach.js +98 -0
  90. package/mcp/dist/reach.js.map +1 -0
  91. package/mcp/dist/resources.js +154 -0
  92. package/mcp/dist/resources.js.map +1 -0
  93. package/mcp/dist/sdk.js +34 -0
  94. package/mcp/dist/sdk.js.map +1 -0
  95. package/mcp/dist/server.js +119 -0
  96. package/mcp/dist/server.js.map +1 -0
  97. package/mcp/dist/setup.js +189 -0
  98. package/mcp/dist/setup.js.map +1 -0
  99. package/mcp/dist/skilltools.js +520 -0
  100. package/mcp/dist/skilltools.js.map +1 -0
  101. package/mcp/dist/terms.js +93 -0
  102. package/mcp/dist/terms.js.map +1 -0
  103. package/mcp/dist/tools.js +1499 -0
  104. package/mcp/dist/tools.js.map +1 -0
  105. package/mcp/dist/wallets.js +168 -0
  106. package/mcp/dist/wallets.js.map +1 -0
  107. package/package.json +18 -13
  108. package/sdk/dist/artifacts/V12Deployments.json +3 -1
  109. package/sdk/dist/artifacts/V12EngineGate.json +1 -2
  110. package/sdk/dist/artifacts/V12KitchenProxy.json +1 -0
  111. package/sdk/dist/chains/canonical.d.ts +15 -24
  112. package/sdk/dist/chains/canonical.d.ts.map +1 -1
  113. package/sdk/dist/chains/canonical.js +18 -29
  114. package/sdk/dist/chains/canonical.js.map +1 -1
  115. package/sdk/dist/cli/actions.d.ts +29 -0
  116. package/sdk/dist/cli/actions.d.ts.map +1 -0
  117. package/sdk/dist/cli/actions.js +122 -0
  118. package/sdk/dist/cli/actions.js.map +1 -0
  119. package/sdk/dist/cli/args.d.ts +118 -0
  120. package/sdk/dist/cli/args.d.ts.map +1 -0
  121. package/sdk/dist/cli/args.js +354 -0
  122. package/sdk/dist/cli/args.js.map +1 -0
  123. package/sdk/dist/cli/assume.d.ts +51 -0
  124. package/sdk/dist/cli/assume.d.ts.map +1 -0
  125. package/sdk/dist/cli/assume.js +207 -0
  126. package/sdk/dist/cli/assume.js.map +1 -0
  127. package/sdk/dist/cli/chain.d.ts +173 -0
  128. package/sdk/dist/cli/chain.d.ts.map +1 -0
  129. package/sdk/dist/cli/chain.js +462 -0
  130. package/sdk/dist/cli/chain.js.map +1 -0
  131. package/sdk/dist/cli/commands.d.ts +226 -0
  132. package/sdk/dist/cli/commands.d.ts.map +1 -0
  133. package/sdk/dist/cli/commands.js +637 -0
  134. package/sdk/dist/cli/commands.js.map +1 -0
  135. package/sdk/dist/cli/create.d.ts +70 -0
  136. package/sdk/dist/cli/create.d.ts.map +1 -0
  137. package/sdk/dist/cli/create.js +483 -0
  138. package/sdk/dist/cli/create.js.map +1 -0
  139. package/sdk/dist/cli/diagnostics.d.ts +12 -0
  140. package/sdk/dist/cli/diagnostics.d.ts.map +1 -0
  141. package/sdk/dist/cli/diagnostics.js +225 -0
  142. package/sdk/dist/cli/diagnostics.js.map +1 -0
  143. package/sdk/dist/cli/effects.d.ts +71 -0
  144. package/sdk/dist/cli/effects.d.ts.map +1 -0
  145. package/sdk/dist/cli/effects.js +279 -0
  146. package/sdk/dist/cli/effects.js.map +1 -0
  147. package/sdk/dist/cli/fill.d.ts +83 -0
  148. package/sdk/dist/cli/fill.d.ts.map +1 -0
  149. package/sdk/dist/cli/fill.js +734 -0
  150. package/sdk/dist/cli/fill.js.map +1 -0
  151. package/sdk/dist/cli/funding.d.ts +126 -0
  152. package/sdk/dist/cli/funding.d.ts.map +1 -0
  153. package/sdk/dist/cli/funding.js +514 -0
  154. package/sdk/dist/cli/funding.js.map +1 -0
  155. package/sdk/dist/cli/globals.d.ts +16 -0
  156. package/sdk/dist/cli/globals.d.ts.map +1 -0
  157. package/sdk/dist/cli/globals.js +219 -0
  158. package/sdk/dist/cli/globals.js.map +1 -0
  159. package/sdk/dist/cli/init.d.ts +34 -0
  160. package/sdk/dist/cli/init.d.ts.map +1 -0
  161. package/sdk/dist/cli/init.js +181 -0
  162. package/sdk/dist/cli/init.js.map +1 -0
  163. package/sdk/dist/cli/inputs.d.ts +72 -0
  164. package/sdk/dist/cli/inputs.d.ts.map +1 -0
  165. package/sdk/dist/cli/inputs.js +152 -0
  166. package/sdk/dist/cli/inputs.js.map +1 -0
  167. package/sdk/dist/cli/inspect.d.ts +48 -0
  168. package/sdk/dist/cli/inspect.d.ts.map +1 -0
  169. package/sdk/dist/cli/inspect.js +536 -0
  170. package/sdk/dist/cli/inspect.js.map +1 -0
  171. package/sdk/dist/cli/intent-commands.d.ts +71 -0
  172. package/sdk/dist/cli/intent-commands.d.ts.map +1 -0
  173. package/sdk/dist/cli/intent-commands.js +698 -0
  174. package/sdk/dist/cli/intent-commands.js.map +1 -0
  175. package/sdk/dist/cli/intent-svm.d.ts +15 -0
  176. package/sdk/dist/cli/intent-svm.d.ts.map +1 -0
  177. package/sdk/dist/cli/intent-svm.js +222 -0
  178. package/sdk/dist/cli/intent-svm.js.map +1 -0
  179. package/sdk/dist/cli/intents.d.ts +43 -0
  180. package/sdk/dist/cli/intents.d.ts.map +1 -0
  181. package/sdk/dist/cli/intents.js +89 -0
  182. package/sdk/dist/cli/intents.js.map +1 -0
  183. package/sdk/dist/cli/interactive.d.ts +11 -0
  184. package/sdk/dist/cli/interactive.d.ts.map +1 -0
  185. package/sdk/dist/cli/interactive.js +161 -0
  186. package/sdk/dist/cli/interactive.js.map +1 -0
  187. package/sdk/dist/cli/lifecycle-svm.d.ts +109 -0
  188. package/sdk/dist/cli/lifecycle-svm.d.ts.map +1 -0
  189. package/sdk/dist/cli/lifecycle-svm.js +299 -0
  190. package/sdk/dist/cli/lifecycle-svm.js.map +1 -0
  191. package/sdk/dist/cli/lifecycle.d.ts +439 -0
  192. package/sdk/dist/cli/lifecycle.d.ts.map +1 -0
  193. package/sdk/dist/cli/lifecycle.js +1721 -0
  194. package/sdk/dist/cli/lifecycle.js.map +1 -0
  195. package/sdk/dist/cli/main.d.ts +3 -0
  196. package/sdk/dist/cli/main.d.ts.map +1 -0
  197. package/sdk/dist/cli/main.js +8 -0
  198. package/sdk/dist/cli/main.js.map +1 -0
  199. package/sdk/dist/cli/mcp.d.ts +66 -0
  200. package/sdk/dist/cli/mcp.d.ts.map +1 -0
  201. package/sdk/dist/cli/mcp.js +169 -0
  202. package/sdk/dist/cli/mcp.js.map +1 -0
  203. package/sdk/dist/cli/password.d.ts +54 -0
  204. package/sdk/dist/cli/password.d.ts.map +1 -0
  205. package/sdk/dist/cli/password.js +148 -0
  206. package/sdk/dist/cli/password.js.map +1 -0
  207. package/sdk/dist/cli/policy.d.ts +130 -0
  208. package/sdk/dist/cli/policy.d.ts.map +1 -0
  209. package/sdk/dist/cli/policy.js +702 -0
  210. package/sdk/dist/cli/policy.js.map +1 -0
  211. package/sdk/dist/cli/pools.d.ts +140 -0
  212. package/sdk/dist/cli/pools.d.ts.map +1 -0
  213. package/sdk/dist/cli/pools.js +658 -0
  214. package/sdk/dist/cli/pools.js.map +1 -0
  215. package/sdk/dist/cli/price.d.ts +74 -0
  216. package/sdk/dist/cli/price.d.ts.map +1 -0
  217. package/sdk/dist/cli/price.js +321 -0
  218. package/sdk/dist/cli/price.js.map +1 -0
  219. package/sdk/dist/cli/prompt.d.ts +30 -0
  220. package/sdk/dist/cli/prompt.d.ts.map +1 -0
  221. package/sdk/dist/cli/prompt.js +53 -0
  222. package/sdk/dist/cli/prompt.js.map +1 -0
  223. package/sdk/dist/cli/publish.d.ts +48 -0
  224. package/sdk/dist/cli/publish.d.ts.map +1 -0
  225. package/sdk/dist/cli/publish.js +480 -0
  226. package/sdk/dist/cli/publish.js.map +1 -0
  227. package/sdk/dist/cli/receipt.d.ts +35 -0
  228. package/sdk/dist/cli/receipt.d.ts.map +1 -0
  229. package/sdk/dist/cli/receipt.js +63 -0
  230. package/sdk/dist/cli/receipt.js.map +1 -0
  231. package/sdk/dist/cli/rehearse.d.ts +80 -0
  232. package/sdk/dist/cli/rehearse.d.ts.map +1 -0
  233. package/sdk/dist/cli/rehearse.js +265 -0
  234. package/sdk/dist/cli/rehearse.js.map +1 -0
  235. package/sdk/dist/cli/report.d.ts +69 -0
  236. package/sdk/dist/cli/report.d.ts.map +1 -0
  237. package/sdk/dist/cli/report.js +206 -0
  238. package/sdk/dist/cli/report.js.map +1 -0
  239. package/sdk/dist/cli/returned.d.ts +16 -0
  240. package/sdk/dist/cli/returned.d.ts.map +1 -0
  241. package/sdk/dist/cli/returned.js +111 -0
  242. package/sdk/dist/cli/returned.js.map +1 -0
  243. package/sdk/dist/cli/run.d.ts +40 -0
  244. package/sdk/dist/cli/run.d.ts.map +1 -0
  245. package/sdk/dist/cli/run.js +3163 -0
  246. package/sdk/dist/cli/run.js.map +1 -0
  247. package/sdk/dist/cli/signer.d.ts +72 -0
  248. package/sdk/dist/cli/signer.d.ts.map +1 -0
  249. package/sdk/dist/cli/signer.js +243 -0
  250. package/sdk/dist/cli/signer.js.map +1 -0
  251. package/sdk/dist/cli/simulate.d.ts +11 -0
  252. package/sdk/dist/cli/simulate.d.ts.map +1 -0
  253. package/sdk/dist/cli/simulate.js +246 -0
  254. package/sdk/dist/cli/simulate.js.map +1 -0
  255. package/sdk/dist/cli/skills.d.ts +77 -0
  256. package/sdk/dist/cli/skills.d.ts.map +1 -0
  257. package/sdk/dist/cli/skills.js +527 -0
  258. package/sdk/dist/cli/skills.js.map +1 -0
  259. package/sdk/dist/cli/solana.d.ts +184 -0
  260. package/sdk/dist/cli/solana.d.ts.map +1 -0
  261. package/sdk/dist/cli/solana.js +1370 -0
  262. package/sdk/dist/cli/solana.js.map +1 -0
  263. package/sdk/dist/cli/store.d.ts +60 -0
  264. package/sdk/dist/cli/store.d.ts.map +1 -0
  265. package/sdk/dist/cli/store.js +196 -0
  266. package/sdk/dist/cli/store.js.map +1 -0
  267. package/sdk/dist/cli/support.d.ts +144 -0
  268. package/sdk/dist/cli/support.d.ts.map +1 -0
  269. package/sdk/dist/cli/support.js +217 -0
  270. package/sdk/dist/cli/support.js.map +1 -0
  271. package/sdk/dist/cli/svm-effects.d.ts +50 -0
  272. package/sdk/dist/cli/svm-effects.d.ts.map +1 -0
  273. package/sdk/dist/cli/svm-effects.js +196 -0
  274. package/sdk/dist/cli/svm-effects.js.map +1 -0
  275. package/sdk/dist/cli/terminal.d.ts +42 -0
  276. package/sdk/dist/cli/terminal.d.ts.map +1 -0
  277. package/sdk/dist/cli/terminal.js +136 -0
  278. package/sdk/dist/cli/terminal.js.map +1 -0
  279. package/sdk/dist/cli/verify.d.ts +32 -0
  280. package/sdk/dist/cli/verify.d.ts.map +1 -0
  281. package/sdk/dist/cli/verify.js +185 -0
  282. package/sdk/dist/cli/verify.js.map +1 -0
  283. package/sdk/dist/cli/wallet-commands.d.ts +59 -0
  284. package/sdk/dist/cli/wallet-commands.d.ts.map +1 -0
  285. package/sdk/dist/cli/wallet-commands.js +222 -0
  286. package/sdk/dist/cli/wallet-commands.js.map +1 -0
  287. package/sdk/dist/cli/wallet-send.d.ts +38 -0
  288. package/sdk/dist/cli/wallet-send.d.ts.map +1 -0
  289. package/sdk/dist/cli/wallet-send.js +303 -0
  290. package/sdk/dist/cli/wallet-send.js.map +1 -0
  291. package/sdk/dist/cli/wallets.d.ts +79 -0
  292. package/sdk/dist/cli/wallets.d.ts.map +1 -0
  293. package/sdk/dist/cli/wallets.js +297 -0
  294. package/sdk/dist/cli/wallets.js.map +1 -0
  295. package/sdk/dist/deployments/index.d.ts +4 -62
  296. package/sdk/dist/deployments/index.d.ts.map +1 -1
  297. package/sdk/dist/deployments/index.js +4 -84
  298. package/sdk/dist/deployments/index.js.map +1 -1
  299. package/sdk/dist/deployments/pot.d.ts +17 -7
  300. package/sdk/dist/deployments/pot.d.ts.map +1 -1
  301. package/sdk/dist/deployments/pot.js +25 -10
  302. package/sdk/dist/deployments/pot.js.map +1 -1
  303. package/sdk/dist/deployments/releases.d.ts +36 -0
  304. package/sdk/dist/deployments/releases.d.ts.map +1 -0
  305. package/sdk/dist/deployments/releases.js +61 -0
  306. package/sdk/dist/deployments/releases.js.map +1 -0
  307. package/sdk/dist/deployments/releases.json +76 -0
  308. package/sdk/dist/deployments/v12-addresses.d.ts +13 -0
  309. package/sdk/dist/deployments/v12-addresses.d.ts.map +1 -1
  310. package/sdk/dist/deployments/v12-addresses.js +16 -3
  311. package/sdk/dist/deployments/v12-addresses.js.map +1 -1
  312. package/sdk/dist/deposit/index.d.ts +6 -6
  313. package/sdk/dist/deposit/index.d.ts.map +1 -1
  314. package/sdk/dist/deposit/index.js +1 -1
  315. package/sdk/dist/deposit/index.js.map +1 -1
  316. package/sdk/dist/deposit/params.d.ts +4 -4
  317. package/sdk/dist/deposit/params.d.ts.map +1 -1
  318. package/sdk/dist/deposit/params.js +7 -4
  319. package/sdk/dist/deposit/params.js.map +1 -1
  320. package/sdk/dist/deposit/source.d.ts +3 -30
  321. package/sdk/dist/deposit/source.d.ts.map +1 -1
  322. package/sdk/dist/deposit/source.js +7 -83
  323. package/sdk/dist/deposit/source.js.map +1 -1
  324. package/sdk/dist/deposit/templates.d.ts +1 -2
  325. package/sdk/dist/deposit/templates.d.ts.map +1 -1
  326. package/sdk/dist/deposit/templates.js +10 -2
  327. package/sdk/dist/deposit/templates.js.map +1 -1
  328. package/sdk/dist/deposit/types.d.ts +14 -12
  329. package/sdk/dist/deposit/types.d.ts.map +1 -1
  330. package/sdk/dist/deposit/types.js +6 -0
  331. package/sdk/dist/deposit/types.js.map +1 -1
  332. package/sdk/dist/descriptors/accessors.d.ts +38 -35
  333. package/sdk/dist/descriptors/accessors.d.ts.map +1 -1
  334. package/sdk/dist/descriptors/accessors.js +16 -0
  335. package/sdk/dist/descriptors/accessors.js.map +1 -1
  336. package/sdk/dist/descriptors/call.d.ts +66 -14
  337. package/sdk/dist/descriptors/call.d.ts.map +1 -1
  338. package/sdk/dist/descriptors/call.js +94 -13
  339. package/sdk/dist/descriptors/call.js.map +1 -1
  340. package/sdk/dist/descriptors/contracts.generated.d.ts +3393 -0
  341. package/sdk/dist/descriptors/contracts.generated.d.ts.map +1 -0
  342. package/sdk/dist/descriptors/contracts.generated.js +728 -0
  343. package/sdk/dist/descriptors/contracts.generated.js.map +1 -0
  344. package/sdk/dist/descriptors/derive.d.ts +20 -11
  345. package/sdk/dist/descriptors/derive.d.ts.map +1 -1
  346. package/sdk/dist/descriptors/derive.js +68 -30
  347. package/sdk/dist/descriptors/derive.js.map +1 -1
  348. package/sdk/dist/descriptors/index.d.ts +6 -7
  349. package/sdk/dist/descriptors/index.d.ts.map +1 -1
  350. package/sdk/dist/descriptors/index.js +2 -2
  351. package/sdk/dist/descriptors/index.js.map +1 -1
  352. package/sdk/dist/descriptors/links.d.ts +23 -214
  353. package/sdk/dist/descriptors/links.d.ts.map +1 -1
  354. package/sdk/dist/descriptors/links.js +1 -232
  355. package/sdk/dist/descriptors/links.js.map +1 -1
  356. package/sdk/dist/descriptors/query.d.ts +1 -1
  357. package/sdk/dist/descriptors/query.d.ts.map +1 -1
  358. package/sdk/dist/descriptors/query.js +1 -1
  359. package/sdk/dist/descriptors/query.js.map +1 -1
  360. package/sdk/dist/descriptors/registry.d.ts +2 -5
  361. package/sdk/dist/descriptors/registry.d.ts.map +1 -1
  362. package/sdk/dist/descriptors/registry.js +11 -66
  363. package/sdk/dist/descriptors/registry.js.map +1 -1
  364. package/sdk/dist/embedded/resolve.d.ts +4 -4
  365. package/sdk/dist/embedded/resolve.d.ts.map +1 -1
  366. package/sdk/dist/embedded/resolve.js +12 -8
  367. package/sdk/dist/embedded/resolve.js.map +1 -1
  368. package/sdk/dist/embedded/skills.generated.d.ts +1 -1
  369. package/sdk/dist/embedded/skills.generated.d.ts.map +1 -1
  370. package/sdk/dist/embedded/skills.generated.js +137 -136
  371. package/sdk/dist/embedded/skills.generated.js.map +1 -1
  372. package/sdk/dist/embedded/sources.generated.d.ts.map +1 -1
  373. package/sdk/dist/embedded/sources.generated.js +40 -6
  374. package/sdk/dist/embedded/sources.generated.js.map +1 -1
  375. package/sdk/dist/evm/engine.d.ts +813 -10
  376. package/sdk/dist/evm/engine.d.ts.map +1 -1
  377. package/sdk/dist/evm/engine.js +127 -8
  378. package/sdk/dist/evm/engine.js.map +1 -1
  379. package/sdk/dist/index.d.ts +3 -2
  380. package/sdk/dist/index.d.ts.map +1 -1
  381. package/sdk/dist/index.js +6 -2
  382. package/sdk/dist/index.js.map +1 -1
  383. package/sdk/dist/price.d.ts +40 -0
  384. package/sdk/dist/price.d.ts.map +1 -0
  385. package/sdk/dist/price.js +101 -0
  386. package/sdk/dist/price.js.map +1 -0
  387. package/sdk/dist/protocols/aerodrome/abis.d.ts +76 -0
  388. package/sdk/dist/protocols/aerodrome/abis.d.ts.map +1 -1
  389. package/sdk/dist/protocols/aerodrome/abis.js +61 -0
  390. package/sdk/dist/protocols/aerodrome/abis.js.map +1 -1
  391. package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts +70 -0
  392. package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts.map +1 -1
  393. package/sdk/dist/protocols/aerodrome-slipstream/abis.js +54 -0
  394. package/sdk/dist/protocols/aerodrome-slipstream/abis.js.map +1 -1
  395. package/sdk/dist/protocols/camelot/abis.d.ts +178 -0
  396. package/sdk/dist/protocols/camelot/abis.d.ts.map +1 -1
  397. package/sdk/dist/protocols/camelot/abis.js +139 -0
  398. package/sdk/dist/protocols/camelot/abis.js.map +1 -1
  399. package/sdk/dist/protocols/eco-routes/abis.d.ts +792 -50
  400. package/sdk/dist/protocols/eco-routes/abis.d.ts.map +1 -1
  401. package/sdk/dist/protocols/eco-routes/abis.js +1058 -49
  402. package/sdk/dist/protocols/eco-routes/abis.js.map +1 -1
  403. package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts +44 -61
  404. package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts.map +1 -1
  405. package/sdk/dist/protocols/eco-routes/addresses.generated.js +45 -62
  406. package/sdk/dist/protocols/eco-routes/addresses.generated.js.map +1 -1
  407. package/sdk/dist/protocols/eco-routes/lookup.d.ts +10 -0
  408. package/sdk/dist/protocols/eco-routes/lookup.d.ts.map +1 -1
  409. package/sdk/dist/protocols/eco-routes/lookup.js +16 -0
  410. package/sdk/dist/protocols/eco-routes/lookup.js.map +1 -1
  411. package/sdk/dist/protocols/maverick/abis.d.ts +77 -0
  412. package/sdk/dist/protocols/maverick/abis.d.ts.map +1 -1
  413. package/sdk/dist/protocols/maverick/abis.js +58 -0
  414. package/sdk/dist/protocols/maverick/abis.js.map +1 -1
  415. package/sdk/dist/protocols/maverick/addresses.d.ts.map +1 -1
  416. package/sdk/dist/protocols/maverick/addresses.js +4 -0
  417. package/sdk/dist/protocols/maverick/addresses.js.map +1 -1
  418. package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts +52 -0
  419. package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts.map +1 -1
  420. package/sdk/dist/protocols/pancakeswap-v2/abis.js +43 -0
  421. package/sdk/dist/protocols/pancakeswap-v2/abis.js.map +1 -1
  422. package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts +73 -0
  423. package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts.map +1 -1
  424. package/sdk/dist/protocols/pancakeswap-v3/abis.js +56 -0
  425. package/sdk/dist/protocols/pancakeswap-v3/abis.js.map +1 -1
  426. package/sdk/dist/protocols/permit2/abis.d.ts +113 -0
  427. package/sdk/dist/protocols/permit2/abis.d.ts.map +1 -1
  428. package/sdk/dist/protocols/permit2/abis.js +63 -0
  429. package/sdk/dist/protocols/permit2/abis.js.map +1 -1
  430. package/sdk/dist/protocols/quickswap/abis.d.ts +148 -0
  431. package/sdk/dist/protocols/quickswap/abis.d.ts.map +1 -1
  432. package/sdk/dist/protocols/quickswap/abis.js +119 -0
  433. package/sdk/dist/protocols/quickswap/abis.js.map +1 -1
  434. package/sdk/dist/protocols/sushiswap-v2/abis.d.ts +52 -0
  435. package/sdk/dist/protocols/sushiswap-v2/abis.d.ts.map +1 -1
  436. package/sdk/dist/protocols/sushiswap-v2/abis.js +42 -0
  437. package/sdk/dist/protocols/sushiswap-v2/abis.js.map +1 -1
  438. package/sdk/dist/protocols/synthra-v3/abis.d.ts +73 -0
  439. package/sdk/dist/protocols/synthra-v3/abis.d.ts.map +1 -1
  440. package/sdk/dist/protocols/synthra-v3/abis.js +55 -0
  441. package/sdk/dist/protocols/synthra-v3/abis.js.map +1 -1
  442. package/sdk/dist/protocols/trader-joe/abis.d.ts +133 -0
  443. package/sdk/dist/protocols/trader-joe/abis.d.ts.map +1 -1
  444. package/sdk/dist/protocols/trader-joe/abis.js +101 -0
  445. package/sdk/dist/protocols/trader-joe/abis.js.map +1 -1
  446. package/sdk/dist/protocols/trader-joe/addresses.d.ts.map +1 -1
  447. package/sdk/dist/protocols/trader-joe/addresses.js +5 -0
  448. package/sdk/dist/protocols/trader-joe/addresses.js.map +1 -1
  449. package/sdk/dist/protocols/uniswap-v2/abis.d.ts +52 -0
  450. package/sdk/dist/protocols/uniswap-v2/abis.d.ts.map +1 -1
  451. package/sdk/dist/protocols/uniswap-v2/abis.js +44 -0
  452. package/sdk/dist/protocols/uniswap-v2/abis.js.map +1 -1
  453. package/sdk/dist/protocols/uniswap-v3/abis.d.ts +73 -0
  454. package/sdk/dist/protocols/uniswap-v3/abis.d.ts.map +1 -1
  455. package/sdk/dist/protocols/uniswap-v3/abis.js +55 -0
  456. package/sdk/dist/protocols/uniswap-v3/abis.js.map +1 -1
  457. package/sdk/dist/protocols/uniswap-v4/abis.d.ts +247 -0
  458. package/sdk/dist/protocols/uniswap-v4/abis.d.ts.map +1 -1
  459. package/sdk/dist/protocols/uniswap-v4/abis.js +167 -0
  460. package/sdk/dist/protocols/uniswap-v4/abis.js.map +1 -1
  461. package/sdk/dist/protocols/uniswap-v4/addresses.d.ts.map +1 -1
  462. package/sdk/dist/protocols/uniswap-v4/addresses.js +50 -0
  463. package/sdk/dist/protocols/uniswap-v4/addresses.js.map +1 -1
  464. package/sdk/dist/protocols/unitflow-v3/abis.d.ts +73 -0
  465. package/sdk/dist/protocols/unitflow-v3/abis.d.ts.map +1 -1
  466. package/sdk/dist/protocols/unitflow-v3/abis.js +56 -0
  467. package/sdk/dist/protocols/unitflow-v3/abis.js.map +1 -1
  468. package/sdk/dist/protocols/velodrome/abis.d.ts +76 -0
  469. package/sdk/dist/protocols/velodrome/abis.d.ts.map +1 -1
  470. package/sdk/dist/protocols/velodrome/abis.js +61 -0
  471. package/sdk/dist/protocols/velodrome/abis.js.map +1 -1
  472. package/sdk/dist/recipes/cctp-split.sauce.ts +2 -2
  473. package/sdk/dist/recipes/plain-transfer.sauce.ts +2 -2
  474. package/sdk/dist/routes/accessor-index.d.ts +2 -2
  475. package/sdk/dist/routes/accessor-index.d.ts.map +1 -1
  476. package/sdk/dist/routes/accessor-index.js +4 -3
  477. package/sdk/dist/routes/accessor-index.js.map +1 -1
  478. package/sdk/dist/routes/ambient.d.ts +5 -0
  479. package/sdk/dist/routes/ambient.d.ts.map +1 -1
  480. package/sdk/dist/routes/ambient.js +20 -0
  481. package/sdk/dist/routes/ambient.js.map +1 -1
  482. package/sdk/dist/routes/ast-walk.d.ts +17 -3
  483. package/sdk/dist/routes/ast-walk.d.ts.map +1 -1
  484. package/sdk/dist/routes/ast-walk.js +24 -2
  485. package/sdk/dist/routes/ast-walk.js.map +1 -1
  486. package/sdk/dist/routes/available.d.ts +43 -0
  487. package/sdk/dist/routes/available.d.ts.map +1 -0
  488. package/sdk/dist/routes/available.js +230 -0
  489. package/sdk/dist/routes/available.js.map +1 -0
  490. package/sdk/dist/routes/builtins.generated.d.ts +180 -0
  491. package/sdk/dist/routes/builtins.generated.d.ts.map +1 -0
  492. package/sdk/dist/routes/builtins.generated.js +2 -0
  493. package/sdk/dist/routes/builtins.generated.js.map +1 -0
  494. package/sdk/dist/routes/chain-exports.generated.d.ts +13 -8
  495. package/sdk/dist/routes/chain-exports.generated.d.ts.map +1 -1
  496. package/sdk/dist/routes/chain-exports.generated.js.map +1 -1
  497. package/sdk/dist/routes/closure.d.ts.map +1 -1
  498. package/sdk/dist/routes/closure.js +13 -26
  499. package/sdk/dist/routes/closure.js.map +1 -1
  500. package/sdk/dist/routes/composed.d.ts.map +1 -1
  501. package/sdk/dist/routes/composed.js +20 -8
  502. package/sdk/dist/routes/composed.js.map +1 -1
  503. package/sdk/dist/routes/encode.d.ts +17 -0
  504. package/sdk/dist/routes/encode.d.ts.map +1 -1
  505. package/sdk/dist/routes/encode.js +14 -11
  506. package/sdk/dist/routes/encode.js.map +1 -1
  507. package/sdk/dist/routes/entry.d.ts +76 -0
  508. package/sdk/dist/routes/entry.d.ts.map +1 -0
  509. package/sdk/dist/routes/entry.js +478 -0
  510. package/sdk/dist/routes/entry.js.map +1 -0
  511. package/sdk/dist/routes/index.d.ts +19 -12
  512. package/sdk/dist/routes/index.d.ts.map +1 -1
  513. package/sdk/dist/routes/index.js +11 -8
  514. package/sdk/dist/routes/index.js.map +1 -1
  515. package/sdk/dist/routes/intent-body.d.ts +97 -0
  516. package/sdk/dist/routes/intent-body.d.ts.map +1 -0
  517. package/sdk/dist/routes/intent-body.js +441 -0
  518. package/sdk/dist/routes/intent-body.js.map +1 -0
  519. package/sdk/dist/routes/intent-dsl.d.ts +21 -6
  520. package/sdk/dist/routes/intent-dsl.d.ts.map +1 -1
  521. package/sdk/dist/routes/intent-dsl.js +34 -17
  522. package/sdk/dist/routes/intent-dsl.js.map +1 -1
  523. package/sdk/dist/routes/intent-sugar.d.ts +77 -4
  524. package/sdk/dist/routes/intent-sugar.d.ts.map +1 -1
  525. package/sdk/dist/routes/intent-sugar.js +318 -129
  526. package/sdk/dist/routes/intent-sugar.js.map +1 -1
  527. package/sdk/dist/routes/intent.d.ts +13 -1
  528. package/sdk/dist/routes/intent.d.ts.map +1 -1
  529. package/sdk/dist/routes/intent.js +37 -1
  530. package/sdk/dist/routes/intent.js.map +1 -1
  531. package/sdk/dist/routes/nest.d.ts +3 -2
  532. package/sdk/dist/routes/nest.d.ts.map +1 -1
  533. package/sdk/dist/routes/nest.js +5 -3
  534. package/sdk/dist/routes/nest.js.map +1 -1
  535. package/sdk/dist/routes/parse.d.ts +6 -0
  536. package/sdk/dist/routes/parse.d.ts.map +1 -0
  537. package/sdk/dist/routes/parse.js +39 -0
  538. package/sdk/dist/routes/parse.js.map +1 -0
  539. package/sdk/dist/routes/portal.d.ts +258 -4
  540. package/sdk/dist/routes/portal.d.ts.map +1 -1
  541. package/sdk/dist/routes/portal.js +588 -9
  542. package/sdk/dist/routes/portal.js.map +1 -1
  543. package/sdk/dist/routes/protocol-rewrite.d.ts +71 -1
  544. package/sdk/dist/routes/protocol-rewrite.d.ts.map +1 -1
  545. package/sdk/dist/routes/protocol-rewrite.js +178 -54
  546. package/sdk/dist/routes/protocol-rewrite.js.map +1 -1
  547. package/sdk/dist/routes/rs-compile.d.ts +25 -22
  548. package/sdk/dist/routes/rs-compile.d.ts.map +1 -1
  549. package/sdk/dist/routes/rs-compile.js +55 -49
  550. package/sdk/dist/routes/rs-compile.js.map +1 -1
  551. package/sdk/dist/routes/sauce-calls.d.ts +26 -12
  552. package/sdk/dist/routes/sauce-calls.d.ts.map +1 -1
  553. package/sdk/dist/routes/sauce-calls.js +16 -23
  554. package/sdk/dist/routes/sauce-calls.js.map +1 -1
  555. package/sdk/dist/routes/sauce-route.d.ts +74 -7
  556. package/sdk/dist/routes/sauce-route.d.ts.map +1 -1
  557. package/sdk/dist/routes/sauce-route.js +225 -75
  558. package/sdk/dist/routes/sauce-route.js.map +1 -1
  559. package/sdk/dist/routes/source-globals.d.ts +107 -0
  560. package/sdk/dist/routes/source-globals.d.ts.map +1 -0
  561. package/sdk/dist/routes/source-globals.generated.d.ts +5601 -933
  562. package/sdk/dist/routes/source-globals.generated.d.ts.map +1 -1
  563. package/sdk/dist/routes/source-globals.generated.js +3 -4
  564. package/sdk/dist/routes/source-globals.generated.js.map +1 -1
  565. package/sdk/dist/routes/source-globals.js +175 -0
  566. package/sdk/dist/routes/source-globals.js.map +1 -0
  567. package/sdk/dist/routes/stock-tokens.d.ts +89 -0
  568. package/sdk/dist/routes/stock-tokens.d.ts.map +1 -0
  569. package/sdk/dist/routes/stock-tokens.generated.d.ts +7 -0
  570. package/sdk/dist/routes/stock-tokens.generated.d.ts.map +1 -0
  571. package/sdk/dist/routes/stock-tokens.generated.js +3664 -0
  572. package/sdk/dist/routes/stock-tokens.generated.js.map +1 -0
  573. package/sdk/dist/routes/stock-tokens.js +89 -0
  574. package/sdk/dist/routes/stock-tokens.js.map +1 -0
  575. package/sdk/dist/routes/token-registry.d.ts +68 -8
  576. package/sdk/dist/routes/token-registry.d.ts.map +1 -1
  577. package/sdk/dist/routes/token-registry.js +218 -32
  578. package/sdk/dist/routes/token-registry.js.map +1 -1
  579. package/sdk/dist/routes/token-rewrite.d.ts +1 -1
  580. package/sdk/dist/routes/token-rewrite.d.ts.map +1 -1
  581. package/sdk/dist/routes/token-rewrite.js +5 -9
  582. package/sdk/dist/routes/token-rewrite.js.map +1 -1
  583. package/sdk/dist/routes/unknown-global.d.ts +32 -0
  584. package/sdk/dist/routes/unknown-global.d.ts.map +1 -0
  585. package/sdk/dist/routes/unknown-global.js +106 -0
  586. package/sdk/dist/routes/unknown-global.js.map +1 -0
  587. package/sdk/dist/routes/vault.d.ts +38 -8
  588. package/sdk/dist/routes/vault.d.ts.map +1 -1
  589. package/sdk/dist/routes/vault.js +47 -8
  590. package/sdk/dist/routes/vault.js.map +1 -1
  591. package/sdk/dist/sauce-script/builtins.d.ts +309 -0
  592. package/sdk/dist/sauce-script/declarations.d.ts +3 -0
  593. package/sdk/dist/sauce-script/declarations.d.ts.map +1 -0
  594. package/sdk/dist/sauce-script/declarations.js +229 -0
  595. package/sdk/dist/sauce-script/declarations.js.map +1 -0
  596. package/sdk/dist/sauce-script/index.d.ts +2714 -0
  597. package/sdk/dist/sauce-script/ts-plugin.cjs +85 -0
  598. package/sdk/dist/skills/loader.d.ts.map +1 -1
  599. package/sdk/dist/skills/loader.js +4 -3
  600. package/sdk/dist/skills/loader.js.map +1 -1
  601. package/sdk/dist/std/router/balancer-v2-vault.abi.json +78 -0
  602. package/sdk/dist/std/router/curve-cryptoswap.abi.json +29 -0
  603. package/sdk/dist/std/router/curve-stableswap.abi.json +29 -0
  604. package/sdk/dist/std/router/dodo-v2-pool.abi.json +39 -0
  605. package/sdk/dist/std/router/lb-pair.abi.json +55 -0
  606. package/sdk/dist/std/router/package.json +7 -0
  607. package/sdk/dist/std/router/router.evm.js +567 -0
  608. package/sdk/dist/std/router/sauce-router.abi.json +202 -0
  609. package/sdk/dist/std/router/uniswap-v2-pair.abi.json +49 -0
  610. package/sdk/dist/std/router/woo-pp-v2.abi.json +42 -0
  611. package/sdk/dist/std/token/permit2.abi.json +226 -0
  612. package/sdk/dist/std/token/token.evm.js +73 -0
  613. package/sdk/dist/std/token/token.svm.js +194 -41
  614. package/sdk/dist/svm/client.d.ts +62 -15
  615. package/sdk/dist/svm/client.d.ts.map +1 -1
  616. package/sdk/dist/svm/client.js +103 -42
  617. package/sdk/dist/svm/client.js.map +1 -1
  618. package/sdk/dist/svm/engine.d.ts +66 -5
  619. package/sdk/dist/svm/engine.d.ts.map +1 -1
  620. package/sdk/dist/svm/engine.js +73 -5
  621. package/sdk/dist/svm/engine.js.map +1 -1
  622. package/sdk/dist/svm/index.d.ts +2 -0
  623. package/sdk/dist/svm/index.d.ts.map +1 -1
  624. package/sdk/dist/svm/index.js +2 -0
  625. package/sdk/dist/svm/index.js.map +1 -1
  626. package/sdk/dist/svm/instructions.d.ts +72 -1
  627. package/sdk/dist/svm/instructions.d.ts.map +1 -1
  628. package/sdk/dist/svm/instructions.js +81 -2
  629. package/sdk/dist/svm/instructions.js.map +1 -1
  630. package/sdk/dist/svm/kitchen.d.ts +20 -1
  631. package/sdk/dist/svm/kitchen.d.ts.map +1 -1
  632. package/sdk/dist/svm/kitchen.js +47 -1
  633. package/sdk/dist/svm/kitchen.js.map +1 -1
  634. package/sdk/dist/svm/portal.d.ts +250 -0
  635. package/sdk/dist/svm/portal.d.ts.map +1 -0
  636. package/sdk/dist/svm/portal.js +462 -0
  637. package/sdk/dist/svm/portal.js.map +1 -0
  638. package/sdk/dist/svm/send.d.ts +18 -2
  639. package/sdk/dist/svm/send.d.ts.map +1 -1
  640. package/sdk/dist/svm/send.js +28 -3
  641. package/sdk/dist/svm/send.js.map +1 -1
  642. package/sdk/dist/svm/token-accounts.d.ts +49 -0
  643. package/sdk/dist/svm/token-accounts.d.ts.map +1 -0
  644. package/sdk/dist/svm/token-accounts.js +58 -0
  645. package/sdk/dist/svm/token-accounts.js.map +1 -0
  646. package/sdk/dist/svm/token-extensions.d.ts +18 -7
  647. package/sdk/dist/svm/token-extensions.d.ts.map +1 -1
  648. package/sdk/dist/svm/token-extensions.js +58 -5
  649. package/sdk/dist/svm/token-extensions.js.map +1 -1
  650. package/sdk/dist/token/evm.js +1 -1
  651. package/sdk/dist/token/index.d.ts +1 -1
  652. package/sdk/dist/token/index.js +1 -1
  653. package/sdk/dist/token/params.js +1 -1
  654. package/sdk/dist/token/source.js +3 -3
  655. package/sdk/dist/token/source.js.map +1 -1
  656. package/sdk/dist/token/types.d.ts +2 -2
  657. package/sdk/dist/token/types.js +2 -2
  658. package/sdk/src/protocols/aerodrome/AerodromePoolABI.json +105 -0
  659. package/sdk/src/protocols/aerodrome/abis.ts +62 -0
  660. package/sdk/src/protocols/aerodrome-slipstream/AerodromeSlipstreamPoolABI.json +96 -0
  661. package/sdk/src/protocols/aerodrome-slipstream/abis.ts +55 -0
  662. package/sdk/src/protocols/camelot/CamelotV2FactoryABI.json +25 -0
  663. package/sdk/src/protocols/camelot/CamelotV2PairABI.json +109 -0
  664. package/sdk/src/protocols/camelot/CamelotV3FactoryABI.json +25 -0
  665. package/sdk/src/protocols/camelot/CamelotV3PoolABI.json +92 -0
  666. package/sdk/src/protocols/camelot/abis.ts +143 -0
  667. package/sdk/src/protocols/eco-routes/PortalABI.json +1448 -0
  668. package/sdk/src/protocols/eco-routes/ProverABI.json +162 -0
  669. package/sdk/src/protocols/eco-routes/abis.ts +1060 -51
  670. package/sdk/src/protocols/eco-routes/addresses.generated.ts +45 -62
  671. package/sdk/src/protocols/eco-routes/lookup.ts +18 -0
  672. package/sdk/src/protocols/maverick/MaverickV2PoolABI.json +107 -0
  673. package/sdk/src/protocols/maverick/abis.ts +59 -0
  674. package/sdk/src/protocols/maverick/addresses.ts +4 -0
  675. package/sdk/src/protocols/pancakeswap-v2/PancakeSwapV2PairABI.json +72 -0
  676. package/sdk/src/protocols/pancakeswap-v2/abis.ts +44 -0
  677. package/sdk/src/protocols/pancakeswap-v3/PancakeSwapV3PoolABI.json +100 -0
  678. package/sdk/src/protocols/pancakeswap-v3/abis.ts +57 -0
  679. package/sdk/src/protocols/permit2/Permit2ABI.json +154 -0
  680. package/sdk/src/protocols/permit2/abis.ts +63 -0
  681. package/sdk/src/protocols/quickswap/QuickSwapV2FactoryABI.json +25 -0
  682. package/sdk/src/protocols/quickswap/QuickSwapV2PairABI.json +72 -0
  683. package/sdk/src/protocols/quickswap/QuickSwapV3FactoryABI.json +25 -0
  684. package/sdk/src/protocols/quickswap/QuickSwapV3PoolABI.json +88 -0
  685. package/sdk/src/protocols/quickswap/abis.ts +123 -0
  686. package/sdk/src/protocols/sushiswap-v2/SushiSwapV2PairABI.json +72 -0
  687. package/sdk/src/protocols/sushiswap-v2/abis.ts +43 -0
  688. package/sdk/src/protocols/synthra-v3/SynthraV3PoolABI.json +100 -0
  689. package/sdk/src/protocols/synthra-v3/abis.ts +56 -0
  690. package/sdk/src/protocols/trader-joe/LBPairABI.json +185 -0
  691. package/sdk/src/protocols/trader-joe/abis.ts +102 -0
  692. package/sdk/src/protocols/trader-joe/addresses.ts +5 -0
  693. package/sdk/src/protocols/uniswap-v2/UniswapV2PairABI.json +72 -0
  694. package/sdk/src/protocols/uniswap-v2/abis.ts +45 -0
  695. package/sdk/src/protocols/uniswap-v3/UniswapV3PoolABI.json +100 -0
  696. package/sdk/src/protocols/uniswap-v3/abis.ts +56 -0
  697. package/sdk/src/protocols/uniswap-v4/UniswapV4PoolManagerABI.json +38 -0
  698. package/sdk/src/protocols/uniswap-v4/UniswapV4StateViewABI.json +307 -0
  699. package/sdk/src/protocols/uniswap-v4/abis.ts +168 -0
  700. package/sdk/src/protocols/uniswap-v4/addresses.ts +50 -0
  701. package/sdk/src/protocols/unitflow-v3/UnitFlowV3PoolABI.json +100 -0
  702. package/sdk/src/protocols/unitflow-v3/abis.ts +57 -0
  703. package/sdk/src/protocols/velodrome/VelodromePoolABI.json +105 -0
  704. package/sdk/src/protocols/velodrome/abis.ts +62 -0
  705. package/skills/sauce-actions/SKILL.md +166 -0
  706. package/skills/sauce-actions/examples/swap-and-supply.json +24 -0
  707. package/skills/sauce-actions/examples/swap-by-key.json +15 -0
  708. package/skills/sauce-actions/references/actions.md +731 -0
  709. package/skills/sauce-chains/SKILL.md +137 -0
  710. package/skills/sauce-chains/examples/chains.sauce.ts +25 -0
  711. package/skills/sauce-chains/references/arbitrum.md +158 -0
  712. package/skills/sauce-chains/references/arc.md +107 -0
  713. package/skills/sauce-chains/references/aurora.md +33 -0
  714. package/skills/sauce-chains/references/avalanche.md +106 -0
  715. package/skills/sauce-chains/references/base-stocks.md +77 -0
  716. package/skills/sauce-chains/references/base.md +141 -0
  717. package/skills/sauce-chains/references/berachain.md +33 -0
  718. package/skills/sauce-chains/references/blast.md +60 -0
  719. package/skills/sauce-chains/references/boba.md +33 -0
  720. package/skills/sauce-chains/references/bsc.md +97 -0
  721. package/skills/sauce-chains/references/celo.md +57 -0
  722. package/skills/sauce-chains/references/core.md +33 -0
  723. package/skills/sauce-chains/references/cronos.md +33 -0
  724. package/skills/sauce-chains/references/ethereum-stocks.md +1741 -0
  725. package/skills/sauce-chains/references/ethereum.md +255 -0
  726. package/skills/sauce-chains/references/evmos.md +33 -0
  727. package/skills/sauce-chains/references/fantom.md +61 -0
  728. package/skills/sauce-chains/references/fuse.md +33 -0
  729. package/skills/sauce-chains/references/gnosis.md +57 -0
  730. package/skills/sauce-chains/references/index.md +58 -0
  731. package/skills/sauce-chains/references/ink.md +55 -0
  732. package/skills/sauce-chains/references/kava.md +33 -0
  733. package/skills/sauce-chains/references/klaytn.md +33 -0
  734. package/skills/sauce-chains/references/linea.md +65 -0
  735. package/skills/sauce-chains/references/manta.md +33 -0
  736. package/skills/sauce-chains/references/mantle.md +33 -0
  737. package/skills/sauce-chains/references/metis.md +54 -0
  738. package/skills/sauce-chains/references/mode.md +55 -0
  739. package/skills/sauce-chains/references/monad.md +79 -0
  740. package/skills/sauce-chains/references/moonbeam.md +33 -0
  741. package/skills/sauce-chains/references/opbnb.md +55 -0
  742. package/skills/sauce-chains/references/optimism.md +123 -0
  743. package/skills/sauce-chains/references/plasma.md +35 -0
  744. package/skills/sauce-chains/references/polygon.md +123 -0
  745. package/skills/sauce-chains/references/pulsechain.md +33 -0
  746. package/skills/sauce-chains/references/ronin.md +35 -0
  747. package/skills/sauce-chains/references/scroll.md +62 -0
  748. package/skills/sauce-chains/references/sei.md +55 -0
  749. package/skills/sauce-chains/references/solana-stocks.md +1812 -0
  750. package/skills/sauce-chains/references/solana.md +56 -0
  751. package/skills/sauce-chains/references/sonic.md +57 -0
  752. package/skills/sauce-chains/references/unichain.md +61 -0
  753. package/skills/sauce-chains/references/zetachain.md +33 -0
  754. package/skills/sauce-chains/references/zksync.md +59 -0
  755. package/skills/sauce-chains/references/zora.md +57 -0
  756. package/skills/sauce-cli/SKILL.md +366 -0
  757. package/skills/sauce-cli/examples/pay.sauce.ts +23 -0
  758. package/skills/sauce-cli/examples/split.sauce.ts +30 -0
  759. package/skills/sauce-distributed-swap/SKILL.md +392 -0
  760. package/skills/sauce-distributed-swap/examples/distributed-swap.mts +251 -0
  761. package/skills/sauce-distributed-swap/examples/distributed-swap.sauce.ts +115 -0
  762. package/skills/sauce-examples/SKILL.md +96 -0
  763. package/skills/sauce-globals/SKILL.md +213 -0
  764. package/skills/sauce-globals/examples/globals.mts +111 -0
  765. package/skills/sauce-globals/examples/globals.sauce.ts +47 -0
  766. package/skills/sauce-globals/references/chains.md +53 -0
  767. package/skills/sauce-globals/references/protocols.md +405 -0
  768. package/skills/sauce-globals/references/stocks.md +3635 -0
  769. package/skills/sauce-globals/references/tokens.md +53 -0
  770. package/skills/sauce-intents/SKILL.md +505 -0
  771. package/skills/sauce-intents/examples/cross-chain.sauce.ts +37 -0
  772. package/skills/sauce-intents/examples/fund-by-transfer.sauce.ts +54 -0
  773. package/skills/sauce-intents/examples/intents.mts +343 -0
  774. package/skills/sauce-intents/examples/swap-on-base.sauce.ts +135 -0
  775. package/skills/sauce-intents/references/portal.md +77 -0
  776. package/skills/sauce-overview/SKILL.md +161 -0
  777. package/skills/sauce-protocols/SKILL.md +118 -0
  778. package/skills/sauce-protocols/examples/protocols.mts +77 -0
  779. package/skills/sauce-protocols/examples/protocols.sauce.ts +27 -0
  780. package/{sdk/src/skills → skills/sauce-protocols/references}/aave-v2.md +35 -17
  781. package/skills/sauce-protocols/references/aave-v3.md +144 -0
  782. package/skills/sauce-protocols/references/aave-v4.md +50 -0
  783. package/skills/sauce-protocols/references/abracadabra.md +72 -0
  784. package/skills/sauce-protocols/references/across.md +73 -0
  785. package/skills/sauce-protocols/references/aerodrome-slipstream.md +50 -0
  786. package/{sdk/src/skills → skills/sauce-protocols/references}/aerodrome.md +43 -24
  787. package/skills/sauce-protocols/references/aevo.md +49 -0
  788. package/{sdk/src/skills → skills/sauce-protocols/references}/alchemix.md +10 -25
  789. package/{sdk/src/skills → skills/sauce-protocols/references}/ambient.md +14 -21
  790. package/{sdk/src/skills → skills/sauce-protocols/references}/arbitrum-bridge.md +11 -14
  791. package/{sdk/src/skills → skills/sauce-protocols/references}/arrakis.md +10 -26
  792. package/skills/sauce-protocols/references/axelar.md +56 -0
  793. package/{sdk/src/skills → skills/sauce-protocols/references}/balancer-v2.md +13 -29
  794. package/{sdk/src/skills → skills/sauce-protocols/references}/base-bridge.md +11 -16
  795. package/{sdk/src/skills → skills/sauce-protocols/references}/baseswap.md +12 -19
  796. package/{sdk/src/skills → skills/sauce-protocols/references}/beefy.md +10 -30
  797. package/{sdk/src/skills → skills/sauce-protocols/references}/benqi.md +11 -21
  798. package/{sdk/src/skills → skills/sauce-protocols/references}/camelot.md +13 -27
  799. package/{sdk/src/skills → skills/sauce-protocols/references}/cbeth.md +10 -22
  800. package/skills/sauce-protocols/references/cctp.md +47 -0
  801. package/{sdk/src/skills → skills/sauce-protocols/references}/celer.md +11 -18
  802. package/{sdk/src/skills → skills/sauce-protocols/references}/chainlink-ccip.md +11 -21
  803. package/skills/sauce-protocols/references/chainlink.md +47 -0
  804. package/{sdk/src/skills → skills/sauce-protocols/references}/circle-gateway.md +12 -38
  805. package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v2.md +11 -25
  806. package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v3.md +43 -27
  807. package/{sdk/src/skills → skills/sauce-protocols/references}/connext.md +11 -15
  808. package/{sdk/src/skills → skills/sauce-protocols/references}/convex.md +10 -28
  809. package/{sdk/src/skills → skills/sauce-protocols/references}/cowswap.md +12 -19
  810. package/{sdk/src/skills → skills/sauce-protocols/references}/crvusd.md +10 -19
  811. package/skills/sauce-protocols/references/curve.md +98 -0
  812. package/{sdk/src/skills → skills/sauce-protocols/references}/debridge.md +11 -33
  813. package/{sdk/src/skills → skills/sauce-protocols/references}/dodo.md +13 -18
  814. package/skills/sauce-protocols/references/eigenlayer.md +48 -0
  815. package/{sdk/src/skills → skills/sauce-protocols/references}/ens.md +10 -26
  816. package/{sdk/src/skills → skills/sauce-protocols/references}/erc20.md +10 -24
  817. package/{sdk/src/skills → skills/sauce-protocols/references}/erc3156.md +10 -13
  818. package/{sdk/src/skills → skills/sauce-protocols/references}/erc4626.md +11 -27
  819. package/{sdk/src/skills → skills/sauce-protocols/references}/ethena.md +10 -27
  820. package/{sdk/src/skills → skills/sauce-protocols/references}/etherfi.md +10 -32
  821. package/{sdk/src/skills → skills/sauce-protocols/references}/euler-v2.md +11 -21
  822. package/{sdk/src/skills → skills/sauce-protocols/references}/fenix.md +12 -18
  823. package/{sdk/src/skills → skills/sauce-protocols/references}/fluid.md +11 -20
  824. package/{sdk/src/skills → skills/sauce-protocols/references}/frax-ether.md +10 -26
  825. package/{sdk/src/skills → skills/sauce-protocols/references}/frax.md +10 -19
  826. package/{sdk/src/skills → skills/sauce-protocols/references}/gains-network.md +11 -28
  827. package/skills/sauce-protocols/references/gamma.md +57 -0
  828. package/{sdk/src/skills → skills/sauce-protocols/references}/gelato.md +12 -20
  829. package/{sdk/src/skills → skills/sauce-protocols/references}/gho.md +10 -19
  830. package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v1.md +12 -34
  831. package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v2.md +15 -28
  832. package/skills/sauce-protocols/references/harvest.md +41 -0
  833. package/{sdk/src/skills → skills/sauce-protocols/references}/hegic.md +10 -18
  834. package/{sdk/src/skills → skills/sauce-protocols/references}/hop.md +11 -21
  835. package/{sdk/src/skills → skills/sauce-protocols/references}/hyperlane.md +11 -21
  836. package/skills/sauce-protocols/references/index.md +355 -0
  837. package/{sdk/src/skills → skills/sauce-protocols/references}/instadapp.md +10 -18
  838. package/skills/sauce-protocols/references/kelp.md +46 -0
  839. package/{sdk/src/skills → skills/sauce-protocols/references}/kim.md +12 -18
  840. package/{sdk/src/skills → skills/sauce-protocols/references}/kyberswap-aggregator.md +12 -35
  841. package/skills/sauce-protocols/references/kyberswap.md +72 -0
  842. package/{sdk/src/skills → skills/sauce-protocols/references}/layerbank.md +11 -26
  843. package/{sdk/src/skills → skills/sauce-protocols/references}/layerzero.md +11 -25
  844. package/{sdk/src/skills → skills/sauce-protocols/references}/level-finance.md +10 -24
  845. package/{sdk/src/skills → skills/sauce-protocols/references}/lido.md +10 -28
  846. package/{sdk/src/skills → skills/sauce-protocols/references}/lifi.md +11 -25
  847. package/{sdk/src/skills → skills/sauce-protocols/references}/linea-bridge.md +11 -14
  848. package/{sdk/src/skills → skills/sauce-protocols/references}/liquity-v1.md +10 -21
  849. package/{sdk/src/skills → skills/sauce-protocols/references}/liquity-v2.md +10 -19
  850. package/{sdk/src/skills → skills/sauce-protocols/references}/lynex.md +12 -18
  851. package/skills/sauce-protocols/references/maker.md +57 -0
  852. package/skills/sauce-protocols/references/mantle-meth.md +43 -0
  853. package/{sdk/src/skills → skills/sauce-protocols/references}/maverick.md +13 -25
  854. package/{sdk/src/skills → skills/sauce-protocols/references}/moonwell.md +11 -21
  855. package/{sdk/src/skills → skills/sauce-protocols/references}/morpho-blue.md +44 -21
  856. package/{sdk/src/skills → skills/sauce-protocols/references}/mux-protocol.md +10 -30
  857. package/skills/sauce-protocols/references/olympus.md +39 -0
  858. package/skills/sauce-protocols/references/oneinch.md +81 -0
  859. package/skills/sauce-protocols/references/openocean.md +69 -0
  860. package/{sdk/src/skills → skills/sauce-protocols/references}/optimism-bridge.md +11 -16
  861. package/{sdk/src/skills → skills/sauce-protocols/references}/opyn.md +10 -21
  862. package/{sdk/src/skills → skills/sauce-protocols/references}/pancakeswap-v2.md +39 -41
  863. package/skills/sauce-protocols/references/pancakeswap-v3.md +72 -0
  864. package/skills/sauce-protocols/references/paraswap.md +39 -0
  865. package/{sdk/src/skills → skills/sauce-protocols/references}/pendle.md +47 -29
  866. package/skills/sauce-protocols/references/permit2.md +101 -0
  867. package/skills/sauce-protocols/references/perpetual-protocol.md +53 -0
  868. package/{sdk/src/skills → skills/sauce-protocols/references}/polygon-bridge.md +11 -17
  869. package/{sdk/src/skills → skills/sauce-protocols/references}/premia.md +10 -19
  870. package/{sdk/src/skills → skills/sauce-protocols/references}/puffer.md +10 -21
  871. package/skills/sauce-protocols/references/pyth.md +45 -0
  872. package/{sdk/src/skills → skills/sauce-protocols/references}/quickswap.md +13 -27
  873. package/{sdk/src/skills → skills/sauce-protocols/references}/radiant.md +11 -15
  874. package/{sdk/src/skills → skills/sauce-protocols/references}/ramses.md +12 -18
  875. package/skills/sauce-protocols/references/reflexer.md +52 -0
  876. package/skills/sauce-protocols/references/registry/aave-v2.md +43 -0
  877. package/skills/sauce-protocols/references/registry/aave-v3.md +62 -0
  878. package/skills/sauce-protocols/references/registry/aave-v4.md +80 -0
  879. package/skills/sauce-protocols/references/registry/abracadabra.md +54 -0
  880. package/skills/sauce-protocols/references/registry/across.md +57 -0
  881. package/skills/sauce-protocols/references/registry/aerodrome-slipstream.md +72 -0
  882. package/skills/sauce-protocols/references/registry/aerodrome.md +58 -0
  883. package/skills/sauce-protocols/references/registry/aevo.md +39 -0
  884. package/skills/sauce-protocols/references/registry/alchemix.md +46 -0
  885. package/skills/sauce-protocols/references/registry/ambient.md +40 -0
  886. package/skills/sauce-protocols/references/registry/arbitrum-bridge.md +40 -0
  887. package/skills/sauce-protocols/references/registry/arrakis.md +49 -0
  888. package/skills/sauce-protocols/references/registry/axelar.md +65 -0
  889. package/skills/sauce-protocols/references/registry/balancer-v2.md +50 -0
  890. package/skills/sauce-protocols/references/registry/base-bridge.md +42 -0
  891. package/skills/sauce-protocols/references/registry/baseswap.md +40 -0
  892. package/skills/sauce-protocols/references/registry/beefy.md +51 -0
  893. package/skills/sauce-protocols/references/registry/benqi.md +49 -0
  894. package/skills/sauce-protocols/references/registry/camelot.md +82 -0
  895. package/skills/sauce-protocols/references/registry/cbeth.md +43 -0
  896. package/skills/sauce-protocols/references/registry/cctp.md +48 -0
  897. package/skills/sauce-protocols/references/registry/celer.md +44 -0
  898. package/skills/sauce-protocols/references/registry/chainlink-ccip.md +45 -0
  899. package/skills/sauce-protocols/references/registry/chainlink.md +49 -0
  900. package/skills/sauce-protocols/references/registry/circle-gateway.md +70 -0
  901. package/skills/sauce-protocols/references/registry/compound-v2.md +53 -0
  902. package/skills/sauce-protocols/references/registry/compound-v3.md +52 -0
  903. package/skills/sauce-protocols/references/registry/connext.md +41 -0
  904. package/skills/sauce-protocols/references/registry/convex.md +51 -0
  905. package/skills/sauce-protocols/references/registry/cowswap.md +40 -0
  906. package/skills/sauce-protocols/references/registry/crvusd.md +40 -0
  907. package/skills/sauce-protocols/references/registry/curve.md +81 -0
  908. package/skills/sauce-protocols/references/registry/debridge.md +59 -0
  909. package/skills/sauce-protocols/references/registry/dodo.md +39 -0
  910. package/skills/sauce-protocols/references/registry/eco-routes.md +65 -0
  911. package/skills/sauce-protocols/references/registry/eigenlayer.md +58 -0
  912. package/skills/sauce-protocols/references/registry/ens.md +49 -0
  913. package/skills/sauce-protocols/references/registry/erc20.md +44 -0
  914. package/skills/sauce-protocols/references/registry/erc3156.md +38 -0
  915. package/skills/sauce-protocols/references/registry/erc4626.md +51 -0
  916. package/skills/sauce-protocols/references/registry/ethena.md +50 -0
  917. package/skills/sauce-protocols/references/registry/etherfi.md +57 -0
  918. package/skills/sauce-protocols/references/registry/euler-v2.md +49 -0
  919. package/skills/sauce-protocols/references/registry/fenix.md +39 -0
  920. package/skills/sauce-protocols/references/registry/fluid.md +48 -0
  921. package/skills/sauce-protocols/references/registry/frax-ether.md +49 -0
  922. package/skills/sauce-protocols/references/registry/frax.md +40 -0
  923. package/skills/sauce-protocols/references/registry/gains-network.md +43 -0
  924. package/skills/sauce-protocols/references/registry/gamma.md +56 -0
  925. package/skills/sauce-protocols/references/registry/gelato.md +45 -0
  926. package/skills/sauce-protocols/references/registry/gho.md +40 -0
  927. package/skills/sauce-protocols/references/registry/gmx-v1.md +59 -0
  928. package/skills/sauce-protocols/references/registry/gmx-v2.md +41 -0
  929. package/skills/sauce-protocols/references/registry/harvest.md +44 -0
  930. package/skills/sauce-protocols/references/registry/hegic.md +39 -0
  931. package/skills/sauce-protocols/references/registry/hop.md +49 -0
  932. package/skills/sauce-protocols/references/registry/hyperlane.md +48 -0
  933. package/skills/sauce-protocols/references/registry/instadapp.md +39 -0
  934. package/skills/sauce-protocols/references/registry/kelp.md +47 -0
  935. package/skills/sauce-protocols/references/registry/kim.md +39 -0
  936. package/skills/sauce-protocols/references/registry/kyberswap-aggregator.md +49 -0
  937. package/skills/sauce-protocols/references/registry/kyberswap.md +63 -0
  938. package/skills/sauce-protocols/references/registry/layerbank.md +54 -0
  939. package/skills/sauce-protocols/references/registry/layerzero.md +49 -0
  940. package/skills/sauce-protocols/references/registry/level-finance.md +41 -0
  941. package/skills/sauce-protocols/references/registry/lido.md +51 -0
  942. package/skills/sauce-protocols/references/registry/lifi.md +48 -0
  943. package/skills/sauce-protocols/references/registry/linea-bridge.md +40 -0
  944. package/skills/sauce-protocols/references/registry/liquity-v1.md +42 -0
  945. package/skills/sauce-protocols/references/registry/liquity-v2.md +40 -0
  946. package/skills/sauce-protocols/references/registry/lynex.md +39 -0
  947. package/skills/sauce-protocols/references/registry/maker.md +55 -0
  948. package/skills/sauce-protocols/references/registry/mantle-meth.md +48 -0
  949. package/skills/sauce-protocols/references/registry/maverick.md +60 -0
  950. package/skills/sauce-protocols/references/registry/moonwell.md +49 -0
  951. package/skills/sauce-protocols/references/registry/morpho-blue.md +47 -0
  952. package/skills/sauce-protocols/references/registry/mux-protocol.md +49 -0
  953. package/skills/sauce-protocols/references/registry/olympus.md +42 -0
  954. package/skills/sauce-protocols/references/registry/oneinch.md +45 -0
  955. package/skills/sauce-protocols/references/registry/openocean.md +44 -0
  956. package/skills/sauce-protocols/references/registry/optimism-bridge.md +42 -0
  957. package/skills/sauce-protocols/references/registry/opyn.md +42 -0
  958. package/skills/sauce-protocols/references/registry/pancakeswap-v2.md +71 -0
  959. package/skills/sauce-protocols/references/registry/pancakeswap-v3.md +76 -0
  960. package/skills/sauce-protocols/references/registry/paraswap.md +51 -0
  961. package/skills/sauce-protocols/references/registry/pendle.md +43 -0
  962. package/skills/sauce-protocols/references/registry/permit2.md +50 -0
  963. package/skills/sauce-protocols/references/registry/perpetual-protocol.md +49 -0
  964. package/skills/sauce-protocols/references/registry/polygon-bridge.md +43 -0
  965. package/skills/sauce-protocols/references/registry/premia.md +40 -0
  966. package/skills/sauce-protocols/references/registry/puffer.md +43 -0
  967. package/skills/sauce-protocols/references/registry/pyth.md +40 -0
  968. package/skills/sauce-protocols/references/registry/quickswap.md +80 -0
  969. package/skills/sauce-protocols/references/registry/radiant.md +41 -0
  970. package/skills/sauce-protocols/references/registry/ramses.md +39 -0
  971. package/skills/sauce-protocols/references/registry/reflexer.md +56 -0
  972. package/skills/sauce-protocols/references/registry/renzo.md +47 -0
  973. package/skills/sauce-protocols/references/registry/rocket-pool.md +49 -0
  974. package/skills/sauce-protocols/references/registry/sablier.md +40 -0
  975. package/skills/sauce-protocols/references/registry/safe.md +47 -0
  976. package/skills/sauce-protocols/references/registry/scroll-bridge.md +48 -0
  977. package/skills/sauce-protocols/references/registry/seamless.md +42 -0
  978. package/skills/sauce-protocols/references/registry/seaport.md +44 -0
  979. package/skills/sauce-protocols/references/registry/silo.md +48 -0
  980. package/skills/sauce-protocols/references/registry/socket.md +44 -0
  981. package/skills/sauce-protocols/references/registry/sommelier.md +43 -0
  982. package/skills/sauce-protocols/references/registry/spark.md +42 -0
  983. package/skills/sauce-protocols/references/registry/spookyswap.md +40 -0
  984. package/skills/sauce-protocols/references/registry/squid.md +45 -0
  985. package/skills/sauce-protocols/references/registry/stader.md +47 -0
  986. package/skills/sauce-protocols/references/registry/stargate.md +45 -0
  987. package/skills/sauce-protocols/references/registry/superfluid.md +49 -0
  988. package/skills/sauce-protocols/references/registry/sushiswap-v2.md +71 -0
  989. package/skills/sauce-protocols/references/registry/swell.md +49 -0
  990. package/skills/sauce-protocols/references/registry/synapse.md +46 -0
  991. package/skills/sauce-protocols/references/registry/syncswap.md +38 -0
  992. package/skills/sauce-protocols/references/registry/synthetix-v3.md +48 -0
  993. package/skills/sauce-protocols/references/registry/synthra-v3.md +77 -0
  994. package/skills/sauce-protocols/references/registry/thales.md +51 -0
  995. package/skills/sauce-protocols/references/registry/thena.md +39 -0
  996. package/skills/sauce-protocols/references/registry/thruster.md +38 -0
  997. package/skills/sauce-protocols/references/registry/tokemak.md +45 -0
  998. package/skills/sauce-protocols/references/registry/trader-joe.md +66 -0
  999. package/skills/sauce-protocols/references/registry/uniswap-v2.md +77 -0
  1000. package/skills/sauce-protocols/references/registry/uniswap-v3.md +113 -0
  1001. package/skills/sauce-protocols/references/registry/uniswap-v4.md +117 -0
  1002. package/skills/sauce-protocols/references/registry/unitflow-v3.md +65 -0
  1003. package/skills/sauce-protocols/references/registry/velodrome.md +58 -0
  1004. package/skills/sauce-protocols/references/registry/venus.md +62 -0
  1005. package/skills/sauce-protocols/references/registry/vertex.md +46 -0
  1006. package/skills/sauce-protocols/references/registry/wormhole.md +59 -0
  1007. package/skills/sauce-protocols/references/registry/yearn-v3.md +46 -0
  1008. package/skills/sauce-protocols/references/registry/zerolend.md +41 -0
  1009. package/skills/sauce-protocols/references/registry/zerox.md +44 -0
  1010. package/skills/sauce-protocols/references/registry/zksync-bridge.md +40 -0
  1011. package/{sdk/src/skills → skills/sauce-protocols/references}/renzo.md +10 -24
  1012. package/{sdk/src/skills → skills/sauce-protocols/references}/rocket-pool.md +10 -26
  1013. package/{sdk/src/skills → skills/sauce-protocols/references}/sablier.md +10 -27
  1014. package/skills/sauce-protocols/references/safe.md +42 -0
  1015. package/{sdk/src/skills → skills/sauce-protocols/references}/scroll-bridge.md +11 -20
  1016. package/{sdk/src/skills → skills/sauce-protocols/references}/seamless.md +11 -16
  1017. package/skills/sauce-protocols/references/seaport.md +38 -0
  1018. package/{sdk/src/skills → skills/sauce-protocols/references}/silo.md +11 -20
  1019. package/{sdk/src/skills → skills/sauce-protocols/references}/socket.md +11 -18
  1020. package/skills/sauce-protocols/references/sommelier.md +40 -0
  1021. package/{sdk/src/skills → skills/sauce-protocols/references}/spark.md +11 -16
  1022. package/{sdk/src/skills → skills/sauce-protocols/references}/spookyswap.md +12 -19
  1023. package/{sdk/src/skills → skills/sauce-protocols/references}/squid.md +11 -21
  1024. package/skills/sauce-protocols/references/stader.md +39 -0
  1025. package/{sdk/src/skills → skills/sauce-protocols/references}/stargate.md +11 -22
  1026. package/{sdk/src/skills → skills/sauce-protocols/references}/superfluid.md +10 -28
  1027. package/{sdk/src/skills → skills/sauce-protocols/references}/sushiswap-v2.md +38 -43
  1028. package/skills/sauce-protocols/references/swell.md +49 -0
  1029. package/skills/sauce-protocols/references/synapse.md +54 -0
  1030. package/{sdk/src/skills → skills/sauce-protocols/references}/syncswap.md +12 -17
  1031. package/{sdk/src/skills → skills/sauce-protocols/references}/synthetix-v3.md +10 -29
  1032. package/skills/sauce-protocols/references/synthra-v3.md +63 -0
  1033. package/skills/sauce-protocols/references/thales.md +58 -0
  1034. package/{sdk/src/skills → skills/sauce-protocols/references}/thena.md +12 -18
  1035. package/{sdk/src/skills → skills/sauce-protocols/references}/thruster.md +13 -18
  1036. package/skills/sauce-protocols/references/tokemak.md +40 -0
  1037. package/{sdk/src/skills → skills/sauce-protocols/references}/trader-joe.md +13 -26
  1038. package/{sdk/src/skills → skills/sauce-protocols/references}/uniswap-v2.md +46 -44
  1039. package/skills/sauce-protocols/references/uniswap-v3.md +188 -0
  1040. package/skills/sauce-protocols/references/uniswap-v4.md +155 -0
  1041. package/skills/sauce-protocols/references/unitflow-v3.md +63 -0
  1042. package/{sdk/src/skills → skills/sauce-protocols/references}/velodrome.md +12 -24
  1043. package/{sdk/src/skills → skills/sauce-protocols/references}/venus.md +12 -31
  1044. package/skills/sauce-protocols/references/vertex.md +42 -0
  1045. package/skills/sauce-protocols/references/wormhole.md +57 -0
  1046. package/{sdk/src/skills → skills/sauce-protocols/references}/yearn-v3.md +10 -25
  1047. package/{sdk/src/skills → skills/sauce-protocols/references}/zerolend.md +11 -15
  1048. package/skills/sauce-protocols/references/zerox.md +39 -0
  1049. package/{sdk/src/skills → skills/sauce-protocols/references}/zksync-bridge.md +11 -14
  1050. package/skills/sauce-script/SKILL.md +407 -0
  1051. package/skills/sauce-script/examples/IOracle.json +12 -0
  1052. package/skills/sauce-script/examples/saucescript.mts +167 -0
  1053. package/skills/sauce-script/examples/twap.sauce.ts +29 -0
  1054. package/skills/sauce-script/references/builtins.json +823 -0
  1055. package/skills/sauce-script/references/builtins.md +674 -0
  1056. package/skills/sauce-solana/SKILL.md +324 -0
  1057. package/skills/sauce-solana/examples/solana.mts +166 -0
  1058. package/skills/sauce-solana/examples/solana.sauce.ts +45 -0
  1059. package/skills/sauce-solana/examples/token-2022.sauce.ts +38 -0
  1060. package/skills/sauce-swaps/SKILL.md +200 -0
  1061. package/skills/sauce-swaps/examples/swap-leg.sauce.ts +50 -0
  1062. package/skills/sauce-swaps/examples/swaps.mts +124 -0
  1063. package/skills/sauce-typescript/SKILL.md +178 -0
  1064. package/skills/sauce-typescript/examples/actions.mts +100 -0
  1065. package/skills/sauce-typescript/examples/compiler.mts +69 -0
  1066. package/skills/sauce-typescript/examples/cook.mts +65 -0
  1067. package/skills/sauce-typescript/examples/verify.mts +104 -0
  1068. package/dev-tools/README.md +0 -16
  1069. package/dev-tools/artifacts/IERC20.json +0 -1
  1070. package/dev-tools/artifacts/ISauceRouter.json +0 -1
  1071. package/dev-tools/artifacts/IUniswapV3Pool.json +0 -1
  1072. package/dev-tools/artifacts/Router.json +0 -1
  1073. package/dev-tools/hardhat.config.cjs +0 -18
  1074. package/dev-tools/sauce/js/add.js +0 -4
  1075. package/dev-tools/sauce/js/call.js +0 -8
  1076. package/dev-tools/sauce/js/erc20.js +0 -18
  1077. package/dev-tools/sauce/js/example.js +0 -6
  1078. package/dev-tools/sauce/js/fibonacci.js +0 -13
  1079. package/dev-tools/sauce/ts/add.ts +0 -4
  1080. package/dev-tools/sauce/ts/call.ts +0 -8
  1081. package/dev-tools/sauce/ts/erc20.ts +0 -18
  1082. package/dev-tools/sauce/ts/example.ts +0 -6
  1083. package/dev-tools/sauce/ts/fibonacci.ts +0 -13
  1084. package/dev-tools/sauce/ts/saucescript.d.ts +0 -1
  1085. package/dev-tools/sauce/ts/tsconfig.json +0 -12
  1086. package/dev-tools/scripts/deploy.ts +0 -107
  1087. package/dev-tools/scripts/init.js +0 -132
  1088. package/dev-tools/scripts/run.ts +0 -67
  1089. package/dev-tools/scripts/start-fork.sh +0 -92
  1090. package/dev-tools/scripts/start-local.sh +0 -120
  1091. package/dev-tools/scripts/stop-local.sh +0 -40
  1092. package/dev-tools/scripts/sync-artifacts.js +0 -46
  1093. package/dev-tools/scripts/sync-price.ts +0 -58
  1094. package/dev-tools/src/contracts.ts +0 -59
  1095. package/dev-tools/src/runner.ts +0 -355
  1096. package/dev-tools/src/svm-local.ts +0 -305
  1097. package/dev-tools/src/sync-price.ts +0 -217
  1098. package/sdk/dist/deployments/v12.generated.d.ts +0 -95
  1099. package/sdk/dist/deployments/v12.generated.d.ts.map +0 -1
  1100. package/sdk/dist/deployments/v12.generated.js +0 -50
  1101. package/sdk/dist/deployments/v12.generated.js.map +0 -1
  1102. package/sdk/dist/swap/index.d.ts +0 -29
  1103. package/sdk/dist/swap/index.d.ts.map +0 -1
  1104. package/sdk/dist/swap/index.js +0 -27
  1105. package/sdk/dist/swap/index.js.map +0 -1
  1106. package/sdk/dist/swap/params.d.ts +0 -29
  1107. package/sdk/dist/swap/params.d.ts.map +0 -1
  1108. package/sdk/dist/swap/params.js +0 -123
  1109. package/sdk/dist/swap/params.js.map +0 -1
  1110. package/sdk/dist/swap/source.d.ts +0 -30
  1111. package/sdk/dist/swap/source.d.ts.map +0 -1
  1112. package/sdk/dist/swap/source.js +0 -101
  1113. package/sdk/dist/swap/source.js.map +0 -1
  1114. package/sdk/dist/swap/types.d.ts +0 -160
  1115. package/sdk/dist/swap/types.d.ts.map +0 -1
  1116. package/sdk/dist/swap/types.js +0 -106
  1117. package/sdk/dist/swap/types.js.map +0 -1
  1118. package/sdk/src/skills/aave-v3.md +0 -134
  1119. package/sdk/src/skills/aave-v4.md +0 -91
  1120. package/sdk/src/skills/abracadabra.md +0 -93
  1121. package/sdk/src/skills/across.md +0 -90
  1122. package/sdk/src/skills/aerodrome-slipstream.md +0 -57
  1123. package/sdk/src/skills/aevo.md +0 -58
  1124. package/sdk/src/skills/axelar.md +0 -80
  1125. package/sdk/src/skills/chainlink.md +0 -62
  1126. package/sdk/src/skills/curve.md +0 -141
  1127. package/sdk/src/skills/eigenlayer.md +0 -71
  1128. package/sdk/src/skills/gamma.md +0 -79
  1129. package/sdk/src/skills/harvest.md +0 -49
  1130. package/sdk/src/skills/index.md +0 -299
  1131. package/sdk/src/skills/kelp.md +0 -60
  1132. package/sdk/src/skills/kyberswap.md +0 -100
  1133. package/sdk/src/skills/loader.ts +0 -46
  1134. package/sdk/src/skills/maker.md +0 -79
  1135. package/sdk/src/skills/mantle-meth.md +0 -60
  1136. package/sdk/src/skills/olympus.md +0 -46
  1137. package/sdk/src/skills/oneinch.md +0 -64
  1138. package/sdk/src/skills/openocean.md +0 -86
  1139. package/sdk/src/skills/pancakeswap-v3.md +0 -104
  1140. package/sdk/src/skills/paraswap.md +0 -67
  1141. package/sdk/src/skills/permit2.md +0 -73
  1142. package/sdk/src/skills/perpetual-protocol.md +0 -73
  1143. package/sdk/src/skills/pyth.md +0 -58
  1144. package/sdk/src/skills/reflexer.md +0 -73
  1145. package/sdk/src/skills/safe.md +0 -56
  1146. package/sdk/src/skills/seaport.md +0 -65
  1147. package/sdk/src/skills/sommelier.md +0 -47
  1148. package/sdk/src/skills/stader.md +0 -53
  1149. package/sdk/src/skills/swell.md +0 -65
  1150. package/sdk/src/skills/synapse.md +0 -63
  1151. package/sdk/src/skills/synthra-v3.md +0 -57
  1152. package/sdk/src/skills/thales.md +0 -74
  1153. package/sdk/src/skills/tokemak.md +0 -48
  1154. package/sdk/src/skills/uniswap-v3.md +0 -202
  1155. package/sdk/src/skills/uniswap-v4.md +0 -125
  1156. package/sdk/src/skills/unitflow-v3.md +0 -62
  1157. package/sdk/src/skills/vertex.md +0 -55
  1158. package/sdk/src/skills/wormhole.md +0 -76
  1159. package/sdk/src/skills/zerox.md +0 -51
@@ -0,0 +1,1446 @@
1
+ # The sauce command
2
+
3
+ [Documentation](../README.md) · [Compiling programs](compiling.md) · [Create an intent](intents.md)
4
+
5
+ `@eco-incorp/sauce` installs a `sauce` command. It compiles a program file exactly as the SDK
6
+ compiles a route body, deploys the Pot the program runs on, rehearses the cook, signs it, sends it
7
+ and waits for it — on an EVM chain or on Solana — and takes transactions and programs back apart
8
+ afterwards. It needs no other tool. It reads no environment variables and reaches a network only
9
+ through an endpoint you name on the command line.
10
+
11
+ | Command | What it does |
12
+ | ---------------- | --------------------------------------------------------------------------------- |
13
+ | `sauce compile` | Compile a program file; print its bytecode, or with `--json` what it takes |
14
+ | `sauce actions` | Lower a JSON actions document for a chain; print the SauceScript and its bytecode |
15
+ | `sauce simulate` | Rehearse the cook with no key, no deployed Pot and assumed balances: what it did |
16
+ | `sauce run` | Compile, sign, send and wait for the cook on your Pot |
17
+ | `sauce intent` | Publish, fill, prove, claim, refund and cancel cross-chain intents |
18
+ | `sauce tx` | Print the unsigned cook transaction, for a wallet to sign |
19
+ | `sauce pot` | Predict a Pot's address, and deploy it or print the transaction that does |
20
+ | `sauce globals` | List the tokens, protocols and other names a program on a chain can use |
21
+ | `sauce price` | Turn a price into a pool's `sqrtPriceX96`, a swap's limit and average-price floor |
22
+ | `sauce pools` | List a pair's price-limit pools on a chain, deepest first, with their prices |
23
+ | `sauce inspect` | Take a cook, a Kitchen or Portal call, a program or a file apart |
24
+ | `sauce verify` | Check that a payload, cook, intent or transaction runs the audited settle program |
25
+ | `sauce init` | Scaffold a project that uses this package |
26
+ | `sauce skills` | Install, update or check this package's agent skills in a project |
27
+
28
+ Every command takes `--help`. A mistyped invocation exits 2. A program that does not compile, a
29
+ cook that reverts, a rejected settle, an outdated skills install and a transaction on a
30
+ [preview chain](#supported-and-preview-chains) exit 1. For the initial release, transactions are
31
+ built and sent on Ethereum, Base and Solana only.
32
+
33
+ ## Install
34
+
35
+ ```sh
36
+ npm install @eco-incorp/sauce
37
+ npx sauce --help
38
+ ```
39
+
40
+ Node.js 24 or newer. To start a new project instead, let the command scaffold it:
41
+
42
+ ```sh
43
+ npx @eco-incorp/sauce init my-app
44
+ cd my-app
45
+ npm install
46
+ ```
47
+
48
+ `sauce init` writes a `package.json` that pins `@eco-incorp/sauce` to exactly the version that ran
49
+ it, an `AGENTS.md` with the project's instructions for coding agents, a `.gitignore` that keeps
50
+ local configuration out of git, `sauce.config.example.json`, and `programs/tsconfig.json`
51
+ ([In an editor](#in-an-editor)), and then installs the agent skills ([Agent skills](#agent-skills)). `init` refuses to overwrite a file that already has other content,
52
+ and lists it, unless you pass `--force`. It runs no package manager unless you pass `--install`.
53
+
54
+ ## Endpoints and signers
55
+
56
+ Nothing reaches a network without one of these:
57
+
58
+ - `--rpc-url <url>`, the chain's endpoint; or
59
+ - `--config <file>`, a JSON file of endpoints by chain id, used for whichever chain the command is
60
+ for:
61
+
62
+ ```json
63
+ { "rpcUrls": { "1": "https://…", "8453": "https://…", "1399811149": "https://…" } }
64
+ ```
65
+
66
+ `sauce init` writes `sauce.config.example.json` with `<…>` placeholders; copy it to
67
+ `sauce.config.json`, which its `.gitignore` keeps out of git. A placeholder left in is refused.
68
+
69
+ The command checks that an EVM endpoint serves the chain you named. It never prints the URL: a
70
+ provider URL often carries a key.
71
+
72
+ Nothing is signed without one of these, and the signer is always the Pot's owner (on Solana with
73
+ `--via engine`, which uses no Pot, the signer is the program's authority):
74
+
75
+ - `--wallet <name>`: a wallet `sauce wallet` keeps, EVM or Solana ([Agent wallets](#agent-wallets)).
76
+ - `--keystore <path>`: a JSON keystore (Web3 Secret Storage v3, scrypt or PBKDF2, as `cast wallet`
77
+ and geth write).
78
+ - `--private-key <hex>`: works, with a warning: it lands in your shell history.
79
+ - `--keypair <path>`, on Solana: a keypair file, the JSON array of 64 bytes `solana-keygen` writes.
80
+
81
+ A wallet's or a keystore's password comes from one source you name, or else it is asked for at the
82
+ terminal without echo:
83
+
84
+ - `--password-env <NAME>`: the environment variable NAME, and no other.
85
+ - `--password-file <path>`: the file's text, one trailing newline dropped. A file that anyone but
86
+ you can read or write is refused: `chmod 600` it.
87
+ - `--password-command "<command>"`: what the command prints, one trailing newline dropped. A secret
88
+ manager's CLI (`pass show sauce`, `op read op://…`) fits. It runs with no stdin, and if it fails,
89
+ the error gives its exit status and never its output.
90
+
91
+ There is no `--password <value>`: a value on the command line lands in shell history and the
92
+ process list. `--password-env` is the command's one read of the environment, and only of the
93
+ variable you name. Keys are read from the paths and wallets named only, never from the config file,
94
+ and no command prints one or a password: everything a command writes passes through a filter that
95
+ removes any secret it was given, error messages included.
96
+
97
+ ## Supported and preview chains
98
+
99
+ For the initial release, the command builds and sends transactions on three chains: **Ethereum**,
100
+ **Base** and **Solana**. Every other chain it knows is a **preview chain**, where it compiles,
101
+ rehearses and reads but builds no transaction ([Supported chains](../README.md#supported-chains)).
102
+
103
+ | On a preview chain | Does |
104
+ | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
105
+ | `compile`, `actions`, `simulate`, `globals`, `price`, `pools`, `inspect`, `verify`, `intent status`, `intent import`, `intent list` | What it does everywhere |
106
+ | `intent publish --dry-run`, `intent fill` without `--send` | Rehearses, sending nothing |
107
+ | `pot` | Predicts the Pot, and with an endpoint reads it, but leaves the deployment out |
108
+ | `tx`, `run`, `pot --deploy`, `pot --format cast` | Refused |
109
+ | `intent publish`, also with `--format`; `intent fill --send`; `intent prove`, `claim`, `refund`, `cancel` | Refused |
110
+
111
+ The refusal comes before the command reaches an endpoint or reads a key. A cook or a publish is
112
+ refused when any chain it involves is a preview chain: the program's own, and the destination of
113
+ every intent it opens (a cascade's later levels, opened inside an intent's body, are not checked:
114
+ keep them on supported chains). A step after publishing is refused by the chain its
115
+ transaction is sent on — a fill, a proof or a cancellation by the intent's destination, a claim or
116
+ a refund by its source. The command exits 1 and says why, which chains are supported, and how to ask
117
+ for the one it refused:
118
+
119
+ ```text
120
+ sauce tx: building the cook transaction is refused: it involves optimism (Optimism, chain id 10), a preview chain. For the initial release, the sauce command and its MCP server build and send transactions only on Ethereum, Base and Solana. On a preview chain a program still compiles, and simulate and dry runs rehearse it.
121
+ To ask for Optimism: add your use case to its request if there is one (https://github.com/eco-incorp/sauce/issues?q=is%3Aissue+label%3Achain-support+%22Optimism%22), or open one (https://github.com/eco-incorp/sauce/issues/new?template=chain-support.yml&title=Chain+support%3A+Optimism+%2810%29&chain=Optimism&chain-id=10).
122
+ ```
123
+
124
+ The first link searches the chain-support requests already filed for that chain; the second opens
125
+ a new one from the issue form, its title (`Chain support: <name> (<id>)`), chain and chain id
126
+ filled in. The form also asks what you want to run there, the protocols and tokens it needs, the
127
+ volume you expect and from when, and, optionally, how to reach you. If a request for the chain
128
+ exists, add your use case to it as a comment instead of opening another.
129
+
130
+ `sauce pot` on a preview chain prints the Pot's address, owner, salt and Kitchen with no `to`,
131
+ `data` or `value`, and adds `refused` to its JSON — the same refusal as an object: `code`
132
+ (`"preview-chain"`), `action`, `message`, `supportedChains` and `previewChains`, each with its
133
+ `request`. `sauce --help` and the `--help` of every refused command say the same. There is no flag
134
+ that lifts the refusal. The TypeScript SDK is not gated: its builders still build transactions for
135
+ every registry chain, at your own risk.
136
+
137
+ ## The flow on an EVM chain
138
+
139
+ A program runs as a **Pot**: a contract you own that holds what the program spends and calls
140
+ `cook(engine, program)` on the released engine. `cook` is `onlyOwner`, and pays the Kitchen's
141
+ execution fee as its value.
142
+
143
+ ```sh
144
+ # 1. The names a program on Base can use: tokens, protocol contracts, functions.
145
+ npx sauce globals --chain base
146
+
147
+ # 2. Check that the program compiles.
148
+ npx sauce compile pay.sauce.ts --chain base --define RECIPIENT=0x… --define AMOUNT=1000000
149
+
150
+ # 3. Deploy your Pot (once). Its address is known before it exists.
151
+ npx sauce pot --deploy --chain base --config sauce.config.json --keystore ~/.keys/me.json
152
+
153
+ # 4. Fund the Pot with what the program spends: send its address the tokens, from any wallet —
154
+ # or let `sauce run --fund` pull them in with the cook (see "Funding a run" below).
155
+
156
+ # 5. Rehearse the cook from the Pot's owner: no key, nothing sent. It can come first: a Pot not
157
+ # deployed yet is deployed in the rehearsal, and --assume-balance gives it what it spends.
158
+ npx sauce simulate pay.sauce.ts --chain base --owner 0xYou --config sauce.config.json \
159
+ --assume-balance USDC:1 --assume-balance USDT:1 --define RECIPIENT=0x… --define AMOUNT=1000000
160
+
161
+ # 6. Run it.
162
+ npx sauce run pay.sauce.ts --chain base --config sauce.config.json --keystore ~/.keys/me.json \
163
+ --define RECIPIENT=0x… --define AMOUNT=1000000
164
+ ```
165
+
166
+ `sauce run` compiles, rehearses the cook, signs it, sends it and waits for the receipt, then prints
167
+ the hash, the status and the gas used, what the cook cost, and what it moved:
168
+
169
+ ```text
170
+ cook 0x5f…: success, gas used 184211, block 21004500
171
+ cost 0.000187 ETH: gas 184211 at 1000000 wei = 0.000184 ETH, L1 data 0.0000018 ETH, value 0.000001 ETH (the Kitchen's fee and any native the program spends)
172
+ Token transfers:
173
+ 1 USDC: 0x8a… (the Pot) -> 0x66…
174
+ Net balance changes:
175
+ 0x8a… (the Pot): -1 USDC
176
+ 0x66…: +1 USDC
177
+ ```
178
+
179
+ The cost is the gas at the price the receipt records, an OP-stack chain's L1 data fee where the
180
+ receipt carries one, and the value the cook carried. What moved is read from the receipt's logs by
181
+ the decoder `simulate` uses: token transfers, approvals and each address's net change. `--json`
182
+ carries both under `cook.cost` and `cook.effects`.
183
+
184
+ A cook that would revert is not sent: the run stops with the decoded reason — a Pot or Kitchen
185
+ error by name, `Error(string)`, or `the program threw "…"` for a SauceScript `throw` — and exits 1.
186
+ The value defaults to the Kitchen's execution fee, read from the chain; pass `--value <wei>` when
187
+ the program also spends native currency (a `--value` below the fee is refused, since the cook would
188
+ revert).
189
+
190
+ If the Pot is not deployed yet, `run` asks first:
191
+
192
+ ```text
193
+ Pot 0x8a… (owner 0xYou, salt 0x00…00) is not deployed on base. Deploy it now? [y/N]
194
+ ```
195
+
196
+ `y` deploys it in a transaction of its own and then cooks; anything else sends nothing.
197
+
198
+ Every transaction a run sends before its cook is asked about like this: deploying a missing Pot (on
199
+ Solana, creating it), approving Permit2 for a token `--fund` pulls, and approving the Pot for an
200
+ amount under `--fund-mode allowance`. `--auto-approve` approves each of them without asking and
201
+ says so for each, as `auto-approved: deploy Pot 0x…` or `auto-approved: approve Permit2 for USDC`.
202
+ With no terminal to ask on (CI, a pipe), the run sends nothing: it names every action it would need
203
+ approved and stops, until it is given `--auto-approve`.
204
+
205
+ ### A program from stdin
206
+
207
+ Any command that takes a program file takes `-` for one read from stdin, and so does every command
208
+ that takes an [actions document](#an-actions-document-instead-of-a-program):
209
+
210
+ ```sh
211
+ cat pay.sauce.ts | npx sauce compile - --chain base --define RECIPIENT=0x… --define AMOUNT=1
212
+ npx sauce inspect - --chain base < cook.hex
213
+ ```
214
+
215
+ Stdin is read only when the file is `-`, never because a file is missing: a command whose stdin is
216
+ held open (an agent's shell, a CI step) would otherwise wait on it forever. `inspect -` reads hex, a
217
+ transaction hash or a program, whichever stdin carries, and `inspect --source -` the program.
218
+
219
+ A program from stdin has no directory of its own, so its relative imports
220
+ (`import { fee } from "./lib/fee.js"`) resolve against the current directory, or the one
221
+ `--source-dir <dir>` names; a compile error from one says so. The package's own modules — the
222
+ `./artifacts/*.json` and `./protocols/*` ABIs, `@sauce/token` — resolve as they always do.
223
+
224
+ Stdin carried the program, so it cannot answer questions too. They go to the terminal the command
225
+ runs in (`/dev/tty`) when there is one, so a program piped in at a terminal is still asked about.
226
+ With no terminal at all — or on Windows, which has no `/dev/tty` — a run sends nothing until
227
+ `--auto-approve` approves what it needs, and a keystore needs `--password-file`. Neither ever waits
228
+ on a stdin that is spent.
229
+
230
+ ### Rehearsing: `sauce simulate`
231
+
232
+ `sauce simulate` runs the cook as a rehearsal from the Pot's owner: no key, no transaction, and
233
+ nothing on chain changes. It needs neither a deployed Pot nor the tokens the program spends:
234
+
235
+ ```sh
236
+ npx sauce simulate pay.sauce.ts --chain base --owner 0xYou --config sauce.config.json \
237
+ --assume-balance USDC:2 --assume-balance USDT:2 --define RECIPIENT=0x… --define AMOUNT=1000000
238
+ ```
239
+
240
+ The owner is `--owner`, or the owner's key: `--keystore` (or `--private-key`; on Solana,
241
+ `--keypair`) names it, and signs nothing but the pulls `--fund` rehearses.
242
+
243
+ - **A Pot that is not deployed** is deployed in the rehearsal first. Anyone may send a Pot's
244
+ `Kitchen.deployPot(owner, salt)`, and the Pot is the owner's whoever sends it, so the rehearsal
245
+ sends it ahead of the cook. Name such a Pot by `--owner` (and `--salt`): a `--pot` address alone
246
+ does not say whose it is.
247
+ - **`--assume-balance <TOKEN|address>:<amount>`**, repeatable, with the amount as `--fund` takes
248
+ it, gives the Pot that balance for this rehearsal only, by state override. `ETH:<amount>` sets
249
+ the Pot's native balance. A token keeps balances in its own storage (a proxy's, behind one), and
250
+ the command finds the word with `eth_call` and state overrides alone — Solidity mappings at slots
251
+ 0–255, Vyper's at 0–31, OpenZeppelin's namespaced ERC-20 and Solady's — then confirms it with
252
+ `balanceOf`. A token whose balance is computed rather than stored (rebasing, shares) is refused.
253
+ - **The cook's value**: an owner holding less than it (the Kitchen's fee, plus whatever `--value`
254
+ or `--fund ETH:` adds) is given it for the rehearsal, and told.
255
+ - **`--fund`**: with the owner's key the rehearsal includes the signed pulls (see
256
+ [Funding a run](#funding-a-run---fund)). With no key the pulls cannot be signed, so the Pot is
257
+ credited what they would bring — its balance plus each amount, or the amount on top of an
258
+ `--assume-balance` of the same token — `--sweep` still runs, and a shortfall in your wallet is
259
+ reported rather than refused.
260
+
261
+ It rehearses through `eth_simulateV1` where the endpoint serves it: one simulated block holding
262
+ the deployment and the cook, state carried from one to the next, with the cook's logs. Everything
263
+ it reads first (the Pot, the Kitchen's fee, the balances it assumes) and the rehearsal itself run on
264
+ one block: the latest when the command starts, or the one `--block <number | latest | safe |
265
+ finalized>` names, so a limit computed from a quote can be rehearsed on the state the quote saw. The
266
+ `Rehearsed with …` line, and `block` in `--json`, say which. On success it prints the gas used and
267
+ what the program returned — read as the type `main` declares, where it declares one (`main returns
268
+ Address: 0xd0b5…`, an array as its elements, a record as its fields; `returnType` and `returned`
269
+ in `--json`) — then what the cook did:
270
+
271
+ ```text
272
+ The cook succeeds from 0xYou: gas used 128999, returns 0x
273
+ Rehearsed with eth_simulateV1 on the state of block 36120411; nothing was signed or sent:
274
+ 1. Kitchen.deployPot(0xYou, 0x00…00): Pot 0x8a… is not deployed on base yet. Any account may send this; the Pot is the owner's either way.
275
+ 2. the cook, from the owner 0xYou
276
+ Assumed for this rehearsal only, by state override:
277
+ the Pot holds 2 USDC: --assume-balance (its balance word 0x1d39…: Solidity mapping at slot 9)
278
+ the owner holds 0.00000374478538635 ETH: the cook's value; it holds 0, and a real cook needs the value and gas
279
+ Token transfers:
280
+ 1 USDC: 0x8a… (the Pot) -> 0x66…
281
+ 1 USDT: 0x8a… (the Pot) -> 0x66…
282
+ Native transfers:
283
+ 0.00000374478538635 ETH: 0xYou (owner) -> 0x8a… (the Pot)
284
+ 0.00000374478538635 ETH: 0x8a… (the Pot) -> 0x1984… (Kitchen)
285
+ Net balance changes:
286
+ 0x8a… (the Pot): -1 USDC, -1 USDT
287
+ 0x66…: +1 USDC, +1 USDT
288
+ 0xYou (owner): -0.00000374478538635 ETH
289
+ 0x1984… (Kitchen): +0.00000374478538635 ETH
290
+ ```
291
+
292
+ ERC-20 `Transfer` and `Approval` logs are decoded with the registry's symbols and whole units (a
293
+ token the registry does not record is named by its own `symbol()` and `decimals()`), native
294
+ transfers come from the node's `traceTransfers`, wrapping and unwrapping the wrapped native token
295
+ count as moves, and every other log is counted, and listed in full under `--json`. Addresses the
296
+ registry records are named, as are the Pot, its owner and the Kitchen.
297
+
298
+ An endpoint without `eth_simulateV1` falls back to `eth_call` with state overrides. A Pot that is
299
+ not deployed is then put in place as its deployment would leave it: an `eth_call` creation runs
300
+ the real `Kitchen.deployPot` and returns the Pot's code, and the cook runs from the owner against
301
+ that code, set at the Pot's address by override with its Router's storage word and a new
302
+ contract's nonce. That route reports the result and an estimated gas but no logs, so not what
303
+ moved. The `Rehearsed with …` line names the route taken, and why it fell back.
304
+
305
+ A revert prints `The cook reverts: <reason>` (or `Deploying the Pot reverts: …`) and exits 1: a
306
+ Pot, Kitchen, Router, Permit2 or Portal error by name, ERC-20's standard errors, `Error(string)`, or
307
+ `the program threw "…"` for a SauceScript `throw` or `require` message. A pool's short revert string
308
+ says what the check is: `"SPL" (a V3-style pool's price-limit check: the limit is on the wrong side
309
+ of the pool's current price, or at or past a bound …)`, and likewise `AS`, `LOK`, `IIA`, `TF`, the
310
+ token helpers' `STF`, `ST`, `SA`, `STE`, and a V2-style pair's `UniswapV2: K` (or any fork's). A
311
+ define or argument named like a price limit (`SQRT_PRICE_LIMIT_X96`) at or past `MIN_SQRT_RATIO` or
312
+ `MAX_SQRT_RATIO` is named on stderr before the rehearsal, by `compile` and `publish` too. `--json`
313
+ carries the same as fields: `block`, `path`, `fallback`, `deployPot`, `assumed`, `gas` and
314
+ `gasKind` (`used` or `estimated`), `returns`, `returnType` and `returned`, `transfers`,
315
+ `approvals`, `nativeTransfers`, `balanceChanges` and `otherLogs`, amounts as decimal strings in
316
+ base units with `formatted` whole units beside them — or `stage` and `reason` for a revert.
317
+
318
+ ### Funding a run: `--fund`
319
+
320
+ A program spends what its Pot holds. Instead of sending the Pot tokens first, `sauce run` can pull
321
+ them from your wallet in the same transaction as the cook:
322
+
323
+ ```sh
324
+ npx sauce run pay.sauce.ts --chain base --config sauce.config.json --keystore ~/.keys/me.json \
325
+ --fund USDC:1.5 --sweep --define RECIPIENT=0x… --define AMOUNT=1000000
326
+ ```
327
+
328
+ `--fund <TOKEN|address>:<amount>` names a token the chain registers (`sauce globals --tokens`) or
329
+ any ERC-20 by address, and an amount in whole units — `USDC:1.5`, by the registry's decimals or
330
+ the token's own — or in base units ending in `n`, as SauceScript writes an integer:
331
+ `USDC:1500000n`. Repeat it for more tokens. `ETH:<amount>` (or `native:`) is the chain's native
332
+ currency: it rides as the cook's value, on top of the Kitchen's fee.
333
+
334
+ The command wraps the program: a new `main`, with the same parameters, first pulls each amount from
335
+ you into the Pot, then calls the program's own `main` with the arguments as given, then, with
336
+ `--sweep`, sends the Pot's whole balance of each funded token (and of the native currency, when
337
+ `ETH` is funded) back to you. A script gets the pulls after its imports and the sweep after its
338
+ last statement. It is one cook, so the pulls, the program and the sweep succeed or
339
+ revert together. The pulls are `@sauce/token`'s, the same functions a program can call itself
340
+ ([Pulling tokens in](protocols-and-tokens.md#pulling-tokens-in)). Your balance of each token is
341
+ checked before anything is sent.
342
+
343
+ `--fund-mode` chooses how the Pot is allowed to pull:
344
+
345
+ | Mode | You sign or send | What stands afterwards |
346
+ | ------------------- | -------------------------------------------------------------- | --------------------------------------------- |
347
+ | `permit2` (default) | A Permit2 signature for exactly this amount, to this Pot, once | Nothing for the Pot; your approval of Permit2 |
348
+ | `permit` | The token's own EIP-2612 `permit` signature, for the Pot | Nothing: the pull spends it |
349
+ | `allowance` | An `approve` of the Pot for the amount, in a transaction first | The Pot's allowance, until a cook spends it |
350
+ | `transfer` | A plain `transfer` to the Pot, in a transaction first | Nothing |
351
+
352
+ **Why `permit2` is the default.** It works for every ERC-20, USDT included, where `permit` needs a
353
+ token that implements EIP-2612. It gives the Pot no allowance at all: each signature is for one
354
+ amount, to one spender, with a fresh nonce Permit2 spends and a deadline ten minutes out, so it
355
+ cannot be replayed or used late. And it is one transaction per run, the cook itself. Permit2 is
356
+ the canonical deployment the registry records (`sauce globals --protocols` lists it as
357
+ `Permit2.Permit2`).
358
+
359
+ The first time you fund a token through Permit2, Permit2 itself needs your approval for that token
360
+ — a standing approval, as Permit2 is meant to have; each spend still needs your signature. The run
361
+ asks, as it does before deploying a Pot:
362
+
363
+ ```text
364
+ Permit2 (0x000000000022D473030F116dDEE9F6B43aC78BA3) may move 0 of your USDC (base units), and this run needs 1500000. Approve Permit2 for USDC now? [y/N]
365
+ ```
366
+
367
+ `y` sends the approval (reset to zero first when a smaller one stands, as USDT requires) and then
368
+ the cook; anything else sends nothing. With no terminal to ask on, the run names it and sends
369
+ nothing, unless you pass `--auto-approve`. `--fund-mode allowance` asks the same about approving
370
+ the Pot, and warns when it leaves an
371
+ allowance standing. `permit` refuses a token whose `DOMAIN_SEPARATOR()` does not match its name,
372
+ version and address, before sending anything.
373
+
374
+ **Every pull is a `safeTransferFrom`.** In `permit` and `allowance` modes the program pulls with
375
+ `@sauce/token`'s `transferFrom`, which has OpenZeppelin `SafeERC20` semantics: a token that returns
376
+ nothing (USDT) is accepted, and one that returns `false` reverts the whole run. In `permit2` mode
377
+ Permit2's `permitTransferFrom` moves the tokens with Solmate's `SafeTransferLib.safeTransferFrom`,
378
+ with the same outcome for both kinds of token. The `permit` call itself is checked as OpenZeppelin's
379
+ `safePermit` checks it: the token's nonce for you must move by exactly one.
380
+
381
+ Security notes:
382
+
383
+ - Signatures are made locally, by the signer you gave, over EIP-712 data the command prints nothing
384
+ of; no key is ever printed. A Permit2 signature names the Pot as its spender, and only the Pot's
385
+ owner can cook on the Pot, so nobody else can use it.
386
+ - A revert inside Permit2 is reported by name: `SignatureExpired(…)` for a passed deadline,
387
+ `InvalidNonce()` for a nonce already spent.
388
+ - `allowance` mode's approval is its own transaction: if the cook then fails, the allowance stands
389
+ until a later cook spends it or you change it. `transfer` mode's transfer is likewise sent before
390
+ the cook, and the tokens stay in the Pot if the cook fails.
391
+
392
+ `sauce simulate --fund` rehearses the same wrapped cook, with nothing sent. The pulls carry your
393
+ signature, so give the owner's key (`--keystore` or `--private-key`) to sign them. Without a key
394
+ the Pot is credited what the pulls would bring instead, by state override
395
+ ([Rehearsing](#rehearsing-sauce-simulate)). An approval `run` would ask for is reported, not made,
396
+ and `transfer` mode's transfer is not rehearsed.
397
+
398
+ ### Pots and salts
399
+
400
+ An owner has one Pot per salt; the default salt is zero. Name another with `--salt <label>`, which
401
+ is `keccak256` of the label's UTF-8 bytes (the SDK's `potSalt(label)`), or give the exact 32 bytes
402
+ with `--salt-hex 0x…`. Use the same salt in every command for that Pot.
403
+
404
+ ```sh
405
+ npx sauce pot --chain base --owner 0xYou --salt treasury
406
+ ```
407
+
408
+ prints the Pot's address — CREATE2 from the Kitchen over the owner and salt — and the unsigned
409
+ `Kitchen.deployPot(owner, salt)` transaction as JSON. With `--deploy` and a signer it sends it,
410
+ unless the Pot is already there, and waits until the endpoint shows the Pot's code before saying it
411
+ is deployed: a load-balanced endpoint can answer from a node that has not seen the block yet. Any
412
+ account may deploy a Pot; it is its owner's either way. So `pot --deploy` takes `--owner` for
413
+ another owner's Pot, which the signer sends and pays for — how the Pot every intent to a chain
414
+ cooks on, owned by that chain's Portal Executor, is deployed — and defaults the owner to the
415
+ signer. On Solana the owner signs `create_pot`, so there the signer creates its own.
416
+
417
+ With a signer and no `--owner`, `sauce pot` is the signer's own Pot: `sauce pot --chain base
418
+ --keystore ~/.keys/me.json` prints your address and your Pot. A keystore that records its address
419
+ (most wallets write one) is read with no password; one that does not is unlocked to learn it.
420
+
421
+ Given an endpoint and no `--deploy`, `sauce pot` also reads the chain (or the Solana cluster) and
422
+ adds what it found under `deployment`, and in a line on stderr: whether the released engine and
423
+ Kitchen are there, the Kitchen's execution fee, and whether the Pot is deployed and whose it is.
424
+ `--deploy` refuses a chain with no Kitchen rather than send a `deployPot` to an address without
425
+ code, which would succeed and deploy nothing.
426
+
427
+ ```sh
428
+ npx sauce pot --chain base --owner 0xYou --config sauce.config.json
429
+ ```
430
+
431
+ `run` and `publish` act for the signer, so the owner is the signer: `--owner` may only restate it,
432
+ and one that names someone else is refused. `simulate`, `tx` and plain `pot` have no signer and
433
+ take `--owner` (or, for `simulate` and `tx`, `--pot <address>`, of a deployed Pot).
434
+
435
+ ### For a wallet: `sauce tx`
436
+
437
+ ```sh
438
+ npx sauce tx pay.sauce.ts --chain base --owner 0xYou --value 1000
439
+ ```
440
+
441
+ prints the cook unsigned, for any wallet to sign from the owner:
442
+
443
+ ```json
444
+ { "chainId": 8453, "to": "0x8a…", "data": "0x…", "value": "1000" }
445
+ ```
446
+
447
+ Give the value, or an endpoint to read the Kitchen's fee (the endpoint also checks the Pot). What
448
+ must be true for it to land — the Pot deployed and funded, sent from its owner — goes to stderr.
449
+
450
+ `--format cast` prints the same transaction as a `cast send` line instead, for
451
+ [Foundry](https://getfoundry.sh/cast/overview) users; it is never needed. The line leaves the
452
+ endpoint and the signer as `<RPC_URL>` and `<PRIVATE_KEY>` placeholders: the command never fills in
453
+ either. `sauce pot --format cast` does the same for the deployment.
454
+
455
+ ## Writing the program file
456
+
457
+ The file is compiled for the chain as a standalone program (`routes.compileSauceProgram`, the
458
+ compile half of `routes.compileSauceRoute`, with the chain's names `openRoute` gives a route body):
459
+ the chain's token symbols (`USDC`), protocol namespaces (`Uniswap.UniversalRouter`), `chainId`, the
460
+ `@sauce/token` functions (`transfer(token, to, amount)` and the rest, with no import), the token
461
+ syntax (`USDC.transfer(...)`, `Token(address).approve(...)`, both SafeERC20) and
462
+ [intents opened inside the program](intents.md#create-an-intent-from-inside-a-program) all resolve
463
+ against it. One file therefore compiles for every chain whose names it uses. `sauce globals --chain
464
+ <c>` lists the names; [Protocols and tokens](protocols-and-tokens.md) explains them. Relative imports
465
+ are read from beside the file.
466
+
467
+ A file is either a script — top-level statements, which are the program — or declares
468
+ `function main(...)`, and it reaches the compiler as written: imports, helper functions,
469
+ `interface` declarations and annotations included. A script's imports come first, and its
470
+ top-level `const`s are the script's own locals, which a function cannot read; declare `main` to
471
+ share a module constant with functions or to return a value.
472
+
473
+ ### Choosing the chain
474
+
475
+ `--chain` takes a slug, an alias or a chain id: `base`, `eth`, `8453`, `solana`. A file can carry
476
+ its own, in the `//` comment lines it starts with; a flag overrides it:
477
+
478
+ ```js
479
+ // @chain base
480
+ // Pays RECIPIENT from the Pot.
481
+ USDC.transfer(RECIPIENT, AMOUNT);
482
+ ```
483
+
484
+ `--target evm|svm` (or a `// @target` line) is a check against the chain. `--target svm` with no
485
+ chain means `solana`.
486
+
487
+ ### Values fixed when it is compiled: defines
488
+
489
+ ```js
490
+ const RECIPIENT = 0n;
491
+ const AMOUNT = 0n;
492
+
493
+ function main() {
494
+ require(RECIPIENT != 0n);
495
+ USDC.transfer(RECIPIENT, AMOUNT);
496
+ }
497
+ ```
498
+
499
+ Pass `--define NAME=VALUE`, repeated, or `--defines values.json`, one JSON object of name to value;
500
+ `--define` wins over the file. A value is one 256-bit word: an integer in decimal or `0x` hex, an
501
+ address (which is its integer), `true` or `false`. In the JSON file, a number must be a safe integer;
502
+ write anything larger as a string.
503
+
504
+ A define replaces a **module-level** `const`, so in a file with `main` the constant sits beside it,
505
+ as above. In a script, a top-level `const` is the script's own local and a define cannot replace it:
506
+ leave the name undeclared and define it. The command refuses a define a script would never see,
507
+ rather than ignoring it, and names on stderr a define the file never reads, which changes nothing.
508
+ For a program on Solana, a value may also be a base58 public key, as `--account` takes them: it is
509
+ the 32-byte word an account's `address` compares to.
510
+
511
+ `sauce compile --json` reports what the compile applied:
512
+
513
+ - `defines`: each define the file reads, its value, its `source` and the `chain` it applied on. The
514
+ source is `user` for `--define` and `--defines`, or `chain` for what compiling for the chain sets,
515
+ with its `kind` (a `token` symbol, a protocol `contract` such as `UniswapV3_Factory`, the
516
+ `chain id`). A user define that replaced a chain value says what it `replaces`. An intent body
517
+ the file opens reads its own chain's values, so its `USDC` is listed again with that chain; a
518
+ define of such a name stays on the chain it was given for, while any other (`RECIPIENT`) holds
519
+ in the body too. stderr names a define that changes nothing for that reason.
520
+ - `contracts`: each protocol contract the program calls or reads (`UniswapV3.Factory.getPool(…)`,
521
+ `Cctp.TokenMessenger`), as written and as resolved, with the chain whose deployment it is — an
522
+ intent body's resolves on the intent's own chain.
523
+ - `size`, the program's bytes, and `payload`, the program with `main`'s arguments appended, given
524
+ with `--args` or `--args-json` (`null` until they are).
525
+ - `returnType`: the type `main` declares it returns, an `interface` spelled out (`null` when it
526
+ returns nothing), which `simulate` reads the cook's return data as.
527
+ - A define's `value` is an address only where it was written as one (`0x` and 40 hex digits, or a
528
+ base58 key on Solana) or where it replaces a chain's token or contract; any other value is the
529
+ integer it is, whatever its size.
530
+ - On Solana, `cook`: the size of the cook's transaction against the 1232-byte limit, measured as
531
+ `sauce run` builds it, with each `--account` given and a distinct account for every other slot —
532
+ the Kitchen's cook, or with `--via engine` the engine's direct one, which is smaller (no Kitchen,
533
+ Pot or salt). Past the limit, stderr says `sauce run` stages the program first.
534
+
535
+ ### Values given when it runs: `main`'s arguments
536
+
537
+ A `main` with typed parameters takes its values at run time, so one compiled program serves every
538
+ call:
539
+
540
+ ```js
541
+ function main(token: Address, recipients: Address[], amount: Uint256, alsoUsdc: bool) {
542
+ for (let i = 0; i < recipients.length; i = i + 1) {
543
+ transfer(token, recipients[i], amount);
544
+ if (alsoUsdc) {
545
+ USDC.transfer(recipients[i], amount);
546
+ }
547
+ }
548
+ }
549
+ ```
550
+
551
+ `sauce compile --json` reports them (`entryParams`, `entryEncoding`, and `entrySchema` under
552
+ `--compact-args`). `simulate`, `run` and `tx` take them after `--args`, in order — a flag after
553
+ them is still a flag, and `--` before an argument that starts with `--` keeps it one — or as one
554
+ JSON array with `--args-json '[…]'` (or a file):
555
+
556
+ ```sh
557
+ npx sauce run split.sauce.ts --chain base --config sauce.config.json --keystore ~/.keys/me.json \
558
+ --args 0xToken '["0xA…","0xB…"]' 1000000 true
559
+ ```
560
+
561
+ An array or tuple argument is JSON. Each value is checked against its declared type before
562
+ anything is sent — `Address`, `Uint256` (also `number`, `bigint`), `bool`, `bytes`, `string`, `T[]`
563
+ and `{ field: T }` — and a wrong one is named:
564
+ `argument 1 (token: Address): '0x12' is not an address: 20 bytes of 0x-prefixed hex`. They are
565
+ encoded ABI-v1 by default, compact-v1 under `--compact-args`, and appended to the program: the SDK's
566
+ `routes.encodeEntryArguments`, whose inverse `routes.decodeEntryArguments` is what `sauce inspect`
567
+ reads them back with.
568
+
569
+ ### When it does not compile
570
+
571
+ Errors point at your file's line and column, including on a line the SDK rewrote before compiling
572
+ it, and a `hint:` line names the flag or define to add:
573
+
574
+ ```text
575
+ sauce compile: pay.sauce.ts does not compile for base
576
+ …
577
+ ╰╴error: `RECIPIENT` is not a declared variable
578
+ --> pay.sauce.ts:2:15
579
+ |
580
+ 2 | USDC.transfer(RECIPIENT, AMOUNT);
581
+ | ^^^^^^^^^
582
+ hint: if RECIPIENT is a value you supply, pass --define RECIPIENT=<value>
583
+ ```
584
+
585
+ ### A program file as a command
586
+
587
+ A program file may start with a `#!` line that runs it through `sauce simulate`:
588
+
589
+ ```sh
590
+ #!/usr/bin/env -S npx -y @eco-incorp/sauce simulate
591
+ ```
592
+
593
+ After `chmod +x pay.sauce.ts`, `./pay.sauce.ts --chain base --config sauce.config.json --owner
594
+ <address> --args <recipient> 1000000` rehearses the cook, exactly as `sauce simulate pay.sauce.ts`
595
+ with those flags does. Running the file never spends: sending it is still `sauce run`. The command
596
+ blanks the line before compiling, so the program and its error positions are the file's own.
597
+
598
+ ### In an editor
599
+
600
+ A program file is checked by an editor as TypeScript, which does not know SauceScript's names.
601
+ `sauce init` writes `programs/tsconfig.json`, a TypeScript project of the `*.sauce.ts` files in
602
+ `programs/` alone, typed by the package's `@eco-incorp/sauce/sauce-script` declarations: the
603
+ builtins (`ctx`, `abi`, `evm`, `svm`, `crypto`, `require`, `revert`), `Token` and the
604
+ `@sauce/token` functions, every chain with its tokens and protocol namespaces, the protocol
605
+ defines, and the ABI a program imports (`import IERC20 from "./artifacts/IERC20.json"`). The
606
+ project's other TypeScript is not in it, so a Node file keeps Node's `crypto` and `require`.
607
+
608
+ Some valid SauceScript is not valid TypeScript: every SauceScript number is one 256-bit integer, so
609
+ `xs[i]` with a `bigint` index, `n + 1` with `n` a `bigint`, and `f(500)` where `f` takes a `bigint`
610
+ are all fine, and a define the file leaves undeclared for `--define` is not an error until the
611
+ compile. The tsconfig names a TypeScript plugin from the package that drops exactly those
612
+ diagnostics, in `*.sauce.ts` files only; a misspelled builtin, a wrong argument count or a method a
613
+ contract does not have still shows. An editor loads the plugin only when it runs the project's own
614
+ TypeScript (in VS Code, "TypeScript: Select TypeScript Version", then "Use Workspace Version"), and
615
+ `init` adds `typescript` to `devDependencies` for it. Without the plugin, those diagnostics show
616
+ and nothing else changes: whether a program compiles is the compiler's to say, not the editor's.
617
+
618
+ In a project `init` did not write, or for programs in another directory,
619
+ `npx sauce init <dir> --tsconfig` writes the same project as `<dir>/tsconfig.json` and nothing else
620
+ (it never replaces a different file without `--force`). An editor takes a file's nearest
621
+ `tsconfig.json`, so every `*.sauce.ts` under `<dir>` is typed as SauceScript. Where the project's
622
+ own `tsconfig.json` also covers those files, add `"exclude": ["**/*.sauce.ts"]` to it, so its
623
+ TypeScript leaves them to their own project. The file it writes is this, `<package>` being
624
+ `@eco-incorp/sauce`:
625
+
626
+ ```json
627
+ {
628
+ "compilerOptions": {
629
+ "target": "ES2022",
630
+ "lib": ["ES2022"],
631
+ "module": "ESNext",
632
+ "moduleResolution": "Bundler",
633
+ "moduleDetection": "force",
634
+ "types": ["@eco-incorp/sauce/sauce-script"],
635
+ "strict": true,
636
+ "noImplicitAny": false,
637
+ "noEmit": true,
638
+ "allowImportingTsExtensions": true,
639
+ "resolveJsonModule": false,
640
+ "skipLibCheck": true,
641
+ "plugins": [{ "name": "@eco-incorp/sauce/sdk/dist/sauce-script/ts-plugin.cjs" }]
642
+ },
643
+ "include": ["**/*.sauce.ts"]
644
+ }
645
+ ```
646
+
647
+ A contract ABI beside a program is typed by its default import, `import IOracle from "./IOracle.json"`,
648
+ as a contract whose methods the editor does not check; the compile checks them against the ABI.
649
+
650
+ ## An actions document instead of a program
651
+
652
+ An [actions document](actions.md) is JSON — `{ "version": 1, "actions": [ … ] }`, each action one
653
+ protocol operation — that the SDK lowers to a SauceScript program. Its tokens are registry symbols
654
+ (`"USDC"`) and its contracts namespace references (`"UniswapV3.Factory"`), or addresses, and a swap
655
+ may name its pool by its factory's key; every name is the program's global of that name, so a
656
+ document with no `chainId` compiles for any chain where its names exist.
657
+
658
+ `sauce actions <file>` lowers one for a chain and prints the SauceScript, `main`'s parameters and the
659
+ bytecode:
660
+
661
+ ```sh
662
+ npx sauce actions swap.json --chain base
663
+ npx sauce actions swap.json --chain ethereum --json
664
+ ```
665
+
666
+ `--chain` defaults to the document's `chainId`; a document without one needs it, and one with a
667
+ `chainId` compiles for that chain only. `--json` prints what `sauce compile --json` does, with the
668
+ parsed `document`, the `source`, the ABI bindings it calls through (`bindings`) and the argument
669
+ names (`parameters`); `contracts` is still the protocol contracts it calls, as `compile` reports them. `--compact-args` compiles the arguments compact-v1. A name the chain lacks is
670
+ refused with its path, the chain and the name:
671
+
672
+ ```text
673
+ sauce actions: swap.json does not compile for avalanche:
674
+ actions[1].tokenIn: no token "USDC" on Avalanche C-Chain (chain 43114), which registers no token symbols — give its address there instead
675
+ ```
676
+
677
+ `compile`, `tx`, `simulate` and `run` take an actions document wherever they take a program file,
678
+ with the same flags: the document's `argument` actions are `main`'s parameters, given after
679
+ `--args` in the order it declares them, and its cook runs on the Pot `--owner` or `--pot` names,
680
+ funded with `--fund` if you like. `--define` and `--defines` are refused, because a document's values
681
+ are its own fields.
682
+
683
+ ```sh
684
+ npx sauce simulate swap.json --chain base --owner 0xYou --rpc-url <url> \
685
+ --assume-balance USDC:1000 --args 1000000000
686
+ npx sauce run swap.json --chain base --config sauce.config.json --keystore ~/.keys/me.json \
687
+ --args 1000000000
688
+ ```
689
+
690
+ ## Intents: `sauce run` or `sauce intent`
691
+
692
+ A program can open an intent on another chain — `Base(() => { … }).reward({ … })`. The command
693
+ needs what the SDK cannot look up: `--intent-deadline <unix seconds>` and `--intent-creator
694
+ <address>`, and, when the intent's body compiles to a program of its own,
695
+ `--intent-execution-fee <wei>`, the destination Kitchen's fee. It names whichever is missing, and
696
+ refuses a deadline at or before now, which no solver could ever fill (`sauce intent fill` still
697
+ rehearses one, with a note, to show the Portal's refusal). `--intent-reward-deadline <unix seconds>`
698
+ sets when an unproven reward becomes refundable (the fill deadline by default), and
699
+ `--intent-prover <address>` overrides the prover the registry records for the pair.
700
+ `--intent-execution-fee auto` reads that fee from each destination's Kitchen, through `--config`
701
+ (an `rpcUrls` entry for the destination's chain id), and says what it read.
702
+
703
+ Every intent whose body runs a program cooks on one Pot on its destination: the one owned by the
704
+ destination Portal's Executor with salt zero, which every intent through that Portal shares. No
705
+ solver can fill the intent until that Pot is deployed. `compile` and `sauce intent publish` check it on the
706
+ destination when `--config` reaches it (`compile --json` reports each under `intentPots`) and warn
707
+ while it is missing, naming the `sauce pot --deploy --chain <destination> --owner <Executor>` that
708
+ deploys it; any account may send that. `publish` warns before it sends anything, and says how to
709
+ check when it cannot.
710
+
711
+ There are two ways to get such a file's intents onto the chain:
712
+
713
+ - **`sauce run`** cooks the file on your Pot. Inside one transaction the Pot reads each intent's
714
+ vault from the Portal, pays the reward into it from its own balance, and publishes the intent,
715
+ so the intent may use a value the program measures as it runs — a balance, a swap's output.
716
+ - **`sauce intent publish`** sends the source chain's transactions from your **wallet**, with no Pot: for
717
+ each reward token a `transfer` to the intent's vault (and, for a native reward, a plain send to
718
+ it), then `Portal.publish`. It prints each intent's hash, its vault and each transaction's
719
+ result.
720
+
721
+ ```sh
722
+ npx sauce intent publish bridge.sauce.ts --chain ethereum --config sauce.config.json \
723
+ --keystore ~/.keys/me.json --intent-deadline 2000000000 --intent-creator 0xYou
724
+ ```
725
+
726
+ Only a file whose intents are fixed when it is built qualifies: every amount a literal, a define
727
+ or a top-level `const` of a literal, and nothing but intents. A file whose intent uses a value
728
+ measured or computed on chain is refused, naming the value and pointing at `sauce run`, and so is
729
+ one that does anything else.
730
+ `--dry-run` rehearses the transactions together (`eth_simulateV1`) and sends nothing, from the
731
+ signer's wallet or `--from <address>`'s, printing each one's gas or revert (`gasUsed` and
732
+ `reason` in `--json`); `--assume-balance USDC:2` (repeatable, `ETH:` for the
733
+ native currency) gives that wallet the reward for the rehearsal only, by state override, as
734
+ `simulate` gives a Pot one. `--format json` (or `cast`) prints the transactions unsigned, with
735
+ `--from <address>` when there is no signer. Publishing, sent or printed, needs a supported source
736
+ and supported destinations ([Supported and preview chains](#supported-and-preview-chains)); a
737
+ dry run rehearses on any chain.
738
+
739
+ The Portal counts an intent funded when its vault holds the reward (`isIntentFunded`), which is
740
+ what a solver checks once it sees `IntentPublished`, so paying the vault directly needs no
741
+ approval at all: nothing is left standing, and a USDT-style token needs no reset. The vault is
742
+ the SDK's own derivation for the Portal's address. With an endpoint it is also read from the
743
+ Portal (`intentVaultAddress`), and when the two disagree nothing is sent: the command says which
744
+ address each reported. Only what the vault does not hold yet is transferred, so running the
745
+ command again publishes alone. The transfers go first and `publish` is sent only once the Portal
746
+ counts the intent funded. A token whose `transfer` returns `false`, or keeps a fee, stops the
747
+ command before the intent is announced, with what was paid still in the vault: top it up and run
748
+ it again, or refund it after the reward deadline. A `--dry-run` reports `Portal.isIntentFunded`
749
+ after the rehearsed transactions, and `--format` prints each intent's `vault`, `vaultFrom` (`read`
750
+ when the Portal agreed, `derived` with no endpoint) and `fundVia`.
751
+
752
+ `--intent-fund-via publishAndFund` (also taken by `run`, `tx`, `simulate`, `compile` and
753
+ `inspect`, for intents a program opens) funds through the Portal instead: for each reward token
754
+ an `approve` to the Portal (reset to zero first when a smaller allowance stands, as SafeERC20
755
+ does; skipped when the allowance already covers it), then `publishAndFund`, which pulls the
756
+ reward into the same vault, records the intent `Funded` and emits `IntentFunded`. Choose it when
757
+ something you rely on reads that event or status rather than the vault's balance. Neither mode
758
+ goes through Permit2: the Portal's Permit2 path (`publishAndFundFor` with Permit2 as its permit
759
+ contract) pulls through a Permit2 _allowance_ to the intent's vault, which takes an on-chain
760
+ `Permit2.approve` per intent — the same number of transactions, plus a standing approval of
761
+ Permit2.
762
+
763
+ Publishing from Solana is not supported: see [Solana](#solana).
764
+
765
+ Everything after publishing is a verb of `sauce intent` too. Each takes the intent's file (with
766
+ `--chain`, its source, and the flags it was built with) or its hash, and `--config` with both
767
+ chains' endpoints:
768
+
769
+ | Verb | What it does |
770
+ | ---------------------- | ---------------------------------------------------------------------------- |
771
+ | `sauce intent publish` | Publish a file's fixed intents from your wallet — or, with no file, make one |
772
+ | `sauce intent fill` | Rehearse a solver's fill on the destination; with `--send`, send it |
773
+ | `sauce intent prove` | Send the proof of a filled (or cancelled) intent, paying the prover's fee |
774
+ | `sauce intent claim` | Withdraw a proven intent's reward to its claimant, on the source |
775
+ | `sauce intent refund` | Return an unearned reward to its creator, once the Portal allows it |
776
+ | `sauce intent cancel` | Cancel an unfilled intent after its fill deadline, for an earlier refund |
777
+ | `sauce intent status` | Where an intent stands on both chains, and what can be done next |
778
+ | `sauce intent list` | Every intent the store keeps |
779
+ | `sauce intent show` | One stored intent: its route, reward, deadlines and events |
780
+ | `sauce intent import` | Store the intents a transaction published, rebuilt from its logs |
781
+ | `sauce intent` | At a terminal: pick a stored intent and act on it |
782
+
783
+ ### Making one: `sauce intent publish` with no file
784
+
785
+ With no file, `publish` makes the intent, step by step: the source and destination chains (those
786
+ with a Portal that are [supported](#supported-and-preview-chains): Ethereum and Base), the token delivered (a registry symbol, or an address whose decimals it reads), how
787
+ much and to whom (you, by default), the reward, the fill and reward deadlines, the prover (the ones
788
+ the registry records on both chains), and how the reward is funded (a transfer to the vault by
789
+ default, or `publishAndFund`). At a terminal it asks for each; every question has a flag, so it
790
+ also runs with none:
791
+
792
+ ```sh
793
+ npx sauce intent publish --source ethereum --destination base --token USDC --amount 1 \
794
+ --recipient 0xYou --reward-token USDC --reward 1.01 --prover HyperProver \
795
+ --fill-deadline +1h --reward-deadline +1d --config sauce.config.json --keystore ~/.keys/me.json
796
+ ```
797
+
798
+ With no terminal, it names every flag still missing; the funding, which has a default, is not one
799
+ (`--intent-fund-via publishAndFund` chooses the Portal's pull). The reward it suggests is what is delivered
800
+ plus a margin over what a solver spends on the destination — the gas of a fill, the prover's fee
801
+ (quoted from the destination's prover) and a Kitchen fee where the body cooks — priced in the
802
+ reward token through a Uniswap V3 pool of the destination's wrapped native token, and doubled so a
803
+ fill is worth a solver's while; it shows how it got there, and you can change it. Deadlines are
804
+ unix seconds or `+30m`, `+2h`, `+1d` from now. The fill deadline is the last second a solver may
805
+ fill; the reward deadline, when an unproven reward becomes refundable, must leave time after it for
806
+ the fill to be proven.
807
+
808
+ It writes the intent as a `.sauce.ts` file (`--out`, else
809
+ `intent-<source>-to-<destination>-<time>.sauce.ts`), headed by the command that publishes it again,
810
+ shows it, rehearses publishing it and filling it on the destination, and with a signer publishes it
811
+ once you approve (or with `--auto-approve`), storing it.
812
+
813
+ ### Rehearsing the fill: `sauce intent fill`
814
+
815
+ `publish --dry-run` rehearses the source side: the reward paid into the vault and `publish`. What the intent
816
+ does — the swap, the minimum it checks, the refund — runs on the destination, when a solver fills
817
+ it, and that is where it fails. `sauce intent fill` rehearses that fill with no key and sends
818
+ nothing. It takes the file and the flags `publish` does (or the intent's hash), and the
819
+ destination's endpoint:
820
+
821
+ ```sh
822
+ npx sauce intent fill swap.sauce.ts --chain ethereum --config sauce.config.json \
823
+ --defines swap.defines.json --intent-deadline 2000000000 --intent-creator 0xYou \
824
+ --intent-execution-fee 3744785386350 --no-prove
825
+ ```
826
+
827
+ For each intent the file opens it runs one `eth_simulateV1` block on the intent's destination,
828
+ every call from a solver:
829
+
830
+ 1. `Kitchen.deployPot(executor, 0)`, when the route cooks on the destination's shared intent Pot
831
+ and it is not deployed yet. Any account may send it, and the Pot is the Executor's either way.
832
+ The command also warns, with the `sauce pot` line that deploys it (`--deploy` and any signer).
833
+ 2. The solver's approval of the Portal for each token the route delivers, reset to zero first where
834
+ a smaller allowance stands. The Portal pulls them from the solver.
835
+ 3. The fill, which proves itself when it can: `Portal.fulfillAndProve(intentHash, route,
836
+ rewardHash, claimant, prover, sourceDomain, data)` when the reward's prover is a Hyperlane one,
837
+ with the route's native amount — the Kitchen's fee for its cook — plus the prover's fee, quoted
838
+ from its `fetchFee`, as the value; else, or with `--no-prove`,
839
+ `Portal.fulfill(intentHash, route, rewardHash, claimant)` with the native amount alone.
840
+
841
+ The prover is the destination's counterpart of the reward's (the registry's address for the same
842
+ role on that chain); it must serve the route's Portal, and with the source chain's endpoint in
843
+ `--config` the command checks the source prover trusts it. The solver is an address nobody holds
844
+ the key of, or `--solver <address>`, and the claimant is the solver, or
845
+ `--claimant <address | bytes32>`. The solver is given the route's tokens and the value by state
846
+ override, the token's balance word found as `simulate --assume-balance` finds it. On success it
847
+ prints the gas, the transfers, each address's net change (an address a define holds is named by the
848
+ define), the Portal's `IntentFulfilled` record, and what the fill left in the shared Pot and the
849
+ Portal's Executor:
850
+
851
+ ```text
852
+ Intent 0xf261…5d2c from ethereum to base: the fill succeeds, gas used 1874288
853
+ Rehearsed with eth_simulateV1 on base, one block from the solver 0x5A0c…F111; nothing was signed or sent:
854
+ 1. approve the Portal for 998 USDC (gas 55425)
855
+ 2. Portal.fulfill(0xf261…5d2c, route, 0xe94c…0a6c, 0x5A0c…F111) with 3744785386350 wei: the route's nativeAmount, the Kitchen's fee for its cook (gas 1874288)
856
+ Assumed for this rehearsal only, by state override:
857
+ the solver holds 998 USDC: the route's tokens, which the solver delivers (its balance word 0xc2e6…e5a4: Solidity mapping at slot 9)
858
+ the solver holds 0.00000374478538635 ETH: fulfill's value
859
+ Token transfers:
860
+ 998 USDC: 0x5A0c…F111 (the solver) -> 0x645d…91Ca (the Portal's Executor)
861
+ 998 USDC: 0x645d…91Ca (the Portal's Executor) -> 0x48e8…744a (the shared intent Pot)
862
+ 0.368481796891017787 WETH: 0x72AB…2D38 -> 0x48e8…744a (the shared intent Pot)
863
+ 998 USDC: 0x48e8…744a (the shared intent Pot) -> 0x72AB…2D38
864
+ 0.368481796891017787 WETH: 0x48e8…744a (the shared intent Pot) -> 0x5a0C…Beef (RECIPIENT, REFUND_TO)
865
+ Native transfers:
866
+ …
867
+ Net balance changes:
868
+ 0x5A0c…F111 (the solver): -998 USDC, -0.00000374478538635 ETH
869
+ 0x72AB…2D38: -0.368481796891017787 WETH, +998 USDC
870
+ 0x5a0C…Beef (RECIPIENT, REFUND_TO): +0.368481796891017787 WETH
871
+ 0x1984…506b (Kitchen): +0.00000374478538635 ETH
872
+ The Portal records the fill: IntentFulfilled(0xf261…5d2c, claimant 0x0000…F111)
873
+ Left behind: nothing. The shared intent Pot and the Portal's Executor end holding none of what the fill moved.
874
+ ```
875
+
876
+ A fill that leaves tokens in the shared Pot or the Executor is warned about: every intent through
877
+ that Portal shares them, so a later intent's program or solver can take what is left. A revert
878
+ prints `the fill reverts: <reason>` and exits 1, a failed route call unwrapped from the Executor's
879
+ `CallFailed` down to its own reason — `route call 2 of 2 (the cook on the shared Pot 0x48e8…)
880
+ reverted: the program threw "output below MIN_OUT"`, or `FeeNotPaid(<fee>, <paid>)` for a cook
881
+ that underpays the Kitchen, which the command also warns about, naming the fee to build with. The
882
+ Portal's own refusals are named: `IntentExpired()` with the deadline, `IntentAlreadyFulfilled`,
883
+ `InvalidHash`. `--json` carries one object per intent under `intents`: the hashes, `portal`,
884
+ `executor`, `pot` and `potDeployed`, `solver`, `claimant`, `value`, `proves`, `prover`, `fee`,
885
+ `calls` (each with its `status` and `gasUsed`), `assumed`, then `gas`, `fulfilled`, `transfers`,
886
+ `approvals`, `nativeTransfers`, `balanceChanges`, `otherLogs` and `leftBehind` — or `stage` and
887
+ `reason`.
888
+
889
+ The endpoint is the destination's: `--config` names one for each destination, and `--rpc-url`
890
+ serves a file whose intents all go to one chain. It needs `eth_simulateV1`, since the deployment,
891
+ the approvals and the fulfill carry state from one to the next. The intent must be fixed when it is
892
+ built, as for `publish`: an intent that uses a value the program measures on chain has no route
893
+ until the program runs (name it by the hash `sauce run` stored instead). A Solana destination is
894
+ not filled.
895
+
896
+ ### Filling it for real: `sauce intent fill --send`
897
+
898
+ A rehearsal sends nothing, so it runs on a preview chain too. With `--send` and a signer, the
899
+ signer is the solver, and the fill is sent — to a supported destination only:
900
+
901
+ ```sh
902
+ npx sauce intent fill 0x<intent hash> --config sauce.config.json --send --keystore ~/.keys/me.json
903
+ ```
904
+
905
+ It is rehearsed first exactly as above, but with nothing assumed: on the signer's own balances, so
906
+ a solver short of a token, or of the value, sees the rehearsal revert and nothing is sent. Then it
907
+ says what the fill spends — each token the route delivers (which the Portal pulls from you into
908
+ its Executor) and the value, split into the Kitchen's fee, what the route spends and the proof's
909
+ fee — and asks you to approve; `--auto-approve` approves without asking, and with no terminal and no
910
+ `--auto-approve` it stops there. The transactions go out in order, each rehearsed again just before, and it
911
+ prints each one's hash, block and gas, the gas cost, what the fulfill moved, the Portal's
912
+ `IntentFulfilled` record and, when the fill proved itself, the Hyperlane message id the proof
913
+ travels as (the Hyperlane explorer finds it by that id). The intent and the fill go into the store.
914
+
915
+ ### After the fill: `prove`, `claim`, `refund`, `cancel`
916
+
917
+ ```sh
918
+ npx sauce intent prove 0x<intent hash> --config sauce.config.json --keystore ~/.keys/me.json
919
+ npx sauce intent claim 0x<intent hash> --chain ethereum --config sauce.config.json --keystore ~/.keys/me.json
920
+ npx sauce intent refund 0x<intent hash> --chain ethereum --config sauce.config.json --keystore ~/.keys/me.json
921
+ npx sauce intent cancel 0x<intent hash> --config sauce.config.json --keystore ~/.keys/me.json
922
+ ```
923
+
924
+ - **`prove`** sends `Portal.prove(prover, sourceDomain, [intentHash…], data)` on the destination,
925
+ for intents filled (or cancelled) there whose proof has not reached the source, with the prover's
926
+ quoted fee as the value, approved as `fill --send`'s spending is. Several hashes with one
927
+ destination, source and prover share one proof. An intent the source has proven already is left
928
+ out.
929
+ - **`claim`** checks that the reward's prover on the source has the intent proven, for its
930
+ destination, and that the reward is neither withdrawn nor refunded, then sends `Portal.withdraw`
931
+ (`batchWithdraw` for several hashes), which anyone may send and which pays the claimant the proof
932
+ names. It prints what left the vault. While the proof has not arrived it says so and exits 1,
933
+ with when the store saw the intent filled and the Hyperlane message its proof travels as.
934
+ - **`refund`** sends `Portal.refund`, which anyone may send and which returns everything the
935
+ intent's vault holds to the reward's creator, once the Portal allows it: at once after a proven
936
+ cancellation, from the reward's deadline for an intent no one proved, and for a claimed one only
937
+ its leftovers. It reads the state first and says why not, with the time left. There is no batch
938
+ refund.
939
+ - **`cancel`** sends `Portal.cancel` on the destination, which anyone may send strictly after the
940
+ fill deadline when no solver filled the intent: no fill can land after it, and once `prove` has
941
+ carried the cancellation to the source, `refund` pays the creator before the reward's deadline.
942
+ It needs a destination Portal with `cancel` and a source Portal whose `withdraw` refuses to pay a
943
+ proven cancellation (`CancelledIntent`), both read from their code, since a cancellation is
944
+ recorded as a claimant nobody controls; where either is missing it says so, and the reward is
945
+ refunded after its deadline instead. Prove a cancellation once the cancel is final on the
946
+ destination: a reorg that let a fill in first would leave that solver unpaid. `--and-prove`
947
+ sends `cancelAndProve` instead, proving at once.
948
+
949
+ With no signer, each prints its transactions unsigned, for a wallet to send in order. Signed or
950
+ unsigned, each is refused on a preview chain: `prove` and `cancel` by the intent's destination,
951
+ `claim` and `refund` by its source.
952
+
953
+ ### An intent to Solana
954
+
955
+ An intent an EVM chain publishes for Solana (eco-routes' Solana deposit addresses publish one per
956
+ deposit) is filled, proven and cancelled through Solana's Portal program, and claimed or refunded on
957
+ its source like any other. Store it from the transaction that published it, then:
958
+
959
+ ```sh
960
+ npx sauce intent import 0x<tx hash> --chain base --config sauce.config.json
961
+ npx sauce intent fill 0x<intent hash> --config sauce.config.json --solver <solana key> --claimant 0xYou
962
+ npx sauce intent fill 0x<intent hash> --config sauce.config.json --claimant 0xYou \
963
+ --send --keypair ~/.config/solana/id.json
964
+ npx sauce intent claim 0x<intent hash> --config sauce.config.json --keystore ~/.keys/me.json
965
+ ```
966
+
967
+ - The config names Solana's endpoint under its chain id, `1399811149`, beside the source's.
968
+ - **`fill`** sends `Portal.fulfill` from the solver: its token accounts pay the route's tokens into
969
+ the Portal's executor, which runs the route's calls. The rehearsal runs on the accounts as they
970
+ are (Solana's simulation takes no overrides, so `--solver` names a Solana key whose accounts
971
+ hold the tokens) and prints the token accounts the fill moves. `--claimant`, the address on the
972
+ source chain the reward pays, is required: a Solana key is not one. With `--send` and
973
+ `--keypair` the fill is sent, then its proof: the Portal's `prove` through the HyperProver, with
974
+ eco-routes' proof_helper paying Hyperlane's Interchain Gas Paymaster for the message's delivery in
975
+ the same transaction. What the proof spends (the gas paymaster's quote and the message accounts'
976
+ rent) is measured by a rehearsal and approved. `--no-prove` leaves it to `prove`.
977
+ - **`prove`** and **`cancel`** sign with `--keypair`, which pays their fee: their transactions are
978
+ built for it, so on Solana they need it. A cancellation's proof waits until the slot that
979
+ cancelled it is finalized; `--and-prove` sends the cancellation and its proof in one transaction.
980
+ - **`claim`** and **`refund`** are the source chain's, as for any intent.
981
+
982
+ `sauce intent status <file | hash>` reads the intent on both chains and prints its state —
983
+ `unfunded`, `funded`, `filled`, `cancelled`, `proven`, `cancelProven`, `claimed` or `refunded` —
984
+ its deadlines, and for fill, prove, claim, refund and cancel whether it can be done now, why not,
985
+ and from when.
986
+
987
+ ### The store, and picking one: `sauce intent`
988
+
989
+ Every intent `sauce intent publish`, `sauce run` and the `sauce intent` verbs touch is kept in a
990
+ store, `~/.sauce/intents` (`--store <dir>` for another), so later commands name it by hash: one
991
+ directory per intent hash, holding `intent.json`, the full intent — route, reward, chains, Portal,
992
+ hashes, vault — written once and never changed, and `events.jsonl`, one line appended per thing that
993
+ happened to it (`published`, `funded`, `imported`, `filled`, `proving`, `claimed`, `refunded`,
994
+ `cancelled`), with its chain, transaction, block and time. Nothing is read and written back, so two
995
+ commands at once cannot tear it, and where an intent stands is never stored: it is read from the
996
+ chains each time. No key or endpoint is written there.
997
+
998
+ `sauce intent import <tx hash> --chain <source> --config sauce.config.json` stores the intents a
999
+ transaction published — someone else's, say — rebuilt from its `IntentPublished` logs, each checked
1000
+ against its hash. `sauce intent list` lists the store, and `sauce intent show <hash>` one intent
1001
+ with its events. `sauce intent` alone, at a terminal, lists the stored intents with where each
1002
+ stands (read live with `--config`), and on the one you pick runs status, fill, prove, claim, refund
1003
+ or cancel, with the same approvals; with a signer, they send. With no terminal it prints the list.
1004
+
1005
+ ## Look up and take apart
1006
+
1007
+ ### `sauce globals`
1008
+
1009
+ ```sh
1010
+ npx sauce globals --chain base # everything
1011
+ npx sauce globals --chain base --tokens # token symbols only
1012
+ npx sauce globals --chain base --protocols # protocol namespaces only
1013
+ npx sauce globals --chain base --protocol UniswapV3 # one namespace, with its methods
1014
+ npx sauce globals --chain base --stocks # the chain's tokenized stocks
1015
+ npx sauce globals --chain base --search spacex # tokens by symbol, company name or ticker
1016
+ ```
1017
+
1018
+ lists every name a program compiled for the chain may use without declaring it: the token symbols
1019
+ with their addresses and decimals, each protocol namespace with its contracts' addresses (and, with
1020
+ `--protocol`, each method with every parameter and struct field named), the chain names that open
1021
+ intents, the defines, and the `@sauce/token` functions. On an EVM chain it also lists the
1022
+ interfaces: ABIs the registry knows with no fixed address (`Erc4626.Vault`, `Erc20.ERC20`), which a
1023
+ program calls with an address of its own, `Erc4626.Vault(vault).totalAssets()`; `--protocol
1024
+ Erc4626` lists their methods. `--json` prints the same for a program to read (`interfaces` beside
1025
+ `protocols`). It is `routes.sourceGlobals(chain)`, which reads the registries the compile reads and
1026
+ lists contracts through the protocol rewrite's own resolver, so a name it lists is one the compile
1027
+ accepts, at the address the program gets.
1028
+
1029
+ A chain's tokenized stocks (Ethereum and Solana have over a thousand each) are counted rather than
1030
+ listed unless you ask: `--stocks` lists them, each with its name, the underlying's ticker and its issuer, and
1031
+ `--search <text>` lists the tokens, stocks included, whose symbol, name, ticker or issuer contains
1032
+ the text, without regard to case. A search also finds a stock by the name another issuer gives it:
1033
+ `--search spacex` finds Coinbase's `SPCXc`, whose own name is "Space Exploration Technologies
1034
+ Corp.". In `--json`, a stock token carries `stock` with its issuer, name, ticker and the issuer's
1035
+ list it was copied from. Symbols are matched without regard to case on the command line too
1036
+ (`--fund spcxc:1`, `sauce price spcxc USDC 150`, `--account source=pot:tslax` on Solana); in a
1037
+ program they are case-sensitive. On Solana each stock is a Token-2022 mint, listed with its mint
1038
+ and the 32-byte key a program holds; `--stocks` leaves out devnet's mints, which have none.
1039
+
1040
+ ### `sauce price`
1041
+
1042
+ ```sh
1043
+ npx sauce price --chain base 2700 USDC per WETH # the price, in words
1044
+ npx sauce price --chain base WETH USDC 2700 # the same: <base> <quote> <price>
1045
+ npx sauce price --chain base 2700 USDC per WETH --config sauce.config.json # and the pool's now
1046
+ npx sauce price --chain base WETH USDC --sqrt-price-x96 4116816085950893928074568
1047
+ ```
1048
+
1049
+ Its first line says what the price means both ways round — `2700 USDC per WETH on base: 1 WETH =
1050
+ 2700 USDC, 1 USDC = 0.00037037037037037 WETH` (`means` and `inverse` in `--json`) — since a price
1051
+ written the wrong way round is off by its own square, a millionfold for WETH and USDC. With
1052
+ `--rpc-url` or `--config` it also reads the pair's price now from its deepest Uniswap V3 pool on
1053
+ the chain (`live` in `--json`) and warns on stderr when the price given is 10x or more away from it,
1054
+ saying so, with the command that reads it the right way, when it looks written backwards. It
1055
+ turns a price, in quote tokens per base token, into the numbers a swap program takes, for the pair's
1056
+ order on the chain (token0 is the lower address): the `sqrtPriceX96` a Uniswap V3 or V4 pool (or a
1057
+ fork) trades at, which is also the swap's `sqrtPriceLimitX96` — a floor when selling token0, a
1058
+ ceiling when selling token1 — and, for selling the base token and for buying it, the `minAvgPrice` a
1059
+ program compares a fill against, `out * 1e18 >= minAvgPrice * spent`, rounded up so the check never
1060
+ passes a worse average. A token is a symbol the chain registers, or `0x…:<decimals>`, or with an
1061
+ endpoint the address alone: its decimals and symbol are read from the token (`readFromChain` in
1062
+ `--json`). `--sqrt-price-x96` reads a pool's price back. The conversion is the package's
1063
+ `sqrtPriceX96FromPrice` and `priceFromSqrtPriceX96`, which a TypeScript program imports from the
1064
+ root; without an endpoint, nothing reaches a network.
1065
+
1066
+ ### `sauce pools`
1067
+
1068
+ ```sh
1069
+ npx sauce pools --chain base USDC WETH --config sauce.config.json
1070
+ npx sauce pools --chain base USDC SPCXc --config sauce.config.json # a tokenized stock
1071
+ npx sauce pools --chain base USDC 0x<token> --config sauce.config.json --json
1072
+ npx sauce pools --chain base WETH USDC --v4-key 50:1 --config sauce.config.json
1073
+ ```
1074
+
1075
+ lists every pool of a pair at the price-limit venues the registry records on the chain, read now:
1076
+ Uniswap V3 and PancakeSwap V3 at each fee tier their factory enables (the tiers tried are 0.01%,
1077
+ 0.02%, 0.03%, 0.04%, 0.05%, 0.25%, 0.3% and 1%), Aerodrome Slipstream at each tick spacing each of
1078
+ its CLFactories enables, and hookless Uniswap V4 pools at the keys `100:1`, `500:10`, `3000:60`
1079
+ and `10000:200`, and any `--v4-key <fee>:<tickSpacing>`. A token is a symbol the chain registers,
1080
+ a tokenized stock's included (`SPCXc`, in any case), or an address the registry does not know, whose
1081
+ decimals and symbol are read from the token (or given, `0x…:8`). It needs an endpoint, and reads
1082
+ everything in five rounds, each a few `eth_call`s carrying up to 32 reads apiece (Multicall3's
1083
+ `aggregate3`, sent deployless, so it needs nothing deployed). It reads on every chain, preview
1084
+ chains included.
1085
+
1086
+ Pools with liquidity at their price come first, **deepest first, by that liquidity** (`sortedBy`
1087
+ in `--json`), which is in the same units at every venue for one pair. For each:
1088
+
1089
+ - the venue, the contract a program finds it through as the program names it
1090
+ (`AerodromeSlipstream.CLFactoryGaugesV3`), and the pool's address — for a V4 pool, its id and
1091
+ key;
1092
+ - its fee, read from the pool: Slipstream's is set per pool; a V4 pool's LP fee and its protocol
1093
+ fee, which is charged on top and differs by direction, from StateView;
1094
+ - tick spacing, liquidity, tick and `sqrtPriceX96`;
1095
+ - both directions, paying the first token for the second and then the reverse: what one token
1096
+ costs in the other at the pool's price (`mid`) and with the fee (`taker`), in whole tokens,
1097
+ decimals-aware; that taker price as the distributed swap's `maxPrice` — the paid token's base
1098
+ units per bought base unit, times 1e18, which is the price times
1099
+ 10^(18 + paid decimals − bought decimals), so 150 USDC for an 8-decimal token is
1100
+ `1500000000000000000` — the pool trading only to a `maxPrice` above it; and `depth1Pct`, how
1101
+ much of the paid token, fee included, moves the pool's price 1% against the taker, walked
1102
+ through its initialized ticks.
1103
+
1104
+ Then the pools with no liquidity at their price, or none at all, listed apart as skipped (`empty`):
1105
+ a swap passes them by. Last, what was looked at (`checked`): the tiers each factory enables, the
1106
+ tick spacings each Slipstream factory enables, and the V4 keys tried, with any venue that could not
1107
+ be read. A pool that answers wrongly is left out with a note on stderr.
1108
+
1109
+ ```text
1110
+ USDC/SPCXc on base: 3 pools with liquidity, deepest first (by liquidity at the pool's price)
1111
+ token0 USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 6 decimals
1112
+ token1 SPCXc 0xb2000000000000000000007b9fcbd005511aCBd5 8 decimals
1113
+
1114
+ 1. Aerodrome Slipstream 0x0bf58fe0FAc935Ac69595c19B12Ba0d75E3F8c0E
1115
+ AerodromeSlipstream.CLFactoryGaugesV3 0xf8f2eB4940CFE7d13603DDDD87f123820Fc061Ef
1116
+ fee 0.05% (read from the pool), tick spacing 10, liquidity 206953500095168, tick -3968
1117
+ sqrtPriceX96 64972491279845651558239670148
1118
+ buy SPCXc with USDC 148.771 USDC each, 148.696 before the fee; 128966 USDC moves it 1%
1119
+ maxPrice 1487706738131601814
1120
+ buy USDC with SPCXc 0.00672848 SPCXc each, 0.00672512 before the fee; 1267.21 SPCXc moves it 1%
1121
+ maxPrice 672848166136197636
1122
+ …
1123
+ ```
1124
+
1125
+ ### `sauce inspect`
1126
+
1127
+ ```sh
1128
+ npx sauce inspect 0x<calldata> --chain base --source split.sauce.ts
1129
+ npx sauce inspect 0x<tx hash> --config sauce.config.json --chain arbitrum
1130
+ npx sauce inspect bridge.sauce.ts --intent-deadline 2000000000 --intent-creator 0xYou
1131
+ ```
1132
+
1133
+ takes bytes back apart into what a SauceScript author wrote:
1134
+
1135
+ - a `Pot.cook`: the engine (and whether it is the released one) and the program — its size, hash,
1136
+ and every intent it opens, with the route's calls, the reward, the intent hash, the vault the
1137
+ reward is escrowed in, and how the program funds it (`fundVia`: paid into the vault then
1138
+ `publish`, or `publishAndFund`);
1139
+ - with `--source <file>`: whether the program is that file's, and the arguments the cook appends,
1140
+ decoded against its `main`;
1141
+ - a `Kitchen.deployPot` (the Pot it makes), a `Portal.publish` or `publishAndFund` (the route, the
1142
+ reward, and the intent's vault — the address a funder's `transfer` pays), an ERC-20 call, or
1143
+ bare program bytes;
1144
+ - a 32-byte hash with an endpoint: the transaction, fetched — its status, sender, value and call,
1145
+ what it cost (gas, an OP-stack chain's L1 data fee, the value), and the token transfers,
1146
+ approvals and net balance changes its receipt's logs record;
1147
+ - a file: the program it compiles to, and its intents, with every value it measures at run time
1148
+ named (`reward: <amount> of 0x…`).
1149
+
1150
+ An intent whose values the program measures at run time is only partly readable from the bytes: its
1151
+ destination, and that the rest is filled in on chain. There is no opcode listing or disassembly:
1152
+ programs are reported by what they are and what they open.
1153
+
1154
+ ### `sauce verify`
1155
+
1156
+ ```sh
1157
+ npx sauce verify 0x<settle payload>
1158
+ npx sauce verify 0x<tx hash> --config sauce.config.json --chain base --pin 0x…:435
1159
+ ```
1160
+
1161
+ checks that a settle payload, a `Pot.cook`, a `Portal.publish[AndFund]` (its route's calls) or a
1162
+ transaction runs the audited settle program, with the SDK's `validateSettleProgram`, and prints the
1163
+ `tokens`, `minOut` and `recipient` it carries. `--pin <keccak256>:<length>` also accepts a historical
1164
+ settle program. A cook must name the released engine, or one you name with `--engine <address>`:
1165
+ the right bytes on another interpreter are another computation. A transaction must have succeeded:
1166
+ one that reverted, or has no receipt yet, settled nothing. A rejection exits 1 with its code — the
1167
+ SDK's `SettleFailureCode` (`PROGRAM_HASH`, `TOKENS_OFFSET`, …), or `UNKNOWN_ENGINE`, `NO_SETTLE` for
1168
+ an intent without a settle cook, `TX_FAILED` or `TX_PENDING`.
1169
+
1170
+ ## Solana
1171
+
1172
+ The same commands take `--chain solana`, through the SDK's Solana client
1173
+ (`svm.createSauceSvmClient`, with the endpoint you give and the program ids `/deployments` records).
1174
+ Three things differ, and a fourth is Solana's alone: how the cook reaches the engine.
1175
+
1176
+ **Accounts.** A Solana program declares every account it touches as an `Account` parameter of
1177
+ `main` — `Account<Writable>`, `Account<Signer>` — and `sauce compile --json` reports them in its
1178
+ `manifest`. Pass each to `simulate`, `run` and `tx` as `--account NAME=<value>`, where the value is
1179
+ an address, `pot` (the Pot, which the Kitchen signs for), `owner` (the signer), or an account named
1180
+ by its token: `pot:USDC` is the Pot's own USDC account — its associated token account for the mint,
1181
+ under the token program that owns the mint — `pot:<mint>` the same for any mint, and `owner:USDC`
1182
+ the owner's (a direct cook, `--via engine`, has no Pot, so no `pot:` account); `mint:USDC` is the
1183
+ mint and `program:USDC` its token program, SPL Token or Token-2022, the accounts
1184
+ `transferChecked` takes. A registered symbol's program is the registry's; any other mint's is read
1185
+ from the cluster. A tokenized stock is named the same way, by its symbol in any case
1186
+ (`pot:TSLAx`, `mint:NVDA_US`). A slot with no `--account` is named with the role it needs, and `simulate` notes each
1187
+ account it was given that the cluster does not have (a guard on it fails with no message of its
1188
+ own).
1189
+
1190
+ ```js
1191
+ // @chain solana
1192
+ function main(
1193
+ tokenProgram: Account,
1194
+ source: Account<Writable>,
1195
+ dest: Account<Writable>,
1196
+ authority: Account<Signer>,
1197
+ amount: Uint256,
1198
+ ) {
1199
+ transfer(MINT, tokenProgram, source, dest, authority, amount);
1200
+ }
1201
+ ```
1202
+
1203
+ ```sh
1204
+ npx sauce run sweep.sauce.ts --config sauce.config.json --keypair ~/.config/solana/id.json \
1205
+ --define MINT=0x<mint, as 32 bytes of hex> \
1206
+ --account tokenProgram=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA \
1207
+ --account source=<the Pot's token account> --account dest=<token account> \
1208
+ --account authority=pot --args 400
1209
+ ```
1210
+
1211
+ **The Pot.** A Pot is the Kitchen's PDA over the owner and the salt. `sauce pot --chain solana
1212
+ --owner <pubkey>` prints it and the `create_pot` instruction; `--deploy` with `--keypair` creates
1213
+ it. With an endpoint it also lists the Pot's token account for each registered mint but the
1214
+ tokenized stocks, over a thousand of them: its address, whether it exists and what it holds
1215
+ (`tokenAccounts` in its JSON). A stock's is `pot:<symbol>`. A cook names its Pot by `--owner` and `--salt`, never `--pot`, and `run` asks before creating a
1216
+ missing one, as on an EVM chain.
1217
+
1218
+ **The cook.** The execution fee is read from the cluster, so there is no `--value`: every output
1219
+ prints it as `fee`, and the cook signs it as its `max_execution_fee`, so it pays what was printed
1220
+ or, if the fee rises before it lands, fails. `--max-execution-fee <lamports>` refuses a cook whose
1221
+ fee is above it, before anything is signed or sent. `simulate`
1222
+ simulates the cook from `--owner` with signatures unchecked; a Pot the Kitchen has not created yet
1223
+ is created by its `create_pot` ahead of the cook, in the same transaction. It prints the compute
1224
+ units, what `main` returned (read as its declared type, as on an EVM chain) and what the cook
1225
+ moved, or the reason — a program's `throw` or `require` message, decoded
1226
+ from the engine's return data — and the program logs. What moved is read from the accounts
1227
+ themselves: every account the transaction may write, as it is now and as the simulation leaves it
1228
+ (`simulateTransaction`'s `accounts`). Each token account's balance change (SPL Token and
1229
+ Token-2022, in whole units by its mint's decimals, a mint the registry records by its symbol) and
1230
+ each account's lamports are listed, named
1231
+ by their `--account` names, as the owner, the Pot and the Kitchen's fee config; the owner's
1232
+ lamports include the transaction's fee. `--json` lists them as `tokenChanges` and
1233
+ `lamportChanges`. Solana's `simulateTransaction` takes no account overrides, so there
1234
+ is no `--assume-balance`: the rehearsal runs on the accounts as they are, and the owner must hold
1235
+ the Pot's rent and the fees (a shortfall is named). A cook too large for one transaction is refused
1236
+ with the bytes to shrink the payload (the program and its arguments) by, since staging it writes a
1237
+ code buffer on chain, which only `run` does. `run` signs with `--keypair`, confirms by polling the endpoint (no websocket to
1238
+ configure), and prints the signature, status and compute units — and the logs when it fails. A
1239
+ program too large for one transaction is staged in a Kitchen code buffer first and the buffer is
1240
+ closed again after the cook — or when staging or the cook's rehearsal fails; if closing it fails,
1241
+ the run still prints the cook and warns with the buffer's address. A failure is named for the
1242
+ program the logs show failing — the Kitchen's or the engine's refusals by name, and a token
1243
+ program's in the words it logged. `tx` prints the
1244
+ cook as a base64 transaction signed by no one, `{ chain, via, feePayer, pot, fee, maxExecutionFee,
1245
+ transaction }`, for the owner's wallet to sign; its blockhash expires in about a minute.
1246
+
1247
+ **Through the Kitchen or direct: `--via`.** `run`, `simulate` and `tx` take
1248
+ `--via kitchen|engine` (and `compile --json` sizes either cook with it):
1249
+
1250
+ - `--via kitchen`, the default, is everything above: the Kitchen's `cook` on the owner's Pot, which
1251
+ the Kitchen signs for. Use it when the program holds or spends what the Pot owns, or writes the
1252
+ Pot's storage.
1253
+ - `--via engine` calls the engine's own paid cook (`cookAndPay`) with no Kitchen and no Pot: nothing
1254
+ is created, `--owner` (or the `--keypair`'s key) signs and pays the fee, and the program acts with
1255
+ that signature — give `--account NAME=owner` where it needs an authority, such as the owner of the
1256
+ token account it spends from. `NAME=pot` for a slot that must sign is refused, since nothing signs
1257
+ for a Pot here. The program's own calls get one more level of CPI depth, as no Kitchen frame sits
1258
+ under the engine. A staged program runs pinned to the staged bytes' digest.
1259
+
1260
+ The fee is the same either way, read from the Kitchen's config and paid into it.
1261
+
1262
+ ```sh
1263
+ npx sauce run sweep.sauce.ts --config sauce.config.json --keypair ~/.config/solana/id.json \
1264
+ --via engine --max-execution-fee 10000 --define MINT=0x<mint, as 32 bytes of hex> \
1265
+ --account tokenProgram=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA \
1266
+ --account source=<your token account> --account dest=<token account> \
1267
+ --account authority=owner --args 400
1268
+ ```
1269
+
1270
+ The flag is `--via` rather than `--entry` because "entry" is already the compiler's word for a
1271
+ program's entry module and the arguments `main` takes (`--compact-args`, `entryEncoding`); `--via`
1272
+ names what the transaction calls. The [Solana guide](solana.md#two-ways-to-run-a-program) sets the
1273
+ two side by side.
1274
+
1275
+ `sauce verify --chain solana <signature> --min-out <n> --spl-count <n>` checks a settle cook: the
1276
+ engine invocation it made, against the SDK's settle program recompiled for that floor and split
1277
+ (`svm.verifySvmSettleExecution`). It rejects with `TX_FAILED` (the transaction failed),
1278
+ `NO_SETTLE` or `NOT_GENUINE`. It reads a cook through the Kitchen: a settle cooked `--via engine`
1279
+ is not one it checks.
1280
+
1281
+ `sauce intent publish` does not work from Solana: open the intent from an EVM chain; its
1282
+ destination may be Solana, and `sauce intent fill`, `prove` and `cancel` act on it there
1283
+ ([An intent to Solana](#an-intent-to-solana)). A `main` argument of type `Address` is a 32-byte
1284
+ public key on Solana: pass it in base58 (or as 32 bytes of hex), and the command encodes the whole
1285
+ key as the word the engine reads (ABI-v1 only, not under `--compact-args`).
1286
+
1287
+ ## Agent wallets
1288
+
1289
+ An agent with no wallet can make one, and keep it. `sauce wallet` keeps keys in a wallet directory,
1290
+ `~/.sauce/wallets` (or `--wallets <dir>`), each encrypted under a password the agent holds, in its
1291
+ `.env` or its secret store, and names by source. The password is never an argument:
1292
+
1293
+ ```sh
1294
+ npx sauce wallet new agent --password-env SAUCE_WALLET_PASSWORD # an EVM wallet
1295
+ npx sauce wallet new agent-sol --solana --password-env SAUCE_WALLET_PASSWORD
1296
+ npx sauce wallet list # no password needed
1297
+ npx sauce wallet address agent
1298
+ ```
1299
+
1300
+ | Verb | Does |
1301
+ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1302
+ | `new` | Generates a key and stores it as `<name>.json`, created `0600` in a directory created `0700`, written once and never overwritten. `--solana` makes a Solana keypair. The password is 8 characters or more |
1303
+ | `list` | Each wallet's name, kind (`evm` or `solana`), address, and whether a policy limits it |
1304
+ | `address` | One wallet's address |
1305
+ | `import` | A key you have, read from a file or stdin (`-`), never from the command line: an EVM private key, a keystore (opened with the password, which the wallet keeps), or a Solana keypair file |
1306
+ | `export` | The key, shown on the terminal itself (never stdout) once you type the wallet's name. It refuses without a terminal, and the MCP server has no such tool |
1307
+
1308
+ An EVM wallet's file is a Web3 Secret Storage v3 keystore (scrypt, AES-128-CTR, a keccak-256 MAC),
1309
+ exactly as geth and `cast wallet` write one, so `--keystore <file>` and `cast wallet` read it too.
1310
+ A Solana wallet's file is the same envelope around the keypair's 64 bytes, marked
1311
+ `"kind": "solana"`. Each file names its address in the clear, so `list` and `address` need no
1312
+ password.
1313
+
1314
+ Every command that signs takes `--wallet <name>` with the same password source: `run`,
1315
+ `pot --deploy`, `simulate --fund`, `intent publish`, `intent fill --send` and the steps after it,
1316
+ with an EVM wallet on an EVM chain and a Solana wallet on Solana:
1317
+
1318
+ ```sh
1319
+ npx sauce run pay.sauce.ts --chain base --config sauce.config.json \
1320
+ --wallet agent --password-env SAUCE_WALLET_PASSWORD --args <recipient> 1000000
1321
+ ```
1322
+
1323
+ ### A wallet's policy
1324
+
1325
+ `<name>.policy.json`, beside the wallet, limits what it sends. Every field is optional, and every
1326
+ amount is a string, in whole units or in base units ending in `n`, as `--fund` takes them:
1327
+
1328
+ ```json
1329
+ {
1330
+ "chains": ["base", "ethereum"],
1331
+ "to": ["<address>"],
1332
+ "native": { "perTransaction": "0.01", "perDay": "0.05" },
1333
+ "tokens": { "USDC": { "perTransaction": "100", "perDay": "500" } }
1334
+ }
1335
+ ```
1336
+
1337
+ - `chains` names the only chains it sends on, and `to` the only addresses a transaction goes to
1338
+ (on Solana, the programs its instructions call).
1339
+ - `native` is the chain's native coin leaving the wallet or the Pot the transaction cooks on. On
1340
+ Solana the fee and any rent are included.
1341
+ - `tokens` are named by registry symbol or by address (an ERC-20, a Solana mint). They count what
1342
+ leaves the wallet or its Pot, and an approval above what the limit leaves room for is refused
1343
+ (an approval of Permit2 aside, which moves nothing without a signature in a later cook). A token
1344
+ the policy does not name is not limited.
1345
+ - `perDay` is the last 24 hours, every chain together, counted from `<name>.ledger.jsonl` beside
1346
+ the wallet.
1347
+
1348
+ What a transaction moves is measured, not read from its calldata. An EVM transaction is rehearsed
1349
+ with `eth_simulateV1`, and its token and native transfers out of the wallet and its Pot are
1350
+ counted. A Solana transaction is simulated with the accounts it writes reported. A limit that
1351
+ cannot be measured on the endpoint (no `eth_simulateV1`, for one) refuses the send. A refused send
1352
+ names the limit and sends nothing:
1353
+
1354
+ ```text
1355
+ sauce run: refused by the policy of wallet agent (…/agent.policy.json): tokens.USDC.perTransaction is 100 USDC, and this transaction sends 250 USDC
1356
+ ```
1357
+
1358
+ With no policy file, sends work, and each says that no limits are set. A policy file that others
1359
+ can write is refused: they could loosen it.
1360
+
1361
+ **It is a hot wallet.** Whoever holds its file and its password holds the key, and an agent sends
1362
+ from it without asking anyone. Keep small balances in it, and set a policy. Every wallet send also
1363
+ holds to the [supported chains](#supported-and-preview-chains).
1364
+
1365
+ ## Agent skills
1366
+
1367
+ The package ships agent skills: directories in the [Agent Skills](https://agentskills.io/specification)
1368
+ format, a `SKILL.md` and the examples and references it links, that teach a coding agent to write
1369
+ Sauce programs and run them with this package. They live in [`skills/`](../../skills/sauce-overview/SKILL.md)
1370
+ at the package root:
1371
+
1372
+ | Skill | What it teaches |
1373
+ | ------------------------ | --------------------------------------------------------------------------------------------- |
1374
+ | `sauce-overview` | What Sauce is, the path from a file to a transaction, the rules, and which skill to load next |
1375
+ | `sauce-script` | The language: program forms, inputs and defines, compile errors, and the builtins reference |
1376
+ | `sauce-globals` | The names a program uses with no import, with generated indexes of them |
1377
+ | `sauce-chains` | Each chain, generated from the registries: tokens, every protocol with its addresses, intents |
1378
+ | `sauce-protocols` | Every protocol by category: how to choose, its deployments, its pitfalls and how to call it |
1379
+ | `sauce-swaps` | Swapping through the Router: entry points, price limits, callbacks and the guard on every leg |
1380
+ | `sauce-distributed-swap` | One exact-input swap spread over several price-limited pools: a limit order |
1381
+ | `sauce-intents` | Cross-chain intents written in Sauce: rewards, cascades, run or publish |
1382
+ | `sauce-solana` | Programs for Solana: accounts, the SPL token functions, the Kitchen |
1383
+ | `sauce-cli` | Everything on this page: compiling, funding, simulating, running and publishing |
1384
+ | `sauce-typescript` | The same from application code: compiling, arguments, cooks, actions and verification |
1385
+ | `sauce-examples` | An index of every example program and runner, with the chains each is checked on |
1386
+
1387
+ Every program in them is compiled through this command on the chains it names, and every command
1388
+ line they show is held to its flags, before the package is published. The per-protocol documents in
1389
+ `sauce-protocols` are the files the [`/skills` export](../api/README.md#protocol-resources) returns.
1390
+
1391
+ They are written once and installed where coding agents read them. Each agent reads skills from
1392
+ these directories, per its vendor's documentation:
1393
+
1394
+ | Agent | Reads project skills from | Documentation |
1395
+ | -------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
1396
+ | Claude Code | `.claude/skills/`, and nothing under `.agents/` | [Skills](https://code.claude.com/docs/en/skills), [memory](https://code.claude.com/docs/en/memory) |
1397
+ | OpenAI Codex | `.agents/skills/`, from the working directory up to the repo root | [Build skills](https://learn.chatgpt.com/docs/build-skills) |
1398
+ | Cursor | `.agents/skills/`, `.cursor/skills/`, and `.claude/skills/` too | [Skills](https://cursor.com/docs/skills) |
1399
+ | GitHub Copilot | `.github/skills/`, `.claude/skills/` or `.agents/skills/` | [Add skills](https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/add-skills) |
1400
+ | Gemini CLI | `.gemini/skills/`, or its `.agents/skills/` alias (which wins) | [Skills](https://geminicli.com/docs/cli/skills/) |
1401
+
1402
+ So two directories reach all five natively: `.claude/skills/` for Claude Code and `.agents/skills/`
1403
+ for the other four. Those two are what `sauce skills install` writes by default, and what
1404
+ `--agent all` means. `--agent claude`, `codex`, `cursor`, `copilot` or `gemini` alone writes only
1405
+ the directory that agent reads. Cursor and Copilot also read `.claude/skills/`, so they see the
1406
+ same skill, with the same files, in both.
1407
+
1408
+ `--agent agents-md` is opt-in, for a tool that reads [`AGENTS.md`](https://agents.md/) but no
1409
+ skills directory: it writes `.agents/skills/` and an index of the skills into `AGENTS.md`, a block
1410
+ between `<!-- sauce-skills:begin … -->` and `<!-- sauce-skills:end -->` markers listing each skill
1411
+ and its `SKILL.md`. The command owns that block and nothing else in the file. Every packaged skill
1412
+ follows the [Agent Skills specification](https://agentskills.io/specification): a `name` that is
1413
+ its directory's, lowercase letters, digits and hyphens, at most 64 characters, and a `description`
1414
+ of at most 1024.
1415
+
1416
+ `sauce init` writes the project's instructions to `AGENTS.md`, which Codex, Cursor, Copilot and
1417
+ Gemini CLI read, and the one-line pointers to it that the other two document: `CLAUDE.md` holding
1418
+ `@AGENTS.md` (Claude Code reads `AGENTS.md` only when there is no `CLAUDE.md`) and `GEMINI.md`
1419
+ holding `@./AGENTS.md` ([GEMINI.md imports](https://geminicli.com/docs/cli/gemini-md)).
1420
+
1421
+ ```sh
1422
+ npx sauce skills install # .claude/skills and .agents/skills
1423
+ npx sauce skills install --agent codex # only the directory Codex reads
1424
+ npx sauce skills install --agent all,agents-md # and the AGENTS.md index
1425
+ npx sauce skills status # exit 1 while any target is outdated
1426
+ npx sauce skills update # after upgrading the package
1427
+ ```
1428
+
1429
+ - **`install`** is the first install. It never overwrites. Run again, it says the skills are up to
1430
+ date, or, after a package upgrade, that they are outdated — installed from one version, the
1431
+ package has another — and to run `sauce skills update`. A file already there that it did not
1432
+ write is left alone.
1433
+ - **`update`** brings each installed target to the package: it adds new skill files, replaces
1434
+ changed ones and removes retired ones. A file edited since it was installed is kept, with a short
1435
+ diff of what differs, unless you pass `--force`. It prints, per target,
1436
+ `added N, updated N, removed N, kept N modified`. In `AGENTS.md` it rewrites only its own block.
1437
+ - **`status`** reports each target as up to date, outdated or modified, listing the files, and
1438
+ exits 1 while any is outdated: put it in CI to notice an upgrade the skills have not followed.
1439
+
1440
+ Each skills directory records what it was given in `.sauce-skills.json` — the package, its version,
1441
+ and the sha256 of each file as written — and the `AGENTS.md` block records the same in its opening
1442
+ marker. That record is how a package upgrade (a file still as installed) is told apart from an edit
1443
+ (a file that is not). Skills of your own in the same directories are never touched.
1444
+
1445
+ The per-protocol documents the `/skills` export returns are not a second set: they are the
1446
+ `sauce-protocols` skill's `references/`, installed with it.