@eco-incorp/sauce 0.99.5 → 0.99.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -16
- package/actions/action-program.schema.json +480 -379
- package/actions/dist/abis.d.ts +19 -18
- package/actions/dist/abis.d.ts.map +1 -1
- package/actions/dist/abis.js +29 -29
- package/actions/dist/compile.d.ts +4 -4
- package/actions/dist/compile.d.ts.map +1 -1
- package/actions/dist/compile.js +3 -1
- package/actions/dist/compose.d.ts +63 -6
- package/actions/dist/compose.d.ts.map +1 -1
- package/actions/dist/compose.js +100 -16
- package/actions/dist/index.d.ts +1 -1
- package/actions/dist/index.d.ts.map +1 -1
- package/actions/dist/names.d.ts +88 -0
- package/actions/dist/names.d.ts.map +1 -0
- package/actions/dist/names.js +324 -0
- package/actions/dist/program.d.ts.map +1 -1
- package/actions/dist/program.js +115 -5
- package/actions/dist/registry.d.ts +10 -8
- package/actions/dist/registry.d.ts.map +1 -1
- package/actions/dist/registry.js +10 -8
- package/actions/dist/schema.d.ts.map +1 -1
- package/actions/dist/schema.js +99 -12
- package/actions/dist/semantics.d.ts +12 -2
- package/actions/dist/semantics.d.ts.map +1 -1
- package/actions/dist/semantics.js +78 -8
- package/actions/dist/spec.d.ts +30 -0
- package/actions/dist/spec.d.ts.map +1 -1
- package/actions/dist/spec.js +151 -138
- package/actions/dist/split-swap.d.ts +10 -5
- package/actions/dist/split-swap.d.ts.map +1 -1
- package/actions/dist/split-swap.js +48 -7
- package/actions/dist/to-quote.d.ts +14 -5
- package/actions/dist/to-quote.d.ts.map +1 -1
- package/actions/dist/to-quote.js +210 -244
- package/actions/dist/to-sauce.d.ts +18 -4
- package/actions/dist/to-sauce.d.ts.map +1 -1
- package/actions/dist/to-sauce.js +232 -205
- package/actions/dist/types.d.ts +245 -147
- package/actions/dist/types.d.ts.map +1 -1
- package/actions/dist/types.js +4 -0
- package/docs/README.md +38 -0
- package/docs/api/README.md +37 -23
- package/docs/api/compiler.md +53 -12
- package/docs/api/contracts.md +105 -0
- package/docs/api/coverage.md +80 -57
- package/docs/api/router.md +238 -0
- package/docs/api/routes.md +31 -22
- package/docs/concepts/architecture.md +30 -5
- package/docs/concepts/saucescript.md +53 -56
- package/docs/examples/README.md +21 -14
- package/docs/examples/action-program.ts +51 -35
- package/docs/examples/cross-chain-cascade.sauce.ts +4 -0
- package/docs/examples/cross-chain-intent.sauce.ts +2 -1
- package/docs/examples/evm-execution.ts +2 -4
- package/docs/examples/first-intent.ts +7 -2
- package/docs/examples/pot-router.ts +19 -0
- package/docs/examples/registry-names.ts +52 -0
- package/docs/examples/router-route.sauce.ts +31 -0
- package/docs/examples/router-route.ts +72 -0
- package/docs/examples/router-swap.sauce.ts +16 -0
- package/docs/examples/router-swap.ts +47 -0
- package/docs/examples/venue-where-deployed.sauce.ts +14 -0
- package/docs/guides/actions.md +230 -120
- package/docs/guides/builders-and-actions.md +24 -15
- package/docs/guides/cli.md +1442 -0
- package/docs/guides/compiling.md +24 -10
- package/docs/guides/intents.md +260 -17
- package/docs/guides/mcp.md +539 -0
- package/docs/guides/nested-intents.md +21 -6
- package/docs/guides/protocols-and-tokens.md +235 -36
- package/docs/guides/quick-start.md +5 -0
- package/docs/guides/solana.md +199 -52
- package/docs/guides/verification.md +2 -2
- package/mcp/dist/config.js +78 -0
- package/mcp/dist/config.js.map +1 -0
- package/mcp/dist/entry.js +112 -0
- package/mcp/dist/entry.js.map +1 -0
- package/mcp/dist/files.js +64 -0
- package/mcp/dist/files.js.map +1 -0
- package/mcp/dist/guard.js +262 -0
- package/mcp/dist/guard.js.map +1 -0
- package/mcp/dist/http.js +111 -0
- package/mcp/dist/http.js.map +1 -0
- package/mcp/dist/intents.js +579 -0
- package/mcp/dist/intents.js.map +1 -0
- package/mcp/dist/prompts.js +153 -0
- package/mcp/dist/prompts.js.map +1 -0
- package/mcp/dist/reach.js +98 -0
- package/mcp/dist/reach.js.map +1 -0
- package/mcp/dist/resources.js +154 -0
- package/mcp/dist/resources.js.map +1 -0
- package/mcp/dist/sdk.js +34 -0
- package/mcp/dist/sdk.js.map +1 -0
- package/mcp/dist/server.js +119 -0
- package/mcp/dist/server.js.map +1 -0
- package/mcp/dist/setup.js +189 -0
- package/mcp/dist/setup.js.map +1 -0
- package/mcp/dist/skilltools.js +520 -0
- package/mcp/dist/skilltools.js.map +1 -0
- package/mcp/dist/terms.js +93 -0
- package/mcp/dist/terms.js.map +1 -0
- package/mcp/dist/tools.js +1497 -0
- package/mcp/dist/tools.js.map +1 -0
- package/mcp/dist/wallets.js +168 -0
- package/mcp/dist/wallets.js.map +1 -0
- package/package.json +18 -13
- package/sdk/dist/artifacts/V12Deployments.json +3 -1
- package/sdk/dist/artifacts/V12EngineGate.json +1 -2
- package/sdk/dist/artifacts/V12KitchenProxy.json +1 -0
- package/sdk/dist/chains/canonical.d.ts +15 -24
- package/sdk/dist/chains/canonical.d.ts.map +1 -1
- package/sdk/dist/chains/canonical.js +18 -29
- package/sdk/dist/chains/canonical.js.map +1 -1
- package/sdk/dist/cli/actions.d.ts +29 -0
- package/sdk/dist/cli/actions.d.ts.map +1 -0
- package/sdk/dist/cli/actions.js +122 -0
- package/sdk/dist/cli/actions.js.map +1 -0
- package/sdk/dist/cli/args.d.ts +118 -0
- package/sdk/dist/cli/args.d.ts.map +1 -0
- package/sdk/dist/cli/args.js +354 -0
- package/sdk/dist/cli/args.js.map +1 -0
- package/sdk/dist/cli/assume.d.ts +51 -0
- package/sdk/dist/cli/assume.d.ts.map +1 -0
- package/sdk/dist/cli/assume.js +207 -0
- package/sdk/dist/cli/assume.js.map +1 -0
- package/sdk/dist/cli/chain.d.ts +170 -0
- package/sdk/dist/cli/chain.d.ts.map +1 -0
- package/sdk/dist/cli/chain.js +457 -0
- package/sdk/dist/cli/chain.js.map +1 -0
- package/sdk/dist/cli/commands.d.ts +226 -0
- package/sdk/dist/cli/commands.d.ts.map +1 -0
- package/sdk/dist/cli/commands.js +637 -0
- package/sdk/dist/cli/commands.js.map +1 -0
- package/sdk/dist/cli/create.d.ts +70 -0
- package/sdk/dist/cli/create.d.ts.map +1 -0
- package/sdk/dist/cli/create.js +483 -0
- package/sdk/dist/cli/create.js.map +1 -0
- package/sdk/dist/cli/diagnostics.d.ts +12 -0
- package/sdk/dist/cli/diagnostics.d.ts.map +1 -0
- package/sdk/dist/cli/diagnostics.js +200 -0
- package/sdk/dist/cli/diagnostics.js.map +1 -0
- package/sdk/dist/cli/effects.d.ts +71 -0
- package/sdk/dist/cli/effects.d.ts.map +1 -0
- package/sdk/dist/cli/effects.js +279 -0
- package/sdk/dist/cli/effects.js.map +1 -0
- package/sdk/dist/cli/fill.d.ts +83 -0
- package/sdk/dist/cli/fill.d.ts.map +1 -0
- package/sdk/dist/cli/fill.js +734 -0
- package/sdk/dist/cli/fill.js.map +1 -0
- package/sdk/dist/cli/funding.d.ts +126 -0
- package/sdk/dist/cli/funding.d.ts.map +1 -0
- package/sdk/dist/cli/funding.js +514 -0
- package/sdk/dist/cli/funding.js.map +1 -0
- package/sdk/dist/cli/globals.d.ts +16 -0
- package/sdk/dist/cli/globals.d.ts.map +1 -0
- package/sdk/dist/cli/globals.js +197 -0
- package/sdk/dist/cli/globals.js.map +1 -0
- package/sdk/dist/cli/init.d.ts +34 -0
- package/sdk/dist/cli/init.d.ts.map +1 -0
- package/sdk/dist/cli/init.js +181 -0
- package/sdk/dist/cli/init.js.map +1 -0
- package/sdk/dist/cli/inputs.d.ts +72 -0
- package/sdk/dist/cli/inputs.d.ts.map +1 -0
- package/sdk/dist/cli/inputs.js +152 -0
- package/sdk/dist/cli/inputs.js.map +1 -0
- package/sdk/dist/cli/inspect.d.ts +48 -0
- package/sdk/dist/cli/inspect.d.ts.map +1 -0
- package/sdk/dist/cli/inspect.js +536 -0
- package/sdk/dist/cli/inspect.js.map +1 -0
- package/sdk/dist/cli/intent-commands.d.ts +71 -0
- package/sdk/dist/cli/intent-commands.d.ts.map +1 -0
- package/sdk/dist/cli/intent-commands.js +698 -0
- package/sdk/dist/cli/intent-commands.js.map +1 -0
- package/sdk/dist/cli/intent-svm.d.ts +15 -0
- package/sdk/dist/cli/intent-svm.d.ts.map +1 -0
- package/sdk/dist/cli/intent-svm.js +222 -0
- package/sdk/dist/cli/intent-svm.js.map +1 -0
- package/sdk/dist/cli/intents.d.ts +43 -0
- package/sdk/dist/cli/intents.d.ts.map +1 -0
- package/sdk/dist/cli/intents.js +89 -0
- package/sdk/dist/cli/intents.js.map +1 -0
- package/sdk/dist/cli/interactive.d.ts +11 -0
- package/sdk/dist/cli/interactive.d.ts.map +1 -0
- package/sdk/dist/cli/interactive.js +161 -0
- package/sdk/dist/cli/interactive.js.map +1 -0
- package/sdk/dist/cli/lifecycle-svm.d.ts +109 -0
- package/sdk/dist/cli/lifecycle-svm.d.ts.map +1 -0
- package/sdk/dist/cli/lifecycle-svm.js +299 -0
- package/sdk/dist/cli/lifecycle-svm.js.map +1 -0
- package/sdk/dist/cli/lifecycle.d.ts +439 -0
- package/sdk/dist/cli/lifecycle.d.ts.map +1 -0
- package/sdk/dist/cli/lifecycle.js +1721 -0
- package/sdk/dist/cli/lifecycle.js.map +1 -0
- package/sdk/dist/cli/main.d.ts +3 -0
- package/sdk/dist/cli/main.d.ts.map +1 -0
- package/sdk/dist/cli/main.js +8 -0
- package/sdk/dist/cli/main.js.map +1 -0
- package/sdk/dist/cli/mcp.d.ts +66 -0
- package/sdk/dist/cli/mcp.d.ts.map +1 -0
- package/sdk/dist/cli/mcp.js +169 -0
- package/sdk/dist/cli/mcp.js.map +1 -0
- package/sdk/dist/cli/password.d.ts +54 -0
- package/sdk/dist/cli/password.d.ts.map +1 -0
- package/sdk/dist/cli/password.js +148 -0
- package/sdk/dist/cli/password.js.map +1 -0
- package/sdk/dist/cli/policy.d.ts +130 -0
- package/sdk/dist/cli/policy.d.ts.map +1 -0
- package/sdk/dist/cli/policy.js +702 -0
- package/sdk/dist/cli/policy.js.map +1 -0
- package/sdk/dist/cli/pools.d.ts +140 -0
- package/sdk/dist/cli/pools.d.ts.map +1 -0
- package/sdk/dist/cli/pools.js +658 -0
- package/sdk/dist/cli/pools.js.map +1 -0
- package/sdk/dist/cli/price.d.ts +74 -0
- package/sdk/dist/cli/price.d.ts.map +1 -0
- package/sdk/dist/cli/price.js +321 -0
- package/sdk/dist/cli/price.js.map +1 -0
- package/sdk/dist/cli/prompt.d.ts +30 -0
- package/sdk/dist/cli/prompt.d.ts.map +1 -0
- package/sdk/dist/cli/prompt.js +53 -0
- package/sdk/dist/cli/prompt.js.map +1 -0
- package/sdk/dist/cli/publish.d.ts +48 -0
- package/sdk/dist/cli/publish.d.ts.map +1 -0
- package/sdk/dist/cli/publish.js +480 -0
- package/sdk/dist/cli/publish.js.map +1 -0
- package/sdk/dist/cli/receipt.d.ts +35 -0
- package/sdk/dist/cli/receipt.d.ts.map +1 -0
- package/sdk/dist/cli/receipt.js +63 -0
- package/sdk/dist/cli/receipt.js.map +1 -0
- package/sdk/dist/cli/rehearse.d.ts +80 -0
- package/sdk/dist/cli/rehearse.d.ts.map +1 -0
- package/sdk/dist/cli/rehearse.js +265 -0
- package/sdk/dist/cli/rehearse.js.map +1 -0
- package/sdk/dist/cli/report.d.ts +69 -0
- package/sdk/dist/cli/report.d.ts.map +1 -0
- package/sdk/dist/cli/report.js +206 -0
- package/sdk/dist/cli/report.js.map +1 -0
- package/sdk/dist/cli/returned.d.ts +16 -0
- package/sdk/dist/cli/returned.d.ts.map +1 -0
- package/sdk/dist/cli/returned.js +111 -0
- package/sdk/dist/cli/returned.js.map +1 -0
- package/sdk/dist/cli/run.d.ts +40 -0
- package/sdk/dist/cli/run.d.ts.map +1 -0
- package/sdk/dist/cli/run.js +3162 -0
- package/sdk/dist/cli/run.js.map +1 -0
- package/sdk/dist/cli/signer.d.ts +72 -0
- package/sdk/dist/cli/signer.d.ts.map +1 -0
- package/sdk/dist/cli/signer.js +243 -0
- package/sdk/dist/cli/signer.js.map +1 -0
- package/sdk/dist/cli/simulate.d.ts +11 -0
- package/sdk/dist/cli/simulate.d.ts.map +1 -0
- package/sdk/dist/cli/simulate.js +246 -0
- package/sdk/dist/cli/simulate.js.map +1 -0
- package/sdk/dist/cli/skills.d.ts +77 -0
- package/sdk/dist/cli/skills.d.ts.map +1 -0
- package/sdk/dist/cli/skills.js +527 -0
- package/sdk/dist/cli/skills.js.map +1 -0
- package/sdk/dist/cli/solana.d.ts +183 -0
- package/sdk/dist/cli/solana.d.ts.map +1 -0
- package/sdk/dist/cli/solana.js +1360 -0
- package/sdk/dist/cli/solana.js.map +1 -0
- package/sdk/dist/cli/store.d.ts +60 -0
- package/sdk/dist/cli/store.d.ts.map +1 -0
- package/sdk/dist/cli/store.js +196 -0
- package/sdk/dist/cli/store.js.map +1 -0
- package/sdk/dist/cli/support.d.ts +144 -0
- package/sdk/dist/cli/support.d.ts.map +1 -0
- package/sdk/dist/cli/support.js +217 -0
- package/sdk/dist/cli/support.js.map +1 -0
- package/sdk/dist/cli/svm-effects.d.ts +50 -0
- package/sdk/dist/cli/svm-effects.d.ts.map +1 -0
- package/sdk/dist/cli/svm-effects.js +196 -0
- package/sdk/dist/cli/svm-effects.js.map +1 -0
- package/sdk/dist/cli/terminal.d.ts +42 -0
- package/sdk/dist/cli/terminal.d.ts.map +1 -0
- package/sdk/dist/cli/terminal.js +136 -0
- package/sdk/dist/cli/terminal.js.map +1 -0
- package/sdk/dist/cli/verify.d.ts +32 -0
- package/sdk/dist/cli/verify.d.ts.map +1 -0
- package/sdk/dist/cli/verify.js +185 -0
- package/sdk/dist/cli/verify.js.map +1 -0
- package/sdk/dist/cli/wallet-commands.d.ts +59 -0
- package/sdk/dist/cli/wallet-commands.d.ts.map +1 -0
- package/sdk/dist/cli/wallet-commands.js +222 -0
- package/sdk/dist/cli/wallet-commands.js.map +1 -0
- package/sdk/dist/cli/wallet-send.d.ts +38 -0
- package/sdk/dist/cli/wallet-send.d.ts.map +1 -0
- package/sdk/dist/cli/wallet-send.js +303 -0
- package/sdk/dist/cli/wallet-send.js.map +1 -0
- package/sdk/dist/cli/wallets.d.ts +79 -0
- package/sdk/dist/cli/wallets.d.ts.map +1 -0
- package/sdk/dist/cli/wallets.js +297 -0
- package/sdk/dist/cli/wallets.js.map +1 -0
- package/sdk/dist/deployments/index.d.ts +4 -62
- package/sdk/dist/deployments/index.d.ts.map +1 -1
- package/sdk/dist/deployments/index.js +4 -84
- package/sdk/dist/deployments/index.js.map +1 -1
- package/sdk/dist/deployments/pot.d.ts +17 -7
- package/sdk/dist/deployments/pot.d.ts.map +1 -1
- package/sdk/dist/deployments/pot.js +25 -10
- package/sdk/dist/deployments/pot.js.map +1 -1
- package/sdk/dist/deployments/releases.d.ts +36 -0
- package/sdk/dist/deployments/releases.d.ts.map +1 -0
- package/sdk/dist/deployments/releases.js +61 -0
- package/sdk/dist/deployments/releases.js.map +1 -0
- package/sdk/dist/deployments/releases.json +76 -0
- package/sdk/dist/deployments/v12-addresses.d.ts +13 -0
- package/sdk/dist/deployments/v12-addresses.d.ts.map +1 -1
- package/sdk/dist/deployments/v12-addresses.js +16 -3
- package/sdk/dist/deployments/v12-addresses.js.map +1 -1
- package/sdk/dist/deposit/index.d.ts +6 -6
- package/sdk/dist/deposit/index.d.ts.map +1 -1
- package/sdk/dist/deposit/index.js +1 -1
- package/sdk/dist/deposit/index.js.map +1 -1
- package/sdk/dist/deposit/params.d.ts +4 -4
- package/sdk/dist/deposit/params.d.ts.map +1 -1
- package/sdk/dist/deposit/params.js +7 -4
- package/sdk/dist/deposit/params.js.map +1 -1
- package/sdk/dist/deposit/source.d.ts +3 -30
- package/sdk/dist/deposit/source.d.ts.map +1 -1
- package/sdk/dist/deposit/source.js +7 -83
- package/sdk/dist/deposit/source.js.map +1 -1
- package/sdk/dist/deposit/templates.d.ts +1 -2
- package/sdk/dist/deposit/templates.d.ts.map +1 -1
- package/sdk/dist/deposit/templates.js +10 -2
- package/sdk/dist/deposit/templates.js.map +1 -1
- package/sdk/dist/deposit/types.d.ts +14 -12
- package/sdk/dist/deposit/types.d.ts.map +1 -1
- package/sdk/dist/deposit/types.js +6 -0
- package/sdk/dist/deposit/types.js.map +1 -1
- package/sdk/dist/descriptors/accessors.d.ts +38 -35
- package/sdk/dist/descriptors/accessors.d.ts.map +1 -1
- package/sdk/dist/descriptors/accessors.js +16 -0
- package/sdk/dist/descriptors/accessors.js.map +1 -1
- package/sdk/dist/descriptors/call.d.ts +66 -14
- package/sdk/dist/descriptors/call.d.ts.map +1 -1
- package/sdk/dist/descriptors/call.js +94 -13
- package/sdk/dist/descriptors/call.js.map +1 -1
- package/sdk/dist/descriptors/contracts.generated.d.ts +3393 -0
- package/sdk/dist/descriptors/contracts.generated.d.ts.map +1 -0
- package/sdk/dist/descriptors/contracts.generated.js +728 -0
- package/sdk/dist/descriptors/contracts.generated.js.map +1 -0
- package/sdk/dist/descriptors/derive.d.ts +20 -11
- package/sdk/dist/descriptors/derive.d.ts.map +1 -1
- package/sdk/dist/descriptors/derive.js +68 -30
- package/sdk/dist/descriptors/derive.js.map +1 -1
- package/sdk/dist/descriptors/index.d.ts +6 -7
- package/sdk/dist/descriptors/index.d.ts.map +1 -1
- package/sdk/dist/descriptors/index.js +2 -2
- package/sdk/dist/descriptors/index.js.map +1 -1
- package/sdk/dist/descriptors/links.d.ts +23 -214
- package/sdk/dist/descriptors/links.d.ts.map +1 -1
- package/sdk/dist/descriptors/links.js +1 -232
- package/sdk/dist/descriptors/links.js.map +1 -1
- package/sdk/dist/descriptors/query.d.ts +1 -1
- package/sdk/dist/descriptors/query.d.ts.map +1 -1
- package/sdk/dist/descriptors/query.js +1 -1
- package/sdk/dist/descriptors/query.js.map +1 -1
- package/sdk/dist/descriptors/registry.d.ts +2 -5
- package/sdk/dist/descriptors/registry.d.ts.map +1 -1
- package/sdk/dist/descriptors/registry.js +11 -66
- package/sdk/dist/descriptors/registry.js.map +1 -1
- package/sdk/dist/embedded/resolve.d.ts +4 -4
- package/sdk/dist/embedded/resolve.d.ts.map +1 -1
- package/sdk/dist/embedded/resolve.js +12 -8
- package/sdk/dist/embedded/resolve.js.map +1 -1
- package/sdk/dist/embedded/skills.generated.d.ts +1 -1
- package/sdk/dist/embedded/skills.generated.d.ts.map +1 -1
- package/sdk/dist/embedded/skills.generated.js +137 -136
- package/sdk/dist/embedded/skills.generated.js.map +1 -1
- package/sdk/dist/embedded/sources.generated.d.ts.map +1 -1
- package/sdk/dist/embedded/sources.generated.js +40 -6
- package/sdk/dist/embedded/sources.generated.js.map +1 -1
- package/sdk/dist/evm/engine.d.ts +813 -10
- package/sdk/dist/evm/engine.d.ts.map +1 -1
- package/sdk/dist/evm/engine.js +127 -8
- package/sdk/dist/evm/engine.js.map +1 -1
- package/sdk/dist/index.d.ts +3 -2
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +6 -2
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/plugin/index.d.ts +3 -2
- package/sdk/dist/plugin/index.d.ts.map +1 -1
- package/sdk/dist/plugin/index.js.map +1 -1
- package/sdk/dist/price.d.ts +40 -0
- package/sdk/dist/price.d.ts.map +1 -0
- package/sdk/dist/price.js +101 -0
- package/sdk/dist/price.js.map +1 -0
- package/sdk/dist/protocols/aerodrome/abis.d.ts +76 -0
- package/sdk/dist/protocols/aerodrome/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/aerodrome/abis.js +61 -0
- package/sdk/dist/protocols/aerodrome/abis.js.map +1 -1
- package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts +70 -0
- package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/aerodrome-slipstream/abis.js +54 -0
- package/sdk/dist/protocols/aerodrome-slipstream/abis.js.map +1 -1
- package/sdk/dist/protocols/camelot/abis.d.ts +178 -0
- package/sdk/dist/protocols/camelot/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/camelot/abis.js +139 -0
- package/sdk/dist/protocols/camelot/abis.js.map +1 -1
- package/sdk/dist/protocols/cbeth/functions.d.ts +2 -2
- package/sdk/dist/protocols/cbeth/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/cbeth/functions.js +4 -6
- package/sdk/dist/protocols/cbeth/functions.js.map +1 -1
- package/sdk/dist/protocols/crvusd/functions.d.ts +2 -2
- package/sdk/dist/protocols/crvusd/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/crvusd/functions.js +6 -6
- package/sdk/dist/protocols/eco-routes/abis.d.ts +792 -50
- package/sdk/dist/protocols/eco-routes/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/abis.js +1058 -49
- package/sdk/dist/protocols/eco-routes/abis.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts +44 -61
- package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/addresses.generated.js +45 -62
- package/sdk/dist/protocols/eco-routes/addresses.generated.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/lookup.d.ts +10 -0
- package/sdk/dist/protocols/eco-routes/lookup.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/lookup.js +16 -0
- package/sdk/dist/protocols/eco-routes/lookup.js.map +1 -1
- package/sdk/dist/protocols/erc20/functions.d.ts +3 -3
- package/sdk/dist/protocols/erc20/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/erc20/functions.js +6 -9
- package/sdk/dist/protocols/erc20/functions.js.map +1 -1
- package/sdk/dist/protocols/frax/functions.d.ts +2 -2
- package/sdk/dist/protocols/frax/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/frax/functions.js +6 -6
- package/sdk/dist/protocols/gho/functions.d.ts +2 -2
- package/sdk/dist/protocols/gho/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/gho/functions.js +4 -6
- package/sdk/dist/protocols/gho/functions.js.map +1 -1
- package/sdk/dist/protocols/liquity-v2/functions.d.ts +2 -2
- package/sdk/dist/protocols/liquity-v2/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/liquity-v2/functions.js +4 -6
- package/sdk/dist/protocols/liquity-v2/functions.js.map +1 -1
- package/sdk/dist/protocols/maverick/abis.d.ts +77 -0
- package/sdk/dist/protocols/maverick/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/maverick/abis.js +58 -0
- package/sdk/dist/protocols/maverick/abis.js.map +1 -1
- package/sdk/dist/protocols/maverick/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/maverick/addresses.js +4 -0
- package/sdk/dist/protocols/maverick/addresses.js.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v2/abis.js +43 -0
- package/sdk/dist/protocols/pancakeswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v3/abis.js +56 -0
- package/sdk/dist/protocols/pancakeswap-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/permit2/abis.d.ts +113 -0
- package/sdk/dist/protocols/permit2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/permit2/abis.js +63 -0
- package/sdk/dist/protocols/permit2/abis.js.map +1 -1
- package/sdk/dist/protocols/quickswap/abis.d.ts +148 -0
- package/sdk/dist/protocols/quickswap/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/quickswap/abis.js +119 -0
- package/sdk/dist/protocols/quickswap/abis.js.map +1 -1
- package/sdk/dist/protocols/sushiswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/sushiswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/sushiswap-v2/abis.js +42 -0
- package/sdk/dist/protocols/sushiswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/synthra-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/synthra-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/synthra-v3/abis.js +55 -0
- package/sdk/dist/protocols/synthra-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/trader-joe/abis.d.ts +133 -0
- package/sdk/dist/protocols/trader-joe/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/trader-joe/abis.js +101 -0
- package/sdk/dist/protocols/trader-joe/abis.js.map +1 -1
- package/sdk/dist/protocols/trader-joe/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/trader-joe/addresses.js +5 -0
- package/sdk/dist/protocols/trader-joe/addresses.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/uniswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v2/abis.js +44 -0
- package/sdk/dist/protocols/uniswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/uniswap-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v3/abis.js +55 -0
- package/sdk/dist/protocols/uniswap-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/abis.d.ts +247 -0
- package/sdk/dist/protocols/uniswap-v4/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/abis.js +167 -0
- package/sdk/dist/protocols/uniswap-v4/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/addresses.js +50 -0
- package/sdk/dist/protocols/uniswap-v4/addresses.js.map +1 -1
- package/sdk/dist/protocols/unitflow-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/unitflow-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/unitflow-v3/abis.js +56 -0
- package/sdk/dist/protocols/unitflow-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/velodrome/abis.d.ts +76 -0
- package/sdk/dist/protocols/velodrome/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/velodrome/abis.js +61 -0
- package/sdk/dist/protocols/velodrome/abis.js.map +1 -1
- package/sdk/dist/recipes/cctp-split.sauce.ts +5 -3
- package/sdk/dist/recipes/plain-transfer.sauce.ts +5 -2
- package/sdk/dist/routes/accessor-index.d.ts +2 -2
- package/sdk/dist/routes/accessor-index.d.ts.map +1 -1
- package/sdk/dist/routes/accessor-index.js +4 -3
- package/sdk/dist/routes/accessor-index.js.map +1 -1
- package/sdk/dist/routes/ambient.d.ts +5 -0
- package/sdk/dist/routes/ambient.d.ts.map +1 -1
- package/sdk/dist/routes/ambient.js +20 -0
- package/sdk/dist/routes/ambient.js.map +1 -1
- package/sdk/dist/routes/ast-walk.d.ts +21 -3
- package/sdk/dist/routes/ast-walk.d.ts.map +1 -1
- package/sdk/dist/routes/ast-walk.js +33 -4
- package/sdk/dist/routes/ast-walk.js.map +1 -1
- package/sdk/dist/routes/available.d.ts +43 -0
- package/sdk/dist/routes/available.d.ts.map +1 -0
- package/sdk/dist/routes/available.js +230 -0
- package/sdk/dist/routes/available.js.map +1 -0
- package/sdk/dist/routes/builtins.generated.d.ts +180 -0
- package/sdk/dist/routes/builtins.generated.d.ts.map +1 -0
- package/sdk/dist/routes/builtins.generated.js +2 -0
- package/sdk/dist/routes/builtins.generated.js.map +1 -0
- package/sdk/dist/routes/chain-exports.generated.d.ts +13 -8
- package/sdk/dist/routes/chain-exports.generated.d.ts.map +1 -1
- package/sdk/dist/routes/chain-exports.generated.js.map +1 -1
- package/sdk/dist/routes/closure.d.ts.map +1 -1
- package/sdk/dist/routes/closure.js +13 -26
- package/sdk/dist/routes/closure.js.map +1 -1
- package/sdk/dist/routes/composed.d.ts.map +1 -1
- package/sdk/dist/routes/composed.js +20 -8
- package/sdk/dist/routes/composed.js.map +1 -1
- package/sdk/dist/routes/encode.d.ts +17 -0
- package/sdk/dist/routes/encode.d.ts.map +1 -1
- package/sdk/dist/routes/encode.js +14 -11
- package/sdk/dist/routes/encode.js.map +1 -1
- package/sdk/dist/routes/entry.d.ts +76 -0
- package/sdk/dist/routes/entry.d.ts.map +1 -0
- package/sdk/dist/routes/entry.js +478 -0
- package/sdk/dist/routes/entry.js.map +1 -0
- package/sdk/dist/routes/index.d.ts +21 -14
- package/sdk/dist/routes/index.d.ts.map +1 -1
- package/sdk/dist/routes/index.js +12 -9
- package/sdk/dist/routes/index.js.map +1 -1
- package/sdk/dist/routes/intent-body.d.ts +97 -0
- package/sdk/dist/routes/intent-body.d.ts.map +1 -0
- package/sdk/dist/routes/intent-body.js +441 -0
- package/sdk/dist/routes/intent-body.js.map +1 -0
- package/sdk/dist/routes/intent-dsl.d.ts +21 -6
- package/sdk/dist/routes/intent-dsl.d.ts.map +1 -1
- package/sdk/dist/routes/intent-dsl.js +34 -17
- package/sdk/dist/routes/intent-dsl.js.map +1 -1
- package/sdk/dist/routes/intent-sugar.d.ts +77 -4
- package/sdk/dist/routes/intent-sugar.d.ts.map +1 -1
- package/sdk/dist/routes/intent-sugar.js +358 -152
- package/sdk/dist/routes/intent-sugar.js.map +1 -1
- package/sdk/dist/routes/intent.d.ts +13 -1
- package/sdk/dist/routes/intent.d.ts.map +1 -1
- package/sdk/dist/routes/intent.js +37 -1
- package/sdk/dist/routes/intent.js.map +1 -1
- package/sdk/dist/routes/nest.d.ts +3 -2
- package/sdk/dist/routes/nest.d.ts.map +1 -1
- package/sdk/dist/routes/nest.js +5 -3
- package/sdk/dist/routes/nest.js.map +1 -1
- package/sdk/dist/routes/parse.d.ts +6 -0
- package/sdk/dist/routes/parse.d.ts.map +1 -0
- package/sdk/dist/routes/parse.js +39 -0
- package/sdk/dist/routes/parse.js.map +1 -0
- package/sdk/dist/routes/portal.d.ts +258 -4
- package/sdk/dist/routes/portal.d.ts.map +1 -1
- package/sdk/dist/routes/portal.js +588 -9
- package/sdk/dist/routes/portal.js.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts +71 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.js +178 -54
- package/sdk/dist/routes/protocol-rewrite.js.map +1 -1
- package/sdk/dist/routes/rs-compile.d.ts +25 -22
- package/sdk/dist/routes/rs-compile.d.ts.map +1 -1
- package/sdk/dist/routes/rs-compile.js +55 -49
- package/sdk/dist/routes/rs-compile.js.map +1 -1
- package/sdk/dist/routes/sauce-calls.d.ts +26 -12
- package/sdk/dist/routes/sauce-calls.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-calls.js +16 -23
- package/sdk/dist/routes/sauce-calls.js.map +1 -1
- package/sdk/dist/routes/sauce-route.d.ts +74 -7
- package/sdk/dist/routes/sauce-route.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-route.js +249 -96
- package/sdk/dist/routes/sauce-route.js.map +1 -1
- package/sdk/dist/routes/source-globals.d.ts +107 -0
- package/sdk/dist/routes/source-globals.d.ts.map +1 -0
- package/sdk/dist/routes/source-globals.generated.d.ts +5530 -936
- package/sdk/dist/routes/source-globals.generated.d.ts.map +1 -1
- package/sdk/dist/routes/source-globals.generated.js +3 -4
- package/sdk/dist/routes/source-globals.generated.js.map +1 -1
- package/sdk/dist/routes/source-globals.js +174 -0
- package/sdk/dist/routes/source-globals.js.map +1 -0
- package/sdk/dist/routes/stock-tokens.d.ts +69 -0
- package/sdk/dist/routes/stock-tokens.d.ts.map +1 -0
- package/sdk/dist/routes/stock-tokens.generated.d.ts +4 -0
- package/sdk/dist/routes/stock-tokens.generated.d.ts.map +1 -0
- package/sdk/dist/routes/stock-tokens.generated.js +1836 -0
- package/sdk/dist/routes/stock-tokens.generated.js.map +1 -0
- package/sdk/dist/routes/stock-tokens.js +65 -0
- package/sdk/dist/routes/stock-tokens.js.map +1 -0
- package/sdk/dist/routes/token-registry.d.ts +64 -8
- package/sdk/dist/routes/token-registry.d.ts.map +1 -1
- package/sdk/dist/routes/token-registry.js +208 -33
- package/sdk/dist/routes/token-registry.js.map +1 -1
- package/sdk/dist/routes/token-rewrite.d.ts +63 -28
- package/sdk/dist/routes/token-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/token-rewrite.js +387 -123
- package/sdk/dist/routes/token-rewrite.js.map +1 -1
- package/sdk/dist/routes/unknown-global.d.ts +32 -0
- package/sdk/dist/routes/unknown-global.d.ts.map +1 -0
- package/sdk/dist/routes/unknown-global.js +106 -0
- package/sdk/dist/routes/unknown-global.js.map +1 -0
- package/sdk/dist/routes/vault.d.ts +38 -8
- package/sdk/dist/routes/vault.d.ts.map +1 -1
- package/sdk/dist/routes/vault.js +47 -8
- package/sdk/dist/routes/vault.js.map +1 -1
- package/sdk/dist/sauce-script/builtins.d.ts +309 -0
- package/sdk/dist/sauce-script/declarations.d.ts +3 -0
- package/sdk/dist/sauce-script/declarations.d.ts.map +1 -0
- package/sdk/dist/sauce-script/declarations.js +229 -0
- package/sdk/dist/sauce-script/declarations.js.map +1 -0
- package/sdk/dist/sauce-script/index.d.ts +2714 -0
- package/sdk/dist/sauce-script/ts-plugin.cjs +85 -0
- package/sdk/dist/skills/loader.d.ts.map +1 -1
- package/sdk/dist/skills/loader.js +4 -3
- package/sdk/dist/skills/loader.js.map +1 -1
- package/sdk/dist/std/router/balancer-v2-vault.abi.json +78 -0
- package/sdk/dist/std/router/curve-cryptoswap.abi.json +29 -0
- package/sdk/dist/std/router/curve-stableswap.abi.json +29 -0
- package/sdk/dist/std/router/dodo-v2-pool.abi.json +39 -0
- package/sdk/dist/std/router/lb-pair.abi.json +55 -0
- package/sdk/dist/std/router/package.json +7 -0
- package/sdk/dist/std/router/router.evm.js +567 -0
- package/sdk/dist/std/router/sauce-router.abi.json +202 -0
- package/sdk/dist/std/router/uniswap-v2-pair.abi.json +49 -0
- package/sdk/dist/std/router/woo-pp-v2.abi.json +42 -0
- package/sdk/dist/std/token/permit2.abi.json +226 -0
- package/sdk/dist/std/token/token.evm.js +73 -0
- package/sdk/dist/std/token/token.svm.js +194 -41
- package/sdk/dist/svm/client.d.ts +62 -15
- package/sdk/dist/svm/client.d.ts.map +1 -1
- package/sdk/dist/svm/client.js +103 -42
- package/sdk/dist/svm/client.js.map +1 -1
- package/sdk/dist/svm/engine.d.ts +66 -5
- package/sdk/dist/svm/engine.d.ts.map +1 -1
- package/sdk/dist/svm/engine.js +73 -5
- package/sdk/dist/svm/engine.js.map +1 -1
- package/sdk/dist/svm/index.d.ts +2 -0
- package/sdk/dist/svm/index.d.ts.map +1 -1
- package/sdk/dist/svm/index.js +2 -0
- package/sdk/dist/svm/index.js.map +1 -1
- package/sdk/dist/svm/instructions.d.ts +72 -1
- package/sdk/dist/svm/instructions.d.ts.map +1 -1
- package/sdk/dist/svm/instructions.js +81 -2
- package/sdk/dist/svm/instructions.js.map +1 -1
- package/sdk/dist/svm/kitchen.d.ts +20 -1
- package/sdk/dist/svm/kitchen.d.ts.map +1 -1
- package/sdk/dist/svm/kitchen.js +47 -1
- package/sdk/dist/svm/kitchen.js.map +1 -1
- package/sdk/dist/svm/portal.d.ts +250 -0
- package/sdk/dist/svm/portal.d.ts.map +1 -0
- package/sdk/dist/svm/portal.js +462 -0
- package/sdk/dist/svm/portal.js.map +1 -0
- package/sdk/dist/svm/send.d.ts +18 -2
- package/sdk/dist/svm/send.d.ts.map +1 -1
- package/sdk/dist/svm/send.js +28 -3
- package/sdk/dist/svm/send.js.map +1 -1
- package/sdk/dist/svm/token-accounts.d.ts +49 -0
- package/sdk/dist/svm/token-accounts.d.ts.map +1 -0
- package/sdk/dist/svm/token-accounts.js +58 -0
- package/sdk/dist/svm/token-accounts.js.map +1 -0
- package/sdk/dist/svm/token-extensions.d.ts +18 -7
- package/sdk/dist/svm/token-extensions.d.ts.map +1 -1
- package/sdk/dist/svm/token-extensions.js +58 -5
- package/sdk/dist/svm/token-extensions.js.map +1 -1
- package/sdk/dist/token/api.d.ts +7 -4
- package/sdk/dist/token/api.d.ts.map +1 -1
- package/sdk/dist/token/api.js.map +1 -1
- package/sdk/dist/token/evm.js +2 -2
- package/sdk/dist/token/index.d.ts +4 -4
- package/sdk/dist/token/index.js +4 -4
- package/sdk/dist/token/params.js +1 -1
- package/sdk/dist/token/source.js +3 -3
- package/sdk/dist/token/source.js.map +1 -1
- package/sdk/dist/token/types.d.ts +2 -2
- package/sdk/dist/token/types.js +2 -2
- package/sdk/src/protocols/aerodrome/AerodromePoolABI.json +105 -0
- package/sdk/src/protocols/aerodrome/abis.ts +62 -0
- package/sdk/src/protocols/aerodrome-slipstream/AerodromeSlipstreamPoolABI.json +96 -0
- package/sdk/src/protocols/aerodrome-slipstream/abis.ts +55 -0
- package/sdk/src/protocols/camelot/CamelotV2FactoryABI.json +25 -0
- package/sdk/src/protocols/camelot/CamelotV2PairABI.json +109 -0
- package/sdk/src/protocols/camelot/CamelotV3FactoryABI.json +25 -0
- package/sdk/src/protocols/camelot/CamelotV3PoolABI.json +92 -0
- package/sdk/src/protocols/camelot/abis.ts +143 -0
- package/sdk/src/protocols/cbeth/functions.ts +4 -6
- package/sdk/src/protocols/crvusd/functions.ts +6 -6
- package/sdk/src/protocols/eco-routes/PortalABI.json +1448 -0
- package/sdk/src/protocols/eco-routes/ProverABI.json +162 -0
- package/sdk/src/protocols/eco-routes/abis.ts +1060 -51
- package/sdk/src/protocols/eco-routes/addresses.generated.ts +45 -62
- package/sdk/src/protocols/eco-routes/lookup.ts +18 -0
- package/sdk/src/protocols/erc20/functions.ts +6 -9
- package/sdk/src/protocols/frax/functions.ts +6 -6
- package/sdk/src/protocols/gho/functions.ts +4 -6
- package/sdk/src/protocols/liquity-v2/functions.ts +4 -6
- package/sdk/src/protocols/maverick/MaverickV2PoolABI.json +107 -0
- package/sdk/src/protocols/maverick/abis.ts +59 -0
- package/sdk/src/protocols/maverick/addresses.ts +4 -0
- package/sdk/src/protocols/pancakeswap-v2/PancakeSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/pancakeswap-v2/abis.ts +44 -0
- package/sdk/src/protocols/pancakeswap-v3/PancakeSwapV3PoolABI.json +100 -0
- package/sdk/src/protocols/pancakeswap-v3/abis.ts +57 -0
- package/sdk/src/protocols/permit2/Permit2ABI.json +154 -0
- package/sdk/src/protocols/permit2/abis.ts +63 -0
- package/sdk/src/protocols/quickswap/QuickSwapV2FactoryABI.json +25 -0
- package/sdk/src/protocols/quickswap/QuickSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/quickswap/QuickSwapV3FactoryABI.json +25 -0
- package/sdk/src/protocols/quickswap/QuickSwapV3PoolABI.json +88 -0
- package/sdk/src/protocols/quickswap/abis.ts +123 -0
- package/sdk/src/protocols/sushiswap-v2/SushiSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/sushiswap-v2/abis.ts +43 -0
- package/sdk/src/protocols/synthra-v3/SynthraV3PoolABI.json +100 -0
- package/sdk/src/protocols/synthra-v3/abis.ts +56 -0
- package/sdk/src/protocols/trader-joe/LBPairABI.json +185 -0
- package/sdk/src/protocols/trader-joe/abis.ts +102 -0
- package/sdk/src/protocols/trader-joe/addresses.ts +5 -0
- package/sdk/src/protocols/uniswap-v2/UniswapV2PairABI.json +72 -0
- package/sdk/src/protocols/uniswap-v2/abis.ts +45 -0
- package/sdk/src/protocols/uniswap-v3/UniswapV3PoolABI.json +100 -0
- package/sdk/src/protocols/uniswap-v3/abis.ts +56 -0
- package/sdk/src/protocols/uniswap-v4/UniswapV4PoolManagerABI.json +38 -0
- package/sdk/src/protocols/uniswap-v4/UniswapV4StateViewABI.json +307 -0
- package/sdk/src/protocols/uniswap-v4/abis.ts +168 -0
- package/sdk/src/protocols/uniswap-v4/addresses.ts +50 -0
- package/sdk/src/protocols/unitflow-v3/UnitFlowV3PoolABI.json +100 -0
- package/sdk/src/protocols/unitflow-v3/abis.ts +57 -0
- package/sdk/src/protocols/velodrome/VelodromePoolABI.json +105 -0
- package/sdk/src/protocols/velodrome/abis.ts +62 -0
- package/skills/sauce-actions/SKILL.md +166 -0
- package/skills/sauce-actions/examples/swap-and-supply.json +24 -0
- package/skills/sauce-actions/examples/swap-by-key.json +15 -0
- package/skills/sauce-actions/references/actions.md +731 -0
- package/skills/sauce-chains/SKILL.md +137 -0
- package/skills/sauce-chains/examples/chains.sauce.ts +25 -0
- package/skills/sauce-chains/references/arbitrum.md +158 -0
- package/skills/sauce-chains/references/arc.md +107 -0
- package/skills/sauce-chains/references/aurora.md +33 -0
- package/skills/sauce-chains/references/avalanche.md +106 -0
- package/skills/sauce-chains/references/base-stocks.md +77 -0
- package/skills/sauce-chains/references/base.md +141 -0
- package/skills/sauce-chains/references/berachain.md +33 -0
- package/skills/sauce-chains/references/blast.md +60 -0
- package/skills/sauce-chains/references/boba.md +33 -0
- package/skills/sauce-chains/references/bsc.md +97 -0
- package/skills/sauce-chains/references/celo.md +57 -0
- package/skills/sauce-chains/references/core.md +33 -0
- package/skills/sauce-chains/references/cronos.md +33 -0
- package/skills/sauce-chains/references/ethereum-stocks.md +1741 -0
- package/skills/sauce-chains/references/ethereum.md +255 -0
- package/skills/sauce-chains/references/evmos.md +33 -0
- package/skills/sauce-chains/references/fantom.md +61 -0
- package/skills/sauce-chains/references/fuse.md +33 -0
- package/skills/sauce-chains/references/gnosis.md +57 -0
- package/skills/sauce-chains/references/index.md +58 -0
- package/skills/sauce-chains/references/ink.md +55 -0
- package/skills/sauce-chains/references/kava.md +33 -0
- package/skills/sauce-chains/references/klaytn.md +33 -0
- package/skills/sauce-chains/references/linea.md +65 -0
- package/skills/sauce-chains/references/manta.md +33 -0
- package/skills/sauce-chains/references/mantle.md +33 -0
- package/skills/sauce-chains/references/metis.md +54 -0
- package/skills/sauce-chains/references/mode.md +55 -0
- package/skills/sauce-chains/references/monad.md +79 -0
- package/skills/sauce-chains/references/moonbeam.md +33 -0
- package/skills/sauce-chains/references/opbnb.md +55 -0
- package/skills/sauce-chains/references/optimism.md +123 -0
- package/skills/sauce-chains/references/plasma.md +35 -0
- package/skills/sauce-chains/references/polygon.md +123 -0
- package/skills/sauce-chains/references/pulsechain.md +33 -0
- package/skills/sauce-chains/references/ronin.md +35 -0
- package/skills/sauce-chains/references/scroll.md +62 -0
- package/skills/sauce-chains/references/sei.md +55 -0
- package/skills/sauce-chains/references/solana.md +53 -0
- package/skills/sauce-chains/references/sonic.md +57 -0
- package/skills/sauce-chains/references/unichain.md +61 -0
- package/skills/sauce-chains/references/zetachain.md +33 -0
- package/skills/sauce-chains/references/zksync.md +59 -0
- package/skills/sauce-chains/references/zora.md +57 -0
- package/skills/sauce-cli/SKILL.md +366 -0
- package/skills/sauce-cli/examples/pay.sauce.ts +23 -0
- package/skills/sauce-cli/examples/split.sauce.ts +30 -0
- package/skills/sauce-distributed-swap/SKILL.md +392 -0
- package/skills/sauce-distributed-swap/examples/distributed-swap.mts +251 -0
- package/skills/sauce-distributed-swap/examples/distributed-swap.sauce.ts +115 -0
- package/skills/sauce-examples/SKILL.md +96 -0
- package/skills/sauce-globals/SKILL.md +175 -0
- package/skills/sauce-globals/examples/globals.mts +111 -0
- package/skills/sauce-globals/examples/globals.sauce.ts +47 -0
- package/skills/sauce-globals/references/chains.md +53 -0
- package/skills/sauce-globals/references/protocols.md +405 -0
- package/skills/sauce-globals/references/stocks.md +1824 -0
- package/skills/sauce-globals/references/tokens.md +53 -0
- package/skills/sauce-intents/SKILL.md +505 -0
- package/skills/sauce-intents/examples/cross-chain.sauce.ts +37 -0
- package/skills/sauce-intents/examples/fund-by-transfer.sauce.ts +54 -0
- package/skills/sauce-intents/examples/intents.mts +343 -0
- package/skills/sauce-intents/examples/swap-on-base.sauce.ts +135 -0
- package/skills/sauce-intents/references/portal.md +77 -0
- package/skills/sauce-overview/SKILL.md +161 -0
- package/skills/sauce-protocols/SKILL.md +118 -0
- package/skills/sauce-protocols/examples/protocols.mts +77 -0
- package/skills/sauce-protocols/examples/protocols.sauce.ts +27 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/aave-v2.md +35 -17
- package/skills/sauce-protocols/references/aave-v3.md +144 -0
- package/skills/sauce-protocols/references/aave-v4.md +50 -0
- package/skills/sauce-protocols/references/abracadabra.md +72 -0
- package/skills/sauce-protocols/references/across.md +73 -0
- package/skills/sauce-protocols/references/aerodrome-slipstream.md +50 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/aerodrome.md +43 -24
- package/skills/sauce-protocols/references/aevo.md +49 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/alchemix.md +10 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/ambient.md +14 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/arbitrum-bridge.md +11 -14
- package/{sdk/src/skills → skills/sauce-protocols/references}/arrakis.md +10 -26
- package/skills/sauce-protocols/references/axelar.md +56 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/balancer-v2.md +13 -29
- package/{sdk/src/skills → skills/sauce-protocols/references}/base-bridge.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/baseswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/beefy.md +10 -30
- package/{sdk/src/skills → skills/sauce-protocols/references}/benqi.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/camelot.md +13 -27
- package/skills/sauce-protocols/references/cbeth.md +48 -0
- package/skills/sauce-protocols/references/cctp.md +47 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/celer.md +11 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/chainlink-ccip.md +11 -21
- package/skills/sauce-protocols/references/chainlink.md +47 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/circle-gateway.md +12 -38
- package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v2.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v3.md +43 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/connext.md +11 -15
- package/{sdk/src/skills → skills/sauce-protocols/references}/convex.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/cowswap.md +12 -19
- package/skills/sauce-protocols/references/crvusd.md +49 -0
- package/skills/sauce-protocols/references/curve.md +98 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/debridge.md +11 -33
- package/{sdk/src/skills → skills/sauce-protocols/references}/dodo.md +13 -18
- package/skills/sauce-protocols/references/eigenlayer.md +48 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/ens.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc20.md +18 -34
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc3156.md +10 -13
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc4626.md +11 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/ethena.md +10 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/etherfi.md +10 -32
- package/{sdk/src/skills → skills/sauce-protocols/references}/euler-v2.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/fenix.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/fluid.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/frax-ether.md +10 -26
- package/skills/sauce-protocols/references/frax.md +48 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/gains-network.md +11 -28
- package/skills/sauce-protocols/references/gamma.md +57 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/gelato.md +12 -20
- package/skills/sauce-protocols/references/gho.md +50 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v1.md +12 -34
- package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v2.md +15 -28
- package/skills/sauce-protocols/references/harvest.md +41 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/hegic.md +10 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/hop.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/hyperlane.md +11 -21
- package/skills/sauce-protocols/references/index.md +355 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/instadapp.md +10 -18
- package/skills/sauce-protocols/references/kelp.md +46 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/kim.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/kyberswap-aggregator.md +12 -35
- package/skills/sauce-protocols/references/kyberswap.md +72 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/layerbank.md +11 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/layerzero.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/level-finance.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/lido.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/lifi.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/linea-bridge.md +11 -14
- package/{sdk/src/skills → skills/sauce-protocols/references}/liquity-v1.md +10 -21
- package/skills/sauce-protocols/references/liquity-v2.md +48 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/lynex.md +12 -18
- package/skills/sauce-protocols/references/maker.md +57 -0
- package/skills/sauce-protocols/references/mantle-meth.md +43 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/maverick.md +13 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/moonwell.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/morpho-blue.md +44 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/mux-protocol.md +10 -30
- package/skills/sauce-protocols/references/olympus.md +39 -0
- package/skills/sauce-protocols/references/oneinch.md +81 -0
- package/skills/sauce-protocols/references/openocean.md +69 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/optimism-bridge.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/opyn.md +10 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/pancakeswap-v2.md +39 -41
- package/skills/sauce-protocols/references/pancakeswap-v3.md +72 -0
- package/skills/sauce-protocols/references/paraswap.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/pendle.md +47 -29
- package/skills/sauce-protocols/references/permit2.md +101 -0
- package/skills/sauce-protocols/references/perpetual-protocol.md +53 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/polygon-bridge.md +11 -17
- package/{sdk/src/skills → skills/sauce-protocols/references}/premia.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/puffer.md +10 -21
- package/skills/sauce-protocols/references/pyth.md +45 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/quickswap.md +13 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/radiant.md +11 -15
- package/{sdk/src/skills → skills/sauce-protocols/references}/ramses.md +12 -18
- package/skills/sauce-protocols/references/reflexer.md +52 -0
- package/skills/sauce-protocols/references/registry/aave-v2.md +43 -0
- package/skills/sauce-protocols/references/registry/aave-v3.md +62 -0
- package/skills/sauce-protocols/references/registry/aave-v4.md +80 -0
- package/skills/sauce-protocols/references/registry/abracadabra.md +54 -0
- package/skills/sauce-protocols/references/registry/across.md +57 -0
- package/skills/sauce-protocols/references/registry/aerodrome-slipstream.md +72 -0
- package/skills/sauce-protocols/references/registry/aerodrome.md +58 -0
- package/skills/sauce-protocols/references/registry/aevo.md +39 -0
- package/skills/sauce-protocols/references/registry/alchemix.md +46 -0
- package/skills/sauce-protocols/references/registry/ambient.md +40 -0
- package/skills/sauce-protocols/references/registry/arbitrum-bridge.md +40 -0
- package/skills/sauce-protocols/references/registry/arrakis.md +49 -0
- package/skills/sauce-protocols/references/registry/axelar.md +65 -0
- package/skills/sauce-protocols/references/registry/balancer-v2.md +50 -0
- package/skills/sauce-protocols/references/registry/base-bridge.md +42 -0
- package/skills/sauce-protocols/references/registry/baseswap.md +40 -0
- package/skills/sauce-protocols/references/registry/beefy.md +51 -0
- package/skills/sauce-protocols/references/registry/benqi.md +49 -0
- package/skills/sauce-protocols/references/registry/camelot.md +82 -0
- package/skills/sauce-protocols/references/registry/cbeth.md +43 -0
- package/skills/sauce-protocols/references/registry/cctp.md +48 -0
- package/skills/sauce-protocols/references/registry/celer.md +44 -0
- package/skills/sauce-protocols/references/registry/chainlink-ccip.md +45 -0
- package/skills/sauce-protocols/references/registry/chainlink.md +49 -0
- package/skills/sauce-protocols/references/registry/circle-gateway.md +70 -0
- package/skills/sauce-protocols/references/registry/compound-v2.md +53 -0
- package/skills/sauce-protocols/references/registry/compound-v3.md +52 -0
- package/skills/sauce-protocols/references/registry/connext.md +41 -0
- package/skills/sauce-protocols/references/registry/convex.md +51 -0
- package/skills/sauce-protocols/references/registry/cowswap.md +40 -0
- package/skills/sauce-protocols/references/registry/crvusd.md +40 -0
- package/skills/sauce-protocols/references/registry/curve.md +81 -0
- package/skills/sauce-protocols/references/registry/debridge.md +59 -0
- package/skills/sauce-protocols/references/registry/dodo.md +39 -0
- package/skills/sauce-protocols/references/registry/eco-routes.md +65 -0
- package/skills/sauce-protocols/references/registry/eigenlayer.md +58 -0
- package/skills/sauce-protocols/references/registry/ens.md +49 -0
- package/skills/sauce-protocols/references/registry/erc20.md +44 -0
- package/skills/sauce-protocols/references/registry/erc3156.md +38 -0
- package/skills/sauce-protocols/references/registry/erc4626.md +51 -0
- package/skills/sauce-protocols/references/registry/ethena.md +50 -0
- package/skills/sauce-protocols/references/registry/etherfi.md +57 -0
- package/skills/sauce-protocols/references/registry/euler-v2.md +49 -0
- package/skills/sauce-protocols/references/registry/fenix.md +39 -0
- package/skills/sauce-protocols/references/registry/fluid.md +48 -0
- package/skills/sauce-protocols/references/registry/frax-ether.md +49 -0
- package/skills/sauce-protocols/references/registry/frax.md +40 -0
- package/skills/sauce-protocols/references/registry/gains-network.md +43 -0
- package/skills/sauce-protocols/references/registry/gamma.md +56 -0
- package/skills/sauce-protocols/references/registry/gelato.md +45 -0
- package/skills/sauce-protocols/references/registry/gho.md +40 -0
- package/skills/sauce-protocols/references/registry/gmx-v1.md +59 -0
- package/skills/sauce-protocols/references/registry/gmx-v2.md +41 -0
- package/skills/sauce-protocols/references/registry/harvest.md +44 -0
- package/skills/sauce-protocols/references/registry/hegic.md +39 -0
- package/skills/sauce-protocols/references/registry/hop.md +49 -0
- package/skills/sauce-protocols/references/registry/hyperlane.md +48 -0
- package/skills/sauce-protocols/references/registry/instadapp.md +39 -0
- package/skills/sauce-protocols/references/registry/kelp.md +47 -0
- package/skills/sauce-protocols/references/registry/kim.md +39 -0
- package/skills/sauce-protocols/references/registry/kyberswap-aggregator.md +49 -0
- package/skills/sauce-protocols/references/registry/kyberswap.md +63 -0
- package/skills/sauce-protocols/references/registry/layerbank.md +54 -0
- package/skills/sauce-protocols/references/registry/layerzero.md +49 -0
- package/skills/sauce-protocols/references/registry/level-finance.md +41 -0
- package/skills/sauce-protocols/references/registry/lido.md +51 -0
- package/skills/sauce-protocols/references/registry/lifi.md +48 -0
- package/skills/sauce-protocols/references/registry/linea-bridge.md +40 -0
- package/skills/sauce-protocols/references/registry/liquity-v1.md +42 -0
- package/skills/sauce-protocols/references/registry/liquity-v2.md +40 -0
- package/skills/sauce-protocols/references/registry/lynex.md +39 -0
- package/skills/sauce-protocols/references/registry/maker.md +55 -0
- package/skills/sauce-protocols/references/registry/mantle-meth.md +48 -0
- package/skills/sauce-protocols/references/registry/maverick.md +60 -0
- package/skills/sauce-protocols/references/registry/moonwell.md +49 -0
- package/skills/sauce-protocols/references/registry/morpho-blue.md +47 -0
- package/skills/sauce-protocols/references/registry/mux-protocol.md +49 -0
- package/skills/sauce-protocols/references/registry/olympus.md +42 -0
- package/skills/sauce-protocols/references/registry/oneinch.md +45 -0
- package/skills/sauce-protocols/references/registry/openocean.md +44 -0
- package/skills/sauce-protocols/references/registry/optimism-bridge.md +42 -0
- package/skills/sauce-protocols/references/registry/opyn.md +42 -0
- package/skills/sauce-protocols/references/registry/pancakeswap-v2.md +71 -0
- package/skills/sauce-protocols/references/registry/pancakeswap-v3.md +76 -0
- package/skills/sauce-protocols/references/registry/paraswap.md +51 -0
- package/skills/sauce-protocols/references/registry/pendle.md +43 -0
- package/skills/sauce-protocols/references/registry/permit2.md +50 -0
- package/skills/sauce-protocols/references/registry/perpetual-protocol.md +49 -0
- package/skills/sauce-protocols/references/registry/polygon-bridge.md +43 -0
- package/skills/sauce-protocols/references/registry/premia.md +40 -0
- package/skills/sauce-protocols/references/registry/puffer.md +43 -0
- package/skills/sauce-protocols/references/registry/pyth.md +40 -0
- package/skills/sauce-protocols/references/registry/quickswap.md +80 -0
- package/skills/sauce-protocols/references/registry/radiant.md +41 -0
- package/skills/sauce-protocols/references/registry/ramses.md +39 -0
- package/skills/sauce-protocols/references/registry/reflexer.md +56 -0
- package/skills/sauce-protocols/references/registry/renzo.md +47 -0
- package/skills/sauce-protocols/references/registry/rocket-pool.md +49 -0
- package/skills/sauce-protocols/references/registry/sablier.md +40 -0
- package/skills/sauce-protocols/references/registry/safe.md +47 -0
- package/skills/sauce-protocols/references/registry/scroll-bridge.md +48 -0
- package/skills/sauce-protocols/references/registry/seamless.md +42 -0
- package/skills/sauce-protocols/references/registry/seaport.md +44 -0
- package/skills/sauce-protocols/references/registry/silo.md +48 -0
- package/skills/sauce-protocols/references/registry/socket.md +44 -0
- package/skills/sauce-protocols/references/registry/sommelier.md +43 -0
- package/skills/sauce-protocols/references/registry/spark.md +42 -0
- package/skills/sauce-protocols/references/registry/spookyswap.md +40 -0
- package/skills/sauce-protocols/references/registry/squid.md +45 -0
- package/skills/sauce-protocols/references/registry/stader.md +47 -0
- package/skills/sauce-protocols/references/registry/stargate.md +45 -0
- package/skills/sauce-protocols/references/registry/superfluid.md +49 -0
- package/skills/sauce-protocols/references/registry/sushiswap-v2.md +71 -0
- package/skills/sauce-protocols/references/registry/swell.md +49 -0
- package/skills/sauce-protocols/references/registry/synapse.md +46 -0
- package/skills/sauce-protocols/references/registry/syncswap.md +38 -0
- package/skills/sauce-protocols/references/registry/synthetix-v3.md +48 -0
- package/skills/sauce-protocols/references/registry/synthra-v3.md +77 -0
- package/skills/sauce-protocols/references/registry/thales.md +51 -0
- package/skills/sauce-protocols/references/registry/thena.md +39 -0
- package/skills/sauce-protocols/references/registry/thruster.md +38 -0
- package/skills/sauce-protocols/references/registry/tokemak.md +45 -0
- package/skills/sauce-protocols/references/registry/trader-joe.md +66 -0
- package/skills/sauce-protocols/references/registry/uniswap-v2.md +77 -0
- package/skills/sauce-protocols/references/registry/uniswap-v3.md +113 -0
- package/skills/sauce-protocols/references/registry/uniswap-v4.md +117 -0
- package/skills/sauce-protocols/references/registry/unitflow-v3.md +65 -0
- package/skills/sauce-protocols/references/registry/velodrome.md +58 -0
- package/skills/sauce-protocols/references/registry/venus.md +62 -0
- package/skills/sauce-protocols/references/registry/vertex.md +46 -0
- package/skills/sauce-protocols/references/registry/wormhole.md +59 -0
- package/skills/sauce-protocols/references/registry/yearn-v3.md +46 -0
- package/skills/sauce-protocols/references/registry/zerolend.md +41 -0
- package/skills/sauce-protocols/references/registry/zerox.md +44 -0
- package/skills/sauce-protocols/references/registry/zksync-bridge.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/renzo.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/rocket-pool.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/sablier.md +10 -27
- package/skills/sauce-protocols/references/safe.md +42 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/scroll-bridge.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/seamless.md +11 -16
- package/skills/sauce-protocols/references/seaport.md +38 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/silo.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/socket.md +11 -18
- package/skills/sauce-protocols/references/sommelier.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/spark.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/spookyswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/squid.md +11 -21
- package/skills/sauce-protocols/references/stader.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/stargate.md +11 -22
- package/{sdk/src/skills → skills/sauce-protocols/references}/superfluid.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/sushiswap-v2.md +38 -43
- package/skills/sauce-protocols/references/swell.md +49 -0
- package/skills/sauce-protocols/references/synapse.md +54 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/syncswap.md +12 -17
- package/{sdk/src/skills → skills/sauce-protocols/references}/synthetix-v3.md +10 -29
- package/skills/sauce-protocols/references/synthra-v3.md +63 -0
- package/skills/sauce-protocols/references/thales.md +58 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/thena.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/thruster.md +13 -18
- package/skills/sauce-protocols/references/tokemak.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/trader-joe.md +13 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/uniswap-v2.md +46 -44
- package/skills/sauce-protocols/references/uniswap-v3.md +188 -0
- package/skills/sauce-protocols/references/uniswap-v4.md +155 -0
- package/skills/sauce-protocols/references/unitflow-v3.md +63 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/velodrome.md +12 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/venus.md +12 -31
- package/skills/sauce-protocols/references/vertex.md +42 -0
- package/skills/sauce-protocols/references/wormhole.md +57 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/yearn-v3.md +10 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/zerolend.md +11 -15
- package/skills/sauce-protocols/references/zerox.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/zksync-bridge.md +11 -14
- package/skills/sauce-script/SKILL.md +407 -0
- package/skills/sauce-script/examples/IOracle.json +12 -0
- package/skills/sauce-script/examples/saucescript.mts +167 -0
- package/skills/sauce-script/examples/twap.sauce.ts +29 -0
- package/skills/sauce-script/references/builtins.json +823 -0
- package/skills/sauce-script/references/builtins.md +674 -0
- package/skills/sauce-solana/SKILL.md +322 -0
- package/skills/sauce-solana/examples/solana.mts +166 -0
- package/skills/sauce-solana/examples/solana.sauce.ts +45 -0
- package/skills/sauce-solana/examples/token-2022.sauce.ts +38 -0
- package/skills/sauce-swaps/SKILL.md +200 -0
- package/skills/sauce-swaps/examples/swap-leg.sauce.ts +50 -0
- package/skills/sauce-swaps/examples/swaps.mts +124 -0
- package/skills/sauce-typescript/SKILL.md +178 -0
- package/skills/sauce-typescript/examples/actions.mts +100 -0
- package/skills/sauce-typescript/examples/compiler.mts +69 -0
- package/skills/sauce-typescript/examples/cook.mts +65 -0
- package/skills/sauce-typescript/examples/verify.mts +104 -0
- package/dev-tools/README.md +0 -16
- package/dev-tools/artifacts/IERC20.json +0 -1
- package/dev-tools/artifacts/ISauceRouter.json +0 -1
- package/dev-tools/artifacts/IUniswapV3Pool.json +0 -1
- package/dev-tools/artifacts/Router.json +0 -1
- package/dev-tools/hardhat.config.cjs +0 -18
- package/dev-tools/sauce/js/add.js +0 -4
- package/dev-tools/sauce/js/call.js +0 -8
- package/dev-tools/sauce/js/erc20.js +0 -18
- package/dev-tools/sauce/js/example.js +0 -6
- package/dev-tools/sauce/js/fibonacci.js +0 -13
- package/dev-tools/sauce/ts/add.ts +0 -4
- package/dev-tools/sauce/ts/call.ts +0 -8
- package/dev-tools/sauce/ts/erc20.ts +0 -18
- package/dev-tools/sauce/ts/example.ts +0 -6
- package/dev-tools/sauce/ts/fibonacci.ts +0 -13
- package/dev-tools/sauce/ts/saucescript.d.ts +0 -1
- package/dev-tools/sauce/ts/tsconfig.json +0 -12
- package/dev-tools/scripts/deploy.ts +0 -107
- package/dev-tools/scripts/init.js +0 -132
- package/dev-tools/scripts/run.ts +0 -67
- package/dev-tools/scripts/start-fork.sh +0 -92
- package/dev-tools/scripts/start-local.sh +0 -120
- package/dev-tools/scripts/stop-local.sh +0 -40
- package/dev-tools/scripts/sync-artifacts.js +0 -46
- package/dev-tools/scripts/sync-price.ts +0 -58
- package/dev-tools/src/contracts.ts +0 -59
- package/dev-tools/src/runner.ts +0 -355
- package/dev-tools/src/svm-local.ts +0 -305
- package/dev-tools/src/sync-price.ts +0 -217
- package/sdk/dist/deployments/v12.generated.d.ts +0 -95
- package/sdk/dist/deployments/v12.generated.d.ts.map +0 -1
- package/sdk/dist/deployments/v12.generated.js +0 -50
- package/sdk/dist/deployments/v12.generated.js.map +0 -1
- package/sdk/dist/swap/index.d.ts +0 -29
- package/sdk/dist/swap/index.d.ts.map +0 -1
- package/sdk/dist/swap/index.js +0 -27
- package/sdk/dist/swap/index.js.map +0 -1
- package/sdk/dist/swap/params.d.ts +0 -29
- package/sdk/dist/swap/params.d.ts.map +0 -1
- package/sdk/dist/swap/params.js +0 -123
- package/sdk/dist/swap/params.js.map +0 -1
- package/sdk/dist/swap/source.d.ts +0 -30
- package/sdk/dist/swap/source.d.ts.map +0 -1
- package/sdk/dist/swap/source.js +0 -101
- package/sdk/dist/swap/source.js.map +0 -1
- package/sdk/dist/swap/types.d.ts +0 -160
- package/sdk/dist/swap/types.d.ts.map +0 -1
- package/sdk/dist/swap/types.js +0 -106
- package/sdk/dist/swap/types.js.map +0 -1
- package/sdk/src/skills/aave-v3.md +0 -134
- package/sdk/src/skills/aave-v4.md +0 -91
- package/sdk/src/skills/abracadabra.md +0 -93
- package/sdk/src/skills/across.md +0 -90
- package/sdk/src/skills/aerodrome-slipstream.md +0 -57
- package/sdk/src/skills/aevo.md +0 -58
- package/sdk/src/skills/axelar.md +0 -80
- package/sdk/src/skills/cbeth.md +0 -62
- package/sdk/src/skills/chainlink.md +0 -62
- package/sdk/src/skills/crvusd.md +0 -58
- package/sdk/src/skills/curve.md +0 -141
- package/sdk/src/skills/eigenlayer.md +0 -71
- package/sdk/src/skills/frax.md +0 -57
- package/sdk/src/skills/gamma.md +0 -79
- package/sdk/src/skills/gho.md +0 -61
- package/sdk/src/skills/harvest.md +0 -49
- package/sdk/src/skills/index.md +0 -299
- package/sdk/src/skills/kelp.md +0 -60
- package/sdk/src/skills/kyberswap.md +0 -100
- package/sdk/src/skills/liquity-v2.md +0 -59
- package/sdk/src/skills/loader.ts +0 -46
- package/sdk/src/skills/maker.md +0 -79
- package/sdk/src/skills/mantle-meth.md +0 -60
- package/sdk/src/skills/olympus.md +0 -46
- package/sdk/src/skills/oneinch.md +0 -64
- package/sdk/src/skills/openocean.md +0 -86
- package/sdk/src/skills/pancakeswap-v3.md +0 -104
- package/sdk/src/skills/paraswap.md +0 -67
- package/sdk/src/skills/permit2.md +0 -73
- package/sdk/src/skills/perpetual-protocol.md +0 -73
- package/sdk/src/skills/pyth.md +0 -58
- package/sdk/src/skills/reflexer.md +0 -73
- package/sdk/src/skills/safe.md +0 -56
- package/sdk/src/skills/seaport.md +0 -65
- package/sdk/src/skills/sommelier.md +0 -47
- package/sdk/src/skills/stader.md +0 -53
- package/sdk/src/skills/swell.md +0 -65
- package/sdk/src/skills/synapse.md +0 -63
- package/sdk/src/skills/synthra-v3.md +0 -57
- package/sdk/src/skills/thales.md +0 -74
- package/sdk/src/skills/tokemak.md +0 -48
- package/sdk/src/skills/uniswap-v3.md +0 -202
- package/sdk/src/skills/uniswap-v4.md +0 -125
- package/sdk/src/skills/unitflow-v3.md +0 -62
- package/sdk/src/skills/vertex.md +0 -55
- package/sdk/src/skills/wormhole.md +0 -76
- package/sdk/src/skills/zerox.md +0 -51
package/actions/dist/spec.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
// ---- field kinds ----------------------------------------------------------------------------
|
|
2
2
|
const address = { k: "address" };
|
|
3
|
+
/** A token: a registry symbol or an address. */
|
|
4
|
+
const token = { k: "token" };
|
|
5
|
+
/** A token, or `"native"` for the chain's native currency where the venue takes it. */
|
|
6
|
+
const tokenOrNative = { k: "token", native: true };
|
|
7
|
+
/** A protocol contract: a namespace reference or an address. */
|
|
8
|
+
const contract = { k: "contract" };
|
|
9
|
+
/** A token that is its own contract: a symbol, a namespace reference or an address. */
|
|
10
|
+
const tokenContract = { k: "tokenContract" };
|
|
3
11
|
const recipient = { k: "recipient" };
|
|
4
12
|
const remoteRecipient = { k: "remoteRecipient" };
|
|
5
13
|
const uint256 = { k: "uint", bits: 256 };
|
|
@@ -22,92 +30,118 @@ const bridge = spec("bridge", { output: "passThrough" });
|
|
|
22
30
|
const wrap = spec("wrap", { output: "realized" });
|
|
23
31
|
const stake = spec("stake", { output: "realized" });
|
|
24
32
|
const lending = spec("lending", { output: "passThrough" });
|
|
25
|
-
const
|
|
33
|
+
const tokens = spec("token", { output: "passThrough" });
|
|
26
34
|
const source = spec("source", { output: "value" });
|
|
35
|
+
/** Where a pool given by its key is found, said once for every swap that takes one. */
|
|
36
|
+
const BY_KEY = "the program reads it from the factory on chain and reverts if there is none";
|
|
27
37
|
const SPECS = [
|
|
28
|
-
// -- swaps
|
|
29
|
-
swap("
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
// -- swaps through @sauce/router ------------------------------------------------------------
|
|
39
|
+
swap("uniswapV2Swap", "Swaps through one Uniswap V2 pair (or a fork's), priced from its reserves and paid by a push.", "@sauce/router uniswapV2: pair.getReserves, an ERC-20 transfer to the pair, pair.swap", {
|
|
40
|
+
pool: opt(contract, "the pair; or leave it out and give `factory`"),
|
|
41
|
+
factory: opt(contract, `instead of \`pool\`: a Uniswap V2-style factory ("UniswapV2.Factory"), whose ` +
|
|
42
|
+
`getPair(tokenIn, tokenOut) is the pair; ${BY_KEY}`),
|
|
43
|
+
tokenIn: f(token, "the token sold, pushed to the pair"),
|
|
44
|
+
tokenOut: f(token, "the token bought; the direction is the pair's sort order"),
|
|
45
|
+
feePpm: opt(int(0, 999_999), "the pair's LP fee in parts per million; absent or 0 is 3000 (0.30%), PancakeSwap V2 is 2500"),
|
|
34
46
|
amountOutMin: MIN_OUT,
|
|
35
|
-
sqrtPriceLimitX96: opt(uint160, "a price limit; absent or 0 for none"),
|
|
36
47
|
recipient: RECIPIENT,
|
|
48
|
+
}, { oneOf: [["pool"], ["factory"]] }),
|
|
49
|
+
swap("uniswapV3Swap", "Swaps through one Uniswap V3 pool (or a fork's), through the Pot's Router, which answers its callback.", "@sauce/router uniswapV3: Router.swapV3", {
|
|
50
|
+
pool: opt(contract, "the pool; or leave it out and give `factory` with `fee` or `tickSpacing`"),
|
|
51
|
+
factory: opt(contract, "instead of `pool`: the factory whose getPool(tokenIn, tokenOut, key) is the pool — a " +
|
|
52
|
+
'Uniswap V3-style factory with `fee` ("UniswapV3.Factory", "PancakeswapV3.Factory"), or ' +
|
|
53
|
+
`Aerodrome Slipstream's with \`tickSpacing\` ("AerodromeSlipstream.CLFactory"); ${BY_KEY}`),
|
|
54
|
+
fee: opt(uintN(24), "with `factory`: the pool's fee tier, in hundredths of a bip (500 is 0.05%)"),
|
|
55
|
+
tickSpacing: opt(int(1, 8_388_607), "with a Slipstream `factory`: the pool's tick spacing"),
|
|
56
|
+
tokenIn: f(token, "the token sold"),
|
|
57
|
+
tokenOut: f(token, "the token bought"),
|
|
58
|
+
sqrtPriceLimitX96: opt(uint160, "a price at which the swap stops, leaving the rest of the input in the Pot; absent or 0 for none"),
|
|
59
|
+
amountOutMin: MIN_OUT,
|
|
60
|
+
recipient: RECIPIENT,
|
|
61
|
+
}, { oneOf: [["pool"], ["factory", "fee"], ["factory", "tickSpacing"]] }),
|
|
62
|
+
swap("uniswapV4Swap", "Swaps through one Uniswap V4 pool, named by its key, through the Pot's Router, which settles " +
|
|
63
|
+
"with the PoolManager.", "@sauce/router uniswapV4: Router.swapV4", {
|
|
64
|
+
poolManager: f(contract, 'the PoolManager ("UniswapV4.PoolManager")'),
|
|
65
|
+
tokenIn: f(tokenOrNative, 'the token sold; "native" is the native currency'),
|
|
66
|
+
tokenOut: f(tokenOrNative, 'the token bought; "native" is the native currency'),
|
|
67
|
+
fee: f(uintN(24), "the pool key's fee, in hundredths of a bip"),
|
|
68
|
+
tickSpacing: f(int(1, 32767), "the pool key's tick spacing"),
|
|
69
|
+
hooks: opt(contract, "the pool key's hooks contract; absent for a pool with none"),
|
|
70
|
+
sqrtPriceLimitX96: opt(uint160, "a price at which the swap stops, leaving the rest of the input in the Pot; absent or 0 for none"),
|
|
71
|
+
amountOutMin: MIN_OUT,
|
|
72
|
+
recipient: RECIPIENT,
|
|
73
|
+
}),
|
|
74
|
+
swap("curveSwap", "Swaps through a Curve pool's 4-argument `exchange`, approving exactly the input; the output " +
|
|
75
|
+
"is a balance delta.", "@sauce/router curve: an exact ERC-20 approval, then pool.exchange(int128|uint256 i, j, dx, min_dy)", {
|
|
76
|
+
pool: f(contract, "the Curve pool"),
|
|
77
|
+
tokenIn: f(token, "the token sold, approved to the pool for exactly the amount"),
|
|
78
|
+
tokenOut: f(token, "the token bought, whose balance delta is the output"),
|
|
79
|
+
i: f(int(0, 7), "the pool index of the coin sold"),
|
|
80
|
+
j: f(int(0, 7), "the pool index of the coin bought"),
|
|
81
|
+
indexType: f({ k: "enum", values: ["int128", "uint256"] }, "the pool's index type: int128 for StableSwap and NG pools, uint256 for CryptoSwap"),
|
|
82
|
+
amountOutMin: MIN_OUT,
|
|
83
|
+
recipient: f(recipient, `${RECIPIENT.doc}; the pool pays the Pot, which forwards it with a transfer`),
|
|
37
84
|
}),
|
|
38
|
-
swap("
|
|
39
|
-
|
|
40
|
-
|
|
85
|
+
swap("balancerV2Swap", "Swaps through one Balancer V2 pool, approving the Vault for exactly the input.", "@sauce/router balancerV2: an exact ERC-20 approval, then Vault.swap (GIVEN_IN)", {
|
|
86
|
+
vault: f(contract, "the Balancer V2 Vault"),
|
|
87
|
+
poolId: f(bytes32, "the pool id"),
|
|
88
|
+
tokenIn: f(token, "the token sold, approved to the Vault for exactly the amount"),
|
|
89
|
+
tokenOut: f(token, "the token bought"),
|
|
41
90
|
amountOutMin: MIN_OUT,
|
|
42
91
|
recipient: RECIPIENT,
|
|
43
92
|
}),
|
|
44
|
-
swap("
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
fee: f(uintN(24), "the pool fee, in hundredths of a bip"),
|
|
52
|
-
tickSpacing: f(int(1, 32767), "the pool's tick spacing"),
|
|
53
|
-
hooks: f(address, "the pool's hooks contract, or the zero address"),
|
|
54
|
-
},
|
|
55
|
-
}, "the V4 pool key"),
|
|
56
|
-
zeroForOne: f(bool, "true sells currency0 for currency1"),
|
|
57
|
-
amountOutMin: f(uint128, "the least output accepted; the router reverts below it"),
|
|
93
|
+
swap("dodoV2Swap", "Swaps through one DODO V2 pool (DVM, DPP or DSP), paid by a push.", "@sauce/router dodoV2: an ERC-20 transfer to the pool, then sellBase(to) or sellQuote(to)", {
|
|
94
|
+
pool: f(contract, "the pool"),
|
|
95
|
+
tokenIn: f(token, "the token sold, pushed to the pool"),
|
|
96
|
+
tokenOut: f(token, "the token bought"),
|
|
97
|
+
baseToken: f(token, "the pool's base token; tokenIn and tokenOut must be base and quote"),
|
|
98
|
+
quoteToken: f(token, "the pool's quote token"),
|
|
99
|
+
amountOutMin: MIN_OUT,
|
|
58
100
|
recipient: RECIPIENT,
|
|
59
101
|
}),
|
|
60
|
-
swap("
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
102
|
+
swap("traderJoeLBSwap", "Swaps through one Trader Joe Liquidity Book pair, paid by a push.", "@sauce/router traderJoeLB: an ERC-20 transfer to the pair, then pair.swap(swapForY, to)", {
|
|
103
|
+
pool: opt(contract, "the pair; or leave it out and give `factory` with `binStep`"),
|
|
104
|
+
factory: opt(contract, 'instead of `pool`: the LBFactory ("TraderJoe.LBFactory"), whose ' +
|
|
105
|
+
`getLBPairInformation(tokenIn, tokenOut, binStep) names the pair; ${BY_KEY}`),
|
|
106
|
+
binStep: opt(int(1, 65_535), "with `factory`: the pair's bin step"),
|
|
107
|
+
tokenIn: f(token, "the token sold, pushed to the pair"),
|
|
108
|
+
tokenOut: f(token, "the token bought"),
|
|
109
|
+
tokenX: opt(token, "the pair's token X; tokenIn and tokenOut must be X and Y. Leave tokenX and tokenY out " +
|
|
110
|
+
"to read them from the pair"),
|
|
111
|
+
tokenY: opt(token, "the pair's token Y"),
|
|
112
|
+
amountOutMin: MIN_OUT,
|
|
113
|
+
recipient: RECIPIENT,
|
|
114
|
+
}, { oneOf: [["pool"], ["factory", "binStep"]], together: [["tokenX", "tokenY"]] }),
|
|
115
|
+
swap("woofiSwap", "Swaps through WOOFi's WooPPV2, paid by a push.", "@sauce/router woofi: an ERC-20 transfer to the pool, then WooPPV2.swap", {
|
|
116
|
+
pool: f(contract, "the WooPPV2 itself, not the WooRouterV2"),
|
|
117
|
+
tokenIn: f(token, "the token sold, pushed to the pool"),
|
|
118
|
+
tokenOut: f(token, "the token bought"),
|
|
119
|
+
amountOutMin: f(uint256, "the least output accepted, as the pool's own minToAmount; required and positive, because the pool prices from an oracle"),
|
|
77
120
|
recipient: RECIPIENT,
|
|
78
121
|
}),
|
|
79
|
-
swap("
|
|
80
|
-
pool: f(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
j: f(int(0, 7), "the pool index of the coin bought"),
|
|
122
|
+
swap("maverickV2Swap", "Swaps through one Maverick V2 pool, through the Pot's Router, which pays what the pool asks for.", "@sauce/router maverickV2: Router.swap", {
|
|
123
|
+
pool: f(contract, "the pool"),
|
|
124
|
+
tokenIn: f(token, "the token sold"),
|
|
125
|
+
tokenOut: f(token, "the token bought"),
|
|
84
126
|
amountOutMin: MIN_OUT,
|
|
85
|
-
recipient:
|
|
127
|
+
recipient: RECIPIENT,
|
|
86
128
|
}),
|
|
129
|
+
// -- swaps at venues @sauce/router does not cover -------------------------------------------
|
|
87
130
|
swap("curveRouterNGSwap", "Swaps along a Curve RouterNG route of up to five hops.", "RouterNG.exchange(address[11],uint256[5][5],uint256,uint256,address[5],address)", {
|
|
88
|
-
router: f(
|
|
89
|
-
route: f({ k: "array", of:
|
|
131
|
+
router: f(contract, "the Curve RouterNG"),
|
|
132
|
+
route: f({ k: "array", of: tokenContract, min: 1, max: 11 }, "the route, tokens and pools alternating; padded to 11 with zero addresses"),
|
|
90
133
|
swapParams: f({
|
|
91
134
|
k: "array",
|
|
92
135
|
min: 1,
|
|
93
136
|
max: 5,
|
|
94
137
|
of: { k: "tuple", of: [int(0, 255), int(0, 255), int(0, 255), int(0, 255), int(0, 255)] },
|
|
95
138
|
}, "per hop: [i, j, swap_type, pool_type, n_coins]; padded to 5 rows"),
|
|
96
|
-
pools: f({ k: "array", of:
|
|
139
|
+
pools: f({ k: "array", of: contract, max: 5 }, "a zap pool where a hop needs one; padded to 5"),
|
|
97
140
|
amountOutMin: MIN_OUT,
|
|
98
141
|
recipient: RECIPIENT,
|
|
99
142
|
}),
|
|
100
|
-
swap("balancerV2Swap", "Swaps through one Balancer V2 pool.", "Vault.swap", {
|
|
101
|
-
vault: f(address, "the Balancer V2 Vault"),
|
|
102
|
-
poolId: f(bytes32, "the pool id"),
|
|
103
|
-
tokenIn: f(address, "the token sold"),
|
|
104
|
-
tokenOut: f(address, "the token bought"),
|
|
105
|
-
amountOutMin: MIN_OUT,
|
|
106
|
-
recipient: RECIPIENT,
|
|
107
|
-
deadline: DEADLINE,
|
|
108
|
-
}),
|
|
109
143
|
swap("balancerV2BatchSwap", "Swaps along Balancer V2 pools in one batch; the output is a balance delta.", "Vault.batchSwap", {
|
|
110
|
-
vault: f(
|
|
144
|
+
vault: f(contract, "the Balancer V2 Vault"),
|
|
111
145
|
steps: f({
|
|
112
146
|
k: "array",
|
|
113
147
|
min: 1,
|
|
@@ -121,32 +155,25 @@ const SPECS = [
|
|
|
121
155
|
},
|
|
122
156
|
},
|
|
123
157
|
}, "the batch's steps; the last step's output asset is the output"),
|
|
124
|
-
assets: f({ k: "array", of:
|
|
158
|
+
assets: f({ k: "array", of: tokenOrNative, min: 2 }, 'every asset the steps index; "native" is the native currency'),
|
|
125
159
|
amountOutMin: MIN_OUT,
|
|
126
160
|
recipient: RECIPIENT,
|
|
127
161
|
deadline: DEADLINE,
|
|
128
162
|
}, { spends: false }),
|
|
129
163
|
swap("balancerV3Swap", "Swaps an exact input through one Balancer V3 pool; the router pays the Pot and pulls " +
|
|
130
164
|
"through Permit2.", "Router.swapSingleTokenExactIn", {
|
|
131
|
-
router: f(
|
|
132
|
-
pool: f(
|
|
133
|
-
tokenIn: f(
|
|
134
|
-
tokenOut: f(
|
|
165
|
+
router: f(contract, "the Balancer V3 Router"),
|
|
166
|
+
pool: f(contract, "the pool"),
|
|
167
|
+
tokenIn: f(token, "the token sold"),
|
|
168
|
+
tokenOut: f(token, "the token bought"),
|
|
135
169
|
amountOutMin: MIN_OUT,
|
|
136
170
|
deadline: DEADLINE,
|
|
137
171
|
wethIsEth: f(bool, "true to pay or receive native ETH for WETH"),
|
|
138
172
|
}),
|
|
139
|
-
swap("uniswapV2Swap", "Swaps an exact input along a Uniswap V2 path; the output is a balance delta.", "UniswapV2Router.swapExactTokensForTokens", {
|
|
140
|
-
router: f(address, "the V2 router"),
|
|
141
|
-
path: f({ k: "array", of: address, min: 2 }, "the token path; the last token is the output"),
|
|
142
|
-
amountOutMin: MIN_OUT,
|
|
143
|
-
recipient: RECIPIENT,
|
|
144
|
-
deadline: DEADLINE,
|
|
145
|
-
}),
|
|
146
173
|
swap("ambientSwap", "Swaps through an Ambient (CrocSwap) pool; the dex pays the Pot, and the output is a balance delta.", "CrocSwapDex.userCmd(1, abi.encode(...))", {
|
|
147
|
-
dex: f(
|
|
148
|
-
base: f(
|
|
149
|
-
quote: f(
|
|
174
|
+
dex: f(contract, "the CrocSwapDex"),
|
|
175
|
+
base: f(tokenOrNative, "the pool's base token (numerically lower)"),
|
|
176
|
+
quote: f(token, "the pool's quote token"),
|
|
150
177
|
poolIdx: f(uintN(53), "the pool type index (420 is the standard pool)"),
|
|
151
178
|
isBuy: f(bool, "true pays base and receives quote"),
|
|
152
179
|
inBaseQty: f(bool, "true when the amount is denominated in the base token"),
|
|
@@ -155,33 +182,19 @@ const SPECS = [
|
|
|
155
182
|
amountOutMin: f(uint128, "the least output accepted; the dex reverts below it"),
|
|
156
183
|
reserveFlags: f(uintN(8), "0x1 settles base from surplus, 0x2 quote"),
|
|
157
184
|
}),
|
|
158
|
-
swap("
|
|
159
|
-
proxy: f(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
pairs: f({ k: "array", of:
|
|
185
|
+
swap("dodoV1Swap", "Swaps through legacy DODO V1 (Classical) pairs via the DODO proxy, which pays the Pot.", "DODOProxy.dodoSwapV1", {
|
|
186
|
+
proxy: f(contract, "the DODO proxy; approvals go to DODOApprove, not to it"),
|
|
187
|
+
tokenIn: f(token, "the token sold"),
|
|
188
|
+
tokenOut: f(token, "the token bought"),
|
|
189
|
+
pairs: f({ k: "array", of: contract, min: 1 }, "the V1 pairs to route through"),
|
|
163
190
|
directions: f(uintN(53), "a bit per pair: 0 sells base, 1 sells quote"),
|
|
164
191
|
amountOutMin: MIN_OUT,
|
|
165
192
|
deadline: DEADLINE,
|
|
166
|
-
version: opt({ k: "enum", values: ["v1", "v2"] }, '"v1" routes legacy Classical pairs through `dodoSwapV1`; default "v2"'),
|
|
167
|
-
}),
|
|
168
|
-
swap("maverickSwap", "Swaps an exact input through one Maverick V2 pool.", "MaverickV2Router.exactInputSingle", {
|
|
169
|
-
router: f(address, "the Maverick V2 router"),
|
|
170
|
-
pool: f(address, "the pool"),
|
|
171
|
-
tokenAIn: f(bool, "true sells the pool's token A"),
|
|
172
|
-
amountOutMin: MIN_OUT,
|
|
173
|
-
recipient: RECIPIENT,
|
|
174
|
-
}),
|
|
175
|
-
swap("maverickMultiHopSwap", "Swaps an exact input along a packed Maverick V2 path.", "MaverickV2Router.exactInputMultiHop", {
|
|
176
|
-
router: f(address, "the Maverick V2 router"),
|
|
177
|
-
path: f(bytes, "per hop, the pool's 20 bytes then one byte: 1 sells token A, 0 token B"),
|
|
178
|
-
amountOutMin: MIN_OUT,
|
|
179
|
-
recipient: RECIPIENT,
|
|
180
193
|
}),
|
|
181
194
|
swap("carbonSwap", "Trades against Carbon strategies by source amount; the controller pays the Pot.", "CarbonController.tradeBySourceAmount", {
|
|
182
|
-
controller: f(
|
|
183
|
-
sourceToken: f(
|
|
184
|
-
targetToken: f(
|
|
195
|
+
controller: f(contract, "the CarbonController"),
|
|
196
|
+
sourceToken: f(token, "the token sold"),
|
|
197
|
+
targetToken: f(token, "the token bought"),
|
|
185
198
|
tradeActions: f({
|
|
186
199
|
k: "array",
|
|
187
200
|
min: 1,
|
|
@@ -197,22 +210,22 @@ const SPECS = [
|
|
|
197
210
|
deadline: DEADLINE,
|
|
198
211
|
}, { spends: false }),
|
|
199
212
|
swap("fraxswapSwap", "Swaps an exact input along a Fraxswap path; the output is a balance delta.", "FraxswapRouter.swapExactTokensForTokens", {
|
|
200
|
-
router: f(
|
|
201
|
-
path: f({ k: "array", of:
|
|
213
|
+
router: f(contract, "the Fraxswap router"),
|
|
214
|
+
path: f({ k: "array", of: token, min: 2 }, "the token path; the last token is the output"),
|
|
202
215
|
amountOutMin: MIN_OUT,
|
|
203
216
|
recipient: RECIPIENT,
|
|
204
217
|
deadline: DEADLINE,
|
|
205
218
|
}),
|
|
206
219
|
swap("fluidDexT1Swap", "Swaps an exact ERC-20 input through a Fluid DEX T1 pool.", "FluidDexT1.swapIn", {
|
|
207
|
-
pool: f(
|
|
220
|
+
pool: f(contract, "the pool"),
|
|
208
221
|
swap0to1: f(bool, "true sells token0"),
|
|
209
222
|
amountOutMin: MIN_OUT,
|
|
210
223
|
recipient: RECIPIENT,
|
|
211
224
|
}),
|
|
212
225
|
// -- bridges --------------------------------------------------------------------------------
|
|
213
226
|
bridge("acrossBridge", "Deposits into an Across SpokePool for the same token on the destination, less the relayer fee.", "SpokePool.depositV3", {
|
|
214
|
-
spokePool: f(
|
|
215
|
-
token: f(
|
|
227
|
+
spokePool: f(contract, "the origin SpokePool; it pulls the token, so approve it first"),
|
|
228
|
+
token: f(token, "the token bridged (input and output)"),
|
|
216
229
|
destChainId: f(int(1, Number.MAX_SAFE_INTEGER), "the destination chain id"),
|
|
217
230
|
recipient: f(address, "receives on the destination"),
|
|
218
231
|
relayerFee: f(uint256, "kept by the relayer: the destination receives `amount - relayerFee`"),
|
|
@@ -222,98 +235,98 @@ const SPECS = [
|
|
|
222
235
|
message: f(bytes, "delivered with the fill; 0x for none"),
|
|
223
236
|
}),
|
|
224
237
|
bridge("stargateBridge", "Sends through a Stargate V2 ERC-20 pool (taxi), paying the LayerZero fee it quotes.", "StargatePool.quoteSend, then StargatePool.send", {
|
|
225
|
-
pool: f(
|
|
238
|
+
pool: f(contract, "the StargatePool; it pulls the token, so approve it first"),
|
|
226
239
|
dstEid: f(uintN(32), "the destination's LayerZero endpoint id"),
|
|
227
240
|
recipient: f(remoteRecipient, "receives on the destination"),
|
|
228
241
|
amountOutMin: f(uint256, "the least the destination may receive"),
|
|
229
242
|
}, { value: "the quoted native fee, from the Pot" }),
|
|
230
243
|
bridge("cctpBridge", "Burns USDC through Circle's CCTP V2 TokenMessenger for minting on the destination.", "TokenMessengerV2.depositForBurn", {
|
|
231
|
-
tokenMessenger: f(
|
|
232
|
-
token: f(
|
|
244
|
+
tokenMessenger: f(contract, "the CCTP V2 TokenMessenger; it pulls the token, so approve it first"),
|
|
245
|
+
token: f(token, "the burned token (USDC)"),
|
|
233
246
|
destinationDomain: f(uintN(32), "the destination's CCTP domain"),
|
|
234
247
|
recipient: f(remoteRecipient, "receives the mint on the destination"),
|
|
235
248
|
maxFee: opt(uint256, 'the most the transfer may pay in fees, from the amount; default "0"'),
|
|
236
249
|
minFinalityThreshold: opt(uintN(32), "2000 waits for finality (standard, the default); 1000 is fast"),
|
|
237
250
|
}),
|
|
238
251
|
bridge("hyperlaneBridge", "Transfers through a Hyperlane ERC-20 warp route, paying the interchain gas it quotes.", "TokenRouter.quoteGasPayment, then TokenRouter.transferRemote", {
|
|
239
|
-
router: f(
|
|
252
|
+
router: f(contract, "the warp route; it pulls the amount plus any fee it charges"),
|
|
240
253
|
destinationDomain: f(uintN(32), "the destination's Hyperlane domain"),
|
|
241
254
|
recipient: f(remoteRecipient, "receives on the destination"),
|
|
242
255
|
}, { value: "the quoted gas payment, from the Pot" }),
|
|
243
256
|
// -- wrapping -------------------------------------------------------------------------------
|
|
244
|
-
wrap("wrapETH", "Wraps native ETH into WETH.", "WETH.deposit", { weth: f(
|
|
245
|
-
wrap("unwrapETH", "Unwraps WETH into native ETH.", "WETH.withdraw", { weth: f(
|
|
257
|
+
wrap("wrapETH", "Wraps native ETH into WETH.", "WETH.deposit", { weth: f(tokenContract, 'the WETH contract ("WETH")') }, { output: "passThrough", value: "amount" }),
|
|
258
|
+
wrap("unwrapETH", "Unwraps WETH into native ETH.", "WETH.withdraw", { weth: f(tokenContract, 'the WETH contract ("WETH")') }, { output: "passThrough" }),
|
|
246
259
|
wrap("wrapStETH", "Wraps stETH into wstETH; the output is the wstETH minted.", "wstETH.wrap", {
|
|
247
|
-
wstETH: f(
|
|
260
|
+
wstETH: f(tokenContract, "the wstETH contract; it pulls the stETH, so approve it first"),
|
|
248
261
|
}),
|
|
249
262
|
wrap("unwrapStETH", "Unwraps wstETH; the output is the stETH returned.", "wstETH.unwrap", {
|
|
250
|
-
wstETH: f(
|
|
263
|
+
wstETH: f(tokenContract, "the wstETH contract"),
|
|
251
264
|
}),
|
|
252
265
|
// -- staking --------------------------------------------------------------------------------
|
|
253
266
|
stake("lidoStake", "Stakes native ETH with Lido; the output is the stETH received.", "stETH.submit", {
|
|
254
|
-
stETH: f(
|
|
267
|
+
stETH: f(tokenContract, "the stETH contract"),
|
|
255
268
|
referral: opt(address, "Lido's referral; default the zero address"),
|
|
256
269
|
}, { value: "amount" }),
|
|
257
270
|
stake("lidoUnstake", "Requests a Lido withdrawal of stETH; the ETH is claimed later with the withdrawal NFT.", "WithdrawalQueueERC721.requestWithdrawals", {
|
|
258
|
-
withdrawalQueue: f(
|
|
271
|
+
withdrawalQueue: f(contract, "Lido's withdrawal queue; it pulls the stETH, so approve it first"),
|
|
259
272
|
owner: f(recipient, 'receives the withdrawal NFT; `"self"` is the Pot'),
|
|
260
273
|
}, { output: "passThrough" }),
|
|
261
274
|
stake("rocketPoolStake", "Stakes native ETH with Rocket Pool; the output is the rETH received.", "RocketDepositPool.deposit", {
|
|
262
|
-
depositPool: f(
|
|
263
|
-
rETH: f(
|
|
275
|
+
depositPool: f(contract, "the live RocketDepositPool, which upgrades move; read it from RocketStorage"),
|
|
276
|
+
rETH: f(tokenContract, "the rETH token, whose balance delta is the output"),
|
|
264
277
|
}, { value: "amount" }),
|
|
265
278
|
stake("rocketPoolUnstake", "Burns rETH; the output is the ETH received.", "rETH.burn", {
|
|
266
|
-
rETH: f(
|
|
279
|
+
rETH: f(tokenContract, "the rETH token"),
|
|
267
280
|
}),
|
|
268
281
|
stake("etherFiStake", "Stakes native ETH with ether.fi; the output is the eETH received.", "LiquidityPool.deposit", {
|
|
269
|
-
liquidityPool: f(
|
|
270
|
-
eETH: f(
|
|
282
|
+
liquidityPool: f(contract, "the ether.fi LiquidityPool"),
|
|
283
|
+
eETH: f(tokenContract, "the eETH token, whose balance delta is the output"),
|
|
271
284
|
}, { value: "amount" }),
|
|
272
285
|
// -- lending --------------------------------------------------------------------------------
|
|
273
286
|
lending("aaveV3Supply", "Supplies a token to Aave V3.", "Pool.supply", {
|
|
274
|
-
pool: f(
|
|
275
|
-
token: f(
|
|
287
|
+
pool: f(contract, "the Aave V3 Pool; it pulls the token, so approve it first"),
|
|
288
|
+
token: f(token, "the asset supplied"),
|
|
276
289
|
onBehalfOf: f(recipient, 'credited with the position; `"self"` is the Pot'),
|
|
277
290
|
referralCode: opt(uintN(16), "Aave's referral code; default 0"),
|
|
278
291
|
}),
|
|
279
292
|
lending("aaveV3Withdraw", "Withdraws a token from Aave V3; the output is the amount withdrawn.", "Pool.withdraw", {
|
|
280
|
-
pool: f(
|
|
281
|
-
token: f(
|
|
293
|
+
pool: f(contract, "the Aave V3 Pool"),
|
|
294
|
+
token: f(token, "the asset withdrawn"),
|
|
282
295
|
recipient: f(recipient, 'receives the asset; `"self"` is the Pot'),
|
|
283
296
|
}, { output: "realized" }),
|
|
284
297
|
lending("aaveV3Borrow", "Borrows a token from Aave V3 at the variable rate, the only rate it offers.", "Pool.borrow", {
|
|
285
|
-
pool: f(
|
|
286
|
-
token: f(
|
|
298
|
+
pool: f(contract, "the Aave V3 Pool"),
|
|
299
|
+
token: f(token, "the asset borrowed"),
|
|
287
300
|
onBehalfOf: f(recipient, 'whose collateral backs the debt; `"self"` is the Pot'),
|
|
288
301
|
referralCode: opt(uintN(16), "Aave's referral code; default 0"),
|
|
289
302
|
}),
|
|
290
303
|
lending("aaveV3Repay", "Repays an Aave V3 variable-rate debt.", "Pool.repay", {
|
|
291
|
-
pool: f(
|
|
292
|
-
token: f(
|
|
304
|
+
pool: f(contract, "the Aave V3 Pool; it pulls the token, so approve it first"),
|
|
305
|
+
token: f(token, "the asset repaid"),
|
|
293
306
|
onBehalfOf: f(recipient, 'whose debt is repaid; `"self"` is the Pot'),
|
|
294
307
|
}),
|
|
295
308
|
lending("compoundV3Supply", "Supplies a token to a Compound V3 (Comet) market.", "Comet.supply", {
|
|
296
|
-
comet: f(
|
|
297
|
-
token: f(
|
|
309
|
+
comet: f(contract, "the Comet market; it pulls the token, so approve it first"),
|
|
310
|
+
token: f(token, "the asset supplied"),
|
|
298
311
|
}),
|
|
299
312
|
lending("compoundV3Withdraw", "Withdraws a token from a Compound V3 (Comet) market.", "Comet.withdraw", {
|
|
300
|
-
comet: f(
|
|
301
|
-
token: f(
|
|
313
|
+
comet: f(contract, "the Comet market"),
|
|
314
|
+
token: f(token, "the asset withdrawn"),
|
|
302
315
|
}),
|
|
303
316
|
// -- tokens ---------------------------------------------------------------------------------
|
|
304
|
-
|
|
305
|
-
token: f(
|
|
317
|
+
tokens("transfer", "Transfers an ERC-20 token.", "ERC-20 transfer, checked like SafeERC20", {
|
|
318
|
+
token: f(token, "the token"),
|
|
306
319
|
recipient: f(recipient, 'the receiver; `"self"` is the Pot'),
|
|
307
320
|
}),
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
permit2: f(
|
|
311
|
-
token: f(
|
|
312
|
-
spender: f(
|
|
321
|
+
tokens("approve", "Approves an ERC-20 spender, resetting a non-zero allowance first.", "ERC-20 approve, checked and reset like SafeERC20.forceApprove", { token: f(token, "the token"), spender: f(contract, "the spender") }),
|
|
322
|
+
tokens("permit2Approve", "Grants a spender a Permit2 allowance; the token must also be approved to Permit2.", "Permit2.approve(address,address,uint160,uint48)", {
|
|
323
|
+
permit2: f(contract, 'Permit2 ("Permit2.Permit2")'),
|
|
324
|
+
token: f(token, "the token"),
|
|
325
|
+
spender: f(contract, "the spender, such as Balancer V3's router"),
|
|
313
326
|
expiration: f(uintN(48), "Unix seconds after which the allowance lapses"),
|
|
314
327
|
}),
|
|
315
328
|
// -- sources --------------------------------------------------------------------------------
|
|
316
|
-
source("balanceOf", "Reads the Pot's balance of a token; the output is that balance.", "IERC20.balanceOf(pot)", { token: f(
|
|
329
|
+
source("balanceOf", "Reads the Pot's balance of a token; the output is that balance.", "IERC20.balanceOf(pot)", { token: f(token, "the token") }, { spends: false }),
|
|
317
330
|
source("nativeBalance", "Reads the Pot's native balance; the output is that balance.", "ctx.selfBalance()", {}, { spends: false }),
|
|
318
331
|
source("argument", "Declares a runtime argument of the compiled program; the output is the value supplied.", "a `main` parameter", { name: f({ k: "identifier" }, "the argument's name; arguments are encoded in order") }, { spends: false }),
|
|
319
332
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { type ChainRef } from "../../sdk/dist/chains/canonical.js";
|
|
1
2
|
import { type CompiledProgram } from "./compose.js";
|
|
2
3
|
import { type QuoteOptions } from "./to-quote.js";
|
|
3
|
-
import type { ApproveAction, SwapAction } from "./types.js";
|
|
4
|
-
type Address = `0x${string}`;
|
|
4
|
+
import type { ApproveAction, Recipient, SwapAction, Token } from "./types.js";
|
|
5
5
|
/** A swap of `amount` split greedily, `buckets` slices at a time, across `candidates`. */
|
|
6
6
|
export interface SplitSwap {
|
|
7
7
|
/**
|
|
@@ -23,13 +23,18 @@ export interface SplitSwap {
|
|
|
23
23
|
readonly approvals?: readonly ApproveAction[];
|
|
24
24
|
/** Sends the total output of `token` to `recipient` at the end; omit to keep it in the Pot. */
|
|
25
25
|
readonly sweep?: {
|
|
26
|
-
readonly token:
|
|
27
|
-
readonly recipient:
|
|
26
|
+
readonly token: Token;
|
|
27
|
+
readonly recipient: Recipient;
|
|
28
28
|
};
|
|
29
29
|
/** The quoter contracts the candidates price through. */
|
|
30
30
|
readonly quoters?: QuoteOptions;
|
|
31
|
+
/**
|
|
32
|
+
* The chain the split runs on, which its token symbols and namespace references resolve on —
|
|
33
|
+
* needed when any candidate, approval or the sweep names one. Each name becomes its address
|
|
34
|
+
* there, because the quotes are calldata built here.
|
|
35
|
+
*/
|
|
36
|
+
readonly chain?: ChainRef;
|
|
31
37
|
}
|
|
32
38
|
/** Compiles a split swap into one program. It takes no runtime arguments. */
|
|
33
39
|
export declare function compileSplitSwap(swap: SplitSwap): CompiledProgram;
|
|
34
|
-
export {};
|
|
35
40
|
//# sourceMappingURL=split-swap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-swap.d.ts","sourceRoot":"","sources":["../src/split-swap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"split-swap.d.ts","sourceRoot":"","sources":["../src/split-swap.ts"],"names":[],"mappings":"AAkCA,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAK9D,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAU,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtF,0FAA0F;AAC1F,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,UAAU,EAAE,CAAC;IAC3C,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC9C,+FAA+F;IAC/F,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;KAAE,CAAC;IAC1E,yDAAyD;IACzD,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAID,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,eAAe,CAsHjE"}
|
|
@@ -24,15 +24,18 @@
|
|
|
24
24
|
* constants here, so the emitted main is O(N + n·N) instructions.
|
|
25
25
|
*/
|
|
26
26
|
import { formatBigint, fn, indent, newEmitter, } from "./emit.js";
|
|
27
|
+
import { resolveChain, } from "../../sdk/dist/chains/canonical.js";
|
|
27
28
|
import { contractsFor } from "./abis.js";
|
|
28
29
|
import { compiled } from "./compose.js";
|
|
30
|
+
import { resolveNames, usesNames } from "./names.js";
|
|
29
31
|
import { parseActions } from "./program.js";
|
|
30
|
-
import {
|
|
32
|
+
import { ProgramError } from "./semantics.js";
|
|
33
|
+
import { lowerAction, routerImport } from "./to-sauce.js";
|
|
31
34
|
import { quoteCall } from "./to-quote.js";
|
|
32
35
|
const UINT_RE = /^(0|[1-9][0-9]*)$/;
|
|
33
36
|
/** Compiles a split swap into one program. It takes no runtime arguments. */
|
|
34
37
|
export function compileSplitSwap(swap) {
|
|
35
|
-
|
|
38
|
+
let candidates = parseActions(swap.candidates, "candidates");
|
|
36
39
|
candidates.forEach((candidate, i) => {
|
|
37
40
|
for (const key of ["amount", "amountRef", "saveOutputAs"]) {
|
|
38
41
|
if (candidate[key] !== undefined) {
|
|
@@ -40,7 +43,7 @@ export function compileSplitSwap(swap) {
|
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
});
|
|
43
|
-
|
|
46
|
+
let approvals = parseActions(swap.approvals ?? [], "approvals");
|
|
44
47
|
approvals.forEach((approval, i) => {
|
|
45
48
|
if (approval.type !== "approve" || approval.amount === undefined) {
|
|
46
49
|
throw new Error(`approvals[${i}]: expected an \`approve\` action with an explicit \`amount\``);
|
|
@@ -48,6 +51,33 @@ export function compileSplitSwap(swap) {
|
|
|
48
51
|
});
|
|
49
52
|
if (candidates.length === 0)
|
|
50
53
|
throw new Error("a split swap needs at least one candidate");
|
|
54
|
+
candidates.forEach((candidate, i) => {
|
|
55
|
+
if (candidate.factory !== undefined) {
|
|
56
|
+
throw new Error(`candidates[${i}].factory: a split quotes each candidate at its pool's address, and a pool ` +
|
|
57
|
+
"named by its key is found only while the program runs — give `pool`");
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
let sweep = swap.sweep;
|
|
61
|
+
const chain = swap.chain === undefined ? undefined : splitChain(swap.chain);
|
|
62
|
+
const sweepAction = sweep === undefined ? [] : [{ type: "transfer", amount: "0", ...sweep }];
|
|
63
|
+
if (usesNames([...candidates, ...approvals, ...sweepAction])) {
|
|
64
|
+
if (chain === undefined) {
|
|
65
|
+
throw new Error("a split swap that names a token or a contract needs `chain`, the chain to resolve it on");
|
|
66
|
+
}
|
|
67
|
+
const issues = [];
|
|
68
|
+
const named = (actions, path) => {
|
|
69
|
+
const result = resolveNames(actions, chain, path);
|
|
70
|
+
issues.push(...result.issues);
|
|
71
|
+
return result.resolved;
|
|
72
|
+
};
|
|
73
|
+
candidates = named(candidates, "candidates");
|
|
74
|
+
approvals = named(approvals, "approvals");
|
|
75
|
+
const [resolvedSweep] = named(sweepAction, "sweep");
|
|
76
|
+
if (sweep !== undefined)
|
|
77
|
+
sweep = { ...sweep, token: resolvedSweep.token };
|
|
78
|
+
if (issues.length > 0)
|
|
79
|
+
throw new ProgramError(issues, chain);
|
|
80
|
+
}
|
|
51
81
|
const n = swap.buckets;
|
|
52
82
|
if (!Number.isSafeInteger(n) || n < 1) {
|
|
53
83
|
throw new Error(`buckets must be a positive integer, got ${n}`);
|
|
@@ -68,9 +98,12 @@ export function compileSplitSwap(swap) {
|
|
|
68
98
|
const N = candidates.length;
|
|
69
99
|
const emit = newEmitter();
|
|
70
100
|
const bindings = new Set();
|
|
101
|
+
const router = new Set();
|
|
71
102
|
const use = (result) => {
|
|
72
103
|
for (const b of result.bindings)
|
|
73
104
|
bindings.add(b);
|
|
105
|
+
for (const f of result.router)
|
|
106
|
+
router.add(f);
|
|
74
107
|
return result;
|
|
75
108
|
};
|
|
76
109
|
const quoteFns = candidates.map((candidate, i) => {
|
|
@@ -93,13 +126,21 @@ export function compileSplitSwap(swap) {
|
|
|
93
126
|
const swapAny = fn("swap_any", ["idx: Uint256", "amount: Uint256"], "Uint256", [
|
|
94
127
|
...outOfRangeGuard(N),
|
|
95
128
|
...blockDispatch(N, (i) => {
|
|
96
|
-
const built = use(lowerAction(emit, candidates[i], "amount", true));
|
|
129
|
+
const built = use(lowerAction(emit, candidates[i], "amount", true, `candidates[${i}]`));
|
|
97
130
|
return [...built.stmts, `return ${built.output};`];
|
|
98
131
|
}),
|
|
99
132
|
]);
|
|
100
|
-
const main = mainFn(emit, N, n, bucket, swap, approvals, use);
|
|
101
|
-
const source = [...quoteFns, quoteAny, swapAny, main].join("\n\n") + "\n";
|
|
102
|
-
return compiled(source, contractsFor(bindings), []);
|
|
133
|
+
const main = mainFn(emit, N, n, bucket, { ...swap, sweep }, approvals, use);
|
|
134
|
+
const source = routerImport([...router].sort()) + [...quoteFns, quoteAny, swapAny, main].join("\n\n") + "\n";
|
|
135
|
+
return compiled(source, contractsFor(bindings), [], {}, chain);
|
|
136
|
+
}
|
|
137
|
+
/** The split's chain, an EVM one the SDK knows. */
|
|
138
|
+
function splitChain(ref) {
|
|
139
|
+
const chain = resolveChain(ref);
|
|
140
|
+
if (chain === undefined || chain.kind !== "evm") {
|
|
141
|
+
throw new Error(`a split swap runs on an EVM chain the SDK knows; got ${String(ref)}`);
|
|
142
|
+
}
|
|
143
|
+
return chain;
|
|
103
144
|
}
|
|
104
145
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
105
146
|
// Dispatchers
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Emitter, type Expr, type Fragment } from "./emit.js";
|
|
2
|
+
import { type ChainRef } from "../../sdk/dist/chains/canonical.js";
|
|
2
3
|
import type { SwapAction } from "./types.js";
|
|
3
4
|
type Address = `0x${string}`;
|
|
4
5
|
type Hex = `0x${string}`;
|
|
@@ -23,11 +24,19 @@ export interface QuoteCall extends Quote {
|
|
|
23
24
|
* the action names.
|
|
24
25
|
*/
|
|
25
26
|
export interface QuoteOptions {
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The chain the swap is on: needed when the action names a token or a contract, which resolve
|
|
29
|
+
* there to the addresses the quote calls.
|
|
30
|
+
*/
|
|
31
|
+
readonly chain?: ChainRef;
|
|
32
|
+
/**
|
|
33
|
+
* The Sauce Router, for `uniswapV3Swap` and `uniswapV4Swap`: the contract that swaps them prices
|
|
34
|
+
* them, with its own `quote`, which needs no tokens. A Pot's Router is the Kitchen's Router until
|
|
35
|
+
* the Pot's owner moves it; `v12RouterAddress()` from `@eco-incorp/sauce/deployments` is the
|
|
36
|
+
* release's.
|
|
37
|
+
*/
|
|
38
|
+
readonly router?: Address;
|
|
39
|
+
/** The MaverickV2Quoter, for `maverickV2Swap`. */
|
|
31
40
|
readonly maverickQuoter?: Address;
|
|
32
41
|
/** Ambient's CrocImpact, for `ambientSwap`. */
|
|
33
42
|
readonly ambientImpact?: Address;
|