@eco-incorp/sauce 0.99.6 → 0.99.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -16
- package/actions/action-program.schema.json +480 -379
- package/actions/dist/abis.d.ts +19 -18
- package/actions/dist/abis.d.ts.map +1 -1
- package/actions/dist/abis.js +29 -29
- package/actions/dist/compile.d.ts +4 -4
- package/actions/dist/compile.d.ts.map +1 -1
- package/actions/dist/compile.js +3 -1
- package/actions/dist/compose.d.ts +63 -6
- package/actions/dist/compose.d.ts.map +1 -1
- package/actions/dist/compose.js +100 -16
- package/actions/dist/index.d.ts +1 -1
- package/actions/dist/index.d.ts.map +1 -1
- package/actions/dist/names.d.ts +88 -0
- package/actions/dist/names.d.ts.map +1 -0
- package/actions/dist/names.js +324 -0
- package/actions/dist/program.d.ts.map +1 -1
- package/actions/dist/program.js +115 -5
- package/actions/dist/registry.d.ts +10 -8
- package/actions/dist/registry.d.ts.map +1 -1
- package/actions/dist/registry.js +10 -8
- package/actions/dist/schema.d.ts.map +1 -1
- package/actions/dist/schema.js +99 -12
- package/actions/dist/semantics.d.ts +12 -2
- package/actions/dist/semantics.d.ts.map +1 -1
- package/actions/dist/semantics.js +78 -8
- package/actions/dist/spec.d.ts +30 -0
- package/actions/dist/spec.d.ts.map +1 -1
- package/actions/dist/spec.js +151 -138
- package/actions/dist/split-swap.d.ts +10 -5
- package/actions/dist/split-swap.d.ts.map +1 -1
- package/actions/dist/split-swap.js +48 -7
- package/actions/dist/to-quote.d.ts +14 -5
- package/actions/dist/to-quote.d.ts.map +1 -1
- package/actions/dist/to-quote.js +210 -244
- package/actions/dist/to-sauce.d.ts +18 -4
- package/actions/dist/to-sauce.d.ts.map +1 -1
- package/actions/dist/to-sauce.js +232 -205
- package/actions/dist/types.d.ts +245 -147
- package/actions/dist/types.d.ts.map +1 -1
- package/actions/dist/types.js +4 -0
- package/docs/README.md +38 -0
- package/docs/api/README.md +37 -23
- package/docs/api/compiler.md +53 -12
- package/docs/api/contracts.md +105 -0
- package/docs/api/coverage.md +80 -57
- package/docs/api/router.md +238 -0
- package/docs/api/routes.md +31 -22
- package/docs/concepts/architecture.md +26 -3
- package/docs/concepts/saucescript.md +35 -55
- package/docs/examples/README.md +21 -14
- package/docs/examples/action-program.ts +51 -35
- package/docs/examples/cross-chain-cascade.sauce.ts +4 -0
- package/docs/examples/cross-chain-intent.sauce.ts +2 -1
- package/docs/examples/evm-execution.ts +2 -4
- package/docs/examples/first-intent.ts +7 -2
- package/docs/examples/pot-router.ts +19 -0
- package/docs/examples/registry-names.ts +52 -0
- package/docs/examples/router-route.sauce.ts +31 -0
- package/docs/examples/router-route.ts +72 -0
- package/docs/examples/router-swap.sauce.ts +16 -0
- package/docs/examples/router-swap.ts +47 -0
- package/docs/examples/venue-where-deployed.sauce.ts +14 -0
- package/docs/guides/actions.md +230 -120
- package/docs/guides/builders-and-actions.md +20 -14
- package/docs/guides/cli.md +1442 -0
- package/docs/guides/compiling.md +19 -7
- package/docs/guides/intents.md +228 -15
- package/docs/guides/mcp.md +539 -0
- package/docs/guides/nested-intents.md +21 -6
- package/docs/guides/protocols-and-tokens.md +218 -39
- package/docs/guides/quick-start.md +5 -0
- package/docs/guides/solana.md +199 -52
- package/docs/guides/verification.md +2 -2
- package/mcp/dist/config.js +78 -0
- package/mcp/dist/config.js.map +1 -0
- package/mcp/dist/entry.js +112 -0
- package/mcp/dist/entry.js.map +1 -0
- package/mcp/dist/files.js +64 -0
- package/mcp/dist/files.js.map +1 -0
- package/mcp/dist/guard.js +262 -0
- package/mcp/dist/guard.js.map +1 -0
- package/mcp/dist/http.js +111 -0
- package/mcp/dist/http.js.map +1 -0
- package/mcp/dist/intents.js +579 -0
- package/mcp/dist/intents.js.map +1 -0
- package/mcp/dist/prompts.js +153 -0
- package/mcp/dist/prompts.js.map +1 -0
- package/mcp/dist/reach.js +98 -0
- package/mcp/dist/reach.js.map +1 -0
- package/mcp/dist/resources.js +154 -0
- package/mcp/dist/resources.js.map +1 -0
- package/mcp/dist/sdk.js +34 -0
- package/mcp/dist/sdk.js.map +1 -0
- package/mcp/dist/server.js +119 -0
- package/mcp/dist/server.js.map +1 -0
- package/mcp/dist/setup.js +189 -0
- package/mcp/dist/setup.js.map +1 -0
- package/mcp/dist/skilltools.js +520 -0
- package/mcp/dist/skilltools.js.map +1 -0
- package/mcp/dist/terms.js +93 -0
- package/mcp/dist/terms.js.map +1 -0
- package/mcp/dist/tools.js +1497 -0
- package/mcp/dist/tools.js.map +1 -0
- package/mcp/dist/wallets.js +168 -0
- package/mcp/dist/wallets.js.map +1 -0
- package/package.json +18 -13
- package/sdk/dist/artifacts/V12Deployments.json +3 -1
- package/sdk/dist/artifacts/V12EngineGate.json +1 -2
- package/sdk/dist/artifacts/V12KitchenProxy.json +1 -0
- package/sdk/dist/chains/canonical.d.ts +15 -24
- package/sdk/dist/chains/canonical.d.ts.map +1 -1
- package/sdk/dist/chains/canonical.js +18 -29
- package/sdk/dist/chains/canonical.js.map +1 -1
- package/sdk/dist/cli/actions.d.ts +29 -0
- package/sdk/dist/cli/actions.d.ts.map +1 -0
- package/sdk/dist/cli/actions.js +122 -0
- package/sdk/dist/cli/actions.js.map +1 -0
- package/sdk/dist/cli/args.d.ts +118 -0
- package/sdk/dist/cli/args.d.ts.map +1 -0
- package/sdk/dist/cli/args.js +354 -0
- package/sdk/dist/cli/args.js.map +1 -0
- package/sdk/dist/cli/assume.d.ts +51 -0
- package/sdk/dist/cli/assume.d.ts.map +1 -0
- package/sdk/dist/cli/assume.js +207 -0
- package/sdk/dist/cli/assume.js.map +1 -0
- package/sdk/dist/cli/chain.d.ts +170 -0
- package/sdk/dist/cli/chain.d.ts.map +1 -0
- package/sdk/dist/cli/chain.js +457 -0
- package/sdk/dist/cli/chain.js.map +1 -0
- package/sdk/dist/cli/commands.d.ts +226 -0
- package/sdk/dist/cli/commands.d.ts.map +1 -0
- package/sdk/dist/cli/commands.js +637 -0
- package/sdk/dist/cli/commands.js.map +1 -0
- package/sdk/dist/cli/create.d.ts +70 -0
- package/sdk/dist/cli/create.d.ts.map +1 -0
- package/sdk/dist/cli/create.js +483 -0
- package/sdk/dist/cli/create.js.map +1 -0
- package/sdk/dist/cli/diagnostics.d.ts +12 -0
- package/sdk/dist/cli/diagnostics.d.ts.map +1 -0
- package/sdk/dist/cli/diagnostics.js +200 -0
- package/sdk/dist/cli/diagnostics.js.map +1 -0
- package/sdk/dist/cli/effects.d.ts +71 -0
- package/sdk/dist/cli/effects.d.ts.map +1 -0
- package/sdk/dist/cli/effects.js +279 -0
- package/sdk/dist/cli/effects.js.map +1 -0
- package/sdk/dist/cli/fill.d.ts +83 -0
- package/sdk/dist/cli/fill.d.ts.map +1 -0
- package/sdk/dist/cli/fill.js +734 -0
- package/sdk/dist/cli/fill.js.map +1 -0
- package/sdk/dist/cli/funding.d.ts +126 -0
- package/sdk/dist/cli/funding.d.ts.map +1 -0
- package/sdk/dist/cli/funding.js +514 -0
- package/sdk/dist/cli/funding.js.map +1 -0
- package/sdk/dist/cli/globals.d.ts +16 -0
- package/sdk/dist/cli/globals.d.ts.map +1 -0
- package/sdk/dist/cli/globals.js +197 -0
- package/sdk/dist/cli/globals.js.map +1 -0
- package/sdk/dist/cli/init.d.ts +34 -0
- package/sdk/dist/cli/init.d.ts.map +1 -0
- package/sdk/dist/cli/init.js +181 -0
- package/sdk/dist/cli/init.js.map +1 -0
- package/sdk/dist/cli/inputs.d.ts +72 -0
- package/sdk/dist/cli/inputs.d.ts.map +1 -0
- package/sdk/dist/cli/inputs.js +152 -0
- package/sdk/dist/cli/inputs.js.map +1 -0
- package/sdk/dist/cli/inspect.d.ts +48 -0
- package/sdk/dist/cli/inspect.d.ts.map +1 -0
- package/sdk/dist/cli/inspect.js +536 -0
- package/sdk/dist/cli/inspect.js.map +1 -0
- package/sdk/dist/cli/intent-commands.d.ts +71 -0
- package/sdk/dist/cli/intent-commands.d.ts.map +1 -0
- package/sdk/dist/cli/intent-commands.js +698 -0
- package/sdk/dist/cli/intent-commands.js.map +1 -0
- package/sdk/dist/cli/intent-svm.d.ts +15 -0
- package/sdk/dist/cli/intent-svm.d.ts.map +1 -0
- package/sdk/dist/cli/intent-svm.js +222 -0
- package/sdk/dist/cli/intent-svm.js.map +1 -0
- package/sdk/dist/cli/intents.d.ts +43 -0
- package/sdk/dist/cli/intents.d.ts.map +1 -0
- package/sdk/dist/cli/intents.js +89 -0
- package/sdk/dist/cli/intents.js.map +1 -0
- package/sdk/dist/cli/interactive.d.ts +11 -0
- package/sdk/dist/cli/interactive.d.ts.map +1 -0
- package/sdk/dist/cli/interactive.js +161 -0
- package/sdk/dist/cli/interactive.js.map +1 -0
- package/sdk/dist/cli/lifecycle-svm.d.ts +109 -0
- package/sdk/dist/cli/lifecycle-svm.d.ts.map +1 -0
- package/sdk/dist/cli/lifecycle-svm.js +299 -0
- package/sdk/dist/cli/lifecycle-svm.js.map +1 -0
- package/sdk/dist/cli/lifecycle.d.ts +439 -0
- package/sdk/dist/cli/lifecycle.d.ts.map +1 -0
- package/sdk/dist/cli/lifecycle.js +1721 -0
- package/sdk/dist/cli/lifecycle.js.map +1 -0
- package/sdk/dist/cli/main.d.ts +3 -0
- package/sdk/dist/cli/main.d.ts.map +1 -0
- package/sdk/dist/cli/main.js +8 -0
- package/sdk/dist/cli/main.js.map +1 -0
- package/sdk/dist/cli/mcp.d.ts +66 -0
- package/sdk/dist/cli/mcp.d.ts.map +1 -0
- package/sdk/dist/cli/mcp.js +169 -0
- package/sdk/dist/cli/mcp.js.map +1 -0
- package/sdk/dist/cli/password.d.ts +54 -0
- package/sdk/dist/cli/password.d.ts.map +1 -0
- package/sdk/dist/cli/password.js +148 -0
- package/sdk/dist/cli/password.js.map +1 -0
- package/sdk/dist/cli/policy.d.ts +130 -0
- package/sdk/dist/cli/policy.d.ts.map +1 -0
- package/sdk/dist/cli/policy.js +702 -0
- package/sdk/dist/cli/policy.js.map +1 -0
- package/sdk/dist/cli/pools.d.ts +140 -0
- package/sdk/dist/cli/pools.d.ts.map +1 -0
- package/sdk/dist/cli/pools.js +658 -0
- package/sdk/dist/cli/pools.js.map +1 -0
- package/sdk/dist/cli/price.d.ts +74 -0
- package/sdk/dist/cli/price.d.ts.map +1 -0
- package/sdk/dist/cli/price.js +321 -0
- package/sdk/dist/cli/price.js.map +1 -0
- package/sdk/dist/cli/prompt.d.ts +30 -0
- package/sdk/dist/cli/prompt.d.ts.map +1 -0
- package/sdk/dist/cli/prompt.js +53 -0
- package/sdk/dist/cli/prompt.js.map +1 -0
- package/sdk/dist/cli/publish.d.ts +48 -0
- package/sdk/dist/cli/publish.d.ts.map +1 -0
- package/sdk/dist/cli/publish.js +480 -0
- package/sdk/dist/cli/publish.js.map +1 -0
- package/sdk/dist/cli/receipt.d.ts +35 -0
- package/sdk/dist/cli/receipt.d.ts.map +1 -0
- package/sdk/dist/cli/receipt.js +63 -0
- package/sdk/dist/cli/receipt.js.map +1 -0
- package/sdk/dist/cli/rehearse.d.ts +80 -0
- package/sdk/dist/cli/rehearse.d.ts.map +1 -0
- package/sdk/dist/cli/rehearse.js +265 -0
- package/sdk/dist/cli/rehearse.js.map +1 -0
- package/sdk/dist/cli/report.d.ts +69 -0
- package/sdk/dist/cli/report.d.ts.map +1 -0
- package/sdk/dist/cli/report.js +206 -0
- package/sdk/dist/cli/report.js.map +1 -0
- package/sdk/dist/cli/returned.d.ts +16 -0
- package/sdk/dist/cli/returned.d.ts.map +1 -0
- package/sdk/dist/cli/returned.js +111 -0
- package/sdk/dist/cli/returned.js.map +1 -0
- package/sdk/dist/cli/run.d.ts +40 -0
- package/sdk/dist/cli/run.d.ts.map +1 -0
- package/sdk/dist/cli/run.js +3162 -0
- package/sdk/dist/cli/run.js.map +1 -0
- package/sdk/dist/cli/signer.d.ts +72 -0
- package/sdk/dist/cli/signer.d.ts.map +1 -0
- package/sdk/dist/cli/signer.js +243 -0
- package/sdk/dist/cli/signer.js.map +1 -0
- package/sdk/dist/cli/simulate.d.ts +11 -0
- package/sdk/dist/cli/simulate.d.ts.map +1 -0
- package/sdk/dist/cli/simulate.js +246 -0
- package/sdk/dist/cli/simulate.js.map +1 -0
- package/sdk/dist/cli/skills.d.ts +77 -0
- package/sdk/dist/cli/skills.d.ts.map +1 -0
- package/sdk/dist/cli/skills.js +527 -0
- package/sdk/dist/cli/skills.js.map +1 -0
- package/sdk/dist/cli/solana.d.ts +183 -0
- package/sdk/dist/cli/solana.d.ts.map +1 -0
- package/sdk/dist/cli/solana.js +1360 -0
- package/sdk/dist/cli/solana.js.map +1 -0
- package/sdk/dist/cli/store.d.ts +60 -0
- package/sdk/dist/cli/store.d.ts.map +1 -0
- package/sdk/dist/cli/store.js +196 -0
- package/sdk/dist/cli/store.js.map +1 -0
- package/sdk/dist/cli/support.d.ts +144 -0
- package/sdk/dist/cli/support.d.ts.map +1 -0
- package/sdk/dist/cli/support.js +217 -0
- package/sdk/dist/cli/support.js.map +1 -0
- package/sdk/dist/cli/svm-effects.d.ts +50 -0
- package/sdk/dist/cli/svm-effects.d.ts.map +1 -0
- package/sdk/dist/cli/svm-effects.js +196 -0
- package/sdk/dist/cli/svm-effects.js.map +1 -0
- package/sdk/dist/cli/terminal.d.ts +42 -0
- package/sdk/dist/cli/terminal.d.ts.map +1 -0
- package/sdk/dist/cli/terminal.js +136 -0
- package/sdk/dist/cli/terminal.js.map +1 -0
- package/sdk/dist/cli/verify.d.ts +32 -0
- package/sdk/dist/cli/verify.d.ts.map +1 -0
- package/sdk/dist/cli/verify.js +185 -0
- package/sdk/dist/cli/verify.js.map +1 -0
- package/sdk/dist/cli/wallet-commands.d.ts +59 -0
- package/sdk/dist/cli/wallet-commands.d.ts.map +1 -0
- package/sdk/dist/cli/wallet-commands.js +222 -0
- package/sdk/dist/cli/wallet-commands.js.map +1 -0
- package/sdk/dist/cli/wallet-send.d.ts +38 -0
- package/sdk/dist/cli/wallet-send.d.ts.map +1 -0
- package/sdk/dist/cli/wallet-send.js +303 -0
- package/sdk/dist/cli/wallet-send.js.map +1 -0
- package/sdk/dist/cli/wallets.d.ts +79 -0
- package/sdk/dist/cli/wallets.d.ts.map +1 -0
- package/sdk/dist/cli/wallets.js +297 -0
- package/sdk/dist/cli/wallets.js.map +1 -0
- package/sdk/dist/deployments/index.d.ts +4 -62
- package/sdk/dist/deployments/index.d.ts.map +1 -1
- package/sdk/dist/deployments/index.js +4 -84
- package/sdk/dist/deployments/index.js.map +1 -1
- package/sdk/dist/deployments/pot.d.ts +17 -7
- package/sdk/dist/deployments/pot.d.ts.map +1 -1
- package/sdk/dist/deployments/pot.js +25 -10
- package/sdk/dist/deployments/pot.js.map +1 -1
- package/sdk/dist/deployments/releases.d.ts +36 -0
- package/sdk/dist/deployments/releases.d.ts.map +1 -0
- package/sdk/dist/deployments/releases.js +61 -0
- package/sdk/dist/deployments/releases.js.map +1 -0
- package/sdk/dist/deployments/releases.json +76 -0
- package/sdk/dist/deployments/v12-addresses.d.ts +13 -0
- package/sdk/dist/deployments/v12-addresses.d.ts.map +1 -1
- package/sdk/dist/deployments/v12-addresses.js +16 -3
- package/sdk/dist/deployments/v12-addresses.js.map +1 -1
- package/sdk/dist/deposit/index.d.ts +6 -6
- package/sdk/dist/deposit/index.d.ts.map +1 -1
- package/sdk/dist/deposit/index.js +1 -1
- package/sdk/dist/deposit/index.js.map +1 -1
- package/sdk/dist/deposit/params.d.ts +4 -4
- package/sdk/dist/deposit/params.d.ts.map +1 -1
- package/sdk/dist/deposit/params.js +7 -4
- package/sdk/dist/deposit/params.js.map +1 -1
- package/sdk/dist/deposit/source.d.ts +3 -30
- package/sdk/dist/deposit/source.d.ts.map +1 -1
- package/sdk/dist/deposit/source.js +7 -83
- package/sdk/dist/deposit/source.js.map +1 -1
- package/sdk/dist/deposit/templates.d.ts +1 -2
- package/sdk/dist/deposit/templates.d.ts.map +1 -1
- package/sdk/dist/deposit/templates.js +10 -2
- package/sdk/dist/deposit/templates.js.map +1 -1
- package/sdk/dist/deposit/types.d.ts +14 -12
- package/sdk/dist/deposit/types.d.ts.map +1 -1
- package/sdk/dist/deposit/types.js +6 -0
- package/sdk/dist/deposit/types.js.map +1 -1
- package/sdk/dist/descriptors/accessors.d.ts +38 -35
- package/sdk/dist/descriptors/accessors.d.ts.map +1 -1
- package/sdk/dist/descriptors/accessors.js +16 -0
- package/sdk/dist/descriptors/accessors.js.map +1 -1
- package/sdk/dist/descriptors/call.d.ts +66 -14
- package/sdk/dist/descriptors/call.d.ts.map +1 -1
- package/sdk/dist/descriptors/call.js +94 -13
- package/sdk/dist/descriptors/call.js.map +1 -1
- package/sdk/dist/descriptors/contracts.generated.d.ts +3393 -0
- package/sdk/dist/descriptors/contracts.generated.d.ts.map +1 -0
- package/sdk/dist/descriptors/contracts.generated.js +728 -0
- package/sdk/dist/descriptors/contracts.generated.js.map +1 -0
- package/sdk/dist/descriptors/derive.d.ts +20 -11
- package/sdk/dist/descriptors/derive.d.ts.map +1 -1
- package/sdk/dist/descriptors/derive.js +68 -30
- package/sdk/dist/descriptors/derive.js.map +1 -1
- package/sdk/dist/descriptors/index.d.ts +6 -7
- package/sdk/dist/descriptors/index.d.ts.map +1 -1
- package/sdk/dist/descriptors/index.js +2 -2
- package/sdk/dist/descriptors/index.js.map +1 -1
- package/sdk/dist/descriptors/links.d.ts +23 -214
- package/sdk/dist/descriptors/links.d.ts.map +1 -1
- package/sdk/dist/descriptors/links.js +1 -232
- package/sdk/dist/descriptors/links.js.map +1 -1
- package/sdk/dist/descriptors/query.d.ts +1 -1
- package/sdk/dist/descriptors/query.d.ts.map +1 -1
- package/sdk/dist/descriptors/query.js +1 -1
- package/sdk/dist/descriptors/query.js.map +1 -1
- package/sdk/dist/descriptors/registry.d.ts +2 -5
- package/sdk/dist/descriptors/registry.d.ts.map +1 -1
- package/sdk/dist/descriptors/registry.js +11 -66
- package/sdk/dist/descriptors/registry.js.map +1 -1
- package/sdk/dist/embedded/resolve.d.ts +4 -4
- package/sdk/dist/embedded/resolve.d.ts.map +1 -1
- package/sdk/dist/embedded/resolve.js +12 -8
- package/sdk/dist/embedded/resolve.js.map +1 -1
- package/sdk/dist/embedded/skills.generated.d.ts +1 -1
- package/sdk/dist/embedded/skills.generated.d.ts.map +1 -1
- package/sdk/dist/embedded/skills.generated.js +137 -136
- package/sdk/dist/embedded/skills.generated.js.map +1 -1
- package/sdk/dist/embedded/sources.generated.d.ts.map +1 -1
- package/sdk/dist/embedded/sources.generated.js +40 -6
- package/sdk/dist/embedded/sources.generated.js.map +1 -1
- package/sdk/dist/evm/engine.d.ts +813 -10
- package/sdk/dist/evm/engine.d.ts.map +1 -1
- package/sdk/dist/evm/engine.js +127 -8
- package/sdk/dist/evm/engine.js.map +1 -1
- package/sdk/dist/index.d.ts +3 -2
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +6 -2
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/price.d.ts +40 -0
- package/sdk/dist/price.d.ts.map +1 -0
- package/sdk/dist/price.js +101 -0
- package/sdk/dist/price.js.map +1 -0
- package/sdk/dist/protocols/aerodrome/abis.d.ts +76 -0
- package/sdk/dist/protocols/aerodrome/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/aerodrome/abis.js +61 -0
- package/sdk/dist/protocols/aerodrome/abis.js.map +1 -1
- package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts +70 -0
- package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/aerodrome-slipstream/abis.js +54 -0
- package/sdk/dist/protocols/aerodrome-slipstream/abis.js.map +1 -1
- package/sdk/dist/protocols/camelot/abis.d.ts +178 -0
- package/sdk/dist/protocols/camelot/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/camelot/abis.js +139 -0
- package/sdk/dist/protocols/camelot/abis.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/abis.d.ts +792 -50
- package/sdk/dist/protocols/eco-routes/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/abis.js +1058 -49
- package/sdk/dist/protocols/eco-routes/abis.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts +44 -61
- package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/addresses.generated.js +45 -62
- package/sdk/dist/protocols/eco-routes/addresses.generated.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/lookup.d.ts +10 -0
- package/sdk/dist/protocols/eco-routes/lookup.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/lookup.js +16 -0
- package/sdk/dist/protocols/eco-routes/lookup.js.map +1 -1
- package/sdk/dist/protocols/maverick/abis.d.ts +77 -0
- package/sdk/dist/protocols/maverick/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/maverick/abis.js +58 -0
- package/sdk/dist/protocols/maverick/abis.js.map +1 -1
- package/sdk/dist/protocols/maverick/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/maverick/addresses.js +4 -0
- package/sdk/dist/protocols/maverick/addresses.js.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v2/abis.js +43 -0
- package/sdk/dist/protocols/pancakeswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v3/abis.js +56 -0
- package/sdk/dist/protocols/pancakeswap-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/permit2/abis.d.ts +113 -0
- package/sdk/dist/protocols/permit2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/permit2/abis.js +63 -0
- package/sdk/dist/protocols/permit2/abis.js.map +1 -1
- package/sdk/dist/protocols/quickswap/abis.d.ts +148 -0
- package/sdk/dist/protocols/quickswap/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/quickswap/abis.js +119 -0
- package/sdk/dist/protocols/quickswap/abis.js.map +1 -1
- package/sdk/dist/protocols/sushiswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/sushiswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/sushiswap-v2/abis.js +42 -0
- package/sdk/dist/protocols/sushiswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/synthra-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/synthra-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/synthra-v3/abis.js +55 -0
- package/sdk/dist/protocols/synthra-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/trader-joe/abis.d.ts +133 -0
- package/sdk/dist/protocols/trader-joe/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/trader-joe/abis.js +101 -0
- package/sdk/dist/protocols/trader-joe/abis.js.map +1 -1
- package/sdk/dist/protocols/trader-joe/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/trader-joe/addresses.js +5 -0
- package/sdk/dist/protocols/trader-joe/addresses.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/uniswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v2/abis.js +44 -0
- package/sdk/dist/protocols/uniswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/uniswap-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v3/abis.js +55 -0
- package/sdk/dist/protocols/uniswap-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/abis.d.ts +247 -0
- package/sdk/dist/protocols/uniswap-v4/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/abis.js +167 -0
- package/sdk/dist/protocols/uniswap-v4/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/addresses.js +50 -0
- package/sdk/dist/protocols/uniswap-v4/addresses.js.map +1 -1
- package/sdk/dist/protocols/unitflow-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/unitflow-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/unitflow-v3/abis.js +56 -0
- package/sdk/dist/protocols/unitflow-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/velodrome/abis.d.ts +76 -0
- package/sdk/dist/protocols/velodrome/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/velodrome/abis.js +61 -0
- package/sdk/dist/protocols/velodrome/abis.js.map +1 -1
- package/sdk/dist/recipes/cctp-split.sauce.ts +2 -2
- package/sdk/dist/recipes/plain-transfer.sauce.ts +2 -2
- package/sdk/dist/routes/accessor-index.d.ts +2 -2
- package/sdk/dist/routes/accessor-index.d.ts.map +1 -1
- package/sdk/dist/routes/accessor-index.js +4 -3
- package/sdk/dist/routes/accessor-index.js.map +1 -1
- package/sdk/dist/routes/ambient.d.ts +5 -0
- package/sdk/dist/routes/ambient.d.ts.map +1 -1
- package/sdk/dist/routes/ambient.js +20 -0
- package/sdk/dist/routes/ambient.js.map +1 -1
- package/sdk/dist/routes/ast-walk.d.ts +17 -3
- package/sdk/dist/routes/ast-walk.d.ts.map +1 -1
- package/sdk/dist/routes/ast-walk.js +24 -2
- package/sdk/dist/routes/ast-walk.js.map +1 -1
- package/sdk/dist/routes/available.d.ts +43 -0
- package/sdk/dist/routes/available.d.ts.map +1 -0
- package/sdk/dist/routes/available.js +230 -0
- package/sdk/dist/routes/available.js.map +1 -0
- package/sdk/dist/routes/builtins.generated.d.ts +180 -0
- package/sdk/dist/routes/builtins.generated.d.ts.map +1 -0
- package/sdk/dist/routes/builtins.generated.js +2 -0
- package/sdk/dist/routes/builtins.generated.js.map +1 -0
- package/sdk/dist/routes/chain-exports.generated.d.ts +13 -8
- package/sdk/dist/routes/chain-exports.generated.d.ts.map +1 -1
- package/sdk/dist/routes/chain-exports.generated.js.map +1 -1
- package/sdk/dist/routes/closure.d.ts.map +1 -1
- package/sdk/dist/routes/closure.js +13 -26
- package/sdk/dist/routes/closure.js.map +1 -1
- package/sdk/dist/routes/composed.d.ts.map +1 -1
- package/sdk/dist/routes/composed.js +20 -8
- package/sdk/dist/routes/composed.js.map +1 -1
- package/sdk/dist/routes/encode.d.ts +17 -0
- package/sdk/dist/routes/encode.d.ts.map +1 -1
- package/sdk/dist/routes/encode.js +14 -11
- package/sdk/dist/routes/encode.js.map +1 -1
- package/sdk/dist/routes/entry.d.ts +76 -0
- package/sdk/dist/routes/entry.d.ts.map +1 -0
- package/sdk/dist/routes/entry.js +478 -0
- package/sdk/dist/routes/entry.js.map +1 -0
- package/sdk/dist/routes/index.d.ts +19 -12
- package/sdk/dist/routes/index.d.ts.map +1 -1
- package/sdk/dist/routes/index.js +11 -8
- package/sdk/dist/routes/index.js.map +1 -1
- package/sdk/dist/routes/intent-body.d.ts +97 -0
- package/sdk/dist/routes/intent-body.d.ts.map +1 -0
- package/sdk/dist/routes/intent-body.js +441 -0
- package/sdk/dist/routes/intent-body.js.map +1 -0
- package/sdk/dist/routes/intent-dsl.d.ts +21 -6
- package/sdk/dist/routes/intent-dsl.d.ts.map +1 -1
- package/sdk/dist/routes/intent-dsl.js +34 -17
- package/sdk/dist/routes/intent-dsl.js.map +1 -1
- package/sdk/dist/routes/intent-sugar.d.ts +77 -4
- package/sdk/dist/routes/intent-sugar.d.ts.map +1 -1
- package/sdk/dist/routes/intent-sugar.js +318 -129
- package/sdk/dist/routes/intent-sugar.js.map +1 -1
- package/sdk/dist/routes/intent.d.ts +13 -1
- package/sdk/dist/routes/intent.d.ts.map +1 -1
- package/sdk/dist/routes/intent.js +37 -1
- package/sdk/dist/routes/intent.js.map +1 -1
- package/sdk/dist/routes/nest.d.ts +3 -2
- package/sdk/dist/routes/nest.d.ts.map +1 -1
- package/sdk/dist/routes/nest.js +5 -3
- package/sdk/dist/routes/nest.js.map +1 -1
- package/sdk/dist/routes/parse.d.ts +6 -0
- package/sdk/dist/routes/parse.d.ts.map +1 -0
- package/sdk/dist/routes/parse.js +39 -0
- package/sdk/dist/routes/parse.js.map +1 -0
- package/sdk/dist/routes/portal.d.ts +258 -4
- package/sdk/dist/routes/portal.d.ts.map +1 -1
- package/sdk/dist/routes/portal.js +588 -9
- package/sdk/dist/routes/portal.js.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts +71 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.js +178 -54
- package/sdk/dist/routes/protocol-rewrite.js.map +1 -1
- package/sdk/dist/routes/rs-compile.d.ts +25 -22
- package/sdk/dist/routes/rs-compile.d.ts.map +1 -1
- package/sdk/dist/routes/rs-compile.js +55 -49
- package/sdk/dist/routes/rs-compile.js.map +1 -1
- package/sdk/dist/routes/sauce-calls.d.ts +26 -12
- package/sdk/dist/routes/sauce-calls.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-calls.js +16 -23
- package/sdk/dist/routes/sauce-calls.js.map +1 -1
- package/sdk/dist/routes/sauce-route.d.ts +74 -7
- package/sdk/dist/routes/sauce-route.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-route.js +225 -75
- package/sdk/dist/routes/sauce-route.js.map +1 -1
- package/sdk/dist/routes/source-globals.d.ts +107 -0
- package/sdk/dist/routes/source-globals.d.ts.map +1 -0
- package/sdk/dist/routes/source-globals.generated.d.ts +5523 -933
- package/sdk/dist/routes/source-globals.generated.d.ts.map +1 -1
- package/sdk/dist/routes/source-globals.generated.js +3 -4
- package/sdk/dist/routes/source-globals.generated.js.map +1 -1
- package/sdk/dist/routes/source-globals.js +174 -0
- package/sdk/dist/routes/source-globals.js.map +1 -0
- package/sdk/dist/routes/stock-tokens.d.ts +69 -0
- package/sdk/dist/routes/stock-tokens.d.ts.map +1 -0
- package/sdk/dist/routes/stock-tokens.generated.d.ts +4 -0
- package/sdk/dist/routes/stock-tokens.generated.d.ts.map +1 -0
- package/sdk/dist/routes/stock-tokens.generated.js +1836 -0
- package/sdk/dist/routes/stock-tokens.generated.js.map +1 -0
- package/sdk/dist/routes/stock-tokens.js +65 -0
- package/sdk/dist/routes/stock-tokens.js.map +1 -0
- package/sdk/dist/routes/token-registry.d.ts +64 -8
- package/sdk/dist/routes/token-registry.d.ts.map +1 -1
- package/sdk/dist/routes/token-registry.js +202 -32
- package/sdk/dist/routes/token-registry.js.map +1 -1
- package/sdk/dist/routes/token-rewrite.d.ts +1 -1
- package/sdk/dist/routes/token-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/token-rewrite.js +5 -9
- package/sdk/dist/routes/token-rewrite.js.map +1 -1
- package/sdk/dist/routes/unknown-global.d.ts +32 -0
- package/sdk/dist/routes/unknown-global.d.ts.map +1 -0
- package/sdk/dist/routes/unknown-global.js +106 -0
- package/sdk/dist/routes/unknown-global.js.map +1 -0
- package/sdk/dist/routes/vault.d.ts +38 -8
- package/sdk/dist/routes/vault.d.ts.map +1 -1
- package/sdk/dist/routes/vault.js +47 -8
- package/sdk/dist/routes/vault.js.map +1 -1
- package/sdk/dist/sauce-script/builtins.d.ts +309 -0
- package/sdk/dist/sauce-script/declarations.d.ts +3 -0
- package/sdk/dist/sauce-script/declarations.d.ts.map +1 -0
- package/sdk/dist/sauce-script/declarations.js +229 -0
- package/sdk/dist/sauce-script/declarations.js.map +1 -0
- package/sdk/dist/sauce-script/index.d.ts +2714 -0
- package/sdk/dist/sauce-script/ts-plugin.cjs +85 -0
- package/sdk/dist/skills/loader.d.ts.map +1 -1
- package/sdk/dist/skills/loader.js +4 -3
- package/sdk/dist/skills/loader.js.map +1 -1
- package/sdk/dist/std/router/balancer-v2-vault.abi.json +78 -0
- package/sdk/dist/std/router/curve-cryptoswap.abi.json +29 -0
- package/sdk/dist/std/router/curve-stableswap.abi.json +29 -0
- package/sdk/dist/std/router/dodo-v2-pool.abi.json +39 -0
- package/sdk/dist/std/router/lb-pair.abi.json +55 -0
- package/sdk/dist/std/router/package.json +7 -0
- package/sdk/dist/std/router/router.evm.js +567 -0
- package/sdk/dist/std/router/sauce-router.abi.json +202 -0
- package/sdk/dist/std/router/uniswap-v2-pair.abi.json +49 -0
- package/sdk/dist/std/router/woo-pp-v2.abi.json +42 -0
- package/sdk/dist/std/token/permit2.abi.json +226 -0
- package/sdk/dist/std/token/token.evm.js +73 -0
- package/sdk/dist/std/token/token.svm.js +194 -41
- package/sdk/dist/svm/client.d.ts +62 -15
- package/sdk/dist/svm/client.d.ts.map +1 -1
- package/sdk/dist/svm/client.js +103 -42
- package/sdk/dist/svm/client.js.map +1 -1
- package/sdk/dist/svm/engine.d.ts +66 -5
- package/sdk/dist/svm/engine.d.ts.map +1 -1
- package/sdk/dist/svm/engine.js +73 -5
- package/sdk/dist/svm/engine.js.map +1 -1
- package/sdk/dist/svm/index.d.ts +2 -0
- package/sdk/dist/svm/index.d.ts.map +1 -1
- package/sdk/dist/svm/index.js +2 -0
- package/sdk/dist/svm/index.js.map +1 -1
- package/sdk/dist/svm/instructions.d.ts +72 -1
- package/sdk/dist/svm/instructions.d.ts.map +1 -1
- package/sdk/dist/svm/instructions.js +81 -2
- package/sdk/dist/svm/instructions.js.map +1 -1
- package/sdk/dist/svm/kitchen.d.ts +20 -1
- package/sdk/dist/svm/kitchen.d.ts.map +1 -1
- package/sdk/dist/svm/kitchen.js +47 -1
- package/sdk/dist/svm/kitchen.js.map +1 -1
- package/sdk/dist/svm/portal.d.ts +250 -0
- package/sdk/dist/svm/portal.d.ts.map +1 -0
- package/sdk/dist/svm/portal.js +462 -0
- package/sdk/dist/svm/portal.js.map +1 -0
- package/sdk/dist/svm/send.d.ts +18 -2
- package/sdk/dist/svm/send.d.ts.map +1 -1
- package/sdk/dist/svm/send.js +28 -3
- package/sdk/dist/svm/send.js.map +1 -1
- package/sdk/dist/svm/token-accounts.d.ts +49 -0
- package/sdk/dist/svm/token-accounts.d.ts.map +1 -0
- package/sdk/dist/svm/token-accounts.js +58 -0
- package/sdk/dist/svm/token-accounts.js.map +1 -0
- package/sdk/dist/svm/token-extensions.d.ts +18 -7
- package/sdk/dist/svm/token-extensions.d.ts.map +1 -1
- package/sdk/dist/svm/token-extensions.js +58 -5
- package/sdk/dist/svm/token-extensions.js.map +1 -1
- package/sdk/dist/token/evm.js +1 -1
- package/sdk/dist/token/index.d.ts +1 -1
- package/sdk/dist/token/index.js +1 -1
- package/sdk/dist/token/params.js +1 -1
- package/sdk/dist/token/source.js +3 -3
- package/sdk/dist/token/source.js.map +1 -1
- package/sdk/dist/token/types.d.ts +2 -2
- package/sdk/dist/token/types.js +2 -2
- package/sdk/src/protocols/aerodrome/AerodromePoolABI.json +105 -0
- package/sdk/src/protocols/aerodrome/abis.ts +62 -0
- package/sdk/src/protocols/aerodrome-slipstream/AerodromeSlipstreamPoolABI.json +96 -0
- package/sdk/src/protocols/aerodrome-slipstream/abis.ts +55 -0
- package/sdk/src/protocols/camelot/CamelotV2FactoryABI.json +25 -0
- package/sdk/src/protocols/camelot/CamelotV2PairABI.json +109 -0
- package/sdk/src/protocols/camelot/CamelotV3FactoryABI.json +25 -0
- package/sdk/src/protocols/camelot/CamelotV3PoolABI.json +92 -0
- package/sdk/src/protocols/camelot/abis.ts +143 -0
- package/sdk/src/protocols/eco-routes/PortalABI.json +1448 -0
- package/sdk/src/protocols/eco-routes/ProverABI.json +162 -0
- package/sdk/src/protocols/eco-routes/abis.ts +1060 -51
- package/sdk/src/protocols/eco-routes/addresses.generated.ts +45 -62
- package/sdk/src/protocols/eco-routes/lookup.ts +18 -0
- package/sdk/src/protocols/maverick/MaverickV2PoolABI.json +107 -0
- package/sdk/src/protocols/maverick/abis.ts +59 -0
- package/sdk/src/protocols/maverick/addresses.ts +4 -0
- package/sdk/src/protocols/pancakeswap-v2/PancakeSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/pancakeswap-v2/abis.ts +44 -0
- package/sdk/src/protocols/pancakeswap-v3/PancakeSwapV3PoolABI.json +100 -0
- package/sdk/src/protocols/pancakeswap-v3/abis.ts +57 -0
- package/sdk/src/protocols/permit2/Permit2ABI.json +154 -0
- package/sdk/src/protocols/permit2/abis.ts +63 -0
- package/sdk/src/protocols/quickswap/QuickSwapV2FactoryABI.json +25 -0
- package/sdk/src/protocols/quickswap/QuickSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/quickswap/QuickSwapV3FactoryABI.json +25 -0
- package/sdk/src/protocols/quickswap/QuickSwapV3PoolABI.json +88 -0
- package/sdk/src/protocols/quickswap/abis.ts +123 -0
- package/sdk/src/protocols/sushiswap-v2/SushiSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/sushiswap-v2/abis.ts +43 -0
- package/sdk/src/protocols/synthra-v3/SynthraV3PoolABI.json +100 -0
- package/sdk/src/protocols/synthra-v3/abis.ts +56 -0
- package/sdk/src/protocols/trader-joe/LBPairABI.json +185 -0
- package/sdk/src/protocols/trader-joe/abis.ts +102 -0
- package/sdk/src/protocols/trader-joe/addresses.ts +5 -0
- package/sdk/src/protocols/uniswap-v2/UniswapV2PairABI.json +72 -0
- package/sdk/src/protocols/uniswap-v2/abis.ts +45 -0
- package/sdk/src/protocols/uniswap-v3/UniswapV3PoolABI.json +100 -0
- package/sdk/src/protocols/uniswap-v3/abis.ts +56 -0
- package/sdk/src/protocols/uniswap-v4/UniswapV4PoolManagerABI.json +38 -0
- package/sdk/src/protocols/uniswap-v4/UniswapV4StateViewABI.json +307 -0
- package/sdk/src/protocols/uniswap-v4/abis.ts +168 -0
- package/sdk/src/protocols/uniswap-v4/addresses.ts +50 -0
- package/sdk/src/protocols/unitflow-v3/UnitFlowV3PoolABI.json +100 -0
- package/sdk/src/protocols/unitflow-v3/abis.ts +57 -0
- package/sdk/src/protocols/velodrome/VelodromePoolABI.json +105 -0
- package/sdk/src/protocols/velodrome/abis.ts +62 -0
- package/skills/sauce-actions/SKILL.md +166 -0
- package/skills/sauce-actions/examples/swap-and-supply.json +24 -0
- package/skills/sauce-actions/examples/swap-by-key.json +15 -0
- package/skills/sauce-actions/references/actions.md +731 -0
- package/skills/sauce-chains/SKILL.md +137 -0
- package/skills/sauce-chains/examples/chains.sauce.ts +25 -0
- package/skills/sauce-chains/references/arbitrum.md +158 -0
- package/skills/sauce-chains/references/arc.md +107 -0
- package/skills/sauce-chains/references/aurora.md +33 -0
- package/skills/sauce-chains/references/avalanche.md +106 -0
- package/skills/sauce-chains/references/base-stocks.md +77 -0
- package/skills/sauce-chains/references/base.md +141 -0
- package/skills/sauce-chains/references/berachain.md +33 -0
- package/skills/sauce-chains/references/blast.md +60 -0
- package/skills/sauce-chains/references/boba.md +33 -0
- package/skills/sauce-chains/references/bsc.md +97 -0
- package/skills/sauce-chains/references/celo.md +57 -0
- package/skills/sauce-chains/references/core.md +33 -0
- package/skills/sauce-chains/references/cronos.md +33 -0
- package/skills/sauce-chains/references/ethereum-stocks.md +1741 -0
- package/skills/sauce-chains/references/ethereum.md +255 -0
- package/skills/sauce-chains/references/evmos.md +33 -0
- package/skills/sauce-chains/references/fantom.md +61 -0
- package/skills/sauce-chains/references/fuse.md +33 -0
- package/skills/sauce-chains/references/gnosis.md +57 -0
- package/skills/sauce-chains/references/index.md +58 -0
- package/skills/sauce-chains/references/ink.md +55 -0
- package/skills/sauce-chains/references/kava.md +33 -0
- package/skills/sauce-chains/references/klaytn.md +33 -0
- package/skills/sauce-chains/references/linea.md +65 -0
- package/skills/sauce-chains/references/manta.md +33 -0
- package/skills/sauce-chains/references/mantle.md +33 -0
- package/skills/sauce-chains/references/metis.md +54 -0
- package/skills/sauce-chains/references/mode.md +55 -0
- package/skills/sauce-chains/references/monad.md +79 -0
- package/skills/sauce-chains/references/moonbeam.md +33 -0
- package/skills/sauce-chains/references/opbnb.md +55 -0
- package/skills/sauce-chains/references/optimism.md +123 -0
- package/skills/sauce-chains/references/plasma.md +35 -0
- package/skills/sauce-chains/references/polygon.md +123 -0
- package/skills/sauce-chains/references/pulsechain.md +33 -0
- package/skills/sauce-chains/references/ronin.md +35 -0
- package/skills/sauce-chains/references/scroll.md +62 -0
- package/skills/sauce-chains/references/sei.md +55 -0
- package/skills/sauce-chains/references/solana.md +53 -0
- package/skills/sauce-chains/references/sonic.md +57 -0
- package/skills/sauce-chains/references/unichain.md +61 -0
- package/skills/sauce-chains/references/zetachain.md +33 -0
- package/skills/sauce-chains/references/zksync.md +59 -0
- package/skills/sauce-chains/references/zora.md +57 -0
- package/skills/sauce-cli/SKILL.md +366 -0
- package/skills/sauce-cli/examples/pay.sauce.ts +23 -0
- package/skills/sauce-cli/examples/split.sauce.ts +30 -0
- package/skills/sauce-distributed-swap/SKILL.md +392 -0
- package/skills/sauce-distributed-swap/examples/distributed-swap.mts +251 -0
- package/skills/sauce-distributed-swap/examples/distributed-swap.sauce.ts +115 -0
- package/skills/sauce-examples/SKILL.md +96 -0
- package/skills/sauce-globals/SKILL.md +175 -0
- package/skills/sauce-globals/examples/globals.mts +111 -0
- package/skills/sauce-globals/examples/globals.sauce.ts +47 -0
- package/skills/sauce-globals/references/chains.md +53 -0
- package/skills/sauce-globals/references/protocols.md +405 -0
- package/skills/sauce-globals/references/stocks.md +1824 -0
- package/skills/sauce-globals/references/tokens.md +53 -0
- package/skills/sauce-intents/SKILL.md +505 -0
- package/skills/sauce-intents/examples/cross-chain.sauce.ts +37 -0
- package/skills/sauce-intents/examples/fund-by-transfer.sauce.ts +54 -0
- package/skills/sauce-intents/examples/intents.mts +343 -0
- package/skills/sauce-intents/examples/swap-on-base.sauce.ts +135 -0
- package/skills/sauce-intents/references/portal.md +77 -0
- package/skills/sauce-overview/SKILL.md +161 -0
- package/skills/sauce-protocols/SKILL.md +118 -0
- package/skills/sauce-protocols/examples/protocols.mts +77 -0
- package/skills/sauce-protocols/examples/protocols.sauce.ts +27 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/aave-v2.md +35 -17
- package/skills/sauce-protocols/references/aave-v3.md +144 -0
- package/skills/sauce-protocols/references/aave-v4.md +50 -0
- package/skills/sauce-protocols/references/abracadabra.md +72 -0
- package/skills/sauce-protocols/references/across.md +73 -0
- package/skills/sauce-protocols/references/aerodrome-slipstream.md +50 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/aerodrome.md +43 -24
- package/skills/sauce-protocols/references/aevo.md +49 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/alchemix.md +10 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/ambient.md +14 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/arbitrum-bridge.md +11 -14
- package/{sdk/src/skills → skills/sauce-protocols/references}/arrakis.md +10 -26
- package/skills/sauce-protocols/references/axelar.md +56 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/balancer-v2.md +13 -29
- package/{sdk/src/skills → skills/sauce-protocols/references}/base-bridge.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/baseswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/beefy.md +10 -30
- package/{sdk/src/skills → skills/sauce-protocols/references}/benqi.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/camelot.md +13 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/cbeth.md +10 -22
- package/skills/sauce-protocols/references/cctp.md +47 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/celer.md +11 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/chainlink-ccip.md +11 -21
- package/skills/sauce-protocols/references/chainlink.md +47 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/circle-gateway.md +12 -38
- package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v2.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v3.md +43 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/connext.md +11 -15
- package/{sdk/src/skills → skills/sauce-protocols/references}/convex.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/cowswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/crvusd.md +10 -19
- package/skills/sauce-protocols/references/curve.md +98 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/debridge.md +11 -33
- package/{sdk/src/skills → skills/sauce-protocols/references}/dodo.md +13 -18
- package/skills/sauce-protocols/references/eigenlayer.md +48 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/ens.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc20.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc3156.md +10 -13
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc4626.md +11 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/ethena.md +10 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/etherfi.md +10 -32
- package/{sdk/src/skills → skills/sauce-protocols/references}/euler-v2.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/fenix.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/fluid.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/frax-ether.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/frax.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/gains-network.md +11 -28
- package/skills/sauce-protocols/references/gamma.md +57 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/gelato.md +12 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/gho.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v1.md +12 -34
- package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v2.md +15 -28
- package/skills/sauce-protocols/references/harvest.md +41 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/hegic.md +10 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/hop.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/hyperlane.md +11 -21
- package/skills/sauce-protocols/references/index.md +355 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/instadapp.md +10 -18
- package/skills/sauce-protocols/references/kelp.md +46 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/kim.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/kyberswap-aggregator.md +12 -35
- package/skills/sauce-protocols/references/kyberswap.md +72 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/layerbank.md +11 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/layerzero.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/level-finance.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/lido.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/lifi.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/linea-bridge.md +11 -14
- package/{sdk/src/skills → skills/sauce-protocols/references}/liquity-v1.md +10 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/liquity-v2.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/lynex.md +12 -18
- package/skills/sauce-protocols/references/maker.md +57 -0
- package/skills/sauce-protocols/references/mantle-meth.md +43 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/maverick.md +13 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/moonwell.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/morpho-blue.md +44 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/mux-protocol.md +10 -30
- package/skills/sauce-protocols/references/olympus.md +39 -0
- package/skills/sauce-protocols/references/oneinch.md +81 -0
- package/skills/sauce-protocols/references/openocean.md +69 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/optimism-bridge.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/opyn.md +10 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/pancakeswap-v2.md +39 -41
- package/skills/sauce-protocols/references/pancakeswap-v3.md +72 -0
- package/skills/sauce-protocols/references/paraswap.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/pendle.md +47 -29
- package/skills/sauce-protocols/references/permit2.md +101 -0
- package/skills/sauce-protocols/references/perpetual-protocol.md +53 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/polygon-bridge.md +11 -17
- package/{sdk/src/skills → skills/sauce-protocols/references}/premia.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/puffer.md +10 -21
- package/skills/sauce-protocols/references/pyth.md +45 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/quickswap.md +13 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/radiant.md +11 -15
- package/{sdk/src/skills → skills/sauce-protocols/references}/ramses.md +12 -18
- package/skills/sauce-protocols/references/reflexer.md +52 -0
- package/skills/sauce-protocols/references/registry/aave-v2.md +43 -0
- package/skills/sauce-protocols/references/registry/aave-v3.md +62 -0
- package/skills/sauce-protocols/references/registry/aave-v4.md +80 -0
- package/skills/sauce-protocols/references/registry/abracadabra.md +54 -0
- package/skills/sauce-protocols/references/registry/across.md +57 -0
- package/skills/sauce-protocols/references/registry/aerodrome-slipstream.md +72 -0
- package/skills/sauce-protocols/references/registry/aerodrome.md +58 -0
- package/skills/sauce-protocols/references/registry/aevo.md +39 -0
- package/skills/sauce-protocols/references/registry/alchemix.md +46 -0
- package/skills/sauce-protocols/references/registry/ambient.md +40 -0
- package/skills/sauce-protocols/references/registry/arbitrum-bridge.md +40 -0
- package/skills/sauce-protocols/references/registry/arrakis.md +49 -0
- package/skills/sauce-protocols/references/registry/axelar.md +65 -0
- package/skills/sauce-protocols/references/registry/balancer-v2.md +50 -0
- package/skills/sauce-protocols/references/registry/base-bridge.md +42 -0
- package/skills/sauce-protocols/references/registry/baseswap.md +40 -0
- package/skills/sauce-protocols/references/registry/beefy.md +51 -0
- package/skills/sauce-protocols/references/registry/benqi.md +49 -0
- package/skills/sauce-protocols/references/registry/camelot.md +82 -0
- package/skills/sauce-protocols/references/registry/cbeth.md +43 -0
- package/skills/sauce-protocols/references/registry/cctp.md +48 -0
- package/skills/sauce-protocols/references/registry/celer.md +44 -0
- package/skills/sauce-protocols/references/registry/chainlink-ccip.md +45 -0
- package/skills/sauce-protocols/references/registry/chainlink.md +49 -0
- package/skills/sauce-protocols/references/registry/circle-gateway.md +70 -0
- package/skills/sauce-protocols/references/registry/compound-v2.md +53 -0
- package/skills/sauce-protocols/references/registry/compound-v3.md +52 -0
- package/skills/sauce-protocols/references/registry/connext.md +41 -0
- package/skills/sauce-protocols/references/registry/convex.md +51 -0
- package/skills/sauce-protocols/references/registry/cowswap.md +40 -0
- package/skills/sauce-protocols/references/registry/crvusd.md +40 -0
- package/skills/sauce-protocols/references/registry/curve.md +81 -0
- package/skills/sauce-protocols/references/registry/debridge.md +59 -0
- package/skills/sauce-protocols/references/registry/dodo.md +39 -0
- package/skills/sauce-protocols/references/registry/eco-routes.md +65 -0
- package/skills/sauce-protocols/references/registry/eigenlayer.md +58 -0
- package/skills/sauce-protocols/references/registry/ens.md +49 -0
- package/skills/sauce-protocols/references/registry/erc20.md +44 -0
- package/skills/sauce-protocols/references/registry/erc3156.md +38 -0
- package/skills/sauce-protocols/references/registry/erc4626.md +51 -0
- package/skills/sauce-protocols/references/registry/ethena.md +50 -0
- package/skills/sauce-protocols/references/registry/etherfi.md +57 -0
- package/skills/sauce-protocols/references/registry/euler-v2.md +49 -0
- package/skills/sauce-protocols/references/registry/fenix.md +39 -0
- package/skills/sauce-protocols/references/registry/fluid.md +48 -0
- package/skills/sauce-protocols/references/registry/frax-ether.md +49 -0
- package/skills/sauce-protocols/references/registry/frax.md +40 -0
- package/skills/sauce-protocols/references/registry/gains-network.md +43 -0
- package/skills/sauce-protocols/references/registry/gamma.md +56 -0
- package/skills/sauce-protocols/references/registry/gelato.md +45 -0
- package/skills/sauce-protocols/references/registry/gho.md +40 -0
- package/skills/sauce-protocols/references/registry/gmx-v1.md +59 -0
- package/skills/sauce-protocols/references/registry/gmx-v2.md +41 -0
- package/skills/sauce-protocols/references/registry/harvest.md +44 -0
- package/skills/sauce-protocols/references/registry/hegic.md +39 -0
- package/skills/sauce-protocols/references/registry/hop.md +49 -0
- package/skills/sauce-protocols/references/registry/hyperlane.md +48 -0
- package/skills/sauce-protocols/references/registry/instadapp.md +39 -0
- package/skills/sauce-protocols/references/registry/kelp.md +47 -0
- package/skills/sauce-protocols/references/registry/kim.md +39 -0
- package/skills/sauce-protocols/references/registry/kyberswap-aggregator.md +49 -0
- package/skills/sauce-protocols/references/registry/kyberswap.md +63 -0
- package/skills/sauce-protocols/references/registry/layerbank.md +54 -0
- package/skills/sauce-protocols/references/registry/layerzero.md +49 -0
- package/skills/sauce-protocols/references/registry/level-finance.md +41 -0
- package/skills/sauce-protocols/references/registry/lido.md +51 -0
- package/skills/sauce-protocols/references/registry/lifi.md +48 -0
- package/skills/sauce-protocols/references/registry/linea-bridge.md +40 -0
- package/skills/sauce-protocols/references/registry/liquity-v1.md +42 -0
- package/skills/sauce-protocols/references/registry/liquity-v2.md +40 -0
- package/skills/sauce-protocols/references/registry/lynex.md +39 -0
- package/skills/sauce-protocols/references/registry/maker.md +55 -0
- package/skills/sauce-protocols/references/registry/mantle-meth.md +48 -0
- package/skills/sauce-protocols/references/registry/maverick.md +60 -0
- package/skills/sauce-protocols/references/registry/moonwell.md +49 -0
- package/skills/sauce-protocols/references/registry/morpho-blue.md +47 -0
- package/skills/sauce-protocols/references/registry/mux-protocol.md +49 -0
- package/skills/sauce-protocols/references/registry/olympus.md +42 -0
- package/skills/sauce-protocols/references/registry/oneinch.md +45 -0
- package/skills/sauce-protocols/references/registry/openocean.md +44 -0
- package/skills/sauce-protocols/references/registry/optimism-bridge.md +42 -0
- package/skills/sauce-protocols/references/registry/opyn.md +42 -0
- package/skills/sauce-protocols/references/registry/pancakeswap-v2.md +71 -0
- package/skills/sauce-protocols/references/registry/pancakeswap-v3.md +76 -0
- package/skills/sauce-protocols/references/registry/paraswap.md +51 -0
- package/skills/sauce-protocols/references/registry/pendle.md +43 -0
- package/skills/sauce-protocols/references/registry/permit2.md +50 -0
- package/skills/sauce-protocols/references/registry/perpetual-protocol.md +49 -0
- package/skills/sauce-protocols/references/registry/polygon-bridge.md +43 -0
- package/skills/sauce-protocols/references/registry/premia.md +40 -0
- package/skills/sauce-protocols/references/registry/puffer.md +43 -0
- package/skills/sauce-protocols/references/registry/pyth.md +40 -0
- package/skills/sauce-protocols/references/registry/quickswap.md +80 -0
- package/skills/sauce-protocols/references/registry/radiant.md +41 -0
- package/skills/sauce-protocols/references/registry/ramses.md +39 -0
- package/skills/sauce-protocols/references/registry/reflexer.md +56 -0
- package/skills/sauce-protocols/references/registry/renzo.md +47 -0
- package/skills/sauce-protocols/references/registry/rocket-pool.md +49 -0
- package/skills/sauce-protocols/references/registry/sablier.md +40 -0
- package/skills/sauce-protocols/references/registry/safe.md +47 -0
- package/skills/sauce-protocols/references/registry/scroll-bridge.md +48 -0
- package/skills/sauce-protocols/references/registry/seamless.md +42 -0
- package/skills/sauce-protocols/references/registry/seaport.md +44 -0
- package/skills/sauce-protocols/references/registry/silo.md +48 -0
- package/skills/sauce-protocols/references/registry/socket.md +44 -0
- package/skills/sauce-protocols/references/registry/sommelier.md +43 -0
- package/skills/sauce-protocols/references/registry/spark.md +42 -0
- package/skills/sauce-protocols/references/registry/spookyswap.md +40 -0
- package/skills/sauce-protocols/references/registry/squid.md +45 -0
- package/skills/sauce-protocols/references/registry/stader.md +47 -0
- package/skills/sauce-protocols/references/registry/stargate.md +45 -0
- package/skills/sauce-protocols/references/registry/superfluid.md +49 -0
- package/skills/sauce-protocols/references/registry/sushiswap-v2.md +71 -0
- package/skills/sauce-protocols/references/registry/swell.md +49 -0
- package/skills/sauce-protocols/references/registry/synapse.md +46 -0
- package/skills/sauce-protocols/references/registry/syncswap.md +38 -0
- package/skills/sauce-protocols/references/registry/synthetix-v3.md +48 -0
- package/skills/sauce-protocols/references/registry/synthra-v3.md +77 -0
- package/skills/sauce-protocols/references/registry/thales.md +51 -0
- package/skills/sauce-protocols/references/registry/thena.md +39 -0
- package/skills/sauce-protocols/references/registry/thruster.md +38 -0
- package/skills/sauce-protocols/references/registry/tokemak.md +45 -0
- package/skills/sauce-protocols/references/registry/trader-joe.md +66 -0
- package/skills/sauce-protocols/references/registry/uniswap-v2.md +77 -0
- package/skills/sauce-protocols/references/registry/uniswap-v3.md +113 -0
- package/skills/sauce-protocols/references/registry/uniswap-v4.md +117 -0
- package/skills/sauce-protocols/references/registry/unitflow-v3.md +65 -0
- package/skills/sauce-protocols/references/registry/velodrome.md +58 -0
- package/skills/sauce-protocols/references/registry/venus.md +62 -0
- package/skills/sauce-protocols/references/registry/vertex.md +46 -0
- package/skills/sauce-protocols/references/registry/wormhole.md +59 -0
- package/skills/sauce-protocols/references/registry/yearn-v3.md +46 -0
- package/skills/sauce-protocols/references/registry/zerolend.md +41 -0
- package/skills/sauce-protocols/references/registry/zerox.md +44 -0
- package/skills/sauce-protocols/references/registry/zksync-bridge.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/renzo.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/rocket-pool.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/sablier.md +10 -27
- package/skills/sauce-protocols/references/safe.md +42 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/scroll-bridge.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/seamless.md +11 -16
- package/skills/sauce-protocols/references/seaport.md +38 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/silo.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/socket.md +11 -18
- package/skills/sauce-protocols/references/sommelier.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/spark.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/spookyswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/squid.md +11 -21
- package/skills/sauce-protocols/references/stader.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/stargate.md +11 -22
- package/{sdk/src/skills → skills/sauce-protocols/references}/superfluid.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/sushiswap-v2.md +38 -43
- package/skills/sauce-protocols/references/swell.md +49 -0
- package/skills/sauce-protocols/references/synapse.md +54 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/syncswap.md +12 -17
- package/{sdk/src/skills → skills/sauce-protocols/references}/synthetix-v3.md +10 -29
- package/skills/sauce-protocols/references/synthra-v3.md +63 -0
- package/skills/sauce-protocols/references/thales.md +58 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/thena.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/thruster.md +13 -18
- package/skills/sauce-protocols/references/tokemak.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/trader-joe.md +13 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/uniswap-v2.md +46 -44
- package/skills/sauce-protocols/references/uniswap-v3.md +188 -0
- package/skills/sauce-protocols/references/uniswap-v4.md +155 -0
- package/skills/sauce-protocols/references/unitflow-v3.md +63 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/velodrome.md +12 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/venus.md +12 -31
- package/skills/sauce-protocols/references/vertex.md +42 -0
- package/skills/sauce-protocols/references/wormhole.md +57 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/yearn-v3.md +10 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/zerolend.md +11 -15
- package/skills/sauce-protocols/references/zerox.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/zksync-bridge.md +11 -14
- package/skills/sauce-script/SKILL.md +407 -0
- package/skills/sauce-script/examples/IOracle.json +12 -0
- package/skills/sauce-script/examples/saucescript.mts +167 -0
- package/skills/sauce-script/examples/twap.sauce.ts +29 -0
- package/skills/sauce-script/references/builtins.json +823 -0
- package/skills/sauce-script/references/builtins.md +674 -0
- package/skills/sauce-solana/SKILL.md +322 -0
- package/skills/sauce-solana/examples/solana.mts +166 -0
- package/skills/sauce-solana/examples/solana.sauce.ts +45 -0
- package/skills/sauce-solana/examples/token-2022.sauce.ts +38 -0
- package/skills/sauce-swaps/SKILL.md +200 -0
- package/skills/sauce-swaps/examples/swap-leg.sauce.ts +50 -0
- package/skills/sauce-swaps/examples/swaps.mts +124 -0
- package/skills/sauce-typescript/SKILL.md +178 -0
- package/skills/sauce-typescript/examples/actions.mts +100 -0
- package/skills/sauce-typescript/examples/compiler.mts +69 -0
- package/skills/sauce-typescript/examples/cook.mts +65 -0
- package/skills/sauce-typescript/examples/verify.mts +104 -0
- package/dev-tools/README.md +0 -16
- package/dev-tools/artifacts/IERC20.json +0 -1
- package/dev-tools/artifacts/ISauceRouter.json +0 -1
- package/dev-tools/artifacts/IUniswapV3Pool.json +0 -1
- package/dev-tools/artifacts/Router.json +0 -1
- package/dev-tools/hardhat.config.cjs +0 -18
- package/dev-tools/sauce/js/add.js +0 -4
- package/dev-tools/sauce/js/call.js +0 -8
- package/dev-tools/sauce/js/erc20.js +0 -18
- package/dev-tools/sauce/js/example.js +0 -6
- package/dev-tools/sauce/js/fibonacci.js +0 -13
- package/dev-tools/sauce/ts/add.ts +0 -4
- package/dev-tools/sauce/ts/call.ts +0 -8
- package/dev-tools/sauce/ts/erc20.ts +0 -18
- package/dev-tools/sauce/ts/example.ts +0 -6
- package/dev-tools/sauce/ts/fibonacci.ts +0 -13
- package/dev-tools/sauce/ts/saucescript.d.ts +0 -1
- package/dev-tools/sauce/ts/tsconfig.json +0 -12
- package/dev-tools/scripts/deploy.ts +0 -107
- package/dev-tools/scripts/init.js +0 -132
- package/dev-tools/scripts/run.ts +0 -67
- package/dev-tools/scripts/start-fork.sh +0 -92
- package/dev-tools/scripts/start-local.sh +0 -120
- package/dev-tools/scripts/stop-local.sh +0 -40
- package/dev-tools/scripts/sync-artifacts.js +0 -46
- package/dev-tools/scripts/sync-price.ts +0 -58
- package/dev-tools/src/contracts.ts +0 -59
- package/dev-tools/src/runner.ts +0 -355
- package/dev-tools/src/svm-local.ts +0 -305
- package/dev-tools/src/sync-price.ts +0 -217
- package/sdk/dist/deployments/v12.generated.d.ts +0 -95
- package/sdk/dist/deployments/v12.generated.d.ts.map +0 -1
- package/sdk/dist/deployments/v12.generated.js +0 -50
- package/sdk/dist/deployments/v12.generated.js.map +0 -1
- package/sdk/dist/swap/index.d.ts +0 -29
- package/sdk/dist/swap/index.d.ts.map +0 -1
- package/sdk/dist/swap/index.js +0 -27
- package/sdk/dist/swap/index.js.map +0 -1
- package/sdk/dist/swap/params.d.ts +0 -29
- package/sdk/dist/swap/params.d.ts.map +0 -1
- package/sdk/dist/swap/params.js +0 -123
- package/sdk/dist/swap/params.js.map +0 -1
- package/sdk/dist/swap/source.d.ts +0 -30
- package/sdk/dist/swap/source.d.ts.map +0 -1
- package/sdk/dist/swap/source.js +0 -101
- package/sdk/dist/swap/source.js.map +0 -1
- package/sdk/dist/swap/types.d.ts +0 -160
- package/sdk/dist/swap/types.d.ts.map +0 -1
- package/sdk/dist/swap/types.js +0 -106
- package/sdk/dist/swap/types.js.map +0 -1
- package/sdk/src/skills/aave-v3.md +0 -134
- package/sdk/src/skills/aave-v4.md +0 -91
- package/sdk/src/skills/abracadabra.md +0 -93
- package/sdk/src/skills/across.md +0 -90
- package/sdk/src/skills/aerodrome-slipstream.md +0 -57
- package/sdk/src/skills/aevo.md +0 -58
- package/sdk/src/skills/axelar.md +0 -80
- package/sdk/src/skills/chainlink.md +0 -62
- package/sdk/src/skills/curve.md +0 -141
- package/sdk/src/skills/eigenlayer.md +0 -71
- package/sdk/src/skills/gamma.md +0 -79
- package/sdk/src/skills/harvest.md +0 -49
- package/sdk/src/skills/index.md +0 -299
- package/sdk/src/skills/kelp.md +0 -60
- package/sdk/src/skills/kyberswap.md +0 -100
- package/sdk/src/skills/loader.ts +0 -46
- package/sdk/src/skills/maker.md +0 -79
- package/sdk/src/skills/mantle-meth.md +0 -60
- package/sdk/src/skills/olympus.md +0 -46
- package/sdk/src/skills/oneinch.md +0 -64
- package/sdk/src/skills/openocean.md +0 -86
- package/sdk/src/skills/pancakeswap-v3.md +0 -104
- package/sdk/src/skills/paraswap.md +0 -67
- package/sdk/src/skills/permit2.md +0 -73
- package/sdk/src/skills/perpetual-protocol.md +0 -73
- package/sdk/src/skills/pyth.md +0 -58
- package/sdk/src/skills/reflexer.md +0 -73
- package/sdk/src/skills/safe.md +0 -56
- package/sdk/src/skills/seaport.md +0 -65
- package/sdk/src/skills/sommelier.md +0 -47
- package/sdk/src/skills/stader.md +0 -53
- package/sdk/src/skills/swell.md +0 -65
- package/sdk/src/skills/synapse.md +0 -63
- package/sdk/src/skills/synthra-v3.md +0 -57
- package/sdk/src/skills/thales.md +0 -74
- package/sdk/src/skills/tokemak.md +0 -48
- package/sdk/src/skills/uniswap-v3.md +0 -202
- package/sdk/src/skills/uniswap-v4.md +0 -125
- package/sdk/src/skills/unitflow-v3.md +0 -62
- package/sdk/src/skills/vertex.md +0 -55
- package/sdk/src/skills/wormhole.md +0 -76
- package/sdk/src/skills/zerox.md +0 -51
|
@@ -20,6 +20,14 @@
|
|
|
20
20
|
* argument below is `encodeRoute(intent.route, intent.destination)` — literally the function
|
|
21
21
|
* `routeHash` calls.
|
|
22
22
|
*
|
|
23
|
+
* THE DESTINATION SIDE (`fulfillTx`, `fulfillApprovalTxs`) is the one exception to the `bytes`
|
|
24
|
+
* rule, because the deployed `Inbox.fulfill(bytes32,Route,bytes32,bytes32)` has no `bytes` form:
|
|
25
|
+
* it takes the `Route` tuple and hashes `abi.encode(route)` itself. That is safe exactly where it
|
|
26
|
+
* applies — an EVM destination, whose route IS ABI-encoded — and the tuple handed over is
|
|
27
|
+
* `encode.ts`'s `evmRouteTuple`, the value `encodeRouteEvm` (and so `routeHash`) encodes. Verified
|
|
28
|
+
* against eco-routes `Inbox.sol` on `main` and the Base Portal (2.6), whose code carries the
|
|
29
|
+
* `fulfill` selector this ABI entry encodes.
|
|
30
|
+
*
|
|
23
31
|
* FUNDING MECHANICS (`IntentSource._fundIntent`/`_fundToken`/`_fundNative`, read verbatim):
|
|
24
32
|
* - the funder is `msg.sender` of `publishAndFund`/`fund` (a separate `funder` address exists only
|
|
25
33
|
* on the `*For` permit variants — out of scope here);
|
|
@@ -35,21 +43,42 @@
|
|
|
35
43
|
* approval is SUFFICIENT but not always CONSUMED — approving the full amount is never wrong.
|
|
36
44
|
*
|
|
37
45
|
* EVM-SOURCE GUARD: every helper here throws a named error when `intent.sourceChainId`'s kind isn't
|
|
38
|
-
* `"evm"` — these are EVM Portal calldata
|
|
39
|
-
* `
|
|
40
|
-
* supported: an EVM-sourced reward with Borsh route bytes
|
|
41
|
-
* `DepositAddress_USDCTransfer_Solana.sol` shape.
|
|
46
|
+
* `"evm"` — these are EVM Portal calldata. The Solana Portal is a separate Anchor program, in
|
|
47
|
+
* `eco/eco-routes-svm`, with its own instructions and accounts, which these helpers do not build.
|
|
48
|
+
* The DESTINATION may be `svm` and is fully supported: an EVM-sourced reward with Borsh route bytes
|
|
49
|
+
* is exactly the `DepositAddress_USDCTransfer_Solana.sol` shape.
|
|
50
|
+
*
|
|
51
|
+
* FUNDING BY TRANSFER — the default `intentSourceTxs` builds (`fundVia: "transfer"`). An intent is
|
|
52
|
+
* funded when its vault HOLDS the reward, however it got there: `IntentSource.isIntentFunded` is
|
|
53
|
+
* `rewardStatuses[hash] == Funded || _isRewardFunded(reward, vault)`, the latter a balance check per
|
|
54
|
+
* leg, and the solver validates funding with exactly that call after picking the intent up from
|
|
55
|
+
* `IntentPublished`. `withdraw` accepts an `Initial` intent and `refund` returns whatever the vault
|
|
56
|
+
* holds, so a vault paid directly pays out like one the Portal pulled into. So the funder transfers
|
|
57
|
+
* each reward token to the vault (and sends the native amount) and then calls `publish`: no approval
|
|
58
|
+
* at all, so nothing to reset for USDT and no allowance left standing. Transfer FIRST: the solver
|
|
59
|
+
* sees `IntentPublished` with the vault already funded, and a `publish` that fails leaves the funds
|
|
60
|
+
* in the vault, to be published later or refunded after the reward deadline.
|
|
61
|
+
*
|
|
62
|
+
* The vault is not read from anything the funder controls: {@link predictIntentVault} derives it
|
|
63
|
+
* offline (`vault.ts#ecoRoutesVaultConfig`, held to every deployed registry Portal), and a vault a
|
|
64
|
+
* caller read on chain (`intentVaultAddressCall`) is cross-checked against it —
|
|
65
|
+
* {@link assertIntentVault} — so a lying endpoint cannot redirect the reward. `fundVia:
|
|
66
|
+
* "publishAndFund"` keeps the approvals and `publishAndFund`: the Portal emits `IntentFunded` and
|
|
67
|
+
* records the intent `Funded`, which the solver's quote flow reads to promote quotes.
|
|
42
68
|
*/
|
|
43
|
-
import { decodeAbiParameters, encodeFunctionData } from "viem";
|
|
44
|
-
import { PortalABI } from "../protocols/eco-routes/abis.js";
|
|
69
|
+
import { concatHex, decodeAbiParameters, decodeEventLog, decodeFunctionResult, encodeAbiParameters, encodeFunctionData, getAbiItem, getAddress, keccak256, numberToHex, toEventSelector, toHex, zeroAddress, } from "viem";
|
|
70
|
+
import { PortalABI, ProverABI } from "../protocols/eco-routes/abis.js";
|
|
45
71
|
import { ERC20ABI } from "../protocols/erc20/abis.js";
|
|
46
|
-
import { denormalizeToEvm, encodeRoute, hashIntent, kindOf } from "./encode.js";
|
|
72
|
+
import { decodeRoute, denormalizeToEvm, encodeRoute, evmRouteTuple, hashIntent, kindOf, } from "./encode.js";
|
|
73
|
+
import { assertRewardAssetsDistinct } from "./intent.js";
|
|
47
74
|
import { toUniversalAddress } from "./normalize.js";
|
|
75
|
+
import { ecoRoutesVaultConfig, predictVaultAddress } from "./vault.js";
|
|
48
76
|
function assertEvmSource(intent, helper) {
|
|
49
77
|
if (kindOf(intent.sourceChainId) !== "evm") {
|
|
50
78
|
throw new Error(`portal.ts#${helper}: intent.sourceChainId (${intent.sourceChainId}) is not an EVM chain — ` +
|
|
51
|
-
`these are EVM Portal calldata helpers, and
|
|
52
|
-
|
|
79
|
+
`these are EVM Portal calldata helpers, and the Solana Portal is a separate program ` +
|
|
80
|
+
`(eco/eco-routes-svm) whose instructions they do not build. The DESTINATION may be svm; ` +
|
|
81
|
+
`only the SOURCE must be evm.`);
|
|
53
82
|
}
|
|
54
83
|
}
|
|
55
84
|
function destinationArg(intent) {
|
|
@@ -74,6 +103,7 @@ function portalAddress(target) {
|
|
|
74
103
|
/** `Portal.publish(destination, routeBytes, reward)`. `value` is always `0n`. */
|
|
75
104
|
export function publishTx(intent, target) {
|
|
76
105
|
assertEvmSource(intent, "publishTx");
|
|
106
|
+
assertRewardAssetsDistinct(intent.sourceChainId, intent.reward);
|
|
77
107
|
return {
|
|
78
108
|
to: portalAddress(target),
|
|
79
109
|
data: encodeFunctionData({
|
|
@@ -87,6 +117,7 @@ export function publishTx(intent, target) {
|
|
|
87
117
|
/** `Portal.publishAndFund(destination, routeBytes, reward, allowPartial)`. `value = reward.nativeAmount`. */
|
|
88
118
|
export function publishAndFundTx(intent, allowPartial, target) {
|
|
89
119
|
assertEvmSource(intent, "publishAndFundTx");
|
|
120
|
+
assertRewardAssetsDistinct(intent.sourceChainId, intent.reward);
|
|
90
121
|
return {
|
|
91
122
|
to: portalAddress(target),
|
|
92
123
|
data: encodeFunctionData({
|
|
@@ -100,6 +131,7 @@ export function publishAndFundTx(intent, allowPartial, target) {
|
|
|
100
131
|
/** `Portal.fund(destination, routeHash, reward, allowPartial)`. `value = reward.nativeAmount`. */
|
|
101
132
|
export function fundTx(intent, allowPartial, target) {
|
|
102
133
|
assertEvmSource(intent, "fundTx");
|
|
134
|
+
assertRewardAssetsDistinct(intent.sourceChainId, intent.reward);
|
|
103
135
|
const rHash = hashIntent(intent).routeHash;
|
|
104
136
|
return {
|
|
105
137
|
to: portalAddress(target),
|
|
@@ -124,6 +156,7 @@ export function fundTx(intent, allowPartial, target) {
|
|
|
124
156
|
*/
|
|
125
157
|
export function approvalTxs(intent, target) {
|
|
126
158
|
assertEvmSource(intent, "approvalTxs");
|
|
159
|
+
assertRewardAssetsDistinct(intent.sourceChainId, intent.reward);
|
|
127
160
|
const portal = portalAddress(target);
|
|
128
161
|
const maxByToken = new Map();
|
|
129
162
|
for (const { token, amount } of intent.reward.tokens) {
|
|
@@ -138,6 +171,72 @@ export function approvalTxs(intent, target) {
|
|
|
138
171
|
value: 0n,
|
|
139
172
|
}));
|
|
140
173
|
}
|
|
174
|
+
function assertEvmDestination(intent, helper) {
|
|
175
|
+
if (kindOf(intent.destination) !== "evm") {
|
|
176
|
+
throw new Error(`portal.ts#${helper}: intent.destination (${intent.destination}) is not an EVM chain — this ` +
|
|
177
|
+
"is the EVM Portal's fulfill calldata; a Solana destination is fulfilled through the " +
|
|
178
|
+
"Solana Portal program.");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/** The destination Portal: the one the route records, which `Inbox._fulfill` requires it to be
|
|
182
|
+
* (`route.portal != address(this)` reverts `InvalidPortal`). */
|
|
183
|
+
function destinationPortalOf(intent) {
|
|
184
|
+
return denormalizeToEvm(intent.route.portal);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* `Portal.fulfill(intentHash, route, rewardHash, claimant)` on the DESTINATION chain: what a solver
|
|
188
|
+
* sends to run an intent's route (`Inbox.fulfill`, read verbatim).
|
|
189
|
+
*
|
|
190
|
+
* - `to` is the Portal the route records — never a parameter, since any other Portal refuses it;
|
|
191
|
+
* - `route` is {@link evmRouteTuple}, the exact value `routeHash` is taken over, and `intentHash`
|
|
192
|
+
* and `rewardHash` are {@link hashIntent}'s: the Portal recomputes
|
|
193
|
+
* `keccak256(abi.encodePacked(uint64 chainid, keccak256(abi.encode(route)), rewardHash))` and
|
|
194
|
+
* refuses a mismatch with `InvalidHash`;
|
|
195
|
+
* - `value` is `route.nativeAmount` — what the route's calls spend, the Kitchen's fee for each cook
|
|
196
|
+
* among them. `_fulfill` refuses less (`InsufficientNativeAmount`) and refunds any excess.
|
|
197
|
+
*
|
|
198
|
+
* The Portal pulls each `route.tokens` entry from the solver (`safeTransferFrom(msg.sender,
|
|
199
|
+
* executor, amount)`), so the solver approves the Portal first: {@link fulfillApprovalTxs}.
|
|
200
|
+
*/
|
|
201
|
+
export function fulfillTx(intent, options) {
|
|
202
|
+
assertEvmDestination(intent, "fulfillTx");
|
|
203
|
+
const claimant = toUniversalAddress(options.claimant);
|
|
204
|
+
if (/^0x0{64}$/.test(claimant)) {
|
|
205
|
+
throw new Error("portal.ts#fulfillTx: the claimant is zero, which the Portal refuses");
|
|
206
|
+
}
|
|
207
|
+
const { intentHash, rewardHash } = hashIntent(intent);
|
|
208
|
+
return {
|
|
209
|
+
to: destinationPortalOf(intent),
|
|
210
|
+
data: encodeFunctionData({
|
|
211
|
+
abi: PortalABI,
|
|
212
|
+
functionName: "fulfill",
|
|
213
|
+
args: [intentHash, evmRouteTuple(intent.route), rewardHash, claimant],
|
|
214
|
+
}),
|
|
215
|
+
value: intent.route.nativeAmount,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The solver's approvals `fulfill` spends: one `approve(portal, amount)` per DISTINCT route token,
|
|
220
|
+
* in first-seen order, to the Portal the route records. Entries naming the same token SUM — unlike
|
|
221
|
+
* the reward's approvals ({@link approvalTxs}), which take the largest — because `_fulfill`
|
|
222
|
+
* `safeTransferFrom`s every `route.tokens` entry in turn, each spending its own share of the one
|
|
223
|
+
* allowance. A standing allowance is the caller's to read: a token like USDT refuses to move a
|
|
224
|
+
* nonzero allowance to another nonzero value, which takes an `approve(portal, 0)` first.
|
|
225
|
+
*/
|
|
226
|
+
export function fulfillApprovalTxs(intent) {
|
|
227
|
+
assertEvmDestination(intent, "fulfillApprovalTxs");
|
|
228
|
+
const portal = destinationPortalOf(intent);
|
|
229
|
+
const sumByToken = new Map();
|
|
230
|
+
for (const { token, amount } of intent.route.tokens) {
|
|
231
|
+
const evmToken = denormalizeToEvm(token);
|
|
232
|
+
sumByToken.set(evmToken, (sumByToken.get(evmToken) ?? 0n) + amount);
|
|
233
|
+
}
|
|
234
|
+
return [...sumByToken].map(([token, amount]) => ({
|
|
235
|
+
to: token,
|
|
236
|
+
data: encodeFunctionData({ abi: ERC20ABI, functionName: "approve", args: [portal, amount] }),
|
|
237
|
+
value: 0n,
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
141
240
|
function readCall(intent, target, functionName, decode) {
|
|
142
241
|
return {
|
|
143
242
|
to: portalAddress(target),
|
|
@@ -175,4 +274,484 @@ export function isIntentFundedCall(intent, target) {
|
|
|
175
274
|
return funded;
|
|
176
275
|
});
|
|
177
276
|
}
|
|
277
|
+
// ---------------------------------------------------------------------------
|
|
278
|
+
// After the fill: proving it, paying the claimant, refunding the creator, cancelling
|
|
279
|
+
// ---------------------------------------------------------------------------
|
|
280
|
+
//
|
|
281
|
+
// An intent's lifecycle past `publishAndFund` and `fulfill`, read from eco-routes v2.12.0
|
|
282
|
+
// (`ea5111ba`, whose forge build is byte-identical outside its immutables to the 2.12.0 Portal
|
|
283
|
+
// `0xEC000769…4A85` and HyperProver `0xEC08fb46…0fc5` on Base and Arbitrum; the 2.6 Portal before
|
|
284
|
+
// it dispatches the same selectors for all but `cancel` and `cancelAndProve`):
|
|
285
|
+
//
|
|
286
|
+
// DESTINATION (`Inbox.sol`)
|
|
287
|
+
// fulfillAndProve(intentHash, route, rewardHash, claimant, prover, sourceChainDomainID, data)
|
|
288
|
+
// is `_fulfill` then the proof of that one hash, in one transaction (`Inbox.sol:105-135`).
|
|
289
|
+
// prove(prover, sourceChainDomainID, intentHashes, data) (`Inbox.sol:203-289`) builds
|
|
290
|
+
// `uint64 CHAIN_ID ‖ (intentHash ‖ claimants[intentHash])…`, refusing an unrecorded hash with
|
|
291
|
+
// `IntentNotFulfilled`, and calls `IProver(prover).prove{value: address(this).balance}` —
|
|
292
|
+
// the Portal's WHOLE balance, which after a fulfill is `msg.value - route.nativeAmount`. A
|
|
293
|
+
// message-bridge prover keeps its `fetchFee` and refunds the rest to the sender
|
|
294
|
+
// (`MessageBridgeProver.prove`), so the value is `route.nativeAmount + fee`.
|
|
295
|
+
// cancel(intentHash, route, rewardHash) (`Inbox.sol:144-150, 325-347`, 2.12+) is
|
|
296
|
+
// permissionless, only STRICTLY after `route.deadline` (`RouteNotExpired`), and records
|
|
297
|
+
// `CANCELLED_CLAIMANT` in `claimants[intentHash]`: a later `fulfill` refuses the intent, and
|
|
298
|
+
// `prove` carries the sentinel to the source like any claimant. `cancelAndProve` is both in
|
|
299
|
+
// one transaction; eco-routes asks a refund service to cancel, wait for destination finality,
|
|
300
|
+
// THEN prove (`CLAUDE/specs/2026-09-24-proven-cancellation-design.md` §1, accepted risk).
|
|
301
|
+
//
|
|
302
|
+
// SOURCE (`IntentSource.sol`)
|
|
303
|
+
// withdraw(destination, routeHash, reward) (`IntentSource.sol:449-484`) is permissionless and
|
|
304
|
+
// pays the claimant the reward's PROVER records (`provenIntents(intentHash).claimant`) from
|
|
305
|
+
// the vault. It refuses a status past Funded, no proof (`InvalidClaimant`) and, 2.12+, a proven
|
|
306
|
+
// cancellation (`CancelledIntent`); a proof recorded for another destination is challenged
|
|
307
|
+
// (deleted) instead, and nothing is paid.
|
|
308
|
+
// batchWithdraw(destinations, routeHashes, rewards) is `withdraw` in a loop (`:492-506`).
|
|
309
|
+
// refund(destination, routeHash, reward) (`:514-526`) is permissionless and returns EVERYTHING
|
|
310
|
+
// the vault holds of the reward's tokens and native to `reward.creator` (`Vault.refund`) once
|
|
311
|
+
// `_validateRefund` (`:865-907`) allows it: a proven cancellation at once (2.12+); no proof,
|
|
312
|
+
// or one for another destination, from `reward.deadline` on; a real proof only after the
|
|
313
|
+
// claimant has withdrawn (the leftovers). There is no batch refund.
|
|
314
|
+
//
|
|
315
|
+
// THE PROVER
|
|
316
|
+
// provenIntents(intentHash) -> (claimant, destination) is set when the bridge delivers the
|
|
317
|
+
// destination's message (`BaseProver._processIntentProofs`); the source Portal reads it.
|
|
318
|
+
// HyperProver's `data` is `abi.encode((bytes32 sourceChainProver, bytes metadata, address
|
|
319
|
+
// hookAddr))` (`HyperProver.sol` `UnpackedData`), its domain ids Hyperlane's (an EVM chain's
|
|
320
|
+
// id), and `fetchFee(domain, encodedProofs, data)` quotes the Mailbox.
|
|
321
|
+
/** The claimant a 2.12+ destination Portal records for a CANCELLED intent:
|
|
322
|
+
* `address(uint160(uint256(keccak256("eco.portal.intent.cancelled"))))` (`types/Intent.sol`). A
|
|
323
|
+
* valid address no key controls: a source that paid it would burn the reward, which is why a
|
|
324
|
+
* cancellation may only be proven to a source whose `withdraw` refuses it (`CancelledIntent`). */
|
|
325
|
+
export const CANCELLED_CLAIMANT = getAddress(`0x${keccak256(toHex("eco.portal.intent.cancelled")).slice(-40)}`);
|
|
326
|
+
/** {@link CANCELLED_CLAIMANT} as the 32 bytes `claimants[intentHash]` holds. */
|
|
327
|
+
export const CANCELLED_CLAIMANT_BYTES32 = toUniversalAddress(CANCELLED_CLAIMANT);
|
|
328
|
+
/** `IIntentSource.Status`, in its declared order: what `getRewardStatus` returns, by index. */
|
|
329
|
+
export const REWARD_STATUSES = ["Initial", "Funded", "Withdrawn", "Refunded"];
|
|
330
|
+
function proveArgs(options) {
|
|
331
|
+
return [denormalizeToEvm(toUniversalAddress(options.prover)), options.sourceDomain];
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* `Portal.fulfillAndProve(...)` on the DESTINATION chain: {@link fulfillTx} and the proof of it in
|
|
335
|
+
* one transaction. `value` is `route.nativeAmount + fee`: `_fulfill` spends the native amount and
|
|
336
|
+
* `prove` forwards the Portal's whole remaining balance to the prover, which keeps its fee and
|
|
337
|
+
* refunds the rest to the sender.
|
|
338
|
+
*/
|
|
339
|
+
export function fulfillAndProveTx(intent, options) {
|
|
340
|
+
assertEvmDestination(intent, "fulfillAndProveTx");
|
|
341
|
+
const claimant = toUniversalAddress(options.claimant);
|
|
342
|
+
if (/^0x0{64}$/.test(claimant)) {
|
|
343
|
+
throw new Error("portal.ts#fulfillAndProveTx: the claimant is zero, which the Portal refuses");
|
|
344
|
+
}
|
|
345
|
+
const { intentHash, rewardHash } = hashIntent(intent);
|
|
346
|
+
const [prover, domain] = proveArgs(options);
|
|
347
|
+
return {
|
|
348
|
+
to: destinationPortalOf(intent),
|
|
349
|
+
data: encodeFunctionData({
|
|
350
|
+
abi: PortalABI,
|
|
351
|
+
functionName: "fulfillAndProve",
|
|
352
|
+
args: [
|
|
353
|
+
intentHash,
|
|
354
|
+
evmRouteTuple(intent.route),
|
|
355
|
+
rewardHash,
|
|
356
|
+
claimant,
|
|
357
|
+
prover,
|
|
358
|
+
domain,
|
|
359
|
+
options.data,
|
|
360
|
+
],
|
|
361
|
+
}),
|
|
362
|
+
value: intent.route.nativeAmount + options.fee,
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* `Portal.prove(prover, sourceDomain, intentHashes, data)` on the DESTINATION chain, for intents
|
|
367
|
+
* already fulfilled (or cancelled) there, all through one Portal. `value` is the fee.
|
|
368
|
+
*/
|
|
369
|
+
export function proveTx(intents, options) {
|
|
370
|
+
if (intents.length === 0)
|
|
371
|
+
throw new Error("portal.ts#proveTx: no intent to prove");
|
|
372
|
+
for (const intent of intents)
|
|
373
|
+
assertEvmDestination(intent, "proveTx");
|
|
374
|
+
const portal = destinationPortalOf(intents[0]);
|
|
375
|
+
if (intents.some((intent) => destinationPortalOf(intent) !== portal)) {
|
|
376
|
+
throw new Error("portal.ts#proveTx: the intents are fulfilled through different Portals");
|
|
377
|
+
}
|
|
378
|
+
const [prover, domain] = proveArgs(options);
|
|
379
|
+
return {
|
|
380
|
+
to: portal,
|
|
381
|
+
data: encodeFunctionData({
|
|
382
|
+
abi: PortalABI,
|
|
383
|
+
functionName: "prove",
|
|
384
|
+
args: [prover, domain, intents.map((intent) => hashIntent(intent).intentHash), options.data],
|
|
385
|
+
}),
|
|
386
|
+
value: options.fee,
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
/** `Portal.cancel(intentHash, route, rewardHash)` on the DESTINATION chain (2.12+ Portals only):
|
|
390
|
+
* permissionless once `route.deadline` has passed. Moves nothing; `value` is `0n`. */
|
|
391
|
+
export function cancelTx(intent) {
|
|
392
|
+
assertEvmDestination(intent, "cancelTx");
|
|
393
|
+
const { intentHash, rewardHash } = hashIntent(intent);
|
|
394
|
+
return {
|
|
395
|
+
to: destinationPortalOf(intent),
|
|
396
|
+
data: encodeFunctionData({
|
|
397
|
+
abi: PortalABI,
|
|
398
|
+
functionName: "cancel",
|
|
399
|
+
args: [intentHash, evmRouteTuple(intent.route), rewardHash],
|
|
400
|
+
}),
|
|
401
|
+
value: 0n,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
/** `Portal.cancelAndProve(...)` on the DESTINATION chain (2.12+): {@link cancelTx} and its proof in
|
|
405
|
+
* one transaction, `value` the fee. eco-routes asks a refund service NOT to use it before the
|
|
406
|
+
* destination is final; {@link cancelTx}, then {@link proveTx} once final, is the safe order. */
|
|
407
|
+
export function cancelAndProveTx(intent, options) {
|
|
408
|
+
assertEvmDestination(intent, "cancelAndProveTx");
|
|
409
|
+
const { intentHash, rewardHash } = hashIntent(intent);
|
|
410
|
+
const [prover, domain] = proveArgs(options);
|
|
411
|
+
return {
|
|
412
|
+
to: destinationPortalOf(intent),
|
|
413
|
+
data: encodeFunctionData({
|
|
414
|
+
abi: PortalABI,
|
|
415
|
+
functionName: "cancelAndProve",
|
|
416
|
+
args: [intentHash, evmRouteTuple(intent.route), rewardHash, prover, domain, options.data],
|
|
417
|
+
}),
|
|
418
|
+
value: options.fee,
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
function sourceArgs(intent) {
|
|
422
|
+
return [destinationArg(intent), hashIntent(intent).routeHash, rewardTupleArg(intent)];
|
|
423
|
+
}
|
|
424
|
+
/** `Portal.withdraw(destination, routeHash, reward)` on the SOURCE chain: pays the reward to the
|
|
425
|
+
* claimant the reward's prover records. Anyone may send it. `value` is `0n`. */
|
|
426
|
+
export function withdrawTx(intent, target) {
|
|
427
|
+
assertEvmSource(intent, "withdrawTx");
|
|
428
|
+
return {
|
|
429
|
+
to: portalAddress(target),
|
|
430
|
+
data: encodeFunctionData({
|
|
431
|
+
abi: PortalABI,
|
|
432
|
+
functionName: "withdraw",
|
|
433
|
+
args: sourceArgs(intent),
|
|
434
|
+
}),
|
|
435
|
+
value: 0n,
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
/** `Portal.batchWithdraw(destinations, routeHashes, rewards)` on the SOURCE chain: {@link withdrawTx}
|
|
439
|
+
* for each intent in one transaction, which reverts as a whole if any one withdrawal does. */
|
|
440
|
+
export function batchWithdrawTx(intents, target) {
|
|
441
|
+
if (intents.length === 0)
|
|
442
|
+
throw new Error("portal.ts#batchWithdrawTx: no intent to withdraw");
|
|
443
|
+
for (const intent of intents)
|
|
444
|
+
assertEvmSource(intent, "batchWithdrawTx");
|
|
445
|
+
return {
|
|
446
|
+
to: portalAddress(target),
|
|
447
|
+
data: encodeFunctionData({
|
|
448
|
+
abi: PortalABI,
|
|
449
|
+
functionName: "batchWithdraw",
|
|
450
|
+
args: [
|
|
451
|
+
intents.map(destinationArg),
|
|
452
|
+
intents.map((intent) => hashIntent(intent).routeHash),
|
|
453
|
+
intents.map(rewardTupleArg),
|
|
454
|
+
],
|
|
455
|
+
}),
|
|
456
|
+
value: 0n,
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
/** `Portal.refund(destination, routeHash, reward)` on the SOURCE chain: returns what the vault holds
|
|
460
|
+
* to `reward.creator`, when `_validateRefund` allows it. Anyone may send it. `value` is `0n`. */
|
|
461
|
+
export function refundTx(intent, target) {
|
|
462
|
+
assertEvmSource(intent, "refundTx");
|
|
463
|
+
return {
|
|
464
|
+
to: portalAddress(target),
|
|
465
|
+
data: encodeFunctionData({ abi: PortalABI, functionName: "refund", args: sourceArgs(intent) }),
|
|
466
|
+
value: 0n,
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
/** `Portal.getRewardStatus(intentHash)` on the SOURCE chain. */
|
|
470
|
+
export function rewardStatusCall(intent, target) {
|
|
471
|
+
assertEvmSource(intent, "rewardStatusCall");
|
|
472
|
+
return {
|
|
473
|
+
to: portalAddress(target),
|
|
474
|
+
data: encodeFunctionData({
|
|
475
|
+
abi: PortalABI,
|
|
476
|
+
functionName: "getRewardStatus",
|
|
477
|
+
args: [hashIntent(intent).intentHash],
|
|
478
|
+
}),
|
|
479
|
+
decode: (result) => {
|
|
480
|
+
const index = decodeFunctionResult({
|
|
481
|
+
abi: PortalABI,
|
|
482
|
+
functionName: "getRewardStatus",
|
|
483
|
+
data: result,
|
|
484
|
+
});
|
|
485
|
+
const status = REWARD_STATUSES[index];
|
|
486
|
+
if (status === undefined)
|
|
487
|
+
throw new Error(`getRewardStatus returned ${index}, not a status`);
|
|
488
|
+
return status;
|
|
489
|
+
},
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
/** What the DESTINATION Portal recorded for an intent: `claimants[intentHash]` — zero while it is
|
|
493
|
+
* neither fulfilled nor cancelled, {@link CANCELLED_CLAIMANT_BYTES32} once cancelled. */
|
|
494
|
+
export function fulfillmentCall(intent) {
|
|
495
|
+
assertEvmDestination(intent, "fulfillmentCall");
|
|
496
|
+
return {
|
|
497
|
+
to: destinationPortalOf(intent),
|
|
498
|
+
data: encodeFunctionData({
|
|
499
|
+
abi: PortalABI,
|
|
500
|
+
functionName: "claimants",
|
|
501
|
+
args: [hashIntent(intent).intentHash],
|
|
502
|
+
}),
|
|
503
|
+
decode: (result) => decodeFunctionResult({ abi: PortalABI, functionName: "claimants", data: result }),
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
/** What the reward's prover, on the SOURCE chain, has recorded for an intent: the claimant (zero
|
|
507
|
+
* while unproven) and the destination it was proven from. */
|
|
508
|
+
export function provenIntentCall(intent) {
|
|
509
|
+
assertEvmSource(intent, "provenIntentCall");
|
|
510
|
+
return {
|
|
511
|
+
to: denormalizeToEvm(intent.reward.prover),
|
|
512
|
+
data: encodeFunctionData({
|
|
513
|
+
abi: ProverABI,
|
|
514
|
+
functionName: "provenIntents",
|
|
515
|
+
args: [hashIntent(intent).intentHash],
|
|
516
|
+
}),
|
|
517
|
+
decode: (result) => {
|
|
518
|
+
const proof = decodeFunctionResult({
|
|
519
|
+
abi: ProverABI,
|
|
520
|
+
functionName: "provenIntents",
|
|
521
|
+
data: result,
|
|
522
|
+
});
|
|
523
|
+
return { claimant: getAddress(proof.claimant), destination: proof.destination };
|
|
524
|
+
},
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
/** A prover's `getProofType()`: `"Hyperlane"`, `"Polymer"`, `"LayerZero"`, `"Metalayer"`, … */
|
|
528
|
+
export function proofTypeCall(prover) {
|
|
529
|
+
return {
|
|
530
|
+
to: denormalizeToEvm(toUniversalAddress(prover)),
|
|
531
|
+
data: encodeFunctionData({ abi: ProverABI, functionName: "getProofType" }),
|
|
532
|
+
decode: (result) => decodeFunctionResult({ abi: ProverABI, functionName: "getProofType", data: result }),
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
/** The message a destination Portal's `prove` hands its prover: `uint64 destination chain id ‖
|
|
536
|
+
* (intentHash ‖ claimant)…` (`Inbox._prove`), which the source prover decodes. */
|
|
537
|
+
export function proofMessage(destinationChainId, pairs) {
|
|
538
|
+
return concatHex([
|
|
539
|
+
numberToHex(destinationChainId, { size: 8 }),
|
|
540
|
+
...pairs.flatMap((pair) => [pair.intentHash, toUniversalAddress(pair.claimant)]),
|
|
541
|
+
]);
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* A message-bridge prover's `fetchFee(sourceDomain, encodedProofs, data)` on the DESTINATION chain:
|
|
545
|
+
* the fee `prove` must forward for these pairs, `encodedProofs` being exactly the message the
|
|
546
|
+
* Portal builds ({@link proofMessage}).
|
|
547
|
+
*/
|
|
548
|
+
export function proverFeeCall(options) {
|
|
549
|
+
return {
|
|
550
|
+
to: denormalizeToEvm(toUniversalAddress(options.prover)),
|
|
551
|
+
data: encodeFunctionData({
|
|
552
|
+
abi: ProverABI,
|
|
553
|
+
functionName: "fetchFee",
|
|
554
|
+
args: [
|
|
555
|
+
options.sourceDomain,
|
|
556
|
+
proofMessage(options.destinationChainId, options.pairs),
|
|
557
|
+
options.data,
|
|
558
|
+
],
|
|
559
|
+
}),
|
|
560
|
+
decode: (result) => decodeFunctionResult({ abi: ProverABI, functionName: "fetchFee", data: result }),
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* HyperProver's message data: `abi.encode((bytes32 sourceChainProver, bytes metadata, address
|
|
565
|
+
* hookAddr))`. `sourceProver` is the reward's prover, the Hyperlane recipient on the source chain;
|
|
566
|
+
* empty `metadata` and a zero `hook` take the Mailbox's default hook and gas limit, as eco's own
|
|
567
|
+
* solver sends them.
|
|
568
|
+
*/
|
|
569
|
+
export function hyperlaneProverData(options) {
|
|
570
|
+
return encodeAbiParameters([
|
|
571
|
+
{
|
|
572
|
+
type: "tuple",
|
|
573
|
+
components: [
|
|
574
|
+
{ name: "sourceChainProver", type: "bytes32" },
|
|
575
|
+
{ name: "metadata", type: "bytes" },
|
|
576
|
+
{ name: "hookAddr", type: "address" },
|
|
577
|
+
],
|
|
578
|
+
},
|
|
579
|
+
], [
|
|
580
|
+
{
|
|
581
|
+
sourceChainProver: toUniversalAddress(options.sourceProver),
|
|
582
|
+
metadata: options.metadata ?? "0x",
|
|
583
|
+
hookAddr: options.hook ?? zeroAddress,
|
|
584
|
+
},
|
|
585
|
+
]);
|
|
586
|
+
}
|
|
587
|
+
const INTENT_PUBLISHED = toEventSelector(getAbiItem({ abi: PortalABI, name: "IntentPublished" }));
|
|
588
|
+
/**
|
|
589
|
+
* The intent an `IntentPublished` log announces, rebuilt in full: the event carries the
|
|
590
|
+
* destination, the route as the bytes the Portal hashed, and the whole reward
|
|
591
|
+
* (`IntentSource._emitIntentPublished`); the chain it was read on is the source. The rebuilt
|
|
592
|
+
* intent's hash is checked against the log's own `intentHash`, so a log the SDK would misread is
|
|
593
|
+
* refused. `undefined` when the log is not an `IntentPublished`.
|
|
594
|
+
*/
|
|
595
|
+
export function intentFromPublished(log, sourceChainId) {
|
|
596
|
+
// viem picks the event by the log's first topic, whatever `eventName` says: any other Portal
|
|
597
|
+
// event (`IntentFunded` in the same receipt) decodes too, and is not this one.
|
|
598
|
+
if (log.topics[0]?.toLowerCase() !== INTENT_PUBLISHED)
|
|
599
|
+
return undefined;
|
|
600
|
+
let decoded;
|
|
601
|
+
try {
|
|
602
|
+
decoded = decodeEventLog({
|
|
603
|
+
abi: PortalABI,
|
|
604
|
+
eventName: "IntentPublished",
|
|
605
|
+
topics: log.topics,
|
|
606
|
+
data: log.data,
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
catch {
|
|
610
|
+
return undefined;
|
|
611
|
+
}
|
|
612
|
+
if (decoded.eventName !== "IntentPublished")
|
|
613
|
+
return undefined;
|
|
614
|
+
const args = decoded.args;
|
|
615
|
+
const intent = {
|
|
616
|
+
sourceChainId,
|
|
617
|
+
destination: args.destination,
|
|
618
|
+
route: decodeRoute(args.route, Number(args.destination)),
|
|
619
|
+
reward: {
|
|
620
|
+
deadline: args.rewardDeadline,
|
|
621
|
+
creator: toUniversalAddress(args.creator),
|
|
622
|
+
prover: toUniversalAddress(args.prover),
|
|
623
|
+
nativeAmount: args.rewardNativeAmount,
|
|
624
|
+
tokens: args.rewardTokens.map((entry) => ({
|
|
625
|
+
token: toUniversalAddress(entry.token),
|
|
626
|
+
amount: entry.amount,
|
|
627
|
+
})),
|
|
628
|
+
},
|
|
629
|
+
};
|
|
630
|
+
const { intentHash } = hashIntent(intent);
|
|
631
|
+
if (intentHash !== args.intentHash.toLowerCase()) {
|
|
632
|
+
throw new Error(`portal.ts#intentFromPublished: the log's intent hashes to ${intentHash}, not the ` +
|
|
633
|
+
`${args.intentHash} it announces`);
|
|
634
|
+
}
|
|
635
|
+
return { intent, intentHash };
|
|
636
|
+
}
|
|
637
|
+
/** Every {@link IntentFundVia}, in the order a message lists them. */
|
|
638
|
+
export const INTENT_FUND_VIA = ["transfer", "publishAndFund"];
|
|
639
|
+
/**
|
|
640
|
+
* What the vault must hold: one leg per DISTINCT reward token, in first-seen order, for the largest
|
|
641
|
+
* of its amounts, then the native amount. Largest and not the sum, because
|
|
642
|
+
* `IntentSource._isRewardFunded` compares each entry against the vault's whole balance of that
|
|
643
|
+
* token — the same reason {@link approvalTxs} approves the largest. A zero leg needs nothing and is
|
|
644
|
+
* left out.
|
|
645
|
+
*/
|
|
646
|
+
export function rewardVaultLegs(intent) {
|
|
647
|
+
const largest = new Map();
|
|
648
|
+
for (const { token, amount } of intent.reward.tokens) {
|
|
649
|
+
const address = getAddress(denormalizeToEvm(token));
|
|
650
|
+
const previous = largest.get(address);
|
|
651
|
+
if (previous === undefined || amount > previous)
|
|
652
|
+
largest.set(address, amount);
|
|
653
|
+
}
|
|
654
|
+
const legs = [...largest]
|
|
655
|
+
.filter(([, amount]) => amount > 0n)
|
|
656
|
+
.map(([token, amount]) => ({ token, amount }));
|
|
657
|
+
if (intent.reward.nativeAmount > 0n)
|
|
658
|
+
legs.push({ amount: intent.reward.nativeAmount });
|
|
659
|
+
return legs;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* One leg paid into `vault`: `token.transfer(vault, amount)`, or `amount` wei sent with no data.
|
|
663
|
+
*
|
|
664
|
+
* A wallet's transaction, not a program's call, so there is no `SafeERC20` check to run on the
|
|
665
|
+
* return: a token that returns nothing (USDT) lands like any other, and one that returns `false`
|
|
666
|
+
* lands having moved nothing. What catches that is the vault's balance, not the receipt — ask
|
|
667
|
+
* `isIntentFundedCall` once the transfers have landed and before `publish` is sent, as
|
|
668
|
+
* `sauce intent publish` does. (A Pot's transfer into the vault is a program's, and is `SafeERC20`'s:
|
|
669
|
+
* `intent-sugar.ts#vaultFundingStatements`.)
|
|
670
|
+
*/
|
|
671
|
+
export function vaultTransferTx(vault, leg) {
|
|
672
|
+
const to = getAddress(denormalizeToEvm(toUniversalAddress(vault)));
|
|
673
|
+
if (leg.token === undefined)
|
|
674
|
+
return { to, data: "0x", value: leg.amount };
|
|
675
|
+
return {
|
|
676
|
+
to: leg.token,
|
|
677
|
+
data: encodeFunctionData({ abi: ERC20ABI, functionName: "transfer", args: [to, leg.amount] }),
|
|
678
|
+
value: 0n,
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
/** Every leg of {@link rewardVaultLegs} paid into `vault`, in order. */
|
|
682
|
+
export function vaultTransferTxs(intent, vault) {
|
|
683
|
+
assertEvmSource(intent, "vaultTransferTxs");
|
|
684
|
+
return rewardVaultLegs(intent).map((leg) => vaultTransferTx(vault, leg));
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* The intent's vault on `target.portal`, derived offline (`vault.ts#ecoRoutesVaultConfig`): what
|
|
688
|
+
* `Portal.intentVaultAddress` returns for an eco-routes Portal, with nothing read from a chain.
|
|
689
|
+
*/
|
|
690
|
+
export function predictIntentVault(intent, target) {
|
|
691
|
+
assertEvmSource(intent, "predictIntentVault");
|
|
692
|
+
return predictVaultAddress(hashIntent(intent).intentHash, ecoRoutesVaultConfig(target.portal));
|
|
693
|
+
}
|
|
694
|
+
/** A vault read from a chain that is not the one the SDK derives for the intent. */
|
|
695
|
+
export class IntentVaultMismatchError extends Error {
|
|
696
|
+
reported;
|
|
697
|
+
predicted;
|
|
698
|
+
constructor(reported, predicted) {
|
|
699
|
+
super(`the Portal reports the intent's vault as ${reported}, but the SDK derives ${predicted} — ` +
|
|
700
|
+
"refusing to send the reward to either. The endpoint may be answering for another chain " +
|
|
701
|
+
"or Portal, or this Portal derives its vaults some other way; fund it with fundVia " +
|
|
702
|
+
"publishAndFund instead, where the Portal moves the reward itself.");
|
|
703
|
+
this.reported = reported;
|
|
704
|
+
this.predicted = predicted;
|
|
705
|
+
this.name = "IntentVaultMismatchError";
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* `vault` — read with `intentVaultAddressCall` — checked against {@link predictIntentVault}, and
|
|
710
|
+
* returned checksummed. Throws {@link IntentVaultMismatchError} when they differ: a transfer is
|
|
711
|
+
* final, so an address two sources disagree on is not paid.
|
|
712
|
+
*/
|
|
713
|
+
export function assertIntentVault(intent, target, vault) {
|
|
714
|
+
const predicted = predictIntentVault(intent, target);
|
|
715
|
+
const reported = getAddress(denormalizeToEvm(toUniversalAddress(vault)));
|
|
716
|
+
if (reported !== predicted)
|
|
717
|
+
throw new IntentVaultMismatchError(reported, predicted);
|
|
718
|
+
return reported;
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* The source-chain transactions that fund and publish `intent` from one wallet, in the order to
|
|
722
|
+
* send them:
|
|
723
|
+
*
|
|
724
|
+
* - `fundVia: "transfer"` (default): {@link vaultTransferTxs} into the vault, then
|
|
725
|
+
* {@link publishTx};
|
|
726
|
+
* - `fundVia: "publishAndFund"`: {@link approvalTxs}, then {@link publishAndFundTx}.
|
|
727
|
+
*
|
|
728
|
+
* Pure: the caller performs any read and sends the transactions. An option the mode cannot honour
|
|
729
|
+
* (`vault` under `"publishAndFund"`, `allowPartial: true` under `"transfer"`) throws rather than
|
|
730
|
+
* being ignored.
|
|
731
|
+
*/
|
|
732
|
+
export function intentSourceTxs(intent, target, options = {}) {
|
|
733
|
+
const fundVia = options.fundVia ?? "transfer";
|
|
734
|
+
if (!INTENT_FUND_VIA.includes(fundVia)) {
|
|
735
|
+
throw new Error(`portal.ts#intentSourceTxs: fundVia '${String(fundVia)}' is not ` +
|
|
736
|
+
`${INTENT_FUND_VIA.map((via) => `"${via}"`).join(" or ")}`);
|
|
737
|
+
}
|
|
738
|
+
if (fundVia === "publishAndFund") {
|
|
739
|
+
if (options.vault !== undefined) {
|
|
740
|
+
throw new Error('portal.ts#intentSourceTxs: `vault` goes with fundVia "transfer" — under ' +
|
|
741
|
+
'"publishAndFund" the Portal finds the vault itself');
|
|
742
|
+
}
|
|
743
|
+
return [
|
|
744
|
+
...approvalTxs(intent, target),
|
|
745
|
+
publishAndFundTx(intent, options.allowPartial ?? false, target),
|
|
746
|
+
];
|
|
747
|
+
}
|
|
748
|
+
if (options.allowPartial === true) {
|
|
749
|
+
throw new Error('portal.ts#intentSourceTxs: `allowPartial` goes with fundVia "publishAndFund" — a transfer ' +
|
|
750
|
+
"pays the whole reward, and `publish` takes no such flag");
|
|
751
|
+
}
|
|
752
|
+
const vault = options.vault === undefined
|
|
753
|
+
? predictIntentVault(intent, target)
|
|
754
|
+
: assertIntentVault(intent, target, options.vault);
|
|
755
|
+
return [...vaultTransferTxs(intent, vault), publishTx(intent, target)];
|
|
756
|
+
}
|
|
178
757
|
//# sourceMappingURL=portal.js.map
|