@eco-incorp/sauce 0.99.5 → 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 +30 -5
- package/docs/concepts/saucescript.md +53 -56
- 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 +24 -15
- package/docs/guides/cli.md +1442 -0
- package/docs/guides/compiling.md +24 -10
- package/docs/guides/intents.md +260 -17
- package/docs/guides/mcp.md +539 -0
- package/docs/guides/nested-intents.md +21 -6
- package/docs/guides/protocols-and-tokens.md +235 -36
- 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/plugin/index.d.ts +3 -2
- package/sdk/dist/plugin/index.d.ts.map +1 -1
- package/sdk/dist/plugin/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/cbeth/functions.d.ts +2 -2
- package/sdk/dist/protocols/cbeth/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/cbeth/functions.js +4 -6
- package/sdk/dist/protocols/cbeth/functions.js.map +1 -1
- package/sdk/dist/protocols/crvusd/functions.d.ts +2 -2
- package/sdk/dist/protocols/crvusd/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/crvusd/functions.js +6 -6
- 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/erc20/functions.d.ts +3 -3
- package/sdk/dist/protocols/erc20/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/erc20/functions.js +6 -9
- package/sdk/dist/protocols/erc20/functions.js.map +1 -1
- package/sdk/dist/protocols/frax/functions.d.ts +2 -2
- package/sdk/dist/protocols/frax/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/frax/functions.js +6 -6
- package/sdk/dist/protocols/gho/functions.d.ts +2 -2
- package/sdk/dist/protocols/gho/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/gho/functions.js +4 -6
- package/sdk/dist/protocols/gho/functions.js.map +1 -1
- package/sdk/dist/protocols/liquity-v2/functions.d.ts +2 -2
- package/sdk/dist/protocols/liquity-v2/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/liquity-v2/functions.js +4 -6
- package/sdk/dist/protocols/liquity-v2/functions.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 +5 -3
- package/sdk/dist/recipes/plain-transfer.sauce.ts +5 -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 +21 -3
- package/sdk/dist/routes/ast-walk.d.ts.map +1 -1
- package/sdk/dist/routes/ast-walk.js +33 -4
- 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 +21 -14
- package/sdk/dist/routes/index.d.ts.map +1 -1
- package/sdk/dist/routes/index.js +12 -9
- 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 +358 -152
- 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 +249 -96
- 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 +5530 -936
- 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 +208 -33
- package/sdk/dist/routes/token-registry.js.map +1 -1
- package/sdk/dist/routes/token-rewrite.d.ts +63 -28
- package/sdk/dist/routes/token-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/token-rewrite.js +387 -123
- 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/api.d.ts +7 -4
- package/sdk/dist/token/api.d.ts.map +1 -1
- package/sdk/dist/token/api.js.map +1 -1
- package/sdk/dist/token/evm.js +2 -2
- package/sdk/dist/token/index.d.ts +4 -4
- package/sdk/dist/token/index.js +4 -4
- 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/cbeth/functions.ts +4 -6
- package/sdk/src/protocols/crvusd/functions.ts +6 -6
- 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/erc20/functions.ts +6 -9
- package/sdk/src/protocols/frax/functions.ts +6 -6
- package/sdk/src/protocols/gho/functions.ts +4 -6
- package/sdk/src/protocols/liquity-v2/functions.ts +4 -6
- 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/skills/sauce-protocols/references/cbeth.md +48 -0
- 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/skills/sauce-protocols/references/crvusd.md +49 -0
- 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 +18 -34
- 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/skills/sauce-protocols/references/frax.md +48 -0
- 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/skills/sauce-protocols/references/gho.md +50 -0
- 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/skills/sauce-protocols/references/liquity-v2.md +48 -0
- 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/cbeth.md +0 -62
- package/sdk/src/skills/chainlink.md +0 -62
- package/sdk/src/skills/crvusd.md +0 -58
- package/sdk/src/skills/curve.md +0 -141
- package/sdk/src/skills/eigenlayer.md +0 -71
- package/sdk/src/skills/frax.md +0 -57
- package/sdk/src/skills/gamma.md +0 -79
- package/sdk/src/skills/gho.md +0 -61
- 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/liquity-v2.md +0 -59
- 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,734 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sauce intent fill`: a solver's fill of the intents a file opens (or the store holds), on each intent's
|
|
3
|
+
* DESTINATION chain — rehearsed with no key and nothing sent, the other half of
|
|
4
|
+
* `publish --dry-run`, which rehearses only the source chain's funding of the vault and `publish`;
|
|
5
|
+
* or, with `--send` and a signer, rehearsed and then SENT, the signer being the solver. The route's
|
|
6
|
+
* body is where an intent fails (a swap, a minimum, a refund), and it runs only on the destination,
|
|
7
|
+
* inside `Portal.fulfill`.
|
|
8
|
+
*
|
|
9
|
+
* The transactions are `lifecycle.ts#planFill`'s, the same ones `sauce mcp` returns unsigned:
|
|
10
|
+
*
|
|
11
|
+
* 1. `Kitchen.deployPot(executor, 0)`, when the route cooks on the destination's shared intent
|
|
12
|
+
* Pot and it is not deployed yet. Any account may send it; the Pot is the Executor's either way.
|
|
13
|
+
* 2. The solver's approval of the Portal for each route token (`fulfillApprovalTxs`), reset to
|
|
14
|
+
* zero first where a smaller allowance stands. The Portal pulls the tokens from the solver.
|
|
15
|
+
* 3. `Portal.fulfillAndProve(…)` with the route's `nativeAmount` (the Kitchen's fee for each cook)
|
|
16
|
+
* plus the prover's quoted fee as its value, when the reward's prover is a Hyperlane one this
|
|
17
|
+
* command drives — else, or with `--no-prove`, `Portal.fulfill(intentHash, route, rewardHash,
|
|
18
|
+
* claimant)` with the native amount alone, to be proven later (`sauce intent prove`).
|
|
19
|
+
*
|
|
20
|
+
* They are rehearsed in one `eth_simulateV1` block, every call from the solver, state carried from
|
|
21
|
+
* one to the next. A rehearsal with nothing to send gives the solver what it delivers by state
|
|
22
|
+
* override: each route token's balance, where the token keeps it found as `simulate
|
|
23
|
+
* --assume-balance` finds it (`assume.ts`), and the value. With `--send` nothing is assumed: the
|
|
24
|
+
* rehearsal runs on the solver's real balances, and a fill that would revert is not sent. What the
|
|
25
|
+
* fill moved is read back from the fulfill's logs (`effects.ts`), and what it left in the shared Pot
|
|
26
|
+
* and the Executor — shared by every intent through that Portal, so anything left there is
|
|
27
|
+
* anyone's — from their balances before it plus what it moved.
|
|
28
|
+
*
|
|
29
|
+
* Every address is the registry's or read from the chain: the Portal is the one the route records,
|
|
30
|
+
* the Executor its `executor()`, the Pot derived from that Executor and the zero salt, the prover
|
|
31
|
+
* the registry's counterpart of the reward's (`lifecycle.ts#proverPlan`).
|
|
32
|
+
*/
|
|
33
|
+
import { decodeErrorResult, formatUnits, getAbiItem, getAddress, keccak256, numberToHex, parseAbi, toFunctionSelector, toHex, } from "viem";
|
|
34
|
+
import { v12EngineAddress } from "../deployments/index.js";
|
|
35
|
+
import { v12PotAbi } from "../evm/engine.js";
|
|
36
|
+
import { PortalABI, ProverABI } from "../protocols/eco-routes/abis.js";
|
|
37
|
+
import { ecoRoutesPortal } from "../protocols/eco-routes/lookup.js";
|
|
38
|
+
import { denormalizeToEvm } from "../routes/encode.js";
|
|
39
|
+
import { CliError, UsageError } from "./args.js";
|
|
40
|
+
import { assumeTokenBalance, mergeOverrides } from "./assume.js";
|
|
41
|
+
import { connect, revertReason, sendAndWait } from "./chain.js";
|
|
42
|
+
import { compileProgram, kitchenAddress, unapproved, } from "./commands.js";
|
|
43
|
+
import { addressLabels, effectLines, effectsJson, effectsOf, formatAmount, labelled, nativeSymbol, } from "./effects.js";
|
|
44
|
+
import { dispatchedMessages, intentRecord, planFill, } from "./lifecycle.js";
|
|
45
|
+
import { costJson, costLine, costOf } from "./receipt.js";
|
|
46
|
+
import { requireSupported } from "./support.js";
|
|
47
|
+
/** The solver a rehearsal fills from when none is named: an address nobody holds the key of. */
|
|
48
|
+
export const DEFAULT_SOLVER = getAddress("0x5a0ce0000000000000000000000000000000f111");
|
|
49
|
+
/** The Executor's refusals (`IExecutor.sol`, eco-routes `main`), which a failed route call reverts
|
|
50
|
+
* `fulfill` with: the Executor is a contract of its own, so the Portal's ABI does not declare them. */
|
|
51
|
+
const EXECUTOR_ERRORS = parseAbi([
|
|
52
|
+
"error CallFailed((address target, bytes data, uint256 value) call, bytes reason)",
|
|
53
|
+
"error CallToEOA(address target)",
|
|
54
|
+
"error NonPortalCaller(address caller)",
|
|
55
|
+
]);
|
|
56
|
+
/** What `fulfill` reverts with by name: the Portal's own errors (the Inbox's refusals among them,
|
|
57
|
+
* and SafeERC20's on a route token pull), the Executor's, and a message-bridge prover's fee. */
|
|
58
|
+
const FULFILL_ERRORS = [
|
|
59
|
+
...PortalABI.filter((item) => item.type === "error"),
|
|
60
|
+
...ProverABI.filter((item) => item.type === "error"),
|
|
61
|
+
...EXECUTOR_ERRORS,
|
|
62
|
+
];
|
|
63
|
+
const ERC20 = parseAbi(["function balanceOf(address) view returns (uint256)"]);
|
|
64
|
+
const COOK = toFunctionSelector(getAbiItem({ abi: v12PotAbi, name: "cook" }));
|
|
65
|
+
const read = async (what, call) => {
|
|
66
|
+
try {
|
|
67
|
+
return await call();
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
throw new CliError(`reading ${what} failed: ${error.shortMessage ?? "the call reverted"}`);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
/** The intents the file opens, each one a solver could fill from what the file says. */
|
|
74
|
+
export function fillTargets(input, files) {
|
|
75
|
+
if (input.chain.kind !== "evm") {
|
|
76
|
+
throw new UsageError(`sauce intent fill rehearses intents an EVM chain opens, and ${input.chain.slug} is not one: ` +
|
|
77
|
+
"the eco-routes Portal this SDK publishes through is EVM only");
|
|
78
|
+
}
|
|
79
|
+
const intents = compileProgram(input, files).intents;
|
|
80
|
+
if (intents.length === 0) {
|
|
81
|
+
throw new UsageError(`${input.file} opens no intent: there is nothing for a solver to fill`);
|
|
82
|
+
}
|
|
83
|
+
for (const intent of intents) {
|
|
84
|
+
if (intent.captures.length > 0) {
|
|
85
|
+
throw new CliError(`the intent to ${intent.destination.slug} uses ` +
|
|
86
|
+
`${intent.captures.map((name) => `\`${name}\``).join(", ")}, which the program measures ` +
|
|
87
|
+
"or computes while it runs: its route exists only once the program has run, so it " +
|
|
88
|
+
"cannot be rehearsed from the file. Name it by its hash once `sauce run` has published " +
|
|
89
|
+
"it, or make the value a literal, a define or a top-level `const` of a literal");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return intents.map((intent) => ({
|
|
93
|
+
intent: intent.intent,
|
|
94
|
+
source: input.chain,
|
|
95
|
+
destination: intent.destination,
|
|
96
|
+
sourcePortal: ecoRoutesPortal(input.chain),
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
/** Names for the addresses a define holds: `RECIPIENT`, `REFUND_TO`. A define of an address-sized
|
|
100
|
+
* integer that is not one names nothing a fill touches. */
|
|
101
|
+
export function defineLabels(input) {
|
|
102
|
+
const names = new Map();
|
|
103
|
+
for (const [name, value] of Object.entries(input.defines)) {
|
|
104
|
+
if (typeof value !== "bigint" || value < 1n << 64n || value >= 1n << 160n)
|
|
105
|
+
continue;
|
|
106
|
+
const address = getAddress(numberToHex(value, { size: 20 }));
|
|
107
|
+
names.set(address, [...(names.get(address) ?? []), name]);
|
|
108
|
+
}
|
|
109
|
+
return [...names].map(([address, list]) => [address, list.join(", ")]);
|
|
110
|
+
}
|
|
111
|
+
/** Why the fulfill reverted, unwrapping a failed route call to the reason it failed with. */
|
|
112
|
+
function fulfillReason(data, intent, pot) {
|
|
113
|
+
if (data === undefined || data === "0x") {
|
|
114
|
+
return "it reverted with no data (out of gas, or a revert with no reason)";
|
|
115
|
+
}
|
|
116
|
+
let decoded;
|
|
117
|
+
try {
|
|
118
|
+
decoded = decodeErrorResult({ abi: FULFILL_ERRORS, data });
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return revertReason({ data });
|
|
122
|
+
}
|
|
123
|
+
const route = intent.route;
|
|
124
|
+
switch (decoded.errorName) {
|
|
125
|
+
case "CallFailed": {
|
|
126
|
+
const [call, reason] = decoded.args;
|
|
127
|
+
const index = route.calls.findIndex((entry) => getAddress(denormalizeToEvm(entry.target)) === getAddress(call.target) &&
|
|
128
|
+
entry.data.toLowerCase() === call.data.toLowerCase() &&
|
|
129
|
+
entry.value === call.value);
|
|
130
|
+
const target = getAddress(call.target);
|
|
131
|
+
const what = target === pot && call.data.startsWith(COOK)
|
|
132
|
+
? `the cook on the shared Pot ${target}`
|
|
133
|
+
: `the call to ${target}`;
|
|
134
|
+
const which = index < 0 ? "a route call" : `route call ${index + 1} of ${route.calls.length}`;
|
|
135
|
+
return `${which} (${what}) reverted: ${fulfillReason(reason, intent, pot)}`;
|
|
136
|
+
}
|
|
137
|
+
case "CallToEOA": {
|
|
138
|
+
const [target] = decoded.args;
|
|
139
|
+
return getAddress(target) === pot
|
|
140
|
+
? `CallToEOA(${target}): the shared Pot is not deployed, so the route's cook calls an ` +
|
|
141
|
+
"address with no code"
|
|
142
|
+
: `CallToEOA(${target}): a route call has data for an address with no code`;
|
|
143
|
+
}
|
|
144
|
+
case "IntentExpired":
|
|
145
|
+
return (`IntentExpired(): the route's deadline, ${route.deadline} ` +
|
|
146
|
+
`(${new Date(Number(route.deadline) * 1000).toISOString()}), has passed`);
|
|
147
|
+
case "InvalidHash":
|
|
148
|
+
return (`InvalidHash(${decoded.args[0]}): the Portal hashes this route and reward to something ` +
|
|
149
|
+
"else");
|
|
150
|
+
case "IntentAlreadyFulfilled":
|
|
151
|
+
return `IntentAlreadyFulfilled(${decoded.args[0]}): a solver has already filled this intent`;
|
|
152
|
+
case "InsufficientFee":
|
|
153
|
+
return `InsufficientFee(${decoded.args[0]}): the prover's fee rose above the one quoted`;
|
|
154
|
+
default: {
|
|
155
|
+
const args = (decoded.args ?? []).map((arg) => String(arg));
|
|
156
|
+
return `${decoded.errorName}(${args.join(", ")})`;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/** Why a call before the fulfill failed. */
|
|
161
|
+
const stepReason = (data) => data === undefined || data === "0x"
|
|
162
|
+
? "it reverted with no data (out of gas, or a revert with no reason)"
|
|
163
|
+
: revertReason({ data });
|
|
164
|
+
/** The destination's client, naming `--rpc-url` when it serves the wrong chain. */
|
|
165
|
+
async function destinationClient(input, target) {
|
|
166
|
+
try {
|
|
167
|
+
return await connect(input.endpointOf(target.destination), target.destination);
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
if (error instanceof CliError && input.endpointFlag === "--rpc-url") {
|
|
171
|
+
throw new CliError(`${error.message}. sauce intent fill rehearses on the intent's destination, so --rpc-url is ` +
|
|
172
|
+
`${target.destination.slug}'s endpoint, not ${target.source.slug}'s`);
|
|
173
|
+
}
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/** Rehearses the fill of one intent on its destination: with what it delivers assumed, unless it
|
|
178
|
+
* is about to be sent from `send`'s account. */
|
|
179
|
+
async function rehearseFill(input, target) {
|
|
180
|
+
const chain = target.destination;
|
|
181
|
+
const client = await destinationClient(input, target);
|
|
182
|
+
const sourceUrl = input.sourceEndpointOf?.(target.source);
|
|
183
|
+
const source = sourceUrl === undefined ? undefined : await connect(sourceUrl, target.source);
|
|
184
|
+
const sending = input.send !== undefined;
|
|
185
|
+
const solver = input.send?.account.address ?? input.solver ?? DEFAULT_SOLVER;
|
|
186
|
+
const plan = await planFill(client, target.intent, {
|
|
187
|
+
solver,
|
|
188
|
+
...(input.claimant === undefined ? {} : { claimant: input.claimant }),
|
|
189
|
+
...(input.prove === undefined ? {} : { prove: input.prove }),
|
|
190
|
+
...(source === undefined ? {} : { source }),
|
|
191
|
+
});
|
|
192
|
+
const notes = [...plan.notes];
|
|
193
|
+
const overrides = [];
|
|
194
|
+
const assumed = [];
|
|
195
|
+
if (!sending) {
|
|
196
|
+
// What the solver holds too little of, given it by state override: found for every token at
|
|
197
|
+
// once, each one's balance word.
|
|
198
|
+
const found = await Promise.all(plan.tokens.map(async (token) => {
|
|
199
|
+
if (token.held >= token.amount)
|
|
200
|
+
return undefined;
|
|
201
|
+
const symbol = token.info.symbol ?? token.token;
|
|
202
|
+
const slot = await assumeTokenBalance(client, token.token, solver, token.amount, symbol).catch((error) => {
|
|
203
|
+
if (!(error instanceof CliError))
|
|
204
|
+
throw error;
|
|
205
|
+
// `assume.ts` words its refusals for `--assume-balance`; here the balance is the solver's.
|
|
206
|
+
const why = error.message
|
|
207
|
+
.replace(/^--assume-balance [^:]+: /, "")
|
|
208
|
+
.replace(/ Fund the Pot instead\.$/, "")
|
|
209
|
+
.replace(/\.$/, "");
|
|
210
|
+
throw new CliError(`the solver delivers ${symbol}, and the rehearsal cannot give it a balance: ` +
|
|
211
|
+
`${why}. Pass --solver <an address that holds it>.`);
|
|
212
|
+
});
|
|
213
|
+
return { token, symbol, slot };
|
|
214
|
+
}));
|
|
215
|
+
for (const entry of found) {
|
|
216
|
+
if (entry === undefined)
|
|
217
|
+
continue;
|
|
218
|
+
overrides.push(entry.slot.override);
|
|
219
|
+
assumed.push({
|
|
220
|
+
token: entry.token.token,
|
|
221
|
+
symbol: entry.symbol,
|
|
222
|
+
...(entry.token.info.decimals === undefined ? {} : { decimals: entry.token.info.decimals }),
|
|
223
|
+
amount: entry.token.amount,
|
|
224
|
+
slot: { slot: entry.slot.slot, layout: entry.slot.layout },
|
|
225
|
+
because: "the route's tokens, which the solver delivers",
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
const balance = await read("the solver's balance", () => client.getBalance({ address: solver }));
|
|
229
|
+
if (balance < plan.value) {
|
|
230
|
+
overrides.push({ address: solver, balance: plan.value });
|
|
231
|
+
assumed.push({
|
|
232
|
+
token: "native",
|
|
233
|
+
symbol: nativeSymbol(chain),
|
|
234
|
+
decimals: 18,
|
|
235
|
+
amount: plan.value,
|
|
236
|
+
because: plan.proves ? "fulfillAndProve's value" : "fulfill's value",
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
let calls;
|
|
241
|
+
try {
|
|
242
|
+
const merged = mergeOverrides(overrides);
|
|
243
|
+
[{ calls } = { calls: [] }] = await client.simulateBlocks({
|
|
244
|
+
blocks: [
|
|
245
|
+
{
|
|
246
|
+
calls: plan.steps.map(({ to, data, value }) => ({ account: solver, to, data, value })),
|
|
247
|
+
...(merged.length === 0 ? {} : { stateOverrides: merged }),
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
traceTransfers: true,
|
|
251
|
+
validation: false,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
throw new CliError(`rehearsing a fill needs eth_simulateV1 — the deploy, the approvals and the fulfill in one ` +
|
|
256
|
+
`block — and the ${chain.slug} endpoint did not run it: ` +
|
|
257
|
+
(error.shortMessage ?? "the request failed").replace(/\.$/, ""));
|
|
258
|
+
}
|
|
259
|
+
const labels = addressLabels(chain, [
|
|
260
|
+
...input.labels,
|
|
261
|
+
[kitchenAddress(), "Kitchen"],
|
|
262
|
+
[getAddress(v12EngineAddress()), "engine"],
|
|
263
|
+
[plan.portal, "Portal"],
|
|
264
|
+
[plan.executor, "the Portal's Executor"],
|
|
265
|
+
[plan.pot, "the shared intent Pot"],
|
|
266
|
+
...(plan.prover.destinationProver === undefined
|
|
267
|
+
? []
|
|
268
|
+
: [
|
|
269
|
+
[
|
|
270
|
+
plan.prover.destinationProver,
|
|
271
|
+
plan.prover.kind === undefined ? "the prover" : `the ${plan.prover.kind} prover`,
|
|
272
|
+
],
|
|
273
|
+
]),
|
|
274
|
+
[solver, "the solver"],
|
|
275
|
+
]);
|
|
276
|
+
const base = {
|
|
277
|
+
target,
|
|
278
|
+
plan,
|
|
279
|
+
client,
|
|
280
|
+
results: plan.steps.map((_, index) => ({
|
|
281
|
+
status: calls[index]?.status ?? "not run",
|
|
282
|
+
...(calls[index]?.gasUsed === undefined ? {} : { gasUsed: calls[index].gasUsed }),
|
|
283
|
+
})),
|
|
284
|
+
assumed,
|
|
285
|
+
labels,
|
|
286
|
+
notes,
|
|
287
|
+
};
|
|
288
|
+
const failed = plan.steps.findIndex((_, index) => calls[index]?.status !== "success");
|
|
289
|
+
if (failed >= 0) {
|
|
290
|
+
const step = plan.steps[failed];
|
|
291
|
+
return {
|
|
292
|
+
...base,
|
|
293
|
+
outcome: {
|
|
294
|
+
ok: false,
|
|
295
|
+
stage: step.kind,
|
|
296
|
+
reason: step.kind === "fulfill"
|
|
297
|
+
? fulfillReason(calls[failed]?.data, target.intent, plan.pot)
|
|
298
|
+
: stepReason(calls[failed]?.data),
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
const result = calls[plan.steps.length - 1];
|
|
303
|
+
const logs = (result.logs ?? []).map((log) => ({
|
|
304
|
+
address: getAddress(log.address),
|
|
305
|
+
topics: log.topics,
|
|
306
|
+
data: log.data,
|
|
307
|
+
}));
|
|
308
|
+
const native = getAddress("0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
|
|
309
|
+
const traced = plan.value === 0n || logs.some((log) => log.address === native);
|
|
310
|
+
const effects = await effectsOf(client, chain, logs, traced, labels);
|
|
311
|
+
const recorded = fulfilledLog(logs, plan);
|
|
312
|
+
return {
|
|
313
|
+
...base,
|
|
314
|
+
outcome: {
|
|
315
|
+
ok: true,
|
|
316
|
+
gas: result.gasUsed,
|
|
317
|
+
effects,
|
|
318
|
+
left: await leftBehind(client, effects, [plan.pot, plan.executor]),
|
|
319
|
+
...(recorded === undefined ? {} : { recordedClaimant: recorded }),
|
|
320
|
+
},
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
/** `IntentFulfilled(bytes32 indexed intentHash, bytes32 indexed claimant)` (`IInbox.sol`). */
|
|
324
|
+
const INTENT_FULFILLED = keccak256(toHex("IntentFulfilled(bytes32,bytes32)"));
|
|
325
|
+
/** The claimant the Portal's own record of the fill names: `IntentFulfilled(intentHash, claimant)`,
|
|
326
|
+
* what a prover later carries back to the source chain. */
|
|
327
|
+
function fulfilledLog(logs, plan) {
|
|
328
|
+
return logs.find((log) => log.address === plan.portal &&
|
|
329
|
+
log.topics[0]?.toLowerCase() === INTENT_FULFILLED &&
|
|
330
|
+
log.topics[1]?.toLowerCase() === plan.hashes.intentHash.toLowerCase())?.topics[2];
|
|
331
|
+
}
|
|
332
|
+
/** What each of `holders` held, before the fill and after it, of every token the fill moved to or
|
|
333
|
+
* from it: its balance now plus the fill's net change. */
|
|
334
|
+
async function leftBehind(client, effects, holders) {
|
|
335
|
+
const pairs = holders.flatMap((holder) => {
|
|
336
|
+
const tokens = new Set();
|
|
337
|
+
for (const move of [...effects.transfers, ...(effects.native ?? [])]) {
|
|
338
|
+
if (move.from === holder || move.to === holder)
|
|
339
|
+
tokens.add(move.token);
|
|
340
|
+
}
|
|
341
|
+
return [...tokens].map((token) => ({ holder, token }));
|
|
342
|
+
});
|
|
343
|
+
// Every balance at once: they are independent reads of the state before the fill.
|
|
344
|
+
return Promise.all(pairs.map(async ({ holder, token }) => {
|
|
345
|
+
const before = token === "native"
|
|
346
|
+
? await read("a balance", () => client.getBalance({ address: holder }))
|
|
347
|
+
: await read("a token balance", () => client.readContract({
|
|
348
|
+
address: token,
|
|
349
|
+
abi: ERC20,
|
|
350
|
+
functionName: "balanceOf",
|
|
351
|
+
args: [holder],
|
|
352
|
+
}));
|
|
353
|
+
const delta = effects.changes
|
|
354
|
+
.find((change) => change.address === holder)
|
|
355
|
+
?.deltas.find((entry) => entry.token === token)?.amount ?? 0n;
|
|
356
|
+
return { holder, token, before, after: before + delta };
|
|
357
|
+
}));
|
|
358
|
+
}
|
|
359
|
+
const assumedText = (balance) => balance.decimals === undefined
|
|
360
|
+
? `${balance.amount} ${balance.symbol} (base units)`
|
|
361
|
+
: `${formatUnits(balance.amount, balance.decimals)} ${balance.symbol}`;
|
|
362
|
+
const head = (fill) => `Intent ${fill.plan.hashes.intentHash} from ${fill.target.source.slug} to ` +
|
|
363
|
+
`${fill.target.destination.slug}: `;
|
|
364
|
+
/** One intent's rehearsal, for a person. */
|
|
365
|
+
function fillLines(fill, sending) {
|
|
366
|
+
const at = (address) => labelled(fill.labels, address);
|
|
367
|
+
const outcome = fill.outcome;
|
|
368
|
+
const { plan } = fill;
|
|
369
|
+
const lines = [
|
|
370
|
+
outcome.ok
|
|
371
|
+
? `${head(fill)}the fill succeeds, gas used ${outcome.gas}`
|
|
372
|
+
: outcome.stage === "fulfill"
|
|
373
|
+
? `${head(fill)}the fill reverts: ${outcome.reason}`
|
|
374
|
+
: `${head(fill)}the ${outcome.stage === "deploy" ? "Pot's deployment" : "approval"} before the ` +
|
|
375
|
+
`fill reverts: ${outcome.reason}`,
|
|
376
|
+
`Rehearsed with eth_simulateV1 on ${fill.target.destination.slug}, one block from the solver ` +
|
|
377
|
+
`${plan.solver}; ${sending ? "nothing assumed" : "nothing was signed or sent"}:`,
|
|
378
|
+
...plan.steps.map((step, index) => {
|
|
379
|
+
const ran = fill.results[index];
|
|
380
|
+
const status = ran.status === "success"
|
|
381
|
+
? ran.gasUsed === undefined
|
|
382
|
+
? ""
|
|
383
|
+
: ` (gas ${ran.gasUsed})`
|
|
384
|
+
: ran.status === "not run"
|
|
385
|
+
? " (not run)"
|
|
386
|
+
: " (reverts)";
|
|
387
|
+
return ` ${index + 1}. ${step.kind === "deploy" ? `${step.what}: the shared intent Pot ${plan.pot} is not deployed on ${fill.target.destination.slug} yet, and any account may deploy it` : step.what}${status}`;
|
|
388
|
+
}),
|
|
389
|
+
];
|
|
390
|
+
if (fill.assumed.length > 0) {
|
|
391
|
+
lines.push("Assumed for this rehearsal only, by state override:", ...fill.assumed.map((balance) => ` the solver holds ${assumedText(balance)}: ${balance.because}` +
|
|
392
|
+
(balance.slot === undefined
|
|
393
|
+
? ""
|
|
394
|
+
: ` (its balance word ${balance.slot.slot}: ${balance.slot.layout})`)));
|
|
395
|
+
}
|
|
396
|
+
if (!outcome.ok)
|
|
397
|
+
return lines;
|
|
398
|
+
lines.push(...effectLines(outcome.effects), outcome.recordedClaimant === undefined
|
|
399
|
+
? "warning: the Portal logged no IntentFulfilled for this intent"
|
|
400
|
+
: `The Portal records the fill: IntentFulfilled(${plan.hashes.intentHash}, claimant ` +
|
|
401
|
+
`${outcome.recordedClaimant})`);
|
|
402
|
+
const kept = outcome.left.filter((entry) => entry.after !== 0n);
|
|
403
|
+
if (kept.length === 0) {
|
|
404
|
+
lines.push(`Left behind: nothing. ${plan.cooks ? "The shared intent Pot and the" : "The"} Portal's ` +
|
|
405
|
+
`Executor ${plan.cooks ? "end" : "ends"} holding none of what the fill moved.`);
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
lines.push("Left behind, where any later intent or solver can take it:", ...kept.map((entry) => ` ${at(entry.holder)} ends holding ` +
|
|
409
|
+
`${formatAmount(outcome.effects, entry.token, entry.after)}` +
|
|
410
|
+
(entry.before === 0n
|
|
411
|
+
? ""
|
|
412
|
+
: ` (it held ${formatAmount(outcome.effects, entry.token, entry.before)} before)`)));
|
|
413
|
+
}
|
|
414
|
+
return lines;
|
|
415
|
+
}
|
|
416
|
+
const proverJson = (plan) => ({
|
|
417
|
+
proves: plan.proves,
|
|
418
|
+
prover: {
|
|
419
|
+
kind: plan.prover.kind ?? null,
|
|
420
|
+
source: plan.prover.sourceProver,
|
|
421
|
+
destination: plan.prover.destinationProver ?? null,
|
|
422
|
+
supported: plan.prover.supported,
|
|
423
|
+
...(plan.prover.why === undefined ? {} : { why: plan.prover.why }),
|
|
424
|
+
},
|
|
425
|
+
fee: { prover: plan.fee.prover.toString(), kitchen: plan.fee.kitchen.toString() },
|
|
426
|
+
});
|
|
427
|
+
/** One intent's rehearsal, for a program. */
|
|
428
|
+
function fillJson(fill) {
|
|
429
|
+
const outcome = fill.outcome;
|
|
430
|
+
const { plan } = fill;
|
|
431
|
+
return {
|
|
432
|
+
ok: outcome.ok,
|
|
433
|
+
intentHash: plan.hashes.intentHash,
|
|
434
|
+
routeHash: plan.hashes.routeHash,
|
|
435
|
+
rewardHash: plan.hashes.rewardHash,
|
|
436
|
+
source: fill.target.source.slug,
|
|
437
|
+
destination: fill.target.destination.slug,
|
|
438
|
+
chainId: fill.target.destination.id,
|
|
439
|
+
portal: plan.portal,
|
|
440
|
+
executor: plan.executor,
|
|
441
|
+
pot: plan.pot,
|
|
442
|
+
potDeployed: plan.deployed,
|
|
443
|
+
solver: plan.solver,
|
|
444
|
+
claimant: plan.claimant,
|
|
445
|
+
value: plan.value.toString(),
|
|
446
|
+
...proverJson(plan),
|
|
447
|
+
path: "eth_simulateV1",
|
|
448
|
+
calls: plan.steps.map((step, index) => ({
|
|
449
|
+
what: step.what,
|
|
450
|
+
kind: step.kind,
|
|
451
|
+
to: step.to,
|
|
452
|
+
data: step.data,
|
|
453
|
+
value: step.value.toString(),
|
|
454
|
+
status: fill.results[index].status,
|
|
455
|
+
...(fill.results[index].gasUsed === undefined
|
|
456
|
+
? {}
|
|
457
|
+
: { gasUsed: fill.results[index].gasUsed.toString() }),
|
|
458
|
+
})),
|
|
459
|
+
assumed: fill.assumed.map((balance) => ({
|
|
460
|
+
holder: plan.solver,
|
|
461
|
+
token: balance.token,
|
|
462
|
+
symbol: balance.symbol,
|
|
463
|
+
amount: balance.amount.toString(),
|
|
464
|
+
...(balance.decimals === undefined
|
|
465
|
+
? {}
|
|
466
|
+
: { formatted: formatUnits(balance.amount, balance.decimals) }),
|
|
467
|
+
because: balance.because,
|
|
468
|
+
...(balance.slot === undefined
|
|
469
|
+
? {}
|
|
470
|
+
: { slot: balance.slot.slot, layout: balance.slot.layout }),
|
|
471
|
+
})),
|
|
472
|
+
...(outcome.ok
|
|
473
|
+
? {
|
|
474
|
+
gas: outcome.gas.toString(),
|
|
475
|
+
fulfilled: outcome.recordedClaimant === undefined ? null : { claimant: outcome.recordedClaimant },
|
|
476
|
+
...effectsJson(outcome.effects),
|
|
477
|
+
leftBehind: outcome.left.map((entry) => ({
|
|
478
|
+
holder: entry.holder,
|
|
479
|
+
...(fill.labels.get(entry.holder) === undefined
|
|
480
|
+
? {}
|
|
481
|
+
: { label: fill.labels.get(entry.holder) }),
|
|
482
|
+
token: entry.token,
|
|
483
|
+
...(outcome.effects.tokens.get(entry.token)?.symbol === undefined
|
|
484
|
+
? {}
|
|
485
|
+
: { symbol: outcome.effects.tokens.get(entry.token).symbol }),
|
|
486
|
+
before: entry.before.toString(),
|
|
487
|
+
after: entry.after.toString(),
|
|
488
|
+
})),
|
|
489
|
+
}
|
|
490
|
+
: { stage: outcome.stage, reason: outcome.reason }),
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
/** What a fill spends from the solver: each route token, and the value. */
|
|
494
|
+
function spendLines(fill) {
|
|
495
|
+
const { plan } = fill;
|
|
496
|
+
const native = nativeSymbol(fill.target.destination);
|
|
497
|
+
const parts = plan.tokens.map((token) => `${formatAmount({ tokens: new Map([[token.token, token.info]]) }, token.token, token.amount)} ` +
|
|
498
|
+
"(the route's tokens, which the Portal pulls from you into its Executor)");
|
|
499
|
+
if (plan.value > 0n) {
|
|
500
|
+
const pieces = [
|
|
501
|
+
plan.fee.kitchen > 0n ? `${formatUnits(plan.fee.kitchen, 18)} for the Kitchen` : undefined,
|
|
502
|
+
plan.value - plan.fee.kitchen - plan.fee.prover > 0n
|
|
503
|
+
? `${formatUnits(plan.value - plan.fee.kitchen - plan.fee.prover, 18)} the route spends`
|
|
504
|
+
: undefined,
|
|
505
|
+
plan.fee.prover > 0n
|
|
506
|
+
? `${formatUnits(plan.fee.prover, 18)} for the ${plan.prover.kind} proof`
|
|
507
|
+
: undefined,
|
|
508
|
+
].filter((piece) => piece !== undefined);
|
|
509
|
+
parts.push(`${formatUnits(plan.value, 18)} ${native} of value (${pieces.join(", ")})`);
|
|
510
|
+
}
|
|
511
|
+
return [
|
|
512
|
+
`Filling ${plan.hashes.intentHash} on ${fill.target.destination.slug} sends ` +
|
|
513
|
+
`${plan.steps.length} transaction(s) from ${plan.solver}:`,
|
|
514
|
+
...plan.steps.map((step, index) => ` ${index + 1}. ${step.what}`),
|
|
515
|
+
`It spends ${parts.length === 0 ? "nothing but gas" : `${parts.join(" and ")}, plus gas`}.`,
|
|
516
|
+
];
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* The fills again, planned and rehearsed on the chain as it is once a person has approved them:
|
|
520
|
+
* a question can stand for minutes, in which the prover's fee or the solver's allowance can move.
|
|
521
|
+
* Refuses, sending nothing, when a fill no longer rehearses or would now spend more native value
|
|
522
|
+
* than was approved; a fill that spends less (a lower fee) goes ahead with the new plan.
|
|
523
|
+
*/
|
|
524
|
+
async function replanned(input, fills) {
|
|
525
|
+
const fresh = await Promise.all(fills.map((fill) => rehearseFill(input, fill.target)));
|
|
526
|
+
for (const [index, fill] of fresh.entries()) {
|
|
527
|
+
const approved = fills[index].plan;
|
|
528
|
+
if (!fill.outcome.ok) {
|
|
529
|
+
throw new CliError(`not sent: ${fill.plan.hashes.intentHash} no longer rehearses on ` +
|
|
530
|
+
`${fill.target.destination.slug} (${fill.outcome.reason}): run it again`);
|
|
531
|
+
}
|
|
532
|
+
if (fill.plan.value > approved.value) {
|
|
533
|
+
const native = nativeSymbol(fill.target.destination);
|
|
534
|
+
throw new CliError(`not sent: filling ${fill.plan.hashes.intentHash} now takes ` +
|
|
535
|
+
`${formatUnits(fill.plan.value, 18)} ${native} of value, more than the ` +
|
|
536
|
+
`${formatUnits(approved.value, 18)} ${native} you approved (the prover's fee rose): run it again`);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
return fresh;
|
|
540
|
+
}
|
|
541
|
+
/** Sends `fill`'s transactions, in order, from the signer: each simulated first by `sendAndWait`. */
|
|
542
|
+
async function sendFill(input, fill) {
|
|
543
|
+
const send = input.send;
|
|
544
|
+
const url = input.endpointOf(fill.target.destination);
|
|
545
|
+
const sent = [];
|
|
546
|
+
for (const step of fill.plan.steps) {
|
|
547
|
+
const result = await sendAndWait(fill.client, url, send.account, step);
|
|
548
|
+
sent.push({ step, result });
|
|
549
|
+
if (result.status !== "success") {
|
|
550
|
+
throw new CliError(`${step.what}: ${result.hash} reverted: ${result.reason ?? "no reason"}`);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
const fulfill = sent[sent.length - 1].result;
|
|
554
|
+
const effects = await effectsOf(fill.client, fill.target.destination, fulfill.logs, false, fill.labels);
|
|
555
|
+
const block = await read("the fill's block", () => fill.client.getBlock({ blockNumber: fulfill.blockNumber }));
|
|
556
|
+
const recorded = fulfilledLog(fulfill.logs, fill.plan);
|
|
557
|
+
return {
|
|
558
|
+
fill,
|
|
559
|
+
sent,
|
|
560
|
+
effects,
|
|
561
|
+
...(recorded === undefined ? {} : { recordedClaimant: recorded }),
|
|
562
|
+
messages: dispatchedMessages(fulfill.logs),
|
|
563
|
+
time: block.timestamp,
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
/** What a sent fill did, for a person. */
|
|
567
|
+
function sentLines(done) {
|
|
568
|
+
const { fill } = done;
|
|
569
|
+
const native = nativeSymbol(fill.target.destination);
|
|
570
|
+
const costs = done.sent.map(({ step, result }) => result.receipt === undefined ? undefined : costOf(result.receipt, step.value));
|
|
571
|
+
const lines = [
|
|
572
|
+
`${head(fill)}${fill.plan.proves ? "filled, and its proof sent" : "filled"}, in ` +
|
|
573
|
+
`${done.sent.length} transaction(s) on ${fill.target.destination.slug} from ${fill.plan.solver}:`,
|
|
574
|
+
...done.sent.map(({ step, result }, index) => {
|
|
575
|
+
const cost = costs[index];
|
|
576
|
+
return (` ${index + 1}. ${step.what}: ${result.hash}, block ${result.blockNumber}` +
|
|
577
|
+
(cost === undefined
|
|
578
|
+
? `, gas used ${result.gasUsed}`
|
|
579
|
+
: `; ${costLine(cost, fill.target.destination, step.kind === "fulfill" ? "the route's native amount and the proof's fee" : "none")}`));
|
|
580
|
+
}),
|
|
581
|
+
`In all: ${formatUnits(costs.reduce((sum, cost) => sum + (cost?.total ?? 0n), 0n), 18)} ${native}` +
|
|
582
|
+
(fill.plan.fee.prover > 0n
|
|
583
|
+
? `, ${formatUnits(fill.plan.fee.prover, 18)} of it the proof's fee`
|
|
584
|
+
: ""),
|
|
585
|
+
...effectLines(done.effects),
|
|
586
|
+
done.recordedClaimant === undefined
|
|
587
|
+
? "warning: the Portal logged no IntentFulfilled for this intent"
|
|
588
|
+
: `The Portal records the fill: IntentFulfilled(${fill.plan.hashes.intentHash}, claimant ` +
|
|
589
|
+
`${done.recordedClaimant})`,
|
|
590
|
+
];
|
|
591
|
+
for (const message of done.messages) {
|
|
592
|
+
lines.push(`The proof travels to ${fill.target.source.slug} as Hyperlane message ${message.id} ` +
|
|
593
|
+
`(dispatched by the Mailbox ${message.mailbox}).`);
|
|
594
|
+
}
|
|
595
|
+
return lines;
|
|
596
|
+
}
|
|
597
|
+
/** `sauce intent fill`: a solver's fill of each intent, rehearsed on its destination, and with `--send`,
|
|
598
|
+
* sent. */
|
|
599
|
+
export async function fillCommand(input) {
|
|
600
|
+
// A rehearsal fills nothing, on any chain; a fill is sent only on a supported destination.
|
|
601
|
+
if (input.send !== undefined) {
|
|
602
|
+
requireSupported("sending a fill", input.intents.map((target) => target.destination));
|
|
603
|
+
}
|
|
604
|
+
const destinations = new Set(input.intents.map((target) => target.destination.slug));
|
|
605
|
+
if (input.endpointFlag === "--rpc-url" && destinations.size > 1) {
|
|
606
|
+
throw new UsageError(`${input.from}'s intents go to ${[...destinations].join(" and ")}: --rpc-url names one ` +
|
|
607
|
+
"endpoint, so give --config, which names each destination's");
|
|
608
|
+
}
|
|
609
|
+
for (const target of input.intents) {
|
|
610
|
+
if (target.destination.kind !== "evm") {
|
|
611
|
+
throw new CliError(`the intent to ${target.destination.slug} is fulfilled through Solana's Portal program, ` +
|
|
612
|
+
"which this rehearsal does not run: it rehearses an EVM destination's Portal.fulfill");
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
const fills = [];
|
|
616
|
+
for (const target of input.intents)
|
|
617
|
+
fills.push(await rehearseFill(input, target));
|
|
618
|
+
const notes = fills.flatMap((fill) => fill.notes);
|
|
619
|
+
for (const fill of fills) {
|
|
620
|
+
if (!fill.outcome.ok)
|
|
621
|
+
continue;
|
|
622
|
+
for (const entry of fill.outcome.left) {
|
|
623
|
+
if (entry.after > entry.before) {
|
|
624
|
+
notes.push(`warning: the fill leaves ` +
|
|
625
|
+
`${formatAmount(fill.outcome.effects, entry.token, entry.after - entry.before)} in ` +
|
|
626
|
+
`${labelled(fill.labels, entry.holder)}, which every intent through ${fill.target.destination.slug}'s ` +
|
|
627
|
+
"Portal shares: a later intent's program or solver can take it. Send it on in the body.");
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
const ok = fills.every((fill) => fill.outcome.ok);
|
|
632
|
+
const rehearsal = {
|
|
633
|
+
text: fills.map((fill) => fillLines(fill, input.send !== undefined).join("\n")).join("\n\n"),
|
|
634
|
+
json: { ok, chain: input.intents[0].source.slug, intents: fills.map(fillJson) },
|
|
635
|
+
};
|
|
636
|
+
if (input.send === undefined || !ok) {
|
|
637
|
+
return {
|
|
638
|
+
...rehearsal,
|
|
639
|
+
...(notes.length === 0 && (input.send === undefined || ok)
|
|
640
|
+
? {}
|
|
641
|
+
: {
|
|
642
|
+
notes: [
|
|
643
|
+
...notes,
|
|
644
|
+
...(input.send === undefined ? [] : ["not sent: the rehearsal reverts"]),
|
|
645
|
+
],
|
|
646
|
+
}),
|
|
647
|
+
...(ok ? {} : { exitCode: 1 }),
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
// Sending: say what it spends, and have it approved.
|
|
651
|
+
const send = input.send;
|
|
652
|
+
const spend = fills.flatMap((fill) => spendLines(fill));
|
|
653
|
+
const action = `fill ${fills.map((fill) => fill.plan.hashes.intentHash).join(", ")}: ${spend
|
|
654
|
+
.at(-1)
|
|
655
|
+
.replace(/^It spends /, "spend ")
|
|
656
|
+
.replace(/\.$/, "")}`;
|
|
657
|
+
const answer = await send.approver.approve(action, `${spend.join("\n")}\nSend them? [y/N] `);
|
|
658
|
+
if (answer === undefined)
|
|
659
|
+
throw unapproved([action]);
|
|
660
|
+
if (!answer)
|
|
661
|
+
throw new CliError("not sent: you declined");
|
|
662
|
+
const done = [];
|
|
663
|
+
for (const fill of send.approver.auto ? fills : await replanned(input, fills)) {
|
|
664
|
+
const result = await sendFill(input, fill);
|
|
665
|
+
done.push(result);
|
|
666
|
+
record(send.store, result);
|
|
667
|
+
}
|
|
668
|
+
return {
|
|
669
|
+
text: [
|
|
670
|
+
...(send.approver.auto ? [...spend, ""] : []),
|
|
671
|
+
done.map((entry) => sentLines(entry).join("\n")).join("\n\n"),
|
|
672
|
+
].join("\n"),
|
|
673
|
+
json: {
|
|
674
|
+
ok: true,
|
|
675
|
+
sent: true,
|
|
676
|
+
chain: input.intents[0].source.slug,
|
|
677
|
+
intents: done.map((entry) => ({
|
|
678
|
+
intentHash: entry.fill.plan.hashes.intentHash,
|
|
679
|
+
source: entry.fill.target.source.slug,
|
|
680
|
+
destination: entry.fill.target.destination.slug,
|
|
681
|
+
solver: entry.fill.plan.solver,
|
|
682
|
+
claimant: entry.fill.plan.claimant,
|
|
683
|
+
...proverJson(entry.fill.plan),
|
|
684
|
+
transactions: entry.sent.map(({ step, result }) => ({
|
|
685
|
+
what: step.what,
|
|
686
|
+
kind: step.kind,
|
|
687
|
+
hash: result.hash,
|
|
688
|
+
status: result.status,
|
|
689
|
+
block: result.blockNumber.toString(),
|
|
690
|
+
gasUsed: result.gasUsed.toString(),
|
|
691
|
+
...(result.receipt === undefined
|
|
692
|
+
? {}
|
|
693
|
+
: { cost: costJson(costOf(result.receipt, step.value)) }),
|
|
694
|
+
})),
|
|
695
|
+
fulfilled: entry.recordedClaimant === undefined ? null : { claimant: entry.recordedClaimant },
|
|
696
|
+
messages: entry.messages,
|
|
697
|
+
...effectsJson(entry.effects),
|
|
698
|
+
})),
|
|
699
|
+
},
|
|
700
|
+
notes: [
|
|
701
|
+
...notes,
|
|
702
|
+
...done.map((entry) => entry.fill.plan.proves
|
|
703
|
+
? `Once the proof arrives on ${entry.fill.target.source.slug}, claim the reward: ` +
|
|
704
|
+
`\`sauce intent claim ${entry.fill.plan.hashes.intentHash} --chain ${entry.fill.target.source.slug}\``
|
|
705
|
+
: `Prove the fill to ${entry.fill.target.source.slug}, then claim: \`sauce intent prove ` +
|
|
706
|
+
`${entry.fill.plan.hashes.intentHash} --chain ${entry.fill.target.source.slug}\``),
|
|
707
|
+
],
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
/** Records a sent fill in the store: the intent, once, and what happened to it. */
|
|
711
|
+
function record(store, done) {
|
|
712
|
+
if (store === undefined)
|
|
713
|
+
return;
|
|
714
|
+
const { fill } = done;
|
|
715
|
+
const intentRecordOf = intentRecord(fill.target.intent, {
|
|
716
|
+
sourcePortal: fill.target.sourcePortal,
|
|
717
|
+
});
|
|
718
|
+
store.save(intentRecordOf);
|
|
719
|
+
const fulfill = done.sent[done.sent.length - 1].result;
|
|
720
|
+
const time = new Date(Number(done.time) * 1000).toISOString();
|
|
721
|
+
const base = {
|
|
722
|
+
chain: fill.target.destination.slug,
|
|
723
|
+
chainId: fill.target.destination.id,
|
|
724
|
+
tx: fulfill.hash,
|
|
725
|
+
block: fulfill.blockNumber.toString(),
|
|
726
|
+
time,
|
|
727
|
+
from: fill.plan.solver,
|
|
728
|
+
};
|
|
729
|
+
store.append(fill.plan.hashes.intentHash, { event: "filled", ...base });
|
|
730
|
+
for (const message of done.messages) {
|
|
731
|
+
store.append(fill.plan.hashes.intentHash, { event: "proving", ...base, message: message.id });
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
//# sourceMappingURL=fill.js.map
|