@eco-incorp/sauce 0.99.6 → 0.99.7
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.
- package/README.md +58 -16
- package/actions/action-program.schema.json +480 -379
- package/actions/dist/abis.d.ts +19 -18
- package/actions/dist/abis.d.ts.map +1 -1
- package/actions/dist/abis.js +29 -29
- package/actions/dist/compile.d.ts +4 -4
- package/actions/dist/compile.d.ts.map +1 -1
- package/actions/dist/compile.js +3 -1
- package/actions/dist/compose.d.ts +63 -6
- package/actions/dist/compose.d.ts.map +1 -1
- package/actions/dist/compose.js +100 -16
- package/actions/dist/index.d.ts +1 -1
- package/actions/dist/index.d.ts.map +1 -1
- package/actions/dist/names.d.ts +88 -0
- package/actions/dist/names.d.ts.map +1 -0
- package/actions/dist/names.js +324 -0
- package/actions/dist/program.d.ts.map +1 -1
- package/actions/dist/program.js +115 -5
- package/actions/dist/registry.d.ts +10 -8
- package/actions/dist/registry.d.ts.map +1 -1
- package/actions/dist/registry.js +10 -8
- package/actions/dist/schema.d.ts.map +1 -1
- package/actions/dist/schema.js +99 -12
- package/actions/dist/semantics.d.ts +12 -2
- package/actions/dist/semantics.d.ts.map +1 -1
- package/actions/dist/semantics.js +78 -8
- package/actions/dist/spec.d.ts +30 -0
- package/actions/dist/spec.d.ts.map +1 -1
- package/actions/dist/spec.js +151 -138
- package/actions/dist/split-swap.d.ts +10 -5
- package/actions/dist/split-swap.d.ts.map +1 -1
- package/actions/dist/split-swap.js +48 -7
- package/actions/dist/to-quote.d.ts +14 -5
- package/actions/dist/to-quote.d.ts.map +1 -1
- package/actions/dist/to-quote.js +210 -244
- package/actions/dist/to-sauce.d.ts +18 -4
- package/actions/dist/to-sauce.d.ts.map +1 -1
- package/actions/dist/to-sauce.js +232 -205
- package/actions/dist/types.d.ts +245 -147
- package/actions/dist/types.d.ts.map +1 -1
- package/actions/dist/types.js +4 -0
- package/docs/README.md +38 -0
- package/docs/api/README.md +37 -23
- package/docs/api/compiler.md +53 -12
- package/docs/api/contracts.md +105 -0
- package/docs/api/coverage.md +80 -57
- package/docs/api/router.md +238 -0
- package/docs/api/routes.md +31 -22
- package/docs/concepts/architecture.md +26 -3
- package/docs/concepts/saucescript.md +35 -55
- package/docs/examples/README.md +21 -14
- package/docs/examples/action-program.ts +51 -35
- package/docs/examples/cross-chain-cascade.sauce.ts +4 -0
- package/docs/examples/cross-chain-intent.sauce.ts +2 -1
- package/docs/examples/evm-execution.ts +2 -4
- package/docs/examples/first-intent.ts +7 -2
- package/docs/examples/pot-router.ts +19 -0
- package/docs/examples/registry-names.ts +52 -0
- package/docs/examples/router-route.sauce.ts +31 -0
- package/docs/examples/router-route.ts +72 -0
- package/docs/examples/router-swap.sauce.ts +16 -0
- package/docs/examples/router-swap.ts +47 -0
- package/docs/examples/venue-where-deployed.sauce.ts +14 -0
- package/docs/guides/actions.md +230 -120
- package/docs/guides/builders-and-actions.md +20 -14
- package/docs/guides/cli.md +1442 -0
- package/docs/guides/compiling.md +19 -7
- package/docs/guides/intents.md +228 -15
- package/docs/guides/mcp.md +539 -0
- package/docs/guides/nested-intents.md +21 -6
- package/docs/guides/protocols-and-tokens.md +218 -39
- package/docs/guides/quick-start.md +5 -0
- package/docs/guides/solana.md +199 -52
- package/docs/guides/verification.md +2 -2
- package/mcp/dist/config.js +78 -0
- package/mcp/dist/config.js.map +1 -0
- package/mcp/dist/entry.js +112 -0
- package/mcp/dist/entry.js.map +1 -0
- package/mcp/dist/files.js +64 -0
- package/mcp/dist/files.js.map +1 -0
- package/mcp/dist/guard.js +262 -0
- package/mcp/dist/guard.js.map +1 -0
- package/mcp/dist/http.js +111 -0
- package/mcp/dist/http.js.map +1 -0
- package/mcp/dist/intents.js +579 -0
- package/mcp/dist/intents.js.map +1 -0
- package/mcp/dist/prompts.js +153 -0
- package/mcp/dist/prompts.js.map +1 -0
- package/mcp/dist/reach.js +98 -0
- package/mcp/dist/reach.js.map +1 -0
- package/mcp/dist/resources.js +154 -0
- package/mcp/dist/resources.js.map +1 -0
- package/mcp/dist/sdk.js +34 -0
- package/mcp/dist/sdk.js.map +1 -0
- package/mcp/dist/server.js +119 -0
- package/mcp/dist/server.js.map +1 -0
- package/mcp/dist/setup.js +189 -0
- package/mcp/dist/setup.js.map +1 -0
- package/mcp/dist/skilltools.js +520 -0
- package/mcp/dist/skilltools.js.map +1 -0
- package/mcp/dist/terms.js +93 -0
- package/mcp/dist/terms.js.map +1 -0
- package/mcp/dist/tools.js +1497 -0
- package/mcp/dist/tools.js.map +1 -0
- package/mcp/dist/wallets.js +168 -0
- package/mcp/dist/wallets.js.map +1 -0
- package/package.json +18 -13
- package/sdk/dist/artifacts/V12Deployments.json +3 -1
- package/sdk/dist/artifacts/V12EngineGate.json +1 -2
- package/sdk/dist/artifacts/V12KitchenProxy.json +1 -0
- package/sdk/dist/chains/canonical.d.ts +15 -24
- package/sdk/dist/chains/canonical.d.ts.map +1 -1
- package/sdk/dist/chains/canonical.js +18 -29
- package/sdk/dist/chains/canonical.js.map +1 -1
- package/sdk/dist/cli/actions.d.ts +29 -0
- package/sdk/dist/cli/actions.d.ts.map +1 -0
- package/sdk/dist/cli/actions.js +122 -0
- package/sdk/dist/cli/actions.js.map +1 -0
- package/sdk/dist/cli/args.d.ts +118 -0
- package/sdk/dist/cli/args.d.ts.map +1 -0
- package/sdk/dist/cli/args.js +354 -0
- package/sdk/dist/cli/args.js.map +1 -0
- package/sdk/dist/cli/assume.d.ts +51 -0
- package/sdk/dist/cli/assume.d.ts.map +1 -0
- package/sdk/dist/cli/assume.js +207 -0
- package/sdk/dist/cli/assume.js.map +1 -0
- package/sdk/dist/cli/chain.d.ts +170 -0
- package/sdk/dist/cli/chain.d.ts.map +1 -0
- package/sdk/dist/cli/chain.js +457 -0
- package/sdk/dist/cli/chain.js.map +1 -0
- package/sdk/dist/cli/commands.d.ts +226 -0
- package/sdk/dist/cli/commands.d.ts.map +1 -0
- package/sdk/dist/cli/commands.js +637 -0
- package/sdk/dist/cli/commands.js.map +1 -0
- package/sdk/dist/cli/create.d.ts +70 -0
- package/sdk/dist/cli/create.d.ts.map +1 -0
- package/sdk/dist/cli/create.js +483 -0
- package/sdk/dist/cli/create.js.map +1 -0
- package/sdk/dist/cli/diagnostics.d.ts +12 -0
- package/sdk/dist/cli/diagnostics.d.ts.map +1 -0
- package/sdk/dist/cli/diagnostics.js +200 -0
- package/sdk/dist/cli/diagnostics.js.map +1 -0
- package/sdk/dist/cli/effects.d.ts +71 -0
- package/sdk/dist/cli/effects.d.ts.map +1 -0
- package/sdk/dist/cli/effects.js +279 -0
- package/sdk/dist/cli/effects.js.map +1 -0
- package/sdk/dist/cli/fill.d.ts +83 -0
- package/sdk/dist/cli/fill.d.ts.map +1 -0
- package/sdk/dist/cli/fill.js +734 -0
- package/sdk/dist/cli/fill.js.map +1 -0
- package/sdk/dist/cli/funding.d.ts +126 -0
- package/sdk/dist/cli/funding.d.ts.map +1 -0
- package/sdk/dist/cli/funding.js +514 -0
- package/sdk/dist/cli/funding.js.map +1 -0
- package/sdk/dist/cli/globals.d.ts +16 -0
- package/sdk/dist/cli/globals.d.ts.map +1 -0
- package/sdk/dist/cli/globals.js +197 -0
- package/sdk/dist/cli/globals.js.map +1 -0
- package/sdk/dist/cli/init.d.ts +34 -0
- package/sdk/dist/cli/init.d.ts.map +1 -0
- package/sdk/dist/cli/init.js +181 -0
- package/sdk/dist/cli/init.js.map +1 -0
- package/sdk/dist/cli/inputs.d.ts +72 -0
- package/sdk/dist/cli/inputs.d.ts.map +1 -0
- package/sdk/dist/cli/inputs.js +152 -0
- package/sdk/dist/cli/inputs.js.map +1 -0
- package/sdk/dist/cli/inspect.d.ts +48 -0
- package/sdk/dist/cli/inspect.d.ts.map +1 -0
- package/sdk/dist/cli/inspect.js +536 -0
- package/sdk/dist/cli/inspect.js.map +1 -0
- package/sdk/dist/cli/intent-commands.d.ts +71 -0
- package/sdk/dist/cli/intent-commands.d.ts.map +1 -0
- package/sdk/dist/cli/intent-commands.js +698 -0
- package/sdk/dist/cli/intent-commands.js.map +1 -0
- package/sdk/dist/cli/intent-svm.d.ts +15 -0
- package/sdk/dist/cli/intent-svm.d.ts.map +1 -0
- package/sdk/dist/cli/intent-svm.js +222 -0
- package/sdk/dist/cli/intent-svm.js.map +1 -0
- package/sdk/dist/cli/intents.d.ts +43 -0
- package/sdk/dist/cli/intents.d.ts.map +1 -0
- package/sdk/dist/cli/intents.js +89 -0
- package/sdk/dist/cli/intents.js.map +1 -0
- package/sdk/dist/cli/interactive.d.ts +11 -0
- package/sdk/dist/cli/interactive.d.ts.map +1 -0
- package/sdk/dist/cli/interactive.js +161 -0
- package/sdk/dist/cli/interactive.js.map +1 -0
- package/sdk/dist/cli/lifecycle-svm.d.ts +109 -0
- package/sdk/dist/cli/lifecycle-svm.d.ts.map +1 -0
- package/sdk/dist/cli/lifecycle-svm.js +299 -0
- package/sdk/dist/cli/lifecycle-svm.js.map +1 -0
- package/sdk/dist/cli/lifecycle.d.ts +439 -0
- package/sdk/dist/cli/lifecycle.d.ts.map +1 -0
- package/sdk/dist/cli/lifecycle.js +1721 -0
- package/sdk/dist/cli/lifecycle.js.map +1 -0
- package/sdk/dist/cli/main.d.ts +3 -0
- package/sdk/dist/cli/main.d.ts.map +1 -0
- package/sdk/dist/cli/main.js +8 -0
- package/sdk/dist/cli/main.js.map +1 -0
- package/sdk/dist/cli/mcp.d.ts +66 -0
- package/sdk/dist/cli/mcp.d.ts.map +1 -0
- package/sdk/dist/cli/mcp.js +169 -0
- package/sdk/dist/cli/mcp.js.map +1 -0
- package/sdk/dist/cli/password.d.ts +54 -0
- package/sdk/dist/cli/password.d.ts.map +1 -0
- package/sdk/dist/cli/password.js +148 -0
- package/sdk/dist/cli/password.js.map +1 -0
- package/sdk/dist/cli/policy.d.ts +130 -0
- package/sdk/dist/cli/policy.d.ts.map +1 -0
- package/sdk/dist/cli/policy.js +702 -0
- package/sdk/dist/cli/policy.js.map +1 -0
- package/sdk/dist/cli/pools.d.ts +140 -0
- package/sdk/dist/cli/pools.d.ts.map +1 -0
- package/sdk/dist/cli/pools.js +658 -0
- package/sdk/dist/cli/pools.js.map +1 -0
- package/sdk/dist/cli/price.d.ts +74 -0
- package/sdk/dist/cli/price.d.ts.map +1 -0
- package/sdk/dist/cli/price.js +321 -0
- package/sdk/dist/cli/price.js.map +1 -0
- package/sdk/dist/cli/prompt.d.ts +30 -0
- package/sdk/dist/cli/prompt.d.ts.map +1 -0
- package/sdk/dist/cli/prompt.js +53 -0
- package/sdk/dist/cli/prompt.js.map +1 -0
- package/sdk/dist/cli/publish.d.ts +48 -0
- package/sdk/dist/cli/publish.d.ts.map +1 -0
- package/sdk/dist/cli/publish.js +480 -0
- package/sdk/dist/cli/publish.js.map +1 -0
- package/sdk/dist/cli/receipt.d.ts +35 -0
- package/sdk/dist/cli/receipt.d.ts.map +1 -0
- package/sdk/dist/cli/receipt.js +63 -0
- package/sdk/dist/cli/receipt.js.map +1 -0
- package/sdk/dist/cli/rehearse.d.ts +80 -0
- package/sdk/dist/cli/rehearse.d.ts.map +1 -0
- package/sdk/dist/cli/rehearse.js +265 -0
- package/sdk/dist/cli/rehearse.js.map +1 -0
- package/sdk/dist/cli/report.d.ts +69 -0
- package/sdk/dist/cli/report.d.ts.map +1 -0
- package/sdk/dist/cli/report.js +206 -0
- package/sdk/dist/cli/report.js.map +1 -0
- package/sdk/dist/cli/returned.d.ts +16 -0
- package/sdk/dist/cli/returned.d.ts.map +1 -0
- package/sdk/dist/cli/returned.js +111 -0
- package/sdk/dist/cli/returned.js.map +1 -0
- package/sdk/dist/cli/run.d.ts +40 -0
- package/sdk/dist/cli/run.d.ts.map +1 -0
- package/sdk/dist/cli/run.js +3162 -0
- package/sdk/dist/cli/run.js.map +1 -0
- package/sdk/dist/cli/signer.d.ts +72 -0
- package/sdk/dist/cli/signer.d.ts.map +1 -0
- package/sdk/dist/cli/signer.js +243 -0
- package/sdk/dist/cli/signer.js.map +1 -0
- package/sdk/dist/cli/simulate.d.ts +11 -0
- package/sdk/dist/cli/simulate.d.ts.map +1 -0
- package/sdk/dist/cli/simulate.js +246 -0
- package/sdk/dist/cli/simulate.js.map +1 -0
- package/sdk/dist/cli/skills.d.ts +77 -0
- package/sdk/dist/cli/skills.d.ts.map +1 -0
- package/sdk/dist/cli/skills.js +527 -0
- package/sdk/dist/cli/skills.js.map +1 -0
- package/sdk/dist/cli/solana.d.ts +183 -0
- package/sdk/dist/cli/solana.d.ts.map +1 -0
- package/sdk/dist/cli/solana.js +1360 -0
- package/sdk/dist/cli/solana.js.map +1 -0
- package/sdk/dist/cli/store.d.ts +60 -0
- package/sdk/dist/cli/store.d.ts.map +1 -0
- package/sdk/dist/cli/store.js +196 -0
- package/sdk/dist/cli/store.js.map +1 -0
- package/sdk/dist/cli/support.d.ts +144 -0
- package/sdk/dist/cli/support.d.ts.map +1 -0
- package/sdk/dist/cli/support.js +217 -0
- package/sdk/dist/cli/support.js.map +1 -0
- package/sdk/dist/cli/svm-effects.d.ts +50 -0
- package/sdk/dist/cli/svm-effects.d.ts.map +1 -0
- package/sdk/dist/cli/svm-effects.js +196 -0
- package/sdk/dist/cli/svm-effects.js.map +1 -0
- package/sdk/dist/cli/terminal.d.ts +42 -0
- package/sdk/dist/cli/terminal.d.ts.map +1 -0
- package/sdk/dist/cli/terminal.js +136 -0
- package/sdk/dist/cli/terminal.js.map +1 -0
- package/sdk/dist/cli/verify.d.ts +32 -0
- package/sdk/dist/cli/verify.d.ts.map +1 -0
- package/sdk/dist/cli/verify.js +185 -0
- package/sdk/dist/cli/verify.js.map +1 -0
- package/sdk/dist/cli/wallet-commands.d.ts +59 -0
- package/sdk/dist/cli/wallet-commands.d.ts.map +1 -0
- package/sdk/dist/cli/wallet-commands.js +222 -0
- package/sdk/dist/cli/wallet-commands.js.map +1 -0
- package/sdk/dist/cli/wallet-send.d.ts +38 -0
- package/sdk/dist/cli/wallet-send.d.ts.map +1 -0
- package/sdk/dist/cli/wallet-send.js +303 -0
- package/sdk/dist/cli/wallet-send.js.map +1 -0
- package/sdk/dist/cli/wallets.d.ts +79 -0
- package/sdk/dist/cli/wallets.d.ts.map +1 -0
- package/sdk/dist/cli/wallets.js +297 -0
- package/sdk/dist/cli/wallets.js.map +1 -0
- package/sdk/dist/deployments/index.d.ts +4 -62
- package/sdk/dist/deployments/index.d.ts.map +1 -1
- package/sdk/dist/deployments/index.js +4 -84
- package/sdk/dist/deployments/index.js.map +1 -1
- package/sdk/dist/deployments/pot.d.ts +17 -7
- package/sdk/dist/deployments/pot.d.ts.map +1 -1
- package/sdk/dist/deployments/pot.js +25 -10
- package/sdk/dist/deployments/pot.js.map +1 -1
- package/sdk/dist/deployments/releases.d.ts +36 -0
- package/sdk/dist/deployments/releases.d.ts.map +1 -0
- package/sdk/dist/deployments/releases.js +61 -0
- package/sdk/dist/deployments/releases.js.map +1 -0
- package/sdk/dist/deployments/releases.json +76 -0
- package/sdk/dist/deployments/v12-addresses.d.ts +13 -0
- package/sdk/dist/deployments/v12-addresses.d.ts.map +1 -1
- package/sdk/dist/deployments/v12-addresses.js +16 -3
- package/sdk/dist/deployments/v12-addresses.js.map +1 -1
- package/sdk/dist/deposit/index.d.ts +6 -6
- package/sdk/dist/deposit/index.d.ts.map +1 -1
- package/sdk/dist/deposit/index.js +1 -1
- package/sdk/dist/deposit/index.js.map +1 -1
- package/sdk/dist/deposit/params.d.ts +4 -4
- package/sdk/dist/deposit/params.d.ts.map +1 -1
- package/sdk/dist/deposit/params.js +7 -4
- package/sdk/dist/deposit/params.js.map +1 -1
- package/sdk/dist/deposit/source.d.ts +3 -30
- package/sdk/dist/deposit/source.d.ts.map +1 -1
- package/sdk/dist/deposit/source.js +7 -83
- package/sdk/dist/deposit/source.js.map +1 -1
- package/sdk/dist/deposit/templates.d.ts +1 -2
- package/sdk/dist/deposit/templates.d.ts.map +1 -1
- package/sdk/dist/deposit/templates.js +10 -2
- package/sdk/dist/deposit/templates.js.map +1 -1
- package/sdk/dist/deposit/types.d.ts +14 -12
- package/sdk/dist/deposit/types.d.ts.map +1 -1
- package/sdk/dist/deposit/types.js +6 -0
- package/sdk/dist/deposit/types.js.map +1 -1
- package/sdk/dist/descriptors/accessors.d.ts +38 -35
- package/sdk/dist/descriptors/accessors.d.ts.map +1 -1
- package/sdk/dist/descriptors/accessors.js +16 -0
- package/sdk/dist/descriptors/accessors.js.map +1 -1
- package/sdk/dist/descriptors/call.d.ts +66 -14
- package/sdk/dist/descriptors/call.d.ts.map +1 -1
- package/sdk/dist/descriptors/call.js +94 -13
- package/sdk/dist/descriptors/call.js.map +1 -1
- package/sdk/dist/descriptors/contracts.generated.d.ts +3393 -0
- package/sdk/dist/descriptors/contracts.generated.d.ts.map +1 -0
- package/sdk/dist/descriptors/contracts.generated.js +728 -0
- package/sdk/dist/descriptors/contracts.generated.js.map +1 -0
- package/sdk/dist/descriptors/derive.d.ts +20 -11
- package/sdk/dist/descriptors/derive.d.ts.map +1 -1
- package/sdk/dist/descriptors/derive.js +68 -30
- package/sdk/dist/descriptors/derive.js.map +1 -1
- package/sdk/dist/descriptors/index.d.ts +6 -7
- package/sdk/dist/descriptors/index.d.ts.map +1 -1
- package/sdk/dist/descriptors/index.js +2 -2
- package/sdk/dist/descriptors/index.js.map +1 -1
- package/sdk/dist/descriptors/links.d.ts +23 -214
- package/sdk/dist/descriptors/links.d.ts.map +1 -1
- package/sdk/dist/descriptors/links.js +1 -232
- package/sdk/dist/descriptors/links.js.map +1 -1
- package/sdk/dist/descriptors/query.d.ts +1 -1
- package/sdk/dist/descriptors/query.d.ts.map +1 -1
- package/sdk/dist/descriptors/query.js +1 -1
- package/sdk/dist/descriptors/query.js.map +1 -1
- package/sdk/dist/descriptors/registry.d.ts +2 -5
- package/sdk/dist/descriptors/registry.d.ts.map +1 -1
- package/sdk/dist/descriptors/registry.js +11 -66
- package/sdk/dist/descriptors/registry.js.map +1 -1
- package/sdk/dist/embedded/resolve.d.ts +4 -4
- package/sdk/dist/embedded/resolve.d.ts.map +1 -1
- package/sdk/dist/embedded/resolve.js +12 -8
- package/sdk/dist/embedded/resolve.js.map +1 -1
- package/sdk/dist/embedded/skills.generated.d.ts +1 -1
- package/sdk/dist/embedded/skills.generated.d.ts.map +1 -1
- package/sdk/dist/embedded/skills.generated.js +137 -136
- package/sdk/dist/embedded/skills.generated.js.map +1 -1
- package/sdk/dist/embedded/sources.generated.d.ts.map +1 -1
- package/sdk/dist/embedded/sources.generated.js +40 -6
- package/sdk/dist/embedded/sources.generated.js.map +1 -1
- package/sdk/dist/evm/engine.d.ts +813 -10
- package/sdk/dist/evm/engine.d.ts.map +1 -1
- package/sdk/dist/evm/engine.js +127 -8
- package/sdk/dist/evm/engine.js.map +1 -1
- package/sdk/dist/index.d.ts +3 -2
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +6 -2
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/price.d.ts +40 -0
- package/sdk/dist/price.d.ts.map +1 -0
- package/sdk/dist/price.js +101 -0
- package/sdk/dist/price.js.map +1 -0
- package/sdk/dist/protocols/aerodrome/abis.d.ts +76 -0
- package/sdk/dist/protocols/aerodrome/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/aerodrome/abis.js +61 -0
- package/sdk/dist/protocols/aerodrome/abis.js.map +1 -1
- package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts +70 -0
- package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/aerodrome-slipstream/abis.js +54 -0
- package/sdk/dist/protocols/aerodrome-slipstream/abis.js.map +1 -1
- package/sdk/dist/protocols/camelot/abis.d.ts +178 -0
- package/sdk/dist/protocols/camelot/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/camelot/abis.js +139 -0
- package/sdk/dist/protocols/camelot/abis.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/abis.d.ts +792 -50
- package/sdk/dist/protocols/eco-routes/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/abis.js +1058 -49
- package/sdk/dist/protocols/eco-routes/abis.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts +44 -61
- package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/addresses.generated.js +45 -62
- package/sdk/dist/protocols/eco-routes/addresses.generated.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/lookup.d.ts +10 -0
- package/sdk/dist/protocols/eco-routes/lookup.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/lookup.js +16 -0
- package/sdk/dist/protocols/eco-routes/lookup.js.map +1 -1
- package/sdk/dist/protocols/maverick/abis.d.ts +77 -0
- package/sdk/dist/protocols/maverick/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/maverick/abis.js +58 -0
- package/sdk/dist/protocols/maverick/abis.js.map +1 -1
- package/sdk/dist/protocols/maverick/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/maverick/addresses.js +4 -0
- package/sdk/dist/protocols/maverick/addresses.js.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v2/abis.js +43 -0
- package/sdk/dist/protocols/pancakeswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v3/abis.js +56 -0
- package/sdk/dist/protocols/pancakeswap-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/permit2/abis.d.ts +113 -0
- package/sdk/dist/protocols/permit2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/permit2/abis.js +63 -0
- package/sdk/dist/protocols/permit2/abis.js.map +1 -1
- package/sdk/dist/protocols/quickswap/abis.d.ts +148 -0
- package/sdk/dist/protocols/quickswap/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/quickswap/abis.js +119 -0
- package/sdk/dist/protocols/quickswap/abis.js.map +1 -1
- package/sdk/dist/protocols/sushiswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/sushiswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/sushiswap-v2/abis.js +42 -0
- package/sdk/dist/protocols/sushiswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/synthra-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/synthra-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/synthra-v3/abis.js +55 -0
- package/sdk/dist/protocols/synthra-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/trader-joe/abis.d.ts +133 -0
- package/sdk/dist/protocols/trader-joe/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/trader-joe/abis.js +101 -0
- package/sdk/dist/protocols/trader-joe/abis.js.map +1 -1
- package/sdk/dist/protocols/trader-joe/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/trader-joe/addresses.js +5 -0
- package/sdk/dist/protocols/trader-joe/addresses.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/uniswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v2/abis.js +44 -0
- package/sdk/dist/protocols/uniswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/uniswap-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v3/abis.js +55 -0
- package/sdk/dist/protocols/uniswap-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/abis.d.ts +247 -0
- package/sdk/dist/protocols/uniswap-v4/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/abis.js +167 -0
- package/sdk/dist/protocols/uniswap-v4/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/addresses.js +50 -0
- package/sdk/dist/protocols/uniswap-v4/addresses.js.map +1 -1
- package/sdk/dist/protocols/unitflow-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/unitflow-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/unitflow-v3/abis.js +56 -0
- package/sdk/dist/protocols/unitflow-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/velodrome/abis.d.ts +76 -0
- package/sdk/dist/protocols/velodrome/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/velodrome/abis.js +61 -0
- package/sdk/dist/protocols/velodrome/abis.js.map +1 -1
- package/sdk/dist/recipes/cctp-split.sauce.ts +2 -2
- package/sdk/dist/recipes/plain-transfer.sauce.ts +2 -2
- package/sdk/dist/routes/accessor-index.d.ts +2 -2
- package/sdk/dist/routes/accessor-index.d.ts.map +1 -1
- package/sdk/dist/routes/accessor-index.js +4 -3
- package/sdk/dist/routes/accessor-index.js.map +1 -1
- package/sdk/dist/routes/ambient.d.ts +5 -0
- package/sdk/dist/routes/ambient.d.ts.map +1 -1
- package/sdk/dist/routes/ambient.js +20 -0
- package/sdk/dist/routes/ambient.js.map +1 -1
- package/sdk/dist/routes/ast-walk.d.ts +17 -3
- package/sdk/dist/routes/ast-walk.d.ts.map +1 -1
- package/sdk/dist/routes/ast-walk.js +24 -2
- package/sdk/dist/routes/ast-walk.js.map +1 -1
- package/sdk/dist/routes/available.d.ts +43 -0
- package/sdk/dist/routes/available.d.ts.map +1 -0
- package/sdk/dist/routes/available.js +230 -0
- package/sdk/dist/routes/available.js.map +1 -0
- package/sdk/dist/routes/builtins.generated.d.ts +180 -0
- package/sdk/dist/routes/builtins.generated.d.ts.map +1 -0
- package/sdk/dist/routes/builtins.generated.js +2 -0
- package/sdk/dist/routes/builtins.generated.js.map +1 -0
- package/sdk/dist/routes/chain-exports.generated.d.ts +13 -8
- package/sdk/dist/routes/chain-exports.generated.d.ts.map +1 -1
- package/sdk/dist/routes/chain-exports.generated.js.map +1 -1
- package/sdk/dist/routes/closure.d.ts.map +1 -1
- package/sdk/dist/routes/closure.js +13 -26
- package/sdk/dist/routes/closure.js.map +1 -1
- package/sdk/dist/routes/composed.d.ts.map +1 -1
- package/sdk/dist/routes/composed.js +20 -8
- package/sdk/dist/routes/composed.js.map +1 -1
- package/sdk/dist/routes/encode.d.ts +17 -0
- package/sdk/dist/routes/encode.d.ts.map +1 -1
- package/sdk/dist/routes/encode.js +14 -11
- package/sdk/dist/routes/encode.js.map +1 -1
- package/sdk/dist/routes/entry.d.ts +76 -0
- package/sdk/dist/routes/entry.d.ts.map +1 -0
- package/sdk/dist/routes/entry.js +478 -0
- package/sdk/dist/routes/entry.js.map +1 -0
- package/sdk/dist/routes/index.d.ts +19 -12
- package/sdk/dist/routes/index.d.ts.map +1 -1
- package/sdk/dist/routes/index.js +11 -8
- package/sdk/dist/routes/index.js.map +1 -1
- package/sdk/dist/routes/intent-body.d.ts +97 -0
- package/sdk/dist/routes/intent-body.d.ts.map +1 -0
- package/sdk/dist/routes/intent-body.js +441 -0
- package/sdk/dist/routes/intent-body.js.map +1 -0
- package/sdk/dist/routes/intent-dsl.d.ts +21 -6
- package/sdk/dist/routes/intent-dsl.d.ts.map +1 -1
- package/sdk/dist/routes/intent-dsl.js +34 -17
- package/sdk/dist/routes/intent-dsl.js.map +1 -1
- package/sdk/dist/routes/intent-sugar.d.ts +77 -4
- package/sdk/dist/routes/intent-sugar.d.ts.map +1 -1
- package/sdk/dist/routes/intent-sugar.js +318 -129
- package/sdk/dist/routes/intent-sugar.js.map +1 -1
- package/sdk/dist/routes/intent.d.ts +13 -1
- package/sdk/dist/routes/intent.d.ts.map +1 -1
- package/sdk/dist/routes/intent.js +37 -1
- package/sdk/dist/routes/intent.js.map +1 -1
- package/sdk/dist/routes/nest.d.ts +3 -2
- package/sdk/dist/routes/nest.d.ts.map +1 -1
- package/sdk/dist/routes/nest.js +5 -3
- package/sdk/dist/routes/nest.js.map +1 -1
- package/sdk/dist/routes/parse.d.ts +6 -0
- package/sdk/dist/routes/parse.d.ts.map +1 -0
- package/sdk/dist/routes/parse.js +39 -0
- package/sdk/dist/routes/parse.js.map +1 -0
- package/sdk/dist/routes/portal.d.ts +258 -4
- package/sdk/dist/routes/portal.d.ts.map +1 -1
- package/sdk/dist/routes/portal.js +588 -9
- package/sdk/dist/routes/portal.js.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts +71 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.js +178 -54
- package/sdk/dist/routes/protocol-rewrite.js.map +1 -1
- package/sdk/dist/routes/rs-compile.d.ts +25 -22
- package/sdk/dist/routes/rs-compile.d.ts.map +1 -1
- package/sdk/dist/routes/rs-compile.js +55 -49
- package/sdk/dist/routes/rs-compile.js.map +1 -1
- package/sdk/dist/routes/sauce-calls.d.ts +26 -12
- package/sdk/dist/routes/sauce-calls.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-calls.js +16 -23
- package/sdk/dist/routes/sauce-calls.js.map +1 -1
- package/sdk/dist/routes/sauce-route.d.ts +74 -7
- package/sdk/dist/routes/sauce-route.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-route.js +225 -75
- package/sdk/dist/routes/sauce-route.js.map +1 -1
- package/sdk/dist/routes/source-globals.d.ts +107 -0
- package/sdk/dist/routes/source-globals.d.ts.map +1 -0
- package/sdk/dist/routes/source-globals.generated.d.ts +5523 -933
- package/sdk/dist/routes/source-globals.generated.d.ts.map +1 -1
- package/sdk/dist/routes/source-globals.generated.js +3 -4
- package/sdk/dist/routes/source-globals.generated.js.map +1 -1
- package/sdk/dist/routes/source-globals.js +174 -0
- package/sdk/dist/routes/source-globals.js.map +1 -0
- package/sdk/dist/routes/stock-tokens.d.ts +69 -0
- package/sdk/dist/routes/stock-tokens.d.ts.map +1 -0
- package/sdk/dist/routes/stock-tokens.generated.d.ts +4 -0
- package/sdk/dist/routes/stock-tokens.generated.d.ts.map +1 -0
- package/sdk/dist/routes/stock-tokens.generated.js +1836 -0
- package/sdk/dist/routes/stock-tokens.generated.js.map +1 -0
- package/sdk/dist/routes/stock-tokens.js +65 -0
- package/sdk/dist/routes/stock-tokens.js.map +1 -0
- package/sdk/dist/routes/token-registry.d.ts +64 -8
- package/sdk/dist/routes/token-registry.d.ts.map +1 -1
- package/sdk/dist/routes/token-registry.js +202 -32
- package/sdk/dist/routes/token-registry.js.map +1 -1
- package/sdk/dist/routes/token-rewrite.d.ts +1 -1
- package/sdk/dist/routes/token-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/token-rewrite.js +5 -9
- package/sdk/dist/routes/token-rewrite.js.map +1 -1
- package/sdk/dist/routes/unknown-global.d.ts +32 -0
- package/sdk/dist/routes/unknown-global.d.ts.map +1 -0
- package/sdk/dist/routes/unknown-global.js +106 -0
- package/sdk/dist/routes/unknown-global.js.map +1 -0
- package/sdk/dist/routes/vault.d.ts +38 -8
- package/sdk/dist/routes/vault.d.ts.map +1 -1
- package/sdk/dist/routes/vault.js +47 -8
- package/sdk/dist/routes/vault.js.map +1 -1
- package/sdk/dist/sauce-script/builtins.d.ts +309 -0
- package/sdk/dist/sauce-script/declarations.d.ts +3 -0
- package/sdk/dist/sauce-script/declarations.d.ts.map +1 -0
- package/sdk/dist/sauce-script/declarations.js +229 -0
- package/sdk/dist/sauce-script/declarations.js.map +1 -0
- package/sdk/dist/sauce-script/index.d.ts +2714 -0
- package/sdk/dist/sauce-script/ts-plugin.cjs +85 -0
- package/sdk/dist/skills/loader.d.ts.map +1 -1
- package/sdk/dist/skills/loader.js +4 -3
- package/sdk/dist/skills/loader.js.map +1 -1
- package/sdk/dist/std/router/balancer-v2-vault.abi.json +78 -0
- package/sdk/dist/std/router/curve-cryptoswap.abi.json +29 -0
- package/sdk/dist/std/router/curve-stableswap.abi.json +29 -0
- package/sdk/dist/std/router/dodo-v2-pool.abi.json +39 -0
- package/sdk/dist/std/router/lb-pair.abi.json +55 -0
- package/sdk/dist/std/router/package.json +7 -0
- package/sdk/dist/std/router/router.evm.js +567 -0
- package/sdk/dist/std/router/sauce-router.abi.json +202 -0
- package/sdk/dist/std/router/uniswap-v2-pair.abi.json +49 -0
- package/sdk/dist/std/router/woo-pp-v2.abi.json +42 -0
- package/sdk/dist/std/token/permit2.abi.json +226 -0
- package/sdk/dist/std/token/token.evm.js +73 -0
- package/sdk/dist/std/token/token.svm.js +194 -41
- package/sdk/dist/svm/client.d.ts +62 -15
- package/sdk/dist/svm/client.d.ts.map +1 -1
- package/sdk/dist/svm/client.js +103 -42
- package/sdk/dist/svm/client.js.map +1 -1
- package/sdk/dist/svm/engine.d.ts +66 -5
- package/sdk/dist/svm/engine.d.ts.map +1 -1
- package/sdk/dist/svm/engine.js +73 -5
- package/sdk/dist/svm/engine.js.map +1 -1
- package/sdk/dist/svm/index.d.ts +2 -0
- package/sdk/dist/svm/index.d.ts.map +1 -1
- package/sdk/dist/svm/index.js +2 -0
- package/sdk/dist/svm/index.js.map +1 -1
- package/sdk/dist/svm/instructions.d.ts +72 -1
- package/sdk/dist/svm/instructions.d.ts.map +1 -1
- package/sdk/dist/svm/instructions.js +81 -2
- package/sdk/dist/svm/instructions.js.map +1 -1
- package/sdk/dist/svm/kitchen.d.ts +20 -1
- package/sdk/dist/svm/kitchen.d.ts.map +1 -1
- package/sdk/dist/svm/kitchen.js +47 -1
- package/sdk/dist/svm/kitchen.js.map +1 -1
- package/sdk/dist/svm/portal.d.ts +250 -0
- package/sdk/dist/svm/portal.d.ts.map +1 -0
- package/sdk/dist/svm/portal.js +462 -0
- package/sdk/dist/svm/portal.js.map +1 -0
- package/sdk/dist/svm/send.d.ts +18 -2
- package/sdk/dist/svm/send.d.ts.map +1 -1
- package/sdk/dist/svm/send.js +28 -3
- package/sdk/dist/svm/send.js.map +1 -1
- package/sdk/dist/svm/token-accounts.d.ts +49 -0
- package/sdk/dist/svm/token-accounts.d.ts.map +1 -0
- package/sdk/dist/svm/token-accounts.js +58 -0
- package/sdk/dist/svm/token-accounts.js.map +1 -0
- package/sdk/dist/svm/token-extensions.d.ts +18 -7
- package/sdk/dist/svm/token-extensions.d.ts.map +1 -1
- package/sdk/dist/svm/token-extensions.js +58 -5
- package/sdk/dist/svm/token-extensions.js.map +1 -1
- package/sdk/dist/token/evm.js +1 -1
- package/sdk/dist/token/index.d.ts +1 -1
- package/sdk/dist/token/index.js +1 -1
- package/sdk/dist/token/params.js +1 -1
- package/sdk/dist/token/source.js +3 -3
- package/sdk/dist/token/source.js.map +1 -1
- package/sdk/dist/token/types.d.ts +2 -2
- package/sdk/dist/token/types.js +2 -2
- package/sdk/src/protocols/aerodrome/AerodromePoolABI.json +105 -0
- package/sdk/src/protocols/aerodrome/abis.ts +62 -0
- package/sdk/src/protocols/aerodrome-slipstream/AerodromeSlipstreamPoolABI.json +96 -0
- package/sdk/src/protocols/aerodrome-slipstream/abis.ts +55 -0
- package/sdk/src/protocols/camelot/CamelotV2FactoryABI.json +25 -0
- package/sdk/src/protocols/camelot/CamelotV2PairABI.json +109 -0
- package/sdk/src/protocols/camelot/CamelotV3FactoryABI.json +25 -0
- package/sdk/src/protocols/camelot/CamelotV3PoolABI.json +92 -0
- package/sdk/src/protocols/camelot/abis.ts +143 -0
- package/sdk/src/protocols/eco-routes/PortalABI.json +1448 -0
- package/sdk/src/protocols/eco-routes/ProverABI.json +162 -0
- package/sdk/src/protocols/eco-routes/abis.ts +1060 -51
- package/sdk/src/protocols/eco-routes/addresses.generated.ts +45 -62
- package/sdk/src/protocols/eco-routes/lookup.ts +18 -0
- package/sdk/src/protocols/maverick/MaverickV2PoolABI.json +107 -0
- package/sdk/src/protocols/maverick/abis.ts +59 -0
- package/sdk/src/protocols/maverick/addresses.ts +4 -0
- package/sdk/src/protocols/pancakeswap-v2/PancakeSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/pancakeswap-v2/abis.ts +44 -0
- package/sdk/src/protocols/pancakeswap-v3/PancakeSwapV3PoolABI.json +100 -0
- package/sdk/src/protocols/pancakeswap-v3/abis.ts +57 -0
- package/sdk/src/protocols/permit2/Permit2ABI.json +154 -0
- package/sdk/src/protocols/permit2/abis.ts +63 -0
- package/sdk/src/protocols/quickswap/QuickSwapV2FactoryABI.json +25 -0
- package/sdk/src/protocols/quickswap/QuickSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/quickswap/QuickSwapV3FactoryABI.json +25 -0
- package/sdk/src/protocols/quickswap/QuickSwapV3PoolABI.json +88 -0
- package/sdk/src/protocols/quickswap/abis.ts +123 -0
- package/sdk/src/protocols/sushiswap-v2/SushiSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/sushiswap-v2/abis.ts +43 -0
- package/sdk/src/protocols/synthra-v3/SynthraV3PoolABI.json +100 -0
- package/sdk/src/protocols/synthra-v3/abis.ts +56 -0
- package/sdk/src/protocols/trader-joe/LBPairABI.json +185 -0
- package/sdk/src/protocols/trader-joe/abis.ts +102 -0
- package/sdk/src/protocols/trader-joe/addresses.ts +5 -0
- package/sdk/src/protocols/uniswap-v2/UniswapV2PairABI.json +72 -0
- package/sdk/src/protocols/uniswap-v2/abis.ts +45 -0
- package/sdk/src/protocols/uniswap-v3/UniswapV3PoolABI.json +100 -0
- package/sdk/src/protocols/uniswap-v3/abis.ts +56 -0
- package/sdk/src/protocols/uniswap-v4/UniswapV4PoolManagerABI.json +38 -0
- package/sdk/src/protocols/uniswap-v4/UniswapV4StateViewABI.json +307 -0
- package/sdk/src/protocols/uniswap-v4/abis.ts +168 -0
- package/sdk/src/protocols/uniswap-v4/addresses.ts +50 -0
- package/sdk/src/protocols/unitflow-v3/UnitFlowV3PoolABI.json +100 -0
- package/sdk/src/protocols/unitflow-v3/abis.ts +57 -0
- package/sdk/src/protocols/velodrome/VelodromePoolABI.json +105 -0
- package/sdk/src/protocols/velodrome/abis.ts +62 -0
- package/skills/sauce-actions/SKILL.md +166 -0
- package/skills/sauce-actions/examples/swap-and-supply.json +24 -0
- package/skills/sauce-actions/examples/swap-by-key.json +15 -0
- package/skills/sauce-actions/references/actions.md +731 -0
- package/skills/sauce-chains/SKILL.md +137 -0
- package/skills/sauce-chains/examples/chains.sauce.ts +25 -0
- package/skills/sauce-chains/references/arbitrum.md +158 -0
- package/skills/sauce-chains/references/arc.md +107 -0
- package/skills/sauce-chains/references/aurora.md +33 -0
- package/skills/sauce-chains/references/avalanche.md +106 -0
- package/skills/sauce-chains/references/base-stocks.md +77 -0
- package/skills/sauce-chains/references/base.md +141 -0
- package/skills/sauce-chains/references/berachain.md +33 -0
- package/skills/sauce-chains/references/blast.md +60 -0
- package/skills/sauce-chains/references/boba.md +33 -0
- package/skills/sauce-chains/references/bsc.md +97 -0
- package/skills/sauce-chains/references/celo.md +57 -0
- package/skills/sauce-chains/references/core.md +33 -0
- package/skills/sauce-chains/references/cronos.md +33 -0
- package/skills/sauce-chains/references/ethereum-stocks.md +1741 -0
- package/skills/sauce-chains/references/ethereum.md +255 -0
- package/skills/sauce-chains/references/evmos.md +33 -0
- package/skills/sauce-chains/references/fantom.md +61 -0
- package/skills/sauce-chains/references/fuse.md +33 -0
- package/skills/sauce-chains/references/gnosis.md +57 -0
- package/skills/sauce-chains/references/index.md +58 -0
- package/skills/sauce-chains/references/ink.md +55 -0
- package/skills/sauce-chains/references/kava.md +33 -0
- package/skills/sauce-chains/references/klaytn.md +33 -0
- package/skills/sauce-chains/references/linea.md +65 -0
- package/skills/sauce-chains/references/manta.md +33 -0
- package/skills/sauce-chains/references/mantle.md +33 -0
- package/skills/sauce-chains/references/metis.md +54 -0
- package/skills/sauce-chains/references/mode.md +55 -0
- package/skills/sauce-chains/references/monad.md +79 -0
- package/skills/sauce-chains/references/moonbeam.md +33 -0
- package/skills/sauce-chains/references/opbnb.md +55 -0
- package/skills/sauce-chains/references/optimism.md +123 -0
- package/skills/sauce-chains/references/plasma.md +35 -0
- package/skills/sauce-chains/references/polygon.md +123 -0
- package/skills/sauce-chains/references/pulsechain.md +33 -0
- package/skills/sauce-chains/references/ronin.md +35 -0
- package/skills/sauce-chains/references/scroll.md +62 -0
- package/skills/sauce-chains/references/sei.md +55 -0
- package/skills/sauce-chains/references/solana.md +53 -0
- package/skills/sauce-chains/references/sonic.md +57 -0
- package/skills/sauce-chains/references/unichain.md +61 -0
- package/skills/sauce-chains/references/zetachain.md +33 -0
- package/skills/sauce-chains/references/zksync.md +59 -0
- package/skills/sauce-chains/references/zora.md +57 -0
- package/skills/sauce-cli/SKILL.md +366 -0
- package/skills/sauce-cli/examples/pay.sauce.ts +23 -0
- package/skills/sauce-cli/examples/split.sauce.ts +30 -0
- package/skills/sauce-distributed-swap/SKILL.md +392 -0
- package/skills/sauce-distributed-swap/examples/distributed-swap.mts +251 -0
- package/skills/sauce-distributed-swap/examples/distributed-swap.sauce.ts +115 -0
- package/skills/sauce-examples/SKILL.md +96 -0
- package/skills/sauce-globals/SKILL.md +175 -0
- package/skills/sauce-globals/examples/globals.mts +111 -0
- package/skills/sauce-globals/examples/globals.sauce.ts +47 -0
- package/skills/sauce-globals/references/chains.md +53 -0
- package/skills/sauce-globals/references/protocols.md +405 -0
- package/skills/sauce-globals/references/stocks.md +1824 -0
- package/skills/sauce-globals/references/tokens.md +53 -0
- package/skills/sauce-intents/SKILL.md +505 -0
- package/skills/sauce-intents/examples/cross-chain.sauce.ts +37 -0
- package/skills/sauce-intents/examples/fund-by-transfer.sauce.ts +54 -0
- package/skills/sauce-intents/examples/intents.mts +343 -0
- package/skills/sauce-intents/examples/swap-on-base.sauce.ts +135 -0
- package/skills/sauce-intents/references/portal.md +77 -0
- package/skills/sauce-overview/SKILL.md +161 -0
- package/skills/sauce-protocols/SKILL.md +118 -0
- package/skills/sauce-protocols/examples/protocols.mts +77 -0
- package/skills/sauce-protocols/examples/protocols.sauce.ts +27 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/aave-v2.md +35 -17
- package/skills/sauce-protocols/references/aave-v3.md +144 -0
- package/skills/sauce-protocols/references/aave-v4.md +50 -0
- package/skills/sauce-protocols/references/abracadabra.md +72 -0
- package/skills/sauce-protocols/references/across.md +73 -0
- package/skills/sauce-protocols/references/aerodrome-slipstream.md +50 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/aerodrome.md +43 -24
- package/skills/sauce-protocols/references/aevo.md +49 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/alchemix.md +10 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/ambient.md +14 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/arbitrum-bridge.md +11 -14
- package/{sdk/src/skills → skills/sauce-protocols/references}/arrakis.md +10 -26
- package/skills/sauce-protocols/references/axelar.md +56 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/balancer-v2.md +13 -29
- package/{sdk/src/skills → skills/sauce-protocols/references}/base-bridge.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/baseswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/beefy.md +10 -30
- package/{sdk/src/skills → skills/sauce-protocols/references}/benqi.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/camelot.md +13 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/cbeth.md +10 -22
- package/skills/sauce-protocols/references/cctp.md +47 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/celer.md +11 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/chainlink-ccip.md +11 -21
- package/skills/sauce-protocols/references/chainlink.md +47 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/circle-gateway.md +12 -38
- package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v2.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v3.md +43 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/connext.md +11 -15
- package/{sdk/src/skills → skills/sauce-protocols/references}/convex.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/cowswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/crvusd.md +10 -19
- package/skills/sauce-protocols/references/curve.md +98 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/debridge.md +11 -33
- package/{sdk/src/skills → skills/sauce-protocols/references}/dodo.md +13 -18
- package/skills/sauce-protocols/references/eigenlayer.md +48 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/ens.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc20.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc3156.md +10 -13
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc4626.md +11 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/ethena.md +10 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/etherfi.md +10 -32
- package/{sdk/src/skills → skills/sauce-protocols/references}/euler-v2.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/fenix.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/fluid.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/frax-ether.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/frax.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/gains-network.md +11 -28
- package/skills/sauce-protocols/references/gamma.md +57 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/gelato.md +12 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/gho.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v1.md +12 -34
- package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v2.md +15 -28
- package/skills/sauce-protocols/references/harvest.md +41 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/hegic.md +10 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/hop.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/hyperlane.md +11 -21
- package/skills/sauce-protocols/references/index.md +355 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/instadapp.md +10 -18
- package/skills/sauce-protocols/references/kelp.md +46 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/kim.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/kyberswap-aggregator.md +12 -35
- package/skills/sauce-protocols/references/kyberswap.md +72 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/layerbank.md +11 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/layerzero.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/level-finance.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/lido.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/lifi.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/linea-bridge.md +11 -14
- package/{sdk/src/skills → skills/sauce-protocols/references}/liquity-v1.md +10 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/liquity-v2.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/lynex.md +12 -18
- package/skills/sauce-protocols/references/maker.md +57 -0
- package/skills/sauce-protocols/references/mantle-meth.md +43 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/maverick.md +13 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/moonwell.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/morpho-blue.md +44 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/mux-protocol.md +10 -30
- package/skills/sauce-protocols/references/olympus.md +39 -0
- package/skills/sauce-protocols/references/oneinch.md +81 -0
- package/skills/sauce-protocols/references/openocean.md +69 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/optimism-bridge.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/opyn.md +10 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/pancakeswap-v2.md +39 -41
- package/skills/sauce-protocols/references/pancakeswap-v3.md +72 -0
- package/skills/sauce-protocols/references/paraswap.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/pendle.md +47 -29
- package/skills/sauce-protocols/references/permit2.md +101 -0
- package/skills/sauce-protocols/references/perpetual-protocol.md +53 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/polygon-bridge.md +11 -17
- package/{sdk/src/skills → skills/sauce-protocols/references}/premia.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/puffer.md +10 -21
- package/skills/sauce-protocols/references/pyth.md +45 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/quickswap.md +13 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/radiant.md +11 -15
- package/{sdk/src/skills → skills/sauce-protocols/references}/ramses.md +12 -18
- package/skills/sauce-protocols/references/reflexer.md +52 -0
- package/skills/sauce-protocols/references/registry/aave-v2.md +43 -0
- package/skills/sauce-protocols/references/registry/aave-v3.md +62 -0
- package/skills/sauce-protocols/references/registry/aave-v4.md +80 -0
- package/skills/sauce-protocols/references/registry/abracadabra.md +54 -0
- package/skills/sauce-protocols/references/registry/across.md +57 -0
- package/skills/sauce-protocols/references/registry/aerodrome-slipstream.md +72 -0
- package/skills/sauce-protocols/references/registry/aerodrome.md +58 -0
- package/skills/sauce-protocols/references/registry/aevo.md +39 -0
- package/skills/sauce-protocols/references/registry/alchemix.md +46 -0
- package/skills/sauce-protocols/references/registry/ambient.md +40 -0
- package/skills/sauce-protocols/references/registry/arbitrum-bridge.md +40 -0
- package/skills/sauce-protocols/references/registry/arrakis.md +49 -0
- package/skills/sauce-protocols/references/registry/axelar.md +65 -0
- package/skills/sauce-protocols/references/registry/balancer-v2.md +50 -0
- package/skills/sauce-protocols/references/registry/base-bridge.md +42 -0
- package/skills/sauce-protocols/references/registry/baseswap.md +40 -0
- package/skills/sauce-protocols/references/registry/beefy.md +51 -0
- package/skills/sauce-protocols/references/registry/benqi.md +49 -0
- package/skills/sauce-protocols/references/registry/camelot.md +82 -0
- package/skills/sauce-protocols/references/registry/cbeth.md +43 -0
- package/skills/sauce-protocols/references/registry/cctp.md +48 -0
- package/skills/sauce-protocols/references/registry/celer.md +44 -0
- package/skills/sauce-protocols/references/registry/chainlink-ccip.md +45 -0
- package/skills/sauce-protocols/references/registry/chainlink.md +49 -0
- package/skills/sauce-protocols/references/registry/circle-gateway.md +70 -0
- package/skills/sauce-protocols/references/registry/compound-v2.md +53 -0
- package/skills/sauce-protocols/references/registry/compound-v3.md +52 -0
- package/skills/sauce-protocols/references/registry/connext.md +41 -0
- package/skills/sauce-protocols/references/registry/convex.md +51 -0
- package/skills/sauce-protocols/references/registry/cowswap.md +40 -0
- package/skills/sauce-protocols/references/registry/crvusd.md +40 -0
- package/skills/sauce-protocols/references/registry/curve.md +81 -0
- package/skills/sauce-protocols/references/registry/debridge.md +59 -0
- package/skills/sauce-protocols/references/registry/dodo.md +39 -0
- package/skills/sauce-protocols/references/registry/eco-routes.md +65 -0
- package/skills/sauce-protocols/references/registry/eigenlayer.md +58 -0
- package/skills/sauce-protocols/references/registry/ens.md +49 -0
- package/skills/sauce-protocols/references/registry/erc20.md +44 -0
- package/skills/sauce-protocols/references/registry/erc3156.md +38 -0
- package/skills/sauce-protocols/references/registry/erc4626.md +51 -0
- package/skills/sauce-protocols/references/registry/ethena.md +50 -0
- package/skills/sauce-protocols/references/registry/etherfi.md +57 -0
- package/skills/sauce-protocols/references/registry/euler-v2.md +49 -0
- package/skills/sauce-protocols/references/registry/fenix.md +39 -0
- package/skills/sauce-protocols/references/registry/fluid.md +48 -0
- package/skills/sauce-protocols/references/registry/frax-ether.md +49 -0
- package/skills/sauce-protocols/references/registry/frax.md +40 -0
- package/skills/sauce-protocols/references/registry/gains-network.md +43 -0
- package/skills/sauce-protocols/references/registry/gamma.md +56 -0
- package/skills/sauce-protocols/references/registry/gelato.md +45 -0
- package/skills/sauce-protocols/references/registry/gho.md +40 -0
- package/skills/sauce-protocols/references/registry/gmx-v1.md +59 -0
- package/skills/sauce-protocols/references/registry/gmx-v2.md +41 -0
- package/skills/sauce-protocols/references/registry/harvest.md +44 -0
- package/skills/sauce-protocols/references/registry/hegic.md +39 -0
- package/skills/sauce-protocols/references/registry/hop.md +49 -0
- package/skills/sauce-protocols/references/registry/hyperlane.md +48 -0
- package/skills/sauce-protocols/references/registry/instadapp.md +39 -0
- package/skills/sauce-protocols/references/registry/kelp.md +47 -0
- package/skills/sauce-protocols/references/registry/kim.md +39 -0
- package/skills/sauce-protocols/references/registry/kyberswap-aggregator.md +49 -0
- package/skills/sauce-protocols/references/registry/kyberswap.md +63 -0
- package/skills/sauce-protocols/references/registry/layerbank.md +54 -0
- package/skills/sauce-protocols/references/registry/layerzero.md +49 -0
- package/skills/sauce-protocols/references/registry/level-finance.md +41 -0
- package/skills/sauce-protocols/references/registry/lido.md +51 -0
- package/skills/sauce-protocols/references/registry/lifi.md +48 -0
- package/skills/sauce-protocols/references/registry/linea-bridge.md +40 -0
- package/skills/sauce-protocols/references/registry/liquity-v1.md +42 -0
- package/skills/sauce-protocols/references/registry/liquity-v2.md +40 -0
- package/skills/sauce-protocols/references/registry/lynex.md +39 -0
- package/skills/sauce-protocols/references/registry/maker.md +55 -0
- package/skills/sauce-protocols/references/registry/mantle-meth.md +48 -0
- package/skills/sauce-protocols/references/registry/maverick.md +60 -0
- package/skills/sauce-protocols/references/registry/moonwell.md +49 -0
- package/skills/sauce-protocols/references/registry/morpho-blue.md +47 -0
- package/skills/sauce-protocols/references/registry/mux-protocol.md +49 -0
- package/skills/sauce-protocols/references/registry/olympus.md +42 -0
- package/skills/sauce-protocols/references/registry/oneinch.md +45 -0
- package/skills/sauce-protocols/references/registry/openocean.md +44 -0
- package/skills/sauce-protocols/references/registry/optimism-bridge.md +42 -0
- package/skills/sauce-protocols/references/registry/opyn.md +42 -0
- package/skills/sauce-protocols/references/registry/pancakeswap-v2.md +71 -0
- package/skills/sauce-protocols/references/registry/pancakeswap-v3.md +76 -0
- package/skills/sauce-protocols/references/registry/paraswap.md +51 -0
- package/skills/sauce-protocols/references/registry/pendle.md +43 -0
- package/skills/sauce-protocols/references/registry/permit2.md +50 -0
- package/skills/sauce-protocols/references/registry/perpetual-protocol.md +49 -0
- package/skills/sauce-protocols/references/registry/polygon-bridge.md +43 -0
- package/skills/sauce-protocols/references/registry/premia.md +40 -0
- package/skills/sauce-protocols/references/registry/puffer.md +43 -0
- package/skills/sauce-protocols/references/registry/pyth.md +40 -0
- package/skills/sauce-protocols/references/registry/quickswap.md +80 -0
- package/skills/sauce-protocols/references/registry/radiant.md +41 -0
- package/skills/sauce-protocols/references/registry/ramses.md +39 -0
- package/skills/sauce-protocols/references/registry/reflexer.md +56 -0
- package/skills/sauce-protocols/references/registry/renzo.md +47 -0
- package/skills/sauce-protocols/references/registry/rocket-pool.md +49 -0
- package/skills/sauce-protocols/references/registry/sablier.md +40 -0
- package/skills/sauce-protocols/references/registry/safe.md +47 -0
- package/skills/sauce-protocols/references/registry/scroll-bridge.md +48 -0
- package/skills/sauce-protocols/references/registry/seamless.md +42 -0
- package/skills/sauce-protocols/references/registry/seaport.md +44 -0
- package/skills/sauce-protocols/references/registry/silo.md +48 -0
- package/skills/sauce-protocols/references/registry/socket.md +44 -0
- package/skills/sauce-protocols/references/registry/sommelier.md +43 -0
- package/skills/sauce-protocols/references/registry/spark.md +42 -0
- package/skills/sauce-protocols/references/registry/spookyswap.md +40 -0
- package/skills/sauce-protocols/references/registry/squid.md +45 -0
- package/skills/sauce-protocols/references/registry/stader.md +47 -0
- package/skills/sauce-protocols/references/registry/stargate.md +45 -0
- package/skills/sauce-protocols/references/registry/superfluid.md +49 -0
- package/skills/sauce-protocols/references/registry/sushiswap-v2.md +71 -0
- package/skills/sauce-protocols/references/registry/swell.md +49 -0
- package/skills/sauce-protocols/references/registry/synapse.md +46 -0
- package/skills/sauce-protocols/references/registry/syncswap.md +38 -0
- package/skills/sauce-protocols/references/registry/synthetix-v3.md +48 -0
- package/skills/sauce-protocols/references/registry/synthra-v3.md +77 -0
- package/skills/sauce-protocols/references/registry/thales.md +51 -0
- package/skills/sauce-protocols/references/registry/thena.md +39 -0
- package/skills/sauce-protocols/references/registry/thruster.md +38 -0
- package/skills/sauce-protocols/references/registry/tokemak.md +45 -0
- package/skills/sauce-protocols/references/registry/trader-joe.md +66 -0
- package/skills/sauce-protocols/references/registry/uniswap-v2.md +77 -0
- package/skills/sauce-protocols/references/registry/uniswap-v3.md +113 -0
- package/skills/sauce-protocols/references/registry/uniswap-v4.md +117 -0
- package/skills/sauce-protocols/references/registry/unitflow-v3.md +65 -0
- package/skills/sauce-protocols/references/registry/velodrome.md +58 -0
- package/skills/sauce-protocols/references/registry/venus.md +62 -0
- package/skills/sauce-protocols/references/registry/vertex.md +46 -0
- package/skills/sauce-protocols/references/registry/wormhole.md +59 -0
- package/skills/sauce-protocols/references/registry/yearn-v3.md +46 -0
- package/skills/sauce-protocols/references/registry/zerolend.md +41 -0
- package/skills/sauce-protocols/references/registry/zerox.md +44 -0
- package/skills/sauce-protocols/references/registry/zksync-bridge.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/renzo.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/rocket-pool.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/sablier.md +10 -27
- package/skills/sauce-protocols/references/safe.md +42 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/scroll-bridge.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/seamless.md +11 -16
- package/skills/sauce-protocols/references/seaport.md +38 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/silo.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/socket.md +11 -18
- package/skills/sauce-protocols/references/sommelier.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/spark.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/spookyswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/squid.md +11 -21
- package/skills/sauce-protocols/references/stader.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/stargate.md +11 -22
- package/{sdk/src/skills → skills/sauce-protocols/references}/superfluid.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/sushiswap-v2.md +38 -43
- package/skills/sauce-protocols/references/swell.md +49 -0
- package/skills/sauce-protocols/references/synapse.md +54 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/syncswap.md +12 -17
- package/{sdk/src/skills → skills/sauce-protocols/references}/synthetix-v3.md +10 -29
- package/skills/sauce-protocols/references/synthra-v3.md +63 -0
- package/skills/sauce-protocols/references/thales.md +58 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/thena.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/thruster.md +13 -18
- package/skills/sauce-protocols/references/tokemak.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/trader-joe.md +13 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/uniswap-v2.md +46 -44
- package/skills/sauce-protocols/references/uniswap-v3.md +188 -0
- package/skills/sauce-protocols/references/uniswap-v4.md +155 -0
- package/skills/sauce-protocols/references/unitflow-v3.md +63 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/velodrome.md +12 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/venus.md +12 -31
- package/skills/sauce-protocols/references/vertex.md +42 -0
- package/skills/sauce-protocols/references/wormhole.md +57 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/yearn-v3.md +10 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/zerolend.md +11 -15
- package/skills/sauce-protocols/references/zerox.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/zksync-bridge.md +11 -14
- package/skills/sauce-script/SKILL.md +407 -0
- package/skills/sauce-script/examples/IOracle.json +12 -0
- package/skills/sauce-script/examples/saucescript.mts +167 -0
- package/skills/sauce-script/examples/twap.sauce.ts +29 -0
- package/skills/sauce-script/references/builtins.json +823 -0
- package/skills/sauce-script/references/builtins.md +674 -0
- package/skills/sauce-solana/SKILL.md +322 -0
- package/skills/sauce-solana/examples/solana.mts +166 -0
- package/skills/sauce-solana/examples/solana.sauce.ts +45 -0
- package/skills/sauce-solana/examples/token-2022.sauce.ts +38 -0
- package/skills/sauce-swaps/SKILL.md +200 -0
- package/skills/sauce-swaps/examples/swap-leg.sauce.ts +50 -0
- package/skills/sauce-swaps/examples/swaps.mts +124 -0
- package/skills/sauce-typescript/SKILL.md +178 -0
- package/skills/sauce-typescript/examples/actions.mts +100 -0
- package/skills/sauce-typescript/examples/compiler.mts +69 -0
- package/skills/sauce-typescript/examples/cook.mts +65 -0
- package/skills/sauce-typescript/examples/verify.mts +104 -0
- package/dev-tools/README.md +0 -16
- package/dev-tools/artifacts/IERC20.json +0 -1
- package/dev-tools/artifacts/ISauceRouter.json +0 -1
- package/dev-tools/artifacts/IUniswapV3Pool.json +0 -1
- package/dev-tools/artifacts/Router.json +0 -1
- package/dev-tools/hardhat.config.cjs +0 -18
- package/dev-tools/sauce/js/add.js +0 -4
- package/dev-tools/sauce/js/call.js +0 -8
- package/dev-tools/sauce/js/erc20.js +0 -18
- package/dev-tools/sauce/js/example.js +0 -6
- package/dev-tools/sauce/js/fibonacci.js +0 -13
- package/dev-tools/sauce/ts/add.ts +0 -4
- package/dev-tools/sauce/ts/call.ts +0 -8
- package/dev-tools/sauce/ts/erc20.ts +0 -18
- package/dev-tools/sauce/ts/example.ts +0 -6
- package/dev-tools/sauce/ts/fibonacci.ts +0 -13
- package/dev-tools/sauce/ts/saucescript.d.ts +0 -1
- package/dev-tools/sauce/ts/tsconfig.json +0 -12
- package/dev-tools/scripts/deploy.ts +0 -107
- package/dev-tools/scripts/init.js +0 -132
- package/dev-tools/scripts/run.ts +0 -67
- package/dev-tools/scripts/start-fork.sh +0 -92
- package/dev-tools/scripts/start-local.sh +0 -120
- package/dev-tools/scripts/stop-local.sh +0 -40
- package/dev-tools/scripts/sync-artifacts.js +0 -46
- package/dev-tools/scripts/sync-price.ts +0 -58
- package/dev-tools/src/contracts.ts +0 -59
- package/dev-tools/src/runner.ts +0 -355
- package/dev-tools/src/svm-local.ts +0 -305
- package/dev-tools/src/sync-price.ts +0 -217
- package/sdk/dist/deployments/v12.generated.d.ts +0 -95
- package/sdk/dist/deployments/v12.generated.d.ts.map +0 -1
- package/sdk/dist/deployments/v12.generated.js +0 -50
- package/sdk/dist/deployments/v12.generated.js.map +0 -1
- package/sdk/dist/swap/index.d.ts +0 -29
- package/sdk/dist/swap/index.d.ts.map +0 -1
- package/sdk/dist/swap/index.js +0 -27
- package/sdk/dist/swap/index.js.map +0 -1
- package/sdk/dist/swap/params.d.ts +0 -29
- package/sdk/dist/swap/params.d.ts.map +0 -1
- package/sdk/dist/swap/params.js +0 -123
- package/sdk/dist/swap/params.js.map +0 -1
- package/sdk/dist/swap/source.d.ts +0 -30
- package/sdk/dist/swap/source.d.ts.map +0 -1
- package/sdk/dist/swap/source.js +0 -101
- package/sdk/dist/swap/source.js.map +0 -1
- package/sdk/dist/swap/types.d.ts +0 -160
- package/sdk/dist/swap/types.d.ts.map +0 -1
- package/sdk/dist/swap/types.js +0 -106
- package/sdk/dist/swap/types.js.map +0 -1
- package/sdk/src/skills/aave-v3.md +0 -134
- package/sdk/src/skills/aave-v4.md +0 -91
- package/sdk/src/skills/abracadabra.md +0 -93
- package/sdk/src/skills/across.md +0 -90
- package/sdk/src/skills/aerodrome-slipstream.md +0 -57
- package/sdk/src/skills/aevo.md +0 -58
- package/sdk/src/skills/axelar.md +0 -80
- package/sdk/src/skills/chainlink.md +0 -62
- package/sdk/src/skills/curve.md +0 -141
- package/sdk/src/skills/eigenlayer.md +0 -71
- package/sdk/src/skills/gamma.md +0 -79
- package/sdk/src/skills/harvest.md +0 -49
- package/sdk/src/skills/index.md +0 -299
- package/sdk/src/skills/kelp.md +0 -60
- package/sdk/src/skills/kyberswap.md +0 -100
- package/sdk/src/skills/loader.ts +0 -46
- package/sdk/src/skills/maker.md +0 -79
- package/sdk/src/skills/mantle-meth.md +0 -60
- package/sdk/src/skills/olympus.md +0 -46
- package/sdk/src/skills/oneinch.md +0 -64
- package/sdk/src/skills/openocean.md +0 -86
- package/sdk/src/skills/pancakeswap-v3.md +0 -104
- package/sdk/src/skills/paraswap.md +0 -67
- package/sdk/src/skills/permit2.md +0 -73
- package/sdk/src/skills/perpetual-protocol.md +0 -73
- package/sdk/src/skills/pyth.md +0 -58
- package/sdk/src/skills/reflexer.md +0 -73
- package/sdk/src/skills/safe.md +0 -56
- package/sdk/src/skills/seaport.md +0 -65
- package/sdk/src/skills/sommelier.md +0 -47
- package/sdk/src/skills/stader.md +0 -53
- package/sdk/src/skills/swell.md +0 -65
- package/sdk/src/skills/synapse.md +0 -63
- package/sdk/src/skills/synthra-v3.md +0 -57
- package/sdk/src/skills/thales.md +0 -74
- package/sdk/src/skills/tokemak.md +0 -48
- package/sdk/src/skills/uniswap-v3.md +0 -202
- package/sdk/src/skills/uniswap-v4.md +0 -125
- package/sdk/src/skills/unitflow-v3.md +0 -62
- package/sdk/src/skills/vertex.md +0 -55
- package/sdk/src/skills/wormhole.md +0 -76
- package/sdk/src/skills/zerox.md +0 -51
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<!-- Generated from the SDK's registries. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# Token globals
|
|
4
|
+
|
|
5
|
+
A program compiled for a chain names these symbols with no import; each is that chain's token,
|
|
6
|
+
and amounts are in its smallest units (its decimals). Their addresses are in the chain's file in
|
|
7
|
+
`sauce-chains`. Any other ERC-20 is `Token(<address>)`.
|
|
8
|
+
|
|
9
|
+
- **Ethereum** (`ethereum`, [addresses](../../sauce-chains/references/ethereum.md)): `USDC` (6), `USDT` (6), `WETH` (18); and 1731 tokenized stocks ([stocks](stocks.md))
|
|
10
|
+
- **Optimism** (`optimism`, [addresses](../../sauce-chains/references/optimism.md)): `USDC` (6), `USDT` (6), `WETH` (18)
|
|
11
|
+
- **Polygon** (`polygon`, [addresses](../../sauce-chains/references/polygon.md)): `USDC` (6), `WETH` (18), `WPOL` (18)
|
|
12
|
+
- **Monad** (`monad`, [addresses](../../sauce-chains/references/monad.md)): `USDC` (6), `WMON` (18)
|
|
13
|
+
- **Arc** (`arc`, [addresses](../../sauce-chains/references/arc.md)): `EURC` (6), `USDC` (6), `USYC` (6), `WETH` (18)
|
|
14
|
+
- **Base** (`base`, [addresses](../../sauce-chains/references/base.md)): `USDC` (6), `WETH` (18); and 67 tokenized stocks ([stocks](stocks.md))
|
|
15
|
+
- **Arbitrum** (`arbitrum`, [addresses](../../sauce-chains/references/arbitrum.md)): `USDC` (6), `WETH` (18)
|
|
16
|
+
- **Solana** (`solana`, [addresses](../../sauce-chains/references/solana.md)): `PYUSD` (6), `USDC` (6), `USDT` (6), `WSOL` (9)
|
|
17
|
+
|
|
18
|
+
On Solana a symbol is the mint's 32-byte key, a value for the `@sauce/token` functions
|
|
19
|
+
(`balanceOf(USDC, account)`); the token accounts are `Account` parameters, and the token
|
|
20
|
+
methods (`USDC.transfer(...)`) are EVM-only. Devnet's mints, which differ, are in the Solana
|
|
21
|
+
file in `sauce-chains`, passed as a define that wins over the symbol. That file also names each
|
|
22
|
+
mint's token program: legacy SPL Token, or Token-2022, whose mints a program moves with the
|
|
23
|
+
checked writes (`sauce-solana`).
|
|
24
|
+
|
|
25
|
+
## Token functions
|
|
26
|
+
|
|
27
|
+
Every program can call these `@sauce/token` functions with no import. The EVM writes are
|
|
28
|
+
SafeERC20: a token that returns nothing works, and one that returns `false` reverts.
|
|
29
|
+
|
|
30
|
+
On EVM chains:
|
|
31
|
+
|
|
32
|
+
- `balanceOf(token: Address, account: Account): Uint256`
|
|
33
|
+
- `totalSupply(token: Address): Uint256`
|
|
34
|
+
- `decimals(token: Address): Uint256`
|
|
35
|
+
- `allowance(token: Address, owner: Address, spender: Address): Uint256`
|
|
36
|
+
- `transfer(token: Address, to: Address, amount: Uint256): void`
|
|
37
|
+
- `transferFrom(token: Address, from: Address, to: Address, amount: Uint256): void`
|
|
38
|
+
- `approve(token: Address, spender: Address, amount: Uint256): void`
|
|
39
|
+
- `permit(token: Address, owner: Address, spender: Address, value: Uint256, deadline: Uint256, v: Uint256, r: Uint256, s: Uint256): void`
|
|
40
|
+
- `permitTransferFrom(token: Address, owner: Address, amount: Uint256, nonce: Uint256, deadline: Uint256, signature: bytes, permit2: Address): void`
|
|
41
|
+
|
|
42
|
+
On Solana:
|
|
43
|
+
|
|
44
|
+
- `balanceOf(token: Address, account: Account): Uint256`
|
|
45
|
+
- `ownerOf(token: Address, account: Account): Address`
|
|
46
|
+
- `totalSupply(token: Account): Uint256`
|
|
47
|
+
- `decimals(token: Account): Uint256`
|
|
48
|
+
- `allowance(token: Address, account: Account, spender: Address): Uint256`
|
|
49
|
+
- `transfer(token: Address, tokenProgram: Account, source: Account, dest: Account, authority: Account, amount: Uint256): void`
|
|
50
|
+
- `transferFrom(token: Address, tokenProgram: Account, source: Account, dest: Account, authority: Account, amount: Uint256): void`
|
|
51
|
+
- `approve(token: Address, tokenProgram: Account, source: Account, delegate: Account, authority: Account, amount: Uint256): void`
|
|
52
|
+
- `transferChecked(token: Address, tokenProgram: Account, source: Account, mint: Account, dest: Account, authority: Account, amount: Uint256, decimals: Uint256): void`
|
|
53
|
+
- `approveChecked(token: Address, tokenProgram: Account, source: Account, mint: Account, delegate: Account, authority: Account, amount: Uint256, decimals: Uint256): void`
|
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sauce-intents
|
|
3
|
+
description: Cross-chain intents written in Sauce — a file that is the intent, Base(() => { ... }).reward({ ... }) as top-level statements with no main and its values as defines; how an intent is published, funded, discovered, filled, proven, claimed, cancelled and refunded (a sauce intent command each) (the intent hash, the per-intent vault, IntentPublished and IntentFunded, isIntentFunded); every way to publish and fund it (sauce intent publish from a wallet, sauce run from a Pot, a transfer into the vault then publish, cascade children, quoted intents); amounts measured on chain; token-only bodies versus program bodies; the delivery; on which chain each name resolves; the shared destination Pot and the Kitchen fee the solver pays; rehearsing both sides; and the deadline and creator every intent needs. Use when a program should continue on another chain, forward a swap or bridge output, build a cascade, pay a solver, or when the user mentions intents, rewards, vaults, solvers, Portals, provers, Executors or Pots.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Cross-chain intents in Sauce
|
|
7
|
+
|
|
8
|
+
An intent is an **offer**: run this on the destination chain, and the reward escrowed on this chain
|
|
9
|
+
is yours. An intent file is written as **top-level statements, with no `main`**: the chain name
|
|
10
|
+
called as a function opens the intent, and every value the file does not compute is a define, left
|
|
11
|
+
undeclared in the file and set with `--define NAME=VALUE` (`sauce-script`).
|
|
12
|
+
|
|
13
|
+
```sauce chain=base define=RECIPIENT,AMOUNT
|
|
14
|
+
Ethereum(() => {
|
|
15
|
+
USDC.transfer(RECIPIENT, AMOUNT); // Ethereum's USDC: the body runs there
|
|
16
|
+
}).reward({ tokens: [{ token: USDC, amount: AMOUNT }] }); // the source chain's USDC
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Nothing about the fill is guaranteed: a solver decides whether the reward is worth it, and the
|
|
20
|
+
package prices nothing. Say an intent is _offered_, never that it _will execute_.
|
|
21
|
+
|
|
22
|
+
## Supported chains
|
|
23
|
+
|
|
24
|
+
For the initial release, intents are published, and every step of their life sent, only between
|
|
25
|
+
**Ethereum, Base and Solana**, the chains Sauce supports transactions on. Every other chain in the
|
|
26
|
+
registry is a **preview chain**: an intent that involves one still compiles, `sauce inspect` lists
|
|
27
|
+
it, and `sauce intent publish --dry-run` and `sauce intent fill` without `--send` rehearse it, but
|
|
28
|
+
the `sauce` command and its MCP server build and send none of its transactions. They refuse before
|
|
29
|
+
anything is built, signed or sent:
|
|
30
|
+
|
|
31
|
+
- **Publishing** — `sauce intent publish` (sent, or printed with `--format`), and `sauce run` or
|
|
32
|
+
`sauce tx` of a file that opens the intent — is refused unless the source and every destination
|
|
33
|
+
it opens are supported. The later levels of a cascade are not checked: keep every level on a
|
|
34
|
+
supported chain.
|
|
35
|
+
- **Each later step** is refused by the chain it is sent on: `fill --send`, `prove` and `cancel` by
|
|
36
|
+
the destination; `claim` and `refund` by the source.
|
|
37
|
+
|
|
38
|
+
The refusal names the supported chains and links the request for that chain (an MCP tool returns it
|
|
39
|
+
as `refused`, with the issue's title, body and a comment to post). To ask for a chain, find its
|
|
40
|
+
request among the existing ones
|
|
41
|
+
(https://github.com/eco-incorp/sauce/issues?q=is%3Aissue+label%3Achain-support) and add the use case
|
|
42
|
+
as a comment, or open one from the form
|
|
43
|
+
(https://github.com/eco-incorp/sauce/issues/new?template=chain-support.yml): the chain and its id,
|
|
44
|
+
what you want to run there, the protocols and tokens it needs, and the volume expected and when.
|
|
45
|
+
|
|
46
|
+
## The lifecycle
|
|
47
|
+
|
|
48
|
+
An intent is three values: the **destination** chain, the **route** (what runs there: a salt, the
|
|
49
|
+
route's deadline, the destination Portal, `nativeAmount`, the tokens the solver delivers, and the
|
|
50
|
+
calls) and the **reward** (its deadline, the creator, the prover, a native amount and tokens). Its
|
|
51
|
+
hash is `keccak256(abi.encodePacked(uint64 destination, keccak256(route bytes), keccak256(abi.encode(reward))))`,
|
|
52
|
+
so every field is in it: the deadlines and the destination Kitchen's fee (the route's
|
|
53
|
+
`nativeAmount`) too. **Changing any of them is a different intent**: rebuild every transaction,
|
|
54
|
+
including any unsigned one printed earlier.
|
|
55
|
+
|
|
56
|
+
1. **Fund.** The reward sits in the intent's own **vault** on the source chain. Its address follows
|
|
57
|
+
from the intent hash, so it exists before anything is published or deployed:
|
|
58
|
+
`Portal.intentVaultAddress(destination, route, reward)` returns it, and tokens sent there count.
|
|
59
|
+
2. **Publish.** `Portal.publish` records the intent and emits `IntentPublished`, which solvers
|
|
60
|
+
watch. It needs no funding and anyone may send it; sending it again re-emits the event.
|
|
61
|
+
3. **Discover and check.** A solver picks the intent up from `IntentPublished` (or, for an intent
|
|
62
|
+
it quoted, from `IntentFunded`) and calls `Portal.isIntentFunded(destination, route, reward)`:
|
|
63
|
+
true when the intent's status is Funded **or** the vault already holds the whole reward. A
|
|
64
|
+
solver that finds it unfunded may retry for a while, then drop it: fund before or with the
|
|
65
|
+
publication.
|
|
66
|
+
4. **Fill.** On the destination the solver calls the destination Portal's `fulfill`, sending the
|
|
67
|
+
route's `nativeAmount` as value and delivering the route's tokens; the Portal's Executor runs the
|
|
68
|
+
calls. Before the route's deadline, once. `fulfillAndProve` does the same and sends the proof in
|
|
69
|
+
the same transaction, its value the `nativeAmount` plus the prover's fee.
|
|
70
|
+
5. **Prove.** The destination Portal's `prove(prover, sourceDomain, intentHashes, data)` hands what
|
|
71
|
+
it recorded (the claimant, or a cancellation) to the destination's prover, which sends it to the
|
|
72
|
+
reward's prover on the source chain for a fee it quotes (`fetchFee`). With Hyperlane, a relayer
|
|
73
|
+
delivers the message; the source prover then records the claimant, which
|
|
74
|
+
`provenIntents(intentHash)` returns.
|
|
75
|
+
6. **Claim.** Once the source has the proof, `withdraw(destination, routeHash, reward)`, sent by
|
|
76
|
+
anyone, pays the vault's reward to the claimant the proof names (`batchWithdraw` claims several).
|
|
77
|
+
7. **Refund.** After the reward's deadline, with no proven fill, `refund(destination, routeHash,
|
|
78
|
+
reward)`, sent by anyone, returns everything the vault holds of the reward to the creator (the
|
|
79
|
+
creator alone may send `refundTo` to choose another recipient). Before the deadline it reverts
|
|
80
|
+
`InvalidStatusForRefund`. A vault that was funded but never published refunds the same way.
|
|
81
|
+
8. **Cancel, for an earlier refund.** Where the destination Portal has `cancel`, anyone may cancel
|
|
82
|
+
an unfilled intent strictly after the route's deadline: no fill can land after it. Proving the
|
|
83
|
+
cancellation (5) lets the creator refund at once, before the reward's deadline. A cancellation is
|
|
84
|
+
recorded as a claimant no key controls, so the source Portal must refuse to pay it
|
|
85
|
+
(`withdraw` reverting `CancelledIntent`); prove one only to a source Portal that does. Prove it
|
|
86
|
+
once the cancel is final on the destination: a reorg that let a fill in first would leave that
|
|
87
|
+
solver unpaid.
|
|
88
|
+
|
|
89
|
+
## Every step from the command line
|
|
90
|
+
|
|
91
|
+
`sauce intent` drives the whole lifecycle. Each verb takes the intent file (with `--chain`, the
|
|
92
|
+
source, and the flags it was built with) or the intent's hash, and `--config sauce.config.json`
|
|
93
|
+
with both chains' endpoints. Every intent the commands publish, fill or import goes into a local
|
|
94
|
+
store in your home directory (`--store <dir>` names another), so later steps name it by hash; where it
|
|
95
|
+
stands is read from the chains each time.
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
npx sauce intent publish --config sauce.config.json --keystore <keystore>
|
|
99
|
+
npx sauce intent status <intent-hash> --config sauce.config.json
|
|
100
|
+
npx sauce intent fill <intent-hash> --config sauce.config.json --send --keystore <keystore>
|
|
101
|
+
npx sauce intent prove <intent-hash> --config sauce.config.json --keystore <keystore>
|
|
102
|
+
npx sauce intent claim <intent-hash> --chain <source> --config sauce.config.json --keystore <keystore>
|
|
103
|
+
npx sauce intent refund <intent-hash> --chain <source> --config sauce.config.json --keystore <keystore>
|
|
104
|
+
npx sauce intent cancel <intent-hash> --config sauce.config.json --keystore <keystore>
|
|
105
|
+
npx sauce intent import <tx-hash> --chain <source> --config sauce.config.json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- `publish` with no file asks, at a terminal, for the chains, the token and amount delivered and
|
|
109
|
+
to whom, the reward (suggested: what is delivered plus a margin over the solver's destination
|
|
110
|
+
costs), the deadlines, the prover and how the reward is funded (a transfer to the vault by
|
|
111
|
+
default), writes the intent as a `.sauce.ts` file, rehearses publishing and filling it, and
|
|
112
|
+
publishes it once approved. Each question has a flag (`--source`, `--destination`, `--token`,
|
|
113
|
+
`--amount`, `--recipient`, `--reward-token`, `--reward`, `--prover`, `--fill-deadline`,
|
|
114
|
+
`--reward-deadline`, `--intent-fund-via`), so it runs without a terminal.
|
|
115
|
+
- `status` prints the intent's state on both chains (unfunded, funded, filled, cancelled, proven,
|
|
116
|
+
cancelProven, claimed, refunded), its deadlines, and whether each next step can be taken now,
|
|
117
|
+
with why not and from when. An intent funded by a transfer into its vault counts as funded,
|
|
118
|
+
though the Portal's status for it stays Initial.
|
|
119
|
+
- `fill --send` fills it as a solver, from the signer: rehearsed first on the signer's real
|
|
120
|
+
balances and not sent if it reverts, and what it spends (each delivered token, and the value)
|
|
121
|
+
shown for approval (`--auto-approve` approves). It sends the approvals (zero first where a smaller one
|
|
122
|
+
stands), then `fulfillAndProve` with the prover's fee, or `fulfill` with `--no-prove`. It prints
|
|
123
|
+
the Hyperlane message the proof travels as.
|
|
124
|
+
- `prove` sends the proof of a filled or cancelled intent, paying the prover's fee; `claim` pays the
|
|
125
|
+
reward once the source has the proof, and says so, with the message's id, while it has not;
|
|
126
|
+
`refund` returns the reward when the Portal allows it, and says from when otherwise; `cancel`
|
|
127
|
+
cancels after the route's deadline, refusing where either Portal lacks the cancellation support
|
|
128
|
+
described above.
|
|
129
|
+
- Without a signer, each prints its transactions unsigned, for a wallet to send in order.
|
|
130
|
+
- `sauce intent` alone, at a terminal, lists the stored intents with where each stands, and runs
|
|
131
|
+
these on the one picked.
|
|
132
|
+
|
|
133
|
+
**An intent to Solana.** An intent Ethereum or Base publishes for Solana is filled, proven and
|
|
134
|
+
cancelled on Solana, through its Portal program, and claimed or refunded on its source as above.
|
|
135
|
+
The config gives Solana's endpoint under its chain id, `1399811149`.
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
npx sauce intent import <tx-hash> --chain <source> --config sauce.config.json
|
|
139
|
+
npx sauce intent fill <intent-hash> --config sauce.config.json --solver <solana-key> --claimant <address>
|
|
140
|
+
npx sauce intent fill <intent-hash> --config sauce.config.json --claimant <address> --send --keypair <keypair>
|
|
141
|
+
npx sauce intent cancel <intent-hash> --config sauce.config.json --keypair <keypair>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
- `--claimant` is required: the address on the source chain the reward pays. A Solana key is not
|
|
145
|
+
one.
|
|
146
|
+
- The rehearsal runs on the solver's accounts as they are, since Solana's simulation takes no
|
|
147
|
+
overrides: the solver must hold the route's tokens.
|
|
148
|
+
- `fill --send` sends the fill, then the proof through the HyperProver, with Hyperlane's gas paid in
|
|
149
|
+
the same transaction. Each spend is approved.
|
|
150
|
+
- `prove` and `cancel` sign with `--keypair`, which pays their fee. A cancellation's proof waits
|
|
151
|
+
until the slot that cancelled it is finalized.
|
|
152
|
+
|
|
153
|
+
The Portal's functions, events and errors, with selectors and topics, are in
|
|
154
|
+
[references/portal.md](references/portal.md).
|
|
155
|
+
|
|
156
|
+
## Names resolve per chain
|
|
157
|
+
|
|
158
|
+
The file is compiled for the **source** chain, the one that pays the reward (`--chain`).
|
|
159
|
+
|
|
160
|
+
- **In `.reward(...)`**, names are the source chain's, which funds and escrows the reward: `USDC`
|
|
161
|
+
there is the source chain's USDC. A reward token must be known when the file is compiled: a
|
|
162
|
+
symbol, or a token's address on the source chain as a literal, a define or a top-level `const` of
|
|
163
|
+
a literal. Its amount may be a measured value.
|
|
164
|
+
- **Inside the braces, and in the delivery argument**, the code runs on the destination, and every
|
|
165
|
+
name a chain supplies resolves there: in an `Ethereum(...)` body, `USDC` is Ethereum's USDC,
|
|
166
|
+
`AaveV3.Pool` is Ethereum's pool, and `chainId` and a `Namespace_Contract` define are Ethereum's.
|
|
167
|
+
The tokens a destination has are listed in
|
|
168
|
+
[../sauce-globals/references/tokens.md](../sauce-globals/references/tokens.md), with their
|
|
169
|
+
addresses in the destination's file in `sauce-chains`
|
|
170
|
+
([../sauce-chains/references/ethereum.md](../sauce-chains/references/ethereum.md) for Ethereum).
|
|
171
|
+
- **The rule repeats at every depth.** An intent opened inside a body is funded on that body's
|
|
172
|
+
chain, so its reward resolves there and its own body on its own destination.
|
|
173
|
+
- **Name a token by a symbol, a literal, a define or a top-level `const` of a literal.** Any other
|
|
174
|
+
top-level `const` holding a token's address (`const TOKEN = USDC;`), used in the reward or the
|
|
175
|
+
delivery, counts as a value the program computes, so the compile refuses the intent, saying the
|
|
176
|
+
token's address must be known when the intent is built, and so does `sauce intent publish`. A
|
|
177
|
+
`const` inside the braces is fine.
|
|
178
|
+
- A literal address means that address everywhere, and so does a define whose name no chain uses
|
|
179
|
+
(`RECIPIENT`). A define under a chain-scoped name (`USDC`, `chainId`, a protocol address) is a
|
|
180
|
+
name on the source chain: it applies to the file's own statements and the reward, and a body on
|
|
181
|
+
another chain keeps that chain's value.
|
|
182
|
+
|
|
183
|
+
## Publishing and funding
|
|
184
|
+
|
|
185
|
+
| Way | What is sent | Emits | Choose it when |
|
|
186
|
+
| ----------------------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------- | ----------------------------------------------------------------------------------- |
|
|
187
|
+
| (a) From a wallet, `sauce intent publish` | a transfer of each reward token to the intent's vault, then `publish`: no approval | `IntentPublished` | every amount is known when you build it, and a wallet pays |
|
|
188
|
+
| (b) From a Pot, `sauce run` | the same, by the Pot, inside the cook, with the vault read from the Portal | `IntentPublished` | an amount is measured on chain, or the intent must open atomically with other steps |
|
|
189
|
+
| (c) Transfer into the vault, by hand | a token transfer to `intentVaultAddress(...)`, then `publish`, for an intent you encode yourself | `IntentPublished` | the intent was not built from a file the package compiles |
|
|
190
|
+
| `--intent-fund-via publishAndFund` | (a) or (b) with `approve(Portal, reward)` per token, then `publishAndFund` | `IntentPublished`, `IntentFunded` | an intent built from a solver's quote (below) |
|
|
191
|
+
|
|
192
|
+
Funding by transfer needs no approval, so no allowance is left standing and USDT needs nothing
|
|
193
|
+
special. The vault counts whatever it holds, so `isIntentFunded` is true from the moment the
|
|
194
|
+
transfer lands; the intent's status stays Initial (only `publishAndFund` or `fund` set Funded), and
|
|
195
|
+
`isIntentFunded`, the check solvers make, accepts either. The reward always goes into the vault
|
|
196
|
+
**before** `publish` is sent, so a solver that sees `IntentPublished` finds the intent funded.
|
|
197
|
+
|
|
198
|
+
**(a) From a wallet.** `sauce intent publish` builds each intent before anything runs, so every amount
|
|
199
|
+
must be a literal, a define or a top-level `const` of a literal, and the file may do nothing but
|
|
200
|
+
open intents (a file with an amount measured or computed on chain is refused, with `sauce run` named
|
|
201
|
+
instead). For each intent it computes the vault from the
|
|
202
|
+
Portal's address and the intent and, with an endpoint, reads it from the Portal's
|
|
203
|
+
`intentVaultAddress`: the two must agree, or nothing is sent. The wallet then transfers each reward
|
|
204
|
+
token to the vault (and sends a native reward to it), only what the vault does not hold yet, and
|
|
205
|
+
calls `publish(destination, route, reward)` once the Portal reports the intent funded. A token whose
|
|
206
|
+
transfer returns `false` stops it there, before the intent is published, with what was paid still
|
|
207
|
+
in the vault: top it up and run it again, or `refund` after the deadline. A second run that finds
|
|
208
|
+
the vault funded only publishes.
|
|
209
|
+
|
|
210
|
+
```sh
|
|
211
|
+
npx sauce intent publish pay-on-ethereum.sauce.ts --chain base --config sauce.config.json \
|
|
212
|
+
--from <address> --dry-run --assume-balance USDC:1 --define RECIPIENT=<address> \
|
|
213
|
+
--define AMOUNT=1000000 --intent-deadline <unix seconds> --intent-creator <address>
|
|
214
|
+
npx sauce intent publish pay-on-ethereum.sauce.ts --chain base --from <address> --format json \
|
|
215
|
+
--define RECIPIENT=<address> --define AMOUNT=1000000 \
|
|
216
|
+
--intent-deadline <unix seconds> --intent-creator <address>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
- `--dry-run` rehearses the transfers and `publish` together from the wallet, then reports what
|
|
220
|
+
`isIntentFunded` returns after them, and sends nothing; `--assume-balance USDC:1` (whole tokens)
|
|
221
|
+
gives the wallet the reward for the rehearsal only, so a wallet that does not hold it yet can
|
|
222
|
+
rehearse. Without `--dry-run`, `--keystore <keystore>` in place of `--from` signs and sends them.
|
|
223
|
+
- `--format json` (or `cast`) with `--from` and no signer prints the transactions, unsigned, for that
|
|
224
|
+
wallet to send in order, transfers first, with each intent's `vault`. With no endpoint the vault
|
|
225
|
+
is the package's own computation and each transfer is for the whole reward; with one, the vault
|
|
226
|
+
is also read from the Portal and only what it does not hold yet is transferred. Send `publish`
|
|
227
|
+
only once the transfers have landed.
|
|
228
|
+
|
|
229
|
+
**(b) From a Pot.** `sauce run` cooks the file on your Pot, and opening the intent is one of its
|
|
230
|
+
steps: in the same transaction as everything else, the Pot reads the intent's vault from the Portal
|
|
231
|
+
(`intentVaultAddress` over the very bytes it then publishes), transfers each reward token there,
|
|
232
|
+
sends a native reward, and calls `publish`, so nothing is published unless the whole cook succeeds,
|
|
233
|
+
and a token whose transfer returns `false` reverts it. Values measured while it runs can flow into the intent: in
|
|
234
|
+
`const amount = USDC.balanceOf(ctx.self())`, `amount` does not exist until the program runs, and
|
|
235
|
+
using it inside the braces, in the delivery or in the reward is enough. The package encodes the
|
|
236
|
+
intent with a slot for it, and the program writes the measured value in before it publishes. Any
|
|
237
|
+
one-word value can be carried this way.
|
|
238
|
+
|
|
239
|
+
```sh
|
|
240
|
+
npx sauce run cross-chain.sauce.ts --chain base --config sauce.config.json --keystore <keystore> \
|
|
241
|
+
--define BENEFICIARY=<address> --intent-deadline <unix seconds> --intent-creator <address> \
|
|
242
|
+
--intent-execution-fee <wei>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**(c) Transfer into the vault, by hand.** (a) and (b) do this for every intent a file opens. For an
|
|
246
|
+
intent encoded some other way, do the same in one cook, with the program reading the vault from the
|
|
247
|
+
Portal itself so it cannot be wrong:
|
|
248
|
+
[examples/fund-by-transfer.sauce.ts](examples/fund-by-transfer.sauce.ts) takes the intent as
|
|
249
|
+
`publish`'s three arguments, transfers each reward token to
|
|
250
|
+
`intentVaultAddress(destination, route, reward)` and calls `publish(destination, route, reward)`,
|
|
251
|
+
which returns the intent hash and the vault. For an intent file, those three arguments are the
|
|
252
|
+
arguments of the `publish` that `sauce intent publish … --from <address> --format json` prints; decode them
|
|
253
|
+
with its signature (in [references/portal.md](references/portal.md)).
|
|
254
|
+
|
|
255
|
+
```sh
|
|
256
|
+
npx sauce run fund-by-transfer.sauce.ts --chain base --config sauce.config.json \
|
|
257
|
+
--keystore <keystore> --args <portal> <destination> <route> <reward>
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
- **From a wallet**, it is two transactions: **transfer first, then publish**, so a solver that sees
|
|
261
|
+
`IntentPublished` finds the intent funded. If the publish fails or is never sent, nothing is lost:
|
|
262
|
+
publish later (the vault still holds the reward), or `refund` after the deadline.
|
|
263
|
+
- **What the CLI emits**: `sauce intent publish` and `sauce run` fund every intent this way by default, as
|
|
264
|
+
(a) and (b) describe; `--intent-fund-via publishAndFund` gives the approve and `publishAndFund`
|
|
265
|
+
instead.
|
|
266
|
+
- A native reward (`reward.nativeAmount`) is native coin sent to the vault the same way, by
|
|
267
|
+
`sauce intent publish` and `sauce run` alike; the example funds tokens only and refuses a native reward.
|
|
268
|
+
|
|
269
|
+
**Quoted intents.** A solver that quoted an intent marks its quote funded when it sees
|
|
270
|
+
`IntentFunded`, which only `publishAndFund` and `fund` emit. For an intent built from a solver's
|
|
271
|
+
quote, fund it with `publishAndFund`: (a) or (b) with `--intent-fund-via publishAndFund`, not by
|
|
272
|
+
transfer. The wallet then approves each reward token to the **Portal** for exactly the reward (with
|
|
273
|
+
an endpoint, a smaller allowance already standing is reset to zero first, as USDT requires), and
|
|
274
|
+
`publishAndFund(destination, route, reward, false)` pulls the reward into the same vault and marks
|
|
275
|
+
the intent Funded; from a Pot, the same happens inside the cook.
|
|
276
|
+
|
|
277
|
+
`sauce inspect <file> --chain <chain>` with the same defines and intent flags prints each intent
|
|
278
|
+
the file opens: its destination, hashes, the route's calls and the reward, with every measured value
|
|
279
|
+
named.
|
|
280
|
+
|
|
281
|
+
## Two kinds of body
|
|
282
|
+
|
|
283
|
+
| The body is… | Lowers to | Needs | Token writes |
|
|
284
|
+
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
285
|
+
| only `transfer`/`approve` calls on a symbol or `Token(address)`, with literal, define or captured arguments | plain calls the destination Portal's Executor makes | nothing more: no Pot, no Kitchen fee | USDT works and `approve` is reset to zero first, but a `false` return is **not** detected |
|
|
286
|
+
| anything else: a local, a balance read, a condition, a protocol call, `transferFrom`, a nested intent | a program compiled for the destination and cooked on its Pot | the destination's Kitchen fee, and the delivery as the second argument | SafeERC20: a `false` return reverts the fulfilment |
|
|
287
|
+
|
|
288
|
+
The Executor checks only that each call did not revert, so a token-only body's transfer that
|
|
289
|
+
returns `false` fills the intent with nothing moved; a call with data to an address with no code
|
|
290
|
+
reverts `CallToEOA`. A program body must say what the solver delivers, because a balance read
|
|
291
|
+
inside it reads what is there, not what must be brought:
|
|
292
|
+
|
|
293
|
+
```sauce chain=base define=BENEFICIARY
|
|
294
|
+
const amount = USDC.balanceOf(ctx.self());
|
|
295
|
+
const delivered = amount - (amount * 10n) / 10000n;
|
|
296
|
+
Ethereum(
|
|
297
|
+
() => {
|
|
298
|
+
USDC.approve(AaveV3.Pool, delivered);
|
|
299
|
+
AaveV3.Pool.supply(USDC, delivered, BENEFICIARY, 0n);
|
|
300
|
+
},
|
|
301
|
+
{ tokens: [{ token: USDC, amount: delivered }] },
|
|
302
|
+
).reward({ tokens: [{ token: USDC, amount }] });
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
The gap between `delivered` (brought on Ethereum) and `amount` (paid on Base) is the solver's
|
|
306
|
+
margin. Make it worth filling.
|
|
307
|
+
|
|
308
|
+
## A whole program as the body
|
|
309
|
+
|
|
310
|
+
The body can be any program for the destination. It is written inside the braces and uses the
|
|
311
|
+
file's defines as values. It may also use what the file declares: its imports (an ABI, a library)
|
|
312
|
+
and its helper functions, each compiled into the body's program for the destination. It calls
|
|
313
|
+
contracts as any program does (`sauce-script`): by namespace (`UniswapV3.Factory.getPool(...)`),
|
|
314
|
+
through a registry ABI import, or through an ABI of the file's own imported at its top. A swap is a
|
|
315
|
+
`@sauce/router`
|
|
316
|
+
call (`sauce-swaps`), imported at the top of the file. Every unsold input and every output leaves the destination Pot
|
|
317
|
+
before the body ends, and a refund the body makes lands on the destination chain. The body runs on
|
|
318
|
+
the shared intent Pot, which holds nothing of anyone's between intents, so it may return a token's
|
|
319
|
+
whole balance there, as the refunds below do; a program on an owner's Pot returns only what is left
|
|
320
|
+
of its own amount instead (`sauce-distributed-swap`).
|
|
321
|
+
|
|
322
|
+
A one-pool swap, with the guard every swap needs (`sauce-swaps`): WETH a solver delivers on Base is
|
|
323
|
+
sold on the Uniswap V3 0.05% pool down to `SQRT_PRICE_LIMIT_X96`, at least `MIN_OUT` USDC goes to
|
|
324
|
+
`RECIPIENT`, and any unsold WETH to `REFUND_TO`, on Base. A fill below `MIN_OUT` reverts the whole
|
|
325
|
+
fulfilment, so set it from the limit (`sauce-distributed-swap` has the recipe), never above what the
|
|
326
|
+
pool can pay.
|
|
327
|
+
|
|
328
|
+
```sauce chain=ethereum define=AMOUNT_IN,REWARD,SQRT_PRICE_LIMIT_X96,MIN_OUT,RECIPIENT,REFUND_TO
|
|
329
|
+
import { uniswapV3 } from "@sauce/router";
|
|
330
|
+
|
|
331
|
+
Base(
|
|
332
|
+
() => {
|
|
333
|
+
const pool = UniswapV3.Factory.getPool(WETH, USDC, 500n); // Base's 0.05% tier
|
|
334
|
+
require(pool != 0n, "no WETH/USDC pool at 0.05%");
|
|
335
|
+
// Pays RECIPIENT the USDC, and reverts the whole fulfilment below MIN_OUT.
|
|
336
|
+
uniswapV3(pool, WETH, USDC, AMOUNT_IN, SQRT_PRICE_LIMIT_X96, MIN_OUT, RECIPIENT);
|
|
337
|
+
const unsold = WETH.balanceOf(ctx.self()); // the shared Pot: return all of it
|
|
338
|
+
if (unsold > 0n) {
|
|
339
|
+
WETH.transfer(REFUND_TO, unsold);
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
{ tokens: [{ token: WETH, amount: AMOUNT_IN }] }, // Base's WETH, which the solver delivers
|
|
343
|
+
).reward({ tokens: [{ token: WETH, amount: REWARD }] }); // the source chain's WETH
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
`REWARD` must exceed what the solver delivers, `AMOUNT_IN`, by what filling costs it (below). To buy
|
|
347
|
+
WETH instead, swap `USDC` for `WETH` and deliver USDC: USDC is token1 on Base, so the limit is then
|
|
348
|
+
a ceiling, the `buy` block of `sauce price`.
|
|
349
|
+
[examples/swap-on-base.sauce.ts](examples/swap-on-base.sauce.ts) is the same with a distributed
|
|
350
|
+
swap as the body (`sauce-distributed-swap`): one pass over every Uniswap V3 and hookless V4 pool of
|
|
351
|
+
the pair, each offered the WETH still unsold up to its own fee-adjusted limit, and skipped when it
|
|
352
|
+
has no liquidity or is past that limit. It swaps through `@sauce/router`, finds each V3 pool with
|
|
353
|
+
`UniswapV3.Factory.getPool` and reads it as `UniswapV3.Pool(pool)`, and reads the V4 pools from
|
|
354
|
+
`UniswapV4.StateView`.
|
|
355
|
+
|
|
356
|
+
## Cascades
|
|
357
|
+
|
|
358
|
+
An intent's body can open the next one. Each level's amounts are measured at that level's own
|
|
359
|
+
execution and carried into the level below; no amount past the first exists when the user signs.
|
|
360
|
+
|
|
361
|
+
```sauce chain=base define=RECIPIENT
|
|
362
|
+
const amount = USDC.balanceOf(ctx.self());
|
|
363
|
+
Ethereum(
|
|
364
|
+
() => {
|
|
365
|
+
const arrived = USDC.balanceOf(ctx.self()); // Ethereum's USDC
|
|
366
|
+
Base(() => {
|
|
367
|
+
USDC.transfer(RECIPIENT, arrived); // Base's USDC
|
|
368
|
+
}).reward({ tokens: [{ token: USDC, amount: arrived }] }); // Ethereum's: it funds this level
|
|
369
|
+
},
|
|
370
|
+
{ tokens: [{ token: USDC, amount }] },
|
|
371
|
+
).reward({ tokens: [{ token: USDC, amount }] });
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
Each level is a separate fulfilment by a solver, later, on its own chain: a failure on a later hop
|
|
375
|
+
does not undo an earlier one. The child is published and funded **by the parent's body**, as (b)
|
|
376
|
+
above: when the Ethereum level runs, the shared Pot there pays the next level's reward into its
|
|
377
|
+
vault on Ethereum's Portal from what it holds, in Ethereum's USDC, and calls `publish`, so the child
|
|
378
|
+
is published like any other intent and any solver can discover it. Keep every level on a supported
|
|
379
|
+
chain, as here (Base, Ethereum, then Base again): the command checks the first level's chains only.
|
|
380
|
+
Each level's deadline must be no
|
|
381
|
+
earlier than its parent's. (The TypeScript cascade builder, `.nest()` in `sauce-typescript`, also
|
|
382
|
+
funds a child by a transfer into its vault by default, but with no publication of its own, and
|
|
383
|
+
takes `publishAndFund` as an option.)
|
|
384
|
+
|
|
385
|
+
## What the compile supplies, and what you pass
|
|
386
|
+
|
|
387
|
+
The Portal, the prover, the destination Pot and the encoding are looked up from the eco-routes
|
|
388
|
+
registry, which records each chain's Portal and a prover deployed on both sides. Each chain's file in
|
|
389
|
+
`sauce-chains` says whether it takes intents and gives its Portal, Executor and shared intent Pot
|
|
390
|
+
([../sauce-chains/references/index.md](../sauce-chains/references/index.md)). Three values are the
|
|
391
|
+
developer's:
|
|
392
|
+
|
|
393
|
+
- **`--intent-deadline <unix seconds>`**: when the intent must be filled by.
|
|
394
|
+
- **`--intent-creator <address>`**: who may reclaim an unearned reward. Never a Pot.
|
|
395
|
+
- **`--intent-execution-fee <wei>`** for a program body: the destination Kitchen's fee. It is
|
|
396
|
+
mutable on chain and lives on the destination, so read it there just before sending: an
|
|
397
|
+
`eth_call` of `executionFee()` on the destination's Kitchen (its address is in the chain's file in
|
|
398
|
+
`sauce-chains`), or pass `--intent-execution-fee auto`, which reads it through `--config`. An
|
|
399
|
+
increase before the fill makes the cook, and the fulfilment, revert.
|
|
400
|
+
|
|
401
|
+
**Units and defines.** Amounts are base units (`AMOUNT=1000000` is 1 USDC); only `--assume-balance`
|
|
402
|
+
and `--fund` take whole tokens. In a `--defines` file, write an address or any value past 2^53 as a
|
|
403
|
+
JSON string (`"AMOUNT_IN": "1000000000000000000"`): a JSON number loses precision. The intent file
|
|
404
|
+
stays top-level statements with no `main`, so every input is a define.
|
|
405
|
+
|
|
406
|
+
Refused at compile time, never silently changed: a name that is neither a define nor a program
|
|
407
|
+
variable, a missing deadline, creator or fee, a chain with no eco-routes deployment, a pair with no
|
|
408
|
+
prover deployed on both sides.
|
|
409
|
+
|
|
410
|
+
## The destination side
|
|
411
|
+
|
|
412
|
+
- **The shared Pot.** A program body cooks on the destination Portal Executor's **shared Pot** (its
|
|
413
|
+
owner is the Executor, its salt zero); the destination's file in `sauce-chains` gives the Pot and
|
|
414
|
+
the Executor. **The Pot must exist before any fill**: until it does, every fulfilment of a program
|
|
415
|
+
body reverts (`CallToEOA`). `npx sauce pot --chain <destination> --owner <Executor>` prints its
|
|
416
|
+
address and deploy transaction; with `--deploy --config sauce.config.json --keystore <keystore>`
|
|
417
|
+
any signer deploys it (the Pot is the Executor's either way), and an existing one is reported, not
|
|
418
|
+
redeployed; `sauce intent fill` says whether it is deployed on the destination, and deploys it in its
|
|
419
|
+
rehearsal when it is not. Anything left in the Pot after the program, token or allowance, belongs
|
|
420
|
+
to the next intent through that Portal: approve exactly what is spent and move every remainder
|
|
421
|
+
out.
|
|
422
|
+
- **What the solver pays.** The Kitchen fee becomes the route's `nativeAmount`: the solver sends it,
|
|
423
|
+
in the destination's native coin, as the value of `fulfill`, and pays the destination gas too.
|
|
424
|
+
Nothing in the reward pays either back, so the margin (the reward minus what the solver delivers)
|
|
425
|
+
must cover both; a body that reads and swaps on many pools costs a lot of gas, so measure it in a
|
|
426
|
+
rehearsal (below). Solvers apply checks of their own, such as the reward covering the route's
|
|
427
|
+
tokens plus their fee, and decide which routes they fill.
|
|
428
|
+
- **Refunds of unsold input land on the destination**, where the body runs.
|
|
429
|
+
|
|
430
|
+
## Rehearse both sides before a solver does
|
|
431
|
+
|
|
432
|
+
- **The source side**: `sauce intent publish --dry-run --assume-balance …` (above) rehearses the transfers
|
|
433
|
+
into the vault and `publish`; `sauce simulate` rehearses a file run from a Pot.
|
|
434
|
+
- **The fill, on the destination**: the body runs there, when a solver fills the intent, and that is
|
|
435
|
+
where a swap misses its minimum or a refund fails. Rehearse it with `sauce intent fill`, the same file
|
|
436
|
+
and flags, before publishing; it signs nothing and sends nothing:
|
|
437
|
+
|
|
438
|
+
```sh
|
|
439
|
+
npx sauce intent fill swap-on-base.sauce.ts --chain <chain> --config sauce.config.json \
|
|
440
|
+
--defines <defines.json> --intent-deadline <unix seconds> --intent-creator <address> \
|
|
441
|
+
--intent-execution-fee <Base Kitchen fee in wei>
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
On each intent's destination it runs, in one simulated block, what a solver sends: the shared
|
|
445
|
+
Pot's deployment when the body cooks on it and nobody has deployed it yet, the solver's approval
|
|
446
|
+
of the destination Portal for the delivered tokens, then `Portal.fulfillAndProve` with the
|
|
447
|
+
Kitchen's fee and the prover's fee as its value (or `Portal.fulfill` with the Kitchen's fee alone,
|
|
448
|
+
with `--no-prove` or a prover it does not drive). The solver is given the delivered tokens for the rehearsal only. It prints each
|
|
449
|
+
transfer, each address's net change (an address a define holds is named by the define) and what
|
|
450
|
+
the shared Pot and the Executor were left holding, which must be nothing; or why the fill
|
|
451
|
+
reverts, down to the body's own `require` message. It warns when the shared Pot is not deployed,
|
|
452
|
+
and when `--intent-execution-fee` is below the destination Kitchen's fee, naming the fee to pass.
|
|
453
|
+
`--config` must name the destination chain's endpoint (`--rpc-url` works when every intent goes
|
|
454
|
+
to one chain, and is then that chain's endpoint). An intent that uses a value measured on chain
|
|
455
|
+
cannot be rehearsed this way: its route exists only once the program runs. Fix what it reports
|
|
456
|
+
and rehearse again before `sauce intent publish` or `sauce run`. With `--send` and a signer,
|
|
457
|
+
`sauce intent fill` then fills it for real (above).
|
|
458
|
+
|
|
459
|
+
- **The body alone, as a program**: copy the body (what is inside the braces) into a file of its own,
|
|
460
|
+
top-level statements with the same defines, and rehearse it as a program for the destination,
|
|
461
|
+
with the delivered tokens assumed in the Pot. It runs on your Pot instead of the shared one, but
|
|
462
|
+
executes the same calls, shows what moves, and gives the gas:
|
|
463
|
+
|
|
464
|
+
```sh
|
|
465
|
+
npx sauce simulate one-pool-body.sauce.ts --chain base --owner <address> \
|
|
466
|
+
--config sauce.config.json --assume-balance WETH:0.001 --define AMOUNT_IN=1000000000000000 \
|
|
467
|
+
--define SQRT_PRICE_LIMIT_X96=<sqrtPriceX96> --define MIN_OUT=<amount> \
|
|
468
|
+
--define RECIPIENT=<address> --define REFUND_TO=<address>
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
- **The fill by hand**, as a solver sends it, on a fork of the destination
|
|
472
|
+
(`anvil --fork-url <destination endpoint>`), with any client:
|
|
473
|
+
1. Get the intent: `sauce inspect <file> --chain <source> --json`, with the same defines and
|
|
474
|
+
intent flags, prints each intent's `intentHash`, `routeHash`, `rewardHash`, route and reward;
|
|
475
|
+
the raw route bytes are the `route` argument of the `publish` that
|
|
476
|
+
`sauce intent publish <file> … --from <address> --format json` prints (their keccak-256 is
|
|
477
|
+
`routeHash`).
|
|
478
|
+
2. Make sure the shared Pot exists (above).
|
|
479
|
+
3. Hold the route's `tokens` in an account and approve the **destination** Portal for each;
|
|
480
|
+
`fulfill` pulls them from the sender.
|
|
481
|
+
4. From that account, call the destination Portal's
|
|
482
|
+
`fulfill(bytes32 intentHash, Route route, bytes32 rewardHash, bytes32 claimant)` with **value =
|
|
483
|
+
the route's `nativeAmount`**, the route decoded from its bytes and the claimant the solver's
|
|
484
|
+
address as 32 bytes. Less value reverts `InsufficientNativeAmount(sent, required)`, a missing
|
|
485
|
+
Pot `CallToEOA(<Pot>)`, and a body that reverts surfaces as the Executor's `CallFailed`, with
|
|
486
|
+
the body's own reason inside.
|
|
487
|
+
5. Read the outcome: what the recipient got, what was refunded, the gas, and that the Pot holds
|
|
488
|
+
nothing.
|
|
489
|
+
|
|
490
|
+
Solana destinations are not built this way (see `sauce-solana`). An application can also build an
|
|
491
|
+
intent from TypeScript around a program it compiles itself (`sauce-typescript`).
|
|
492
|
+
|
|
493
|
+
## Examples
|
|
494
|
+
|
|
495
|
+
- [examples/cross-chain.sauce.ts](examples/cross-chain.sauce.ts) forwards the Pot's USDC to Aave on
|
|
496
|
+
Ethereum. It measures its amount, so it runs from a Pot.
|
|
497
|
+
- [examples/swap-on-base.sauce.ts](examples/swap-on-base.sauce.ts) is the distributed swap as the
|
|
498
|
+
body of an intent to Base, opened from Ethereum. Its amounts are defines, so it can be run from a
|
|
499
|
+
Pot or published from a wallet.
|
|
500
|
+
- [examples/fund-by-transfer.sauce.ts](examples/fund-by-transfer.sauce.ts) funds an intent by a
|
|
501
|
+
transfer into its vault and publishes it, in one cook on a Pot.
|
|
502
|
+
- [examples/intents.mts](examples/intents.mts) compiles the intent files, with the deadline, the
|
|
503
|
+
creator, Base's and Ethereum's fees and the recipient as developer inputs, and pins on which chain
|
|
504
|
+
each name resolves, the fee requirement, the token-only case, the pool ABI's selectors, and the
|
|
505
|
+
rehearsal's transactions: the Pot's deploy and `fulfill` with the fee as its value.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Forwards the USDC this Pot holds to Ethereum, where a solver supplies it to Aave V3 for
|
|
2
|
+
// BENEFICIARY. The amount is only known when this runs, so the file runs on the owner's Pot (sauce
|
|
3
|
+
// run) and opens the intent as it goes. The whole file is the program: top-level statements, no
|
|
4
|
+
// main, and BENEFICIARY a define.
|
|
5
|
+
//
|
|
6
|
+
// `--chain` is the source chain, which funds the reward: `USDC` in `.reward(...)` is its USDC.
|
|
7
|
+
// Inside the braces, and in the delivery argument after them, the code runs on Ethereum: `USDC` and
|
|
8
|
+
// `AaveV3.Pool` there are Ethereum's. The gap between what is delivered and the reward is the
|
|
9
|
+
// solver's margin.
|
|
10
|
+
//
|
|
11
|
+
// sauce run cross-chain.sauce.ts --chain <chain> --config sauce.config.json \
|
|
12
|
+
// --keystore <keystore> --define BENEFICIARY=<address> --intent-deadline <unix seconds> \
|
|
13
|
+
// --intent-creator <address> --intent-execution-fee <Ethereum Kitchen fee in wei>
|
|
14
|
+
//
|
|
15
|
+
// BENEFICIARY: Address who the Aave V3 position on Ethereum is supplied for
|
|
16
|
+
// --intent-deadline: unix seconds the last second a solver may fill it
|
|
17
|
+
// --intent-creator: Address who may reclaim the reward if no solver earns it
|
|
18
|
+
// --intent-execution-fee: wei Ethereum's Kitchen fee for the body's cook; `auto` reads it
|
|
19
|
+
// through --config
|
|
20
|
+
//
|
|
21
|
+
// From Base, with the fee read from Ethereum:
|
|
22
|
+
//
|
|
23
|
+
// sauce run cross-chain.sauce.ts --chain base --config sauce.config.json \
|
|
24
|
+
// --keystore <keystore> --define BENEFICIARY=<address> --intent-deadline <unix seconds> \
|
|
25
|
+
// --intent-creator <address> --intent-execution-fee auto
|
|
26
|
+
require(BENEFICIARY != 0n, "set BENEFICIARY");
|
|
27
|
+
const amount = USDC.balanceOf(ctx.self());
|
|
28
|
+
require(amount > 0n, "nothing to forward");
|
|
29
|
+
const delivered = amount - (amount * 10n) / 10000n; // the solver keeps 0.1%
|
|
30
|
+
|
|
31
|
+
Ethereum(
|
|
32
|
+
() => {
|
|
33
|
+
USDC.approve(AaveV3.Pool, delivered);
|
|
34
|
+
AaveV3.Pool.supply(USDC, delivered, BENEFICIARY, 0n);
|
|
35
|
+
},
|
|
36
|
+
{ tokens: [{ token: USDC, amount: delivered }] },
|
|
37
|
+
).reward({ tokens: [{ token: USDC, amount }] });
|