@eco-incorp/sauce 0.99.6 → 0.99.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +334 -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 +96 -57
- package/docs/api/router.md +238 -0
- package/docs/api/routes.md +31 -22
- package/docs/concepts/architecture.md +26 -3
- package/docs/concepts/saucescript.md +35 -55
- package/docs/examples/README.md +21 -14
- package/docs/examples/action-program.ts +51 -35
- package/docs/examples/cross-chain-cascade.sauce.ts +4 -0
- package/docs/examples/cross-chain-intent.sauce.ts +2 -1
- package/docs/examples/evm-execution.ts +2 -4
- package/docs/examples/first-intent.ts +7 -2
- package/docs/examples/pot-router.ts +19 -0
- package/docs/examples/registry-names.ts +52 -0
- package/docs/examples/router-route.sauce.ts +31 -0
- package/docs/examples/router-route.ts +72 -0
- package/docs/examples/router-swap.sauce.ts +16 -0
- package/docs/examples/router-swap.ts +47 -0
- package/docs/examples/venue-where-deployed.sauce.ts +14 -0
- package/docs/guides/actions.md +230 -120
- package/docs/guides/builders-and-actions.md +20 -14
- package/docs/guides/cli.md +1446 -0
- package/docs/guides/compiling.md +19 -7
- package/docs/guides/intents.md +228 -15
- package/docs/guides/mcp.md +540 -0
- package/docs/guides/nested-intents.md +21 -6
- package/docs/guides/protocols-and-tokens.md +218 -39
- package/docs/guides/quick-start.md +5 -0
- package/docs/guides/solana.md +199 -52
- package/docs/guides/verification.md +2 -2
- package/mcp/dist/config.js +78 -0
- package/mcp/dist/config.js.map +1 -0
- package/mcp/dist/entry.js +112 -0
- package/mcp/dist/entry.js.map +1 -0
- package/mcp/dist/files.js +64 -0
- package/mcp/dist/files.js.map +1 -0
- package/mcp/dist/guard.js +262 -0
- package/mcp/dist/guard.js.map +1 -0
- package/mcp/dist/http.js +111 -0
- package/mcp/dist/http.js.map +1 -0
- package/mcp/dist/intents.js +579 -0
- package/mcp/dist/intents.js.map +1 -0
- package/mcp/dist/prompts.js +153 -0
- package/mcp/dist/prompts.js.map +1 -0
- package/mcp/dist/reach.js +98 -0
- package/mcp/dist/reach.js.map +1 -0
- package/mcp/dist/resources.js +154 -0
- package/mcp/dist/resources.js.map +1 -0
- package/mcp/dist/sdk.js +34 -0
- package/mcp/dist/sdk.js.map +1 -0
- package/mcp/dist/server.js +119 -0
- package/mcp/dist/server.js.map +1 -0
- package/mcp/dist/setup.js +189 -0
- package/mcp/dist/setup.js.map +1 -0
- package/mcp/dist/skilltools.js +520 -0
- package/mcp/dist/skilltools.js.map +1 -0
- package/mcp/dist/terms.js +93 -0
- package/mcp/dist/terms.js.map +1 -0
- package/mcp/dist/tools.js +1499 -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 +173 -0
- package/sdk/dist/cli/chain.d.ts.map +1 -0
- package/sdk/dist/cli/chain.js +462 -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 +225 -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 +219 -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 +3163 -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 +184 -0
- package/sdk/dist/cli/solana.d.ts.map +1 -0
- package/sdk/dist/cli/solana.js +1370 -0
- package/sdk/dist/cli/solana.js.map +1 -0
- package/sdk/dist/cli/store.d.ts +60 -0
- package/sdk/dist/cli/store.d.ts.map +1 -0
- package/sdk/dist/cli/store.js +196 -0
- package/sdk/dist/cli/store.js.map +1 -0
- package/sdk/dist/cli/support.d.ts +144 -0
- package/sdk/dist/cli/support.d.ts.map +1 -0
- package/sdk/dist/cli/support.js +217 -0
- package/sdk/dist/cli/support.js.map +1 -0
- package/sdk/dist/cli/svm-effects.d.ts +50 -0
- package/sdk/dist/cli/svm-effects.d.ts.map +1 -0
- package/sdk/dist/cli/svm-effects.js +196 -0
- package/sdk/dist/cli/svm-effects.js.map +1 -0
- package/sdk/dist/cli/terminal.d.ts +42 -0
- package/sdk/dist/cli/terminal.d.ts.map +1 -0
- package/sdk/dist/cli/terminal.js +136 -0
- package/sdk/dist/cli/terminal.js.map +1 -0
- package/sdk/dist/cli/verify.d.ts +32 -0
- package/sdk/dist/cli/verify.d.ts.map +1 -0
- package/sdk/dist/cli/verify.js +185 -0
- package/sdk/dist/cli/verify.js.map +1 -0
- package/sdk/dist/cli/wallet-commands.d.ts +59 -0
- package/sdk/dist/cli/wallet-commands.d.ts.map +1 -0
- package/sdk/dist/cli/wallet-commands.js +222 -0
- package/sdk/dist/cli/wallet-commands.js.map +1 -0
- package/sdk/dist/cli/wallet-send.d.ts +38 -0
- package/sdk/dist/cli/wallet-send.d.ts.map +1 -0
- package/sdk/dist/cli/wallet-send.js +303 -0
- package/sdk/dist/cli/wallet-send.js.map +1 -0
- package/sdk/dist/cli/wallets.d.ts +79 -0
- package/sdk/dist/cli/wallets.d.ts.map +1 -0
- package/sdk/dist/cli/wallets.js +297 -0
- package/sdk/dist/cli/wallets.js.map +1 -0
- package/sdk/dist/deployments/index.d.ts +4 -62
- package/sdk/dist/deployments/index.d.ts.map +1 -1
- package/sdk/dist/deployments/index.js +4 -84
- package/sdk/dist/deployments/index.js.map +1 -1
- package/sdk/dist/deployments/pot.d.ts +17 -7
- package/sdk/dist/deployments/pot.d.ts.map +1 -1
- package/sdk/dist/deployments/pot.js +25 -10
- package/sdk/dist/deployments/pot.js.map +1 -1
- package/sdk/dist/deployments/releases.d.ts +36 -0
- package/sdk/dist/deployments/releases.d.ts.map +1 -0
- package/sdk/dist/deployments/releases.js +61 -0
- package/sdk/dist/deployments/releases.js.map +1 -0
- package/sdk/dist/deployments/releases.json +76 -0
- package/sdk/dist/deployments/v12-addresses.d.ts +13 -0
- package/sdk/dist/deployments/v12-addresses.d.ts.map +1 -1
- package/sdk/dist/deployments/v12-addresses.js +16 -3
- package/sdk/dist/deployments/v12-addresses.js.map +1 -1
- package/sdk/dist/deposit/index.d.ts +6 -6
- package/sdk/dist/deposit/index.d.ts.map +1 -1
- package/sdk/dist/deposit/index.js +1 -1
- package/sdk/dist/deposit/index.js.map +1 -1
- package/sdk/dist/deposit/params.d.ts +4 -4
- package/sdk/dist/deposit/params.d.ts.map +1 -1
- package/sdk/dist/deposit/params.js +7 -4
- package/sdk/dist/deposit/params.js.map +1 -1
- package/sdk/dist/deposit/source.d.ts +3 -30
- package/sdk/dist/deposit/source.d.ts.map +1 -1
- package/sdk/dist/deposit/source.js +7 -83
- package/sdk/dist/deposit/source.js.map +1 -1
- package/sdk/dist/deposit/templates.d.ts +1 -2
- package/sdk/dist/deposit/templates.d.ts.map +1 -1
- package/sdk/dist/deposit/templates.js +10 -2
- package/sdk/dist/deposit/templates.js.map +1 -1
- package/sdk/dist/deposit/types.d.ts +14 -12
- package/sdk/dist/deposit/types.d.ts.map +1 -1
- package/sdk/dist/deposit/types.js +6 -0
- package/sdk/dist/deposit/types.js.map +1 -1
- package/sdk/dist/descriptors/accessors.d.ts +38 -35
- package/sdk/dist/descriptors/accessors.d.ts.map +1 -1
- package/sdk/dist/descriptors/accessors.js +16 -0
- package/sdk/dist/descriptors/accessors.js.map +1 -1
- package/sdk/dist/descriptors/call.d.ts +66 -14
- package/sdk/dist/descriptors/call.d.ts.map +1 -1
- package/sdk/dist/descriptors/call.js +94 -13
- package/sdk/dist/descriptors/call.js.map +1 -1
- package/sdk/dist/descriptors/contracts.generated.d.ts +3393 -0
- package/sdk/dist/descriptors/contracts.generated.d.ts.map +1 -0
- package/sdk/dist/descriptors/contracts.generated.js +728 -0
- package/sdk/dist/descriptors/contracts.generated.js.map +1 -0
- package/sdk/dist/descriptors/derive.d.ts +20 -11
- package/sdk/dist/descriptors/derive.d.ts.map +1 -1
- package/sdk/dist/descriptors/derive.js +68 -30
- package/sdk/dist/descriptors/derive.js.map +1 -1
- package/sdk/dist/descriptors/index.d.ts +6 -7
- package/sdk/dist/descriptors/index.d.ts.map +1 -1
- package/sdk/dist/descriptors/index.js +2 -2
- package/sdk/dist/descriptors/index.js.map +1 -1
- package/sdk/dist/descriptors/links.d.ts +23 -214
- package/sdk/dist/descriptors/links.d.ts.map +1 -1
- package/sdk/dist/descriptors/links.js +1 -232
- package/sdk/dist/descriptors/links.js.map +1 -1
- package/sdk/dist/descriptors/query.d.ts +1 -1
- package/sdk/dist/descriptors/query.d.ts.map +1 -1
- package/sdk/dist/descriptors/query.js +1 -1
- package/sdk/dist/descriptors/query.js.map +1 -1
- package/sdk/dist/descriptors/registry.d.ts +2 -5
- package/sdk/dist/descriptors/registry.d.ts.map +1 -1
- package/sdk/dist/descriptors/registry.js +11 -66
- package/sdk/dist/descriptors/registry.js.map +1 -1
- package/sdk/dist/embedded/resolve.d.ts +4 -4
- package/sdk/dist/embedded/resolve.d.ts.map +1 -1
- package/sdk/dist/embedded/resolve.js +12 -8
- package/sdk/dist/embedded/resolve.js.map +1 -1
- package/sdk/dist/embedded/skills.generated.d.ts +1 -1
- package/sdk/dist/embedded/skills.generated.d.ts.map +1 -1
- package/sdk/dist/embedded/skills.generated.js +137 -136
- package/sdk/dist/embedded/skills.generated.js.map +1 -1
- package/sdk/dist/embedded/sources.generated.d.ts.map +1 -1
- package/sdk/dist/embedded/sources.generated.js +40 -6
- package/sdk/dist/embedded/sources.generated.js.map +1 -1
- package/sdk/dist/evm/engine.d.ts +813 -10
- package/sdk/dist/evm/engine.d.ts.map +1 -1
- package/sdk/dist/evm/engine.js +127 -8
- package/sdk/dist/evm/engine.js.map +1 -1
- package/sdk/dist/index.d.ts +3 -2
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +6 -2
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/price.d.ts +40 -0
- package/sdk/dist/price.d.ts.map +1 -0
- package/sdk/dist/price.js +101 -0
- package/sdk/dist/price.js.map +1 -0
- package/sdk/dist/protocols/aerodrome/abis.d.ts +76 -0
- package/sdk/dist/protocols/aerodrome/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/aerodrome/abis.js +61 -0
- package/sdk/dist/protocols/aerodrome/abis.js.map +1 -1
- package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts +70 -0
- package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/aerodrome-slipstream/abis.js +54 -0
- package/sdk/dist/protocols/aerodrome-slipstream/abis.js.map +1 -1
- package/sdk/dist/protocols/camelot/abis.d.ts +178 -0
- package/sdk/dist/protocols/camelot/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/camelot/abis.js +139 -0
- package/sdk/dist/protocols/camelot/abis.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/abis.d.ts +792 -50
- package/sdk/dist/protocols/eco-routes/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/abis.js +1058 -49
- package/sdk/dist/protocols/eco-routes/abis.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts +44 -61
- package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/addresses.generated.js +45 -62
- package/sdk/dist/protocols/eco-routes/addresses.generated.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/lookup.d.ts +10 -0
- package/sdk/dist/protocols/eco-routes/lookup.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/lookup.js +16 -0
- package/sdk/dist/protocols/eco-routes/lookup.js.map +1 -1
- package/sdk/dist/protocols/maverick/abis.d.ts +77 -0
- package/sdk/dist/protocols/maverick/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/maverick/abis.js +58 -0
- package/sdk/dist/protocols/maverick/abis.js.map +1 -1
- package/sdk/dist/protocols/maverick/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/maverick/addresses.js +4 -0
- package/sdk/dist/protocols/maverick/addresses.js.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v2/abis.js +43 -0
- package/sdk/dist/protocols/pancakeswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v3/abis.js +56 -0
- package/sdk/dist/protocols/pancakeswap-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/permit2/abis.d.ts +113 -0
- package/sdk/dist/protocols/permit2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/permit2/abis.js +63 -0
- package/sdk/dist/protocols/permit2/abis.js.map +1 -1
- package/sdk/dist/protocols/quickswap/abis.d.ts +148 -0
- package/sdk/dist/protocols/quickswap/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/quickswap/abis.js +119 -0
- package/sdk/dist/protocols/quickswap/abis.js.map +1 -1
- package/sdk/dist/protocols/sushiswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/sushiswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/sushiswap-v2/abis.js +42 -0
- package/sdk/dist/protocols/sushiswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/synthra-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/synthra-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/synthra-v3/abis.js +55 -0
- package/sdk/dist/protocols/synthra-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/trader-joe/abis.d.ts +133 -0
- package/sdk/dist/protocols/trader-joe/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/trader-joe/abis.js +101 -0
- package/sdk/dist/protocols/trader-joe/abis.js.map +1 -1
- package/sdk/dist/protocols/trader-joe/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/trader-joe/addresses.js +5 -0
- package/sdk/dist/protocols/trader-joe/addresses.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/uniswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v2/abis.js +44 -0
- package/sdk/dist/protocols/uniswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/uniswap-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v3/abis.js +55 -0
- package/sdk/dist/protocols/uniswap-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/abis.d.ts +247 -0
- package/sdk/dist/protocols/uniswap-v4/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/abis.js +167 -0
- package/sdk/dist/protocols/uniswap-v4/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/addresses.js +50 -0
- package/sdk/dist/protocols/uniswap-v4/addresses.js.map +1 -1
- package/sdk/dist/protocols/unitflow-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/unitflow-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/unitflow-v3/abis.js +56 -0
- package/sdk/dist/protocols/unitflow-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/velodrome/abis.d.ts +76 -0
- package/sdk/dist/protocols/velodrome/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/velodrome/abis.js +61 -0
- package/sdk/dist/protocols/velodrome/abis.js.map +1 -1
- package/sdk/dist/recipes/cctp-split.sauce.ts +2 -2
- package/sdk/dist/recipes/plain-transfer.sauce.ts +2 -2
- package/sdk/dist/routes/accessor-index.d.ts +2 -2
- package/sdk/dist/routes/accessor-index.d.ts.map +1 -1
- package/sdk/dist/routes/accessor-index.js +4 -3
- package/sdk/dist/routes/accessor-index.js.map +1 -1
- package/sdk/dist/routes/ambient.d.ts +5 -0
- package/sdk/dist/routes/ambient.d.ts.map +1 -1
- package/sdk/dist/routes/ambient.js +20 -0
- package/sdk/dist/routes/ambient.js.map +1 -1
- package/sdk/dist/routes/ast-walk.d.ts +17 -3
- package/sdk/dist/routes/ast-walk.d.ts.map +1 -1
- package/sdk/dist/routes/ast-walk.js +24 -2
- package/sdk/dist/routes/ast-walk.js.map +1 -1
- package/sdk/dist/routes/available.d.ts +43 -0
- package/sdk/dist/routes/available.d.ts.map +1 -0
- package/sdk/dist/routes/available.js +230 -0
- package/sdk/dist/routes/available.js.map +1 -0
- package/sdk/dist/routes/builtins.generated.d.ts +180 -0
- package/sdk/dist/routes/builtins.generated.d.ts.map +1 -0
- package/sdk/dist/routes/builtins.generated.js +2 -0
- package/sdk/dist/routes/builtins.generated.js.map +1 -0
- package/sdk/dist/routes/chain-exports.generated.d.ts +13 -8
- package/sdk/dist/routes/chain-exports.generated.d.ts.map +1 -1
- package/sdk/dist/routes/chain-exports.generated.js.map +1 -1
- package/sdk/dist/routes/closure.d.ts.map +1 -1
- package/sdk/dist/routes/closure.js +13 -26
- package/sdk/dist/routes/closure.js.map +1 -1
- package/sdk/dist/routes/composed.d.ts.map +1 -1
- package/sdk/dist/routes/composed.js +20 -8
- package/sdk/dist/routes/composed.js.map +1 -1
- package/sdk/dist/routes/encode.d.ts +17 -0
- package/sdk/dist/routes/encode.d.ts.map +1 -1
- package/sdk/dist/routes/encode.js +14 -11
- package/sdk/dist/routes/encode.js.map +1 -1
- package/sdk/dist/routes/entry.d.ts +76 -0
- package/sdk/dist/routes/entry.d.ts.map +1 -0
- package/sdk/dist/routes/entry.js +478 -0
- package/sdk/dist/routes/entry.js.map +1 -0
- package/sdk/dist/routes/index.d.ts +19 -12
- package/sdk/dist/routes/index.d.ts.map +1 -1
- package/sdk/dist/routes/index.js +11 -8
- package/sdk/dist/routes/index.js.map +1 -1
- package/sdk/dist/routes/intent-body.d.ts +97 -0
- package/sdk/dist/routes/intent-body.d.ts.map +1 -0
- package/sdk/dist/routes/intent-body.js +441 -0
- package/sdk/dist/routes/intent-body.js.map +1 -0
- package/sdk/dist/routes/intent-dsl.d.ts +21 -6
- package/sdk/dist/routes/intent-dsl.d.ts.map +1 -1
- package/sdk/dist/routes/intent-dsl.js +34 -17
- package/sdk/dist/routes/intent-dsl.js.map +1 -1
- package/sdk/dist/routes/intent-sugar.d.ts +77 -4
- package/sdk/dist/routes/intent-sugar.d.ts.map +1 -1
- package/sdk/dist/routes/intent-sugar.js +318 -129
- package/sdk/dist/routes/intent-sugar.js.map +1 -1
- package/sdk/dist/routes/intent.d.ts +13 -1
- package/sdk/dist/routes/intent.d.ts.map +1 -1
- package/sdk/dist/routes/intent.js +37 -1
- package/sdk/dist/routes/intent.js.map +1 -1
- package/sdk/dist/routes/nest.d.ts +3 -2
- package/sdk/dist/routes/nest.d.ts.map +1 -1
- package/sdk/dist/routes/nest.js +5 -3
- package/sdk/dist/routes/nest.js.map +1 -1
- package/sdk/dist/routes/parse.d.ts +6 -0
- package/sdk/dist/routes/parse.d.ts.map +1 -0
- package/sdk/dist/routes/parse.js +39 -0
- package/sdk/dist/routes/parse.js.map +1 -0
- package/sdk/dist/routes/portal.d.ts +258 -4
- package/sdk/dist/routes/portal.d.ts.map +1 -1
- package/sdk/dist/routes/portal.js +588 -9
- package/sdk/dist/routes/portal.js.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts +71 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.js +178 -54
- package/sdk/dist/routes/protocol-rewrite.js.map +1 -1
- package/sdk/dist/routes/rs-compile.d.ts +25 -22
- package/sdk/dist/routes/rs-compile.d.ts.map +1 -1
- package/sdk/dist/routes/rs-compile.js +55 -49
- package/sdk/dist/routes/rs-compile.js.map +1 -1
- package/sdk/dist/routes/sauce-calls.d.ts +26 -12
- package/sdk/dist/routes/sauce-calls.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-calls.js +16 -23
- package/sdk/dist/routes/sauce-calls.js.map +1 -1
- package/sdk/dist/routes/sauce-route.d.ts +74 -7
- package/sdk/dist/routes/sauce-route.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-route.js +225 -75
- package/sdk/dist/routes/sauce-route.js.map +1 -1
- package/sdk/dist/routes/source-globals.d.ts +107 -0
- package/sdk/dist/routes/source-globals.d.ts.map +1 -0
- package/sdk/dist/routes/source-globals.generated.d.ts +5601 -933
- package/sdk/dist/routes/source-globals.generated.d.ts.map +1 -1
- package/sdk/dist/routes/source-globals.generated.js +3 -4
- package/sdk/dist/routes/source-globals.generated.js.map +1 -1
- package/sdk/dist/routes/source-globals.js +175 -0
- package/sdk/dist/routes/source-globals.js.map +1 -0
- package/sdk/dist/routes/stock-tokens.d.ts +89 -0
- package/sdk/dist/routes/stock-tokens.d.ts.map +1 -0
- package/sdk/dist/routes/stock-tokens.generated.d.ts +7 -0
- package/sdk/dist/routes/stock-tokens.generated.d.ts.map +1 -0
- package/sdk/dist/routes/stock-tokens.generated.js +3664 -0
- package/sdk/dist/routes/stock-tokens.generated.js.map +1 -0
- package/sdk/dist/routes/stock-tokens.js +89 -0
- package/sdk/dist/routes/stock-tokens.js.map +1 -0
- package/sdk/dist/routes/token-registry.d.ts +68 -8
- package/sdk/dist/routes/token-registry.d.ts.map +1 -1
- package/sdk/dist/routes/token-registry.js +218 -32
- package/sdk/dist/routes/token-registry.js.map +1 -1
- package/sdk/dist/routes/token-rewrite.d.ts +1 -1
- package/sdk/dist/routes/token-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/token-rewrite.js +5 -9
- package/sdk/dist/routes/token-rewrite.js.map +1 -1
- package/sdk/dist/routes/unknown-global.d.ts +32 -0
- package/sdk/dist/routes/unknown-global.d.ts.map +1 -0
- package/sdk/dist/routes/unknown-global.js +106 -0
- package/sdk/dist/routes/unknown-global.js.map +1 -0
- package/sdk/dist/routes/vault.d.ts +38 -8
- package/sdk/dist/routes/vault.d.ts.map +1 -1
- package/sdk/dist/routes/vault.js +47 -8
- package/sdk/dist/routes/vault.js.map +1 -1
- package/sdk/dist/sauce-script/builtins.d.ts +309 -0
- package/sdk/dist/sauce-script/declarations.d.ts +3 -0
- package/sdk/dist/sauce-script/declarations.d.ts.map +1 -0
- package/sdk/dist/sauce-script/declarations.js +229 -0
- package/sdk/dist/sauce-script/declarations.js.map +1 -0
- package/sdk/dist/sauce-script/index.d.ts +2714 -0
- package/sdk/dist/sauce-script/ts-plugin.cjs +85 -0
- package/sdk/dist/skills/loader.d.ts.map +1 -1
- package/sdk/dist/skills/loader.js +4 -3
- package/sdk/dist/skills/loader.js.map +1 -1
- package/sdk/dist/std/router/balancer-v2-vault.abi.json +78 -0
- package/sdk/dist/std/router/curve-cryptoswap.abi.json +29 -0
- package/sdk/dist/std/router/curve-stableswap.abi.json +29 -0
- package/sdk/dist/std/router/dodo-v2-pool.abi.json +39 -0
- package/sdk/dist/std/router/lb-pair.abi.json +55 -0
- package/sdk/dist/std/router/package.json +7 -0
- package/sdk/dist/std/router/router.evm.js +567 -0
- package/sdk/dist/std/router/sauce-router.abi.json +202 -0
- package/sdk/dist/std/router/uniswap-v2-pair.abi.json +49 -0
- package/sdk/dist/std/router/woo-pp-v2.abi.json +42 -0
- package/sdk/dist/std/token/permit2.abi.json +226 -0
- package/sdk/dist/std/token/token.evm.js +73 -0
- package/sdk/dist/std/token/token.svm.js +194 -41
- package/sdk/dist/svm/client.d.ts +62 -15
- package/sdk/dist/svm/client.d.ts.map +1 -1
- package/sdk/dist/svm/client.js +103 -42
- package/sdk/dist/svm/client.js.map +1 -1
- package/sdk/dist/svm/engine.d.ts +66 -5
- package/sdk/dist/svm/engine.d.ts.map +1 -1
- package/sdk/dist/svm/engine.js +73 -5
- package/sdk/dist/svm/engine.js.map +1 -1
- package/sdk/dist/svm/index.d.ts +2 -0
- package/sdk/dist/svm/index.d.ts.map +1 -1
- package/sdk/dist/svm/index.js +2 -0
- package/sdk/dist/svm/index.js.map +1 -1
- package/sdk/dist/svm/instructions.d.ts +72 -1
- package/sdk/dist/svm/instructions.d.ts.map +1 -1
- package/sdk/dist/svm/instructions.js +81 -2
- package/sdk/dist/svm/instructions.js.map +1 -1
- package/sdk/dist/svm/kitchen.d.ts +20 -1
- package/sdk/dist/svm/kitchen.d.ts.map +1 -1
- package/sdk/dist/svm/kitchen.js +47 -1
- package/sdk/dist/svm/kitchen.js.map +1 -1
- package/sdk/dist/svm/portal.d.ts +250 -0
- package/sdk/dist/svm/portal.d.ts.map +1 -0
- package/sdk/dist/svm/portal.js +462 -0
- package/sdk/dist/svm/portal.js.map +1 -0
- package/sdk/dist/svm/send.d.ts +18 -2
- package/sdk/dist/svm/send.d.ts.map +1 -1
- package/sdk/dist/svm/send.js +28 -3
- package/sdk/dist/svm/send.js.map +1 -1
- package/sdk/dist/svm/token-accounts.d.ts +49 -0
- package/sdk/dist/svm/token-accounts.d.ts.map +1 -0
- package/sdk/dist/svm/token-accounts.js +58 -0
- package/sdk/dist/svm/token-accounts.js.map +1 -0
- package/sdk/dist/svm/token-extensions.d.ts +18 -7
- package/sdk/dist/svm/token-extensions.d.ts.map +1 -1
- package/sdk/dist/svm/token-extensions.js +58 -5
- package/sdk/dist/svm/token-extensions.js.map +1 -1
- package/sdk/dist/token/evm.js +1 -1
- package/sdk/dist/token/index.d.ts +1 -1
- package/sdk/dist/token/index.js +1 -1
- package/sdk/dist/token/params.js +1 -1
- package/sdk/dist/token/source.js +3 -3
- package/sdk/dist/token/source.js.map +1 -1
- package/sdk/dist/token/types.d.ts +2 -2
- package/sdk/dist/token/types.js +2 -2
- package/sdk/src/protocols/aerodrome/AerodromePoolABI.json +105 -0
- package/sdk/src/protocols/aerodrome/abis.ts +62 -0
- package/sdk/src/protocols/aerodrome-slipstream/AerodromeSlipstreamPoolABI.json +96 -0
- package/sdk/src/protocols/aerodrome-slipstream/abis.ts +55 -0
- package/sdk/src/protocols/camelot/CamelotV2FactoryABI.json +25 -0
- package/sdk/src/protocols/camelot/CamelotV2PairABI.json +109 -0
- package/sdk/src/protocols/camelot/CamelotV3FactoryABI.json +25 -0
- package/sdk/src/protocols/camelot/CamelotV3PoolABI.json +92 -0
- package/sdk/src/protocols/camelot/abis.ts +143 -0
- package/sdk/src/protocols/eco-routes/PortalABI.json +1448 -0
- package/sdk/src/protocols/eco-routes/ProverABI.json +162 -0
- package/sdk/src/protocols/eco-routes/abis.ts +1060 -51
- package/sdk/src/protocols/eco-routes/addresses.generated.ts +45 -62
- package/sdk/src/protocols/eco-routes/lookup.ts +18 -0
- package/sdk/src/protocols/maverick/MaverickV2PoolABI.json +107 -0
- package/sdk/src/protocols/maverick/abis.ts +59 -0
- package/sdk/src/protocols/maverick/addresses.ts +4 -0
- package/sdk/src/protocols/pancakeswap-v2/PancakeSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/pancakeswap-v2/abis.ts +44 -0
- package/sdk/src/protocols/pancakeswap-v3/PancakeSwapV3PoolABI.json +100 -0
- package/sdk/src/protocols/pancakeswap-v3/abis.ts +57 -0
- package/sdk/src/protocols/permit2/Permit2ABI.json +154 -0
- package/sdk/src/protocols/permit2/abis.ts +63 -0
- package/sdk/src/protocols/quickswap/QuickSwapV2FactoryABI.json +25 -0
- package/sdk/src/protocols/quickswap/QuickSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/quickswap/QuickSwapV3FactoryABI.json +25 -0
- package/sdk/src/protocols/quickswap/QuickSwapV3PoolABI.json +88 -0
- package/sdk/src/protocols/quickswap/abis.ts +123 -0
- package/sdk/src/protocols/sushiswap-v2/SushiSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/sushiswap-v2/abis.ts +43 -0
- package/sdk/src/protocols/synthra-v3/SynthraV3PoolABI.json +100 -0
- package/sdk/src/protocols/synthra-v3/abis.ts +56 -0
- package/sdk/src/protocols/trader-joe/LBPairABI.json +185 -0
- package/sdk/src/protocols/trader-joe/abis.ts +102 -0
- package/sdk/src/protocols/trader-joe/addresses.ts +5 -0
- package/sdk/src/protocols/uniswap-v2/UniswapV2PairABI.json +72 -0
- package/sdk/src/protocols/uniswap-v2/abis.ts +45 -0
- package/sdk/src/protocols/uniswap-v3/UniswapV3PoolABI.json +100 -0
- package/sdk/src/protocols/uniswap-v3/abis.ts +56 -0
- package/sdk/src/protocols/uniswap-v4/UniswapV4PoolManagerABI.json +38 -0
- package/sdk/src/protocols/uniswap-v4/UniswapV4StateViewABI.json +307 -0
- package/sdk/src/protocols/uniswap-v4/abis.ts +168 -0
- package/sdk/src/protocols/uniswap-v4/addresses.ts +50 -0
- package/sdk/src/protocols/unitflow-v3/UnitFlowV3PoolABI.json +100 -0
- package/sdk/src/protocols/unitflow-v3/abis.ts +57 -0
- package/sdk/src/protocols/velodrome/VelodromePoolABI.json +105 -0
- package/sdk/src/protocols/velodrome/abis.ts +62 -0
- package/skills/sauce-actions/SKILL.md +166 -0
- package/skills/sauce-actions/examples/swap-and-supply.json +24 -0
- package/skills/sauce-actions/examples/swap-by-key.json +15 -0
- package/skills/sauce-actions/references/actions.md +731 -0
- package/skills/sauce-chains/SKILL.md +137 -0
- package/skills/sauce-chains/examples/chains.sauce.ts +25 -0
- package/skills/sauce-chains/references/arbitrum.md +158 -0
- package/skills/sauce-chains/references/arc.md +107 -0
- package/skills/sauce-chains/references/aurora.md +33 -0
- package/skills/sauce-chains/references/avalanche.md +106 -0
- package/skills/sauce-chains/references/base-stocks.md +77 -0
- package/skills/sauce-chains/references/base.md +141 -0
- package/skills/sauce-chains/references/berachain.md +33 -0
- package/skills/sauce-chains/references/blast.md +60 -0
- package/skills/sauce-chains/references/boba.md +33 -0
- package/skills/sauce-chains/references/bsc.md +97 -0
- package/skills/sauce-chains/references/celo.md +57 -0
- package/skills/sauce-chains/references/core.md +33 -0
- package/skills/sauce-chains/references/cronos.md +33 -0
- package/skills/sauce-chains/references/ethereum-stocks.md +1741 -0
- package/skills/sauce-chains/references/ethereum.md +255 -0
- package/skills/sauce-chains/references/evmos.md +33 -0
- package/skills/sauce-chains/references/fantom.md +61 -0
- package/skills/sauce-chains/references/fuse.md +33 -0
- package/skills/sauce-chains/references/gnosis.md +57 -0
- package/skills/sauce-chains/references/index.md +58 -0
- package/skills/sauce-chains/references/ink.md +55 -0
- package/skills/sauce-chains/references/kava.md +33 -0
- package/skills/sauce-chains/references/klaytn.md +33 -0
- package/skills/sauce-chains/references/linea.md +65 -0
- package/skills/sauce-chains/references/manta.md +33 -0
- package/skills/sauce-chains/references/mantle.md +33 -0
- package/skills/sauce-chains/references/metis.md +54 -0
- package/skills/sauce-chains/references/mode.md +55 -0
- package/skills/sauce-chains/references/monad.md +79 -0
- package/skills/sauce-chains/references/moonbeam.md +33 -0
- package/skills/sauce-chains/references/opbnb.md +55 -0
- package/skills/sauce-chains/references/optimism.md +123 -0
- package/skills/sauce-chains/references/plasma.md +35 -0
- package/skills/sauce-chains/references/polygon.md +123 -0
- package/skills/sauce-chains/references/pulsechain.md +33 -0
- package/skills/sauce-chains/references/ronin.md +35 -0
- package/skills/sauce-chains/references/scroll.md +62 -0
- package/skills/sauce-chains/references/sei.md +55 -0
- package/skills/sauce-chains/references/solana-stocks.md +1812 -0
- package/skills/sauce-chains/references/solana.md +56 -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 +213 -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 +3635 -0
- package/skills/sauce-globals/references/tokens.md +53 -0
- package/skills/sauce-intents/SKILL.md +505 -0
- package/skills/sauce-intents/examples/cross-chain.sauce.ts +37 -0
- package/skills/sauce-intents/examples/fund-by-transfer.sauce.ts +54 -0
- package/skills/sauce-intents/examples/intents.mts +343 -0
- package/skills/sauce-intents/examples/swap-on-base.sauce.ts +135 -0
- package/skills/sauce-intents/references/portal.md +77 -0
- package/skills/sauce-overview/SKILL.md +161 -0
- package/skills/sauce-protocols/SKILL.md +118 -0
- package/skills/sauce-protocols/examples/protocols.mts +77 -0
- package/skills/sauce-protocols/examples/protocols.sauce.ts +27 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/aave-v2.md +35 -17
- package/skills/sauce-protocols/references/aave-v3.md +144 -0
- package/skills/sauce-protocols/references/aave-v4.md +50 -0
- package/skills/sauce-protocols/references/abracadabra.md +72 -0
- package/skills/sauce-protocols/references/across.md +73 -0
- package/skills/sauce-protocols/references/aerodrome-slipstream.md +50 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/aerodrome.md +43 -24
- package/skills/sauce-protocols/references/aevo.md +49 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/alchemix.md +10 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/ambient.md +14 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/arbitrum-bridge.md +11 -14
- package/{sdk/src/skills → skills/sauce-protocols/references}/arrakis.md +10 -26
- package/skills/sauce-protocols/references/axelar.md +56 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/balancer-v2.md +13 -29
- package/{sdk/src/skills → skills/sauce-protocols/references}/base-bridge.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/baseswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/beefy.md +10 -30
- package/{sdk/src/skills → skills/sauce-protocols/references}/benqi.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/camelot.md +13 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/cbeth.md +10 -22
- package/skills/sauce-protocols/references/cctp.md +47 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/celer.md +11 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/chainlink-ccip.md +11 -21
- package/skills/sauce-protocols/references/chainlink.md +47 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/circle-gateway.md +12 -38
- package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v2.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v3.md +43 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/connext.md +11 -15
- package/{sdk/src/skills → skills/sauce-protocols/references}/convex.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/cowswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/crvusd.md +10 -19
- package/skills/sauce-protocols/references/curve.md +98 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/debridge.md +11 -33
- package/{sdk/src/skills → skills/sauce-protocols/references}/dodo.md +13 -18
- package/skills/sauce-protocols/references/eigenlayer.md +48 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/ens.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc20.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc3156.md +10 -13
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc4626.md +11 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/ethena.md +10 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/etherfi.md +10 -32
- package/{sdk/src/skills → skills/sauce-protocols/references}/euler-v2.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/fenix.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/fluid.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/frax-ether.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/frax.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/gains-network.md +11 -28
- package/skills/sauce-protocols/references/gamma.md +57 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/gelato.md +12 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/gho.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v1.md +12 -34
- package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v2.md +15 -28
- package/skills/sauce-protocols/references/harvest.md +41 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/hegic.md +10 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/hop.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/hyperlane.md +11 -21
- package/skills/sauce-protocols/references/index.md +355 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/instadapp.md +10 -18
- package/skills/sauce-protocols/references/kelp.md +46 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/kim.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/kyberswap-aggregator.md +12 -35
- package/skills/sauce-protocols/references/kyberswap.md +72 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/layerbank.md +11 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/layerzero.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/level-finance.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/lido.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/lifi.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/linea-bridge.md +11 -14
- package/{sdk/src/skills → skills/sauce-protocols/references}/liquity-v1.md +10 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/liquity-v2.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/lynex.md +12 -18
- package/skills/sauce-protocols/references/maker.md +57 -0
- package/skills/sauce-protocols/references/mantle-meth.md +43 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/maverick.md +13 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/moonwell.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/morpho-blue.md +44 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/mux-protocol.md +10 -30
- package/skills/sauce-protocols/references/olympus.md +39 -0
- package/skills/sauce-protocols/references/oneinch.md +81 -0
- package/skills/sauce-protocols/references/openocean.md +69 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/optimism-bridge.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/opyn.md +10 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/pancakeswap-v2.md +39 -41
- package/skills/sauce-protocols/references/pancakeswap-v3.md +72 -0
- package/skills/sauce-protocols/references/paraswap.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/pendle.md +47 -29
- package/skills/sauce-protocols/references/permit2.md +101 -0
- package/skills/sauce-protocols/references/perpetual-protocol.md +53 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/polygon-bridge.md +11 -17
- package/{sdk/src/skills → skills/sauce-protocols/references}/premia.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/puffer.md +10 -21
- package/skills/sauce-protocols/references/pyth.md +45 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/quickswap.md +13 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/radiant.md +11 -15
- package/{sdk/src/skills → skills/sauce-protocols/references}/ramses.md +12 -18
- package/skills/sauce-protocols/references/reflexer.md +52 -0
- package/skills/sauce-protocols/references/registry/aave-v2.md +43 -0
- package/skills/sauce-protocols/references/registry/aave-v3.md +62 -0
- package/skills/sauce-protocols/references/registry/aave-v4.md +80 -0
- package/skills/sauce-protocols/references/registry/abracadabra.md +54 -0
- package/skills/sauce-protocols/references/registry/across.md +57 -0
- package/skills/sauce-protocols/references/registry/aerodrome-slipstream.md +72 -0
- package/skills/sauce-protocols/references/registry/aerodrome.md +58 -0
- package/skills/sauce-protocols/references/registry/aevo.md +39 -0
- package/skills/sauce-protocols/references/registry/alchemix.md +46 -0
- package/skills/sauce-protocols/references/registry/ambient.md +40 -0
- package/skills/sauce-protocols/references/registry/arbitrum-bridge.md +40 -0
- package/skills/sauce-protocols/references/registry/arrakis.md +49 -0
- package/skills/sauce-protocols/references/registry/axelar.md +65 -0
- package/skills/sauce-protocols/references/registry/balancer-v2.md +50 -0
- package/skills/sauce-protocols/references/registry/base-bridge.md +42 -0
- package/skills/sauce-protocols/references/registry/baseswap.md +40 -0
- package/skills/sauce-protocols/references/registry/beefy.md +51 -0
- package/skills/sauce-protocols/references/registry/benqi.md +49 -0
- package/skills/sauce-protocols/references/registry/camelot.md +82 -0
- package/skills/sauce-protocols/references/registry/cbeth.md +43 -0
- package/skills/sauce-protocols/references/registry/cctp.md +48 -0
- package/skills/sauce-protocols/references/registry/celer.md +44 -0
- package/skills/sauce-protocols/references/registry/chainlink-ccip.md +45 -0
- package/skills/sauce-protocols/references/registry/chainlink.md +49 -0
- package/skills/sauce-protocols/references/registry/circle-gateway.md +70 -0
- package/skills/sauce-protocols/references/registry/compound-v2.md +53 -0
- package/skills/sauce-protocols/references/registry/compound-v3.md +52 -0
- package/skills/sauce-protocols/references/registry/connext.md +41 -0
- package/skills/sauce-protocols/references/registry/convex.md +51 -0
- package/skills/sauce-protocols/references/registry/cowswap.md +40 -0
- package/skills/sauce-protocols/references/registry/crvusd.md +40 -0
- package/skills/sauce-protocols/references/registry/curve.md +81 -0
- package/skills/sauce-protocols/references/registry/debridge.md +59 -0
- package/skills/sauce-protocols/references/registry/dodo.md +39 -0
- package/skills/sauce-protocols/references/registry/eco-routes.md +65 -0
- package/skills/sauce-protocols/references/registry/eigenlayer.md +58 -0
- package/skills/sauce-protocols/references/registry/ens.md +49 -0
- package/skills/sauce-protocols/references/registry/erc20.md +44 -0
- package/skills/sauce-protocols/references/registry/erc3156.md +38 -0
- package/skills/sauce-protocols/references/registry/erc4626.md +51 -0
- package/skills/sauce-protocols/references/registry/ethena.md +50 -0
- package/skills/sauce-protocols/references/registry/etherfi.md +57 -0
- package/skills/sauce-protocols/references/registry/euler-v2.md +49 -0
- package/skills/sauce-protocols/references/registry/fenix.md +39 -0
- package/skills/sauce-protocols/references/registry/fluid.md +48 -0
- package/skills/sauce-protocols/references/registry/frax-ether.md +49 -0
- package/skills/sauce-protocols/references/registry/frax.md +40 -0
- package/skills/sauce-protocols/references/registry/gains-network.md +43 -0
- package/skills/sauce-protocols/references/registry/gamma.md +56 -0
- package/skills/sauce-protocols/references/registry/gelato.md +45 -0
- package/skills/sauce-protocols/references/registry/gho.md +40 -0
- package/skills/sauce-protocols/references/registry/gmx-v1.md +59 -0
- package/skills/sauce-protocols/references/registry/gmx-v2.md +41 -0
- package/skills/sauce-protocols/references/registry/harvest.md +44 -0
- package/skills/sauce-protocols/references/registry/hegic.md +39 -0
- package/skills/sauce-protocols/references/registry/hop.md +49 -0
- package/skills/sauce-protocols/references/registry/hyperlane.md +48 -0
- package/skills/sauce-protocols/references/registry/instadapp.md +39 -0
- package/skills/sauce-protocols/references/registry/kelp.md +47 -0
- package/skills/sauce-protocols/references/registry/kim.md +39 -0
- package/skills/sauce-protocols/references/registry/kyberswap-aggregator.md +49 -0
- package/skills/sauce-protocols/references/registry/kyberswap.md +63 -0
- package/skills/sauce-protocols/references/registry/layerbank.md +54 -0
- package/skills/sauce-protocols/references/registry/layerzero.md +49 -0
- package/skills/sauce-protocols/references/registry/level-finance.md +41 -0
- package/skills/sauce-protocols/references/registry/lido.md +51 -0
- package/skills/sauce-protocols/references/registry/lifi.md +48 -0
- package/skills/sauce-protocols/references/registry/linea-bridge.md +40 -0
- package/skills/sauce-protocols/references/registry/liquity-v1.md +42 -0
- package/skills/sauce-protocols/references/registry/liquity-v2.md +40 -0
- package/skills/sauce-protocols/references/registry/lynex.md +39 -0
- package/skills/sauce-protocols/references/registry/maker.md +55 -0
- package/skills/sauce-protocols/references/registry/mantle-meth.md +48 -0
- package/skills/sauce-protocols/references/registry/maverick.md +60 -0
- package/skills/sauce-protocols/references/registry/moonwell.md +49 -0
- package/skills/sauce-protocols/references/registry/morpho-blue.md +47 -0
- package/skills/sauce-protocols/references/registry/mux-protocol.md +49 -0
- package/skills/sauce-protocols/references/registry/olympus.md +42 -0
- package/skills/sauce-protocols/references/registry/oneinch.md +45 -0
- package/skills/sauce-protocols/references/registry/openocean.md +44 -0
- package/skills/sauce-protocols/references/registry/optimism-bridge.md +42 -0
- package/skills/sauce-protocols/references/registry/opyn.md +42 -0
- package/skills/sauce-protocols/references/registry/pancakeswap-v2.md +71 -0
- package/skills/sauce-protocols/references/registry/pancakeswap-v3.md +76 -0
- package/skills/sauce-protocols/references/registry/paraswap.md +51 -0
- package/skills/sauce-protocols/references/registry/pendle.md +43 -0
- package/skills/sauce-protocols/references/registry/permit2.md +50 -0
- package/skills/sauce-protocols/references/registry/perpetual-protocol.md +49 -0
- package/skills/sauce-protocols/references/registry/polygon-bridge.md +43 -0
- package/skills/sauce-protocols/references/registry/premia.md +40 -0
- package/skills/sauce-protocols/references/registry/puffer.md +43 -0
- package/skills/sauce-protocols/references/registry/pyth.md +40 -0
- package/skills/sauce-protocols/references/registry/quickswap.md +80 -0
- package/skills/sauce-protocols/references/registry/radiant.md +41 -0
- package/skills/sauce-protocols/references/registry/ramses.md +39 -0
- package/skills/sauce-protocols/references/registry/reflexer.md +56 -0
- package/skills/sauce-protocols/references/registry/renzo.md +47 -0
- package/skills/sauce-protocols/references/registry/rocket-pool.md +49 -0
- package/skills/sauce-protocols/references/registry/sablier.md +40 -0
- package/skills/sauce-protocols/references/registry/safe.md +47 -0
- package/skills/sauce-protocols/references/registry/scroll-bridge.md +48 -0
- package/skills/sauce-protocols/references/registry/seamless.md +42 -0
- package/skills/sauce-protocols/references/registry/seaport.md +44 -0
- package/skills/sauce-protocols/references/registry/silo.md +48 -0
- package/skills/sauce-protocols/references/registry/socket.md +44 -0
- package/skills/sauce-protocols/references/registry/sommelier.md +43 -0
- package/skills/sauce-protocols/references/registry/spark.md +42 -0
- package/skills/sauce-protocols/references/registry/spookyswap.md +40 -0
- package/skills/sauce-protocols/references/registry/squid.md +45 -0
- package/skills/sauce-protocols/references/registry/stader.md +47 -0
- package/skills/sauce-protocols/references/registry/stargate.md +45 -0
- package/skills/sauce-protocols/references/registry/superfluid.md +49 -0
- package/skills/sauce-protocols/references/registry/sushiswap-v2.md +71 -0
- package/skills/sauce-protocols/references/registry/swell.md +49 -0
- package/skills/sauce-protocols/references/registry/synapse.md +46 -0
- package/skills/sauce-protocols/references/registry/syncswap.md +38 -0
- package/skills/sauce-protocols/references/registry/synthetix-v3.md +48 -0
- package/skills/sauce-protocols/references/registry/synthra-v3.md +77 -0
- package/skills/sauce-protocols/references/registry/thales.md +51 -0
- package/skills/sauce-protocols/references/registry/thena.md +39 -0
- package/skills/sauce-protocols/references/registry/thruster.md +38 -0
- package/skills/sauce-protocols/references/registry/tokemak.md +45 -0
- package/skills/sauce-protocols/references/registry/trader-joe.md +66 -0
- package/skills/sauce-protocols/references/registry/uniswap-v2.md +77 -0
- package/skills/sauce-protocols/references/registry/uniswap-v3.md +113 -0
- package/skills/sauce-protocols/references/registry/uniswap-v4.md +117 -0
- package/skills/sauce-protocols/references/registry/unitflow-v3.md +65 -0
- package/skills/sauce-protocols/references/registry/velodrome.md +58 -0
- package/skills/sauce-protocols/references/registry/venus.md +62 -0
- package/skills/sauce-protocols/references/registry/vertex.md +46 -0
- package/skills/sauce-protocols/references/registry/wormhole.md +59 -0
- package/skills/sauce-protocols/references/registry/yearn-v3.md +46 -0
- package/skills/sauce-protocols/references/registry/zerolend.md +41 -0
- package/skills/sauce-protocols/references/registry/zerox.md +44 -0
- package/skills/sauce-protocols/references/registry/zksync-bridge.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/renzo.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/rocket-pool.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/sablier.md +10 -27
- package/skills/sauce-protocols/references/safe.md +42 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/scroll-bridge.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/seamless.md +11 -16
- package/skills/sauce-protocols/references/seaport.md +38 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/silo.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/socket.md +11 -18
- package/skills/sauce-protocols/references/sommelier.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/spark.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/spookyswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/squid.md +11 -21
- package/skills/sauce-protocols/references/stader.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/stargate.md +11 -22
- package/{sdk/src/skills → skills/sauce-protocols/references}/superfluid.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/sushiswap-v2.md +38 -43
- package/skills/sauce-protocols/references/swell.md +49 -0
- package/skills/sauce-protocols/references/synapse.md +54 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/syncswap.md +12 -17
- package/{sdk/src/skills → skills/sauce-protocols/references}/synthetix-v3.md +10 -29
- package/skills/sauce-protocols/references/synthra-v3.md +63 -0
- package/skills/sauce-protocols/references/thales.md +58 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/thena.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/thruster.md +13 -18
- package/skills/sauce-protocols/references/tokemak.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/trader-joe.md +13 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/uniswap-v2.md +46 -44
- package/skills/sauce-protocols/references/uniswap-v3.md +188 -0
- package/skills/sauce-protocols/references/uniswap-v4.md +155 -0
- package/skills/sauce-protocols/references/unitflow-v3.md +63 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/velodrome.md +12 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/venus.md +12 -31
- package/skills/sauce-protocols/references/vertex.md +42 -0
- package/skills/sauce-protocols/references/wormhole.md +57 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/yearn-v3.md +10 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/zerolend.md +11 -15
- package/skills/sauce-protocols/references/zerox.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/zksync-bridge.md +11 -14
- package/skills/sauce-script/SKILL.md +407 -0
- package/skills/sauce-script/examples/IOracle.json +12 -0
- package/skills/sauce-script/examples/saucescript.mts +167 -0
- package/skills/sauce-script/examples/twap.sauce.ts +29 -0
- package/skills/sauce-script/references/builtins.json +823 -0
- package/skills/sauce-script/references/builtins.md +674 -0
- package/skills/sauce-solana/SKILL.md +324 -0
- package/skills/sauce-solana/examples/solana.mts +166 -0
- package/skills/sauce-solana/examples/solana.sauce.ts +45 -0
- package/skills/sauce-solana/examples/token-2022.sauce.ts +38 -0
- package/skills/sauce-swaps/SKILL.md +200 -0
- package/skills/sauce-swaps/examples/swap-leg.sauce.ts +50 -0
- package/skills/sauce-swaps/examples/swaps.mts +124 -0
- package/skills/sauce-typescript/SKILL.md +178 -0
- package/skills/sauce-typescript/examples/actions.mts +100 -0
- package/skills/sauce-typescript/examples/compiler.mts +69 -0
- package/skills/sauce-typescript/examples/cook.mts +65 -0
- package/skills/sauce-typescript/examples/verify.mts +104 -0
- package/dev-tools/README.md +0 -16
- package/dev-tools/artifacts/IERC20.json +0 -1
- package/dev-tools/artifacts/ISauceRouter.json +0 -1
- package/dev-tools/artifacts/IUniswapV3Pool.json +0 -1
- package/dev-tools/artifacts/Router.json +0 -1
- package/dev-tools/hardhat.config.cjs +0 -18
- package/dev-tools/sauce/js/add.js +0 -4
- package/dev-tools/sauce/js/call.js +0 -8
- package/dev-tools/sauce/js/erc20.js +0 -18
- package/dev-tools/sauce/js/example.js +0 -6
- package/dev-tools/sauce/js/fibonacci.js +0 -13
- package/dev-tools/sauce/ts/add.ts +0 -4
- package/dev-tools/sauce/ts/call.ts +0 -8
- package/dev-tools/sauce/ts/erc20.ts +0 -18
- package/dev-tools/sauce/ts/example.ts +0 -6
- package/dev-tools/sauce/ts/fibonacci.ts +0 -13
- package/dev-tools/sauce/ts/saucescript.d.ts +0 -1
- package/dev-tools/sauce/ts/tsconfig.json +0 -12
- package/dev-tools/scripts/deploy.ts +0 -107
- package/dev-tools/scripts/init.js +0 -132
- package/dev-tools/scripts/run.ts +0 -67
- package/dev-tools/scripts/start-fork.sh +0 -92
- package/dev-tools/scripts/start-local.sh +0 -120
- package/dev-tools/scripts/stop-local.sh +0 -40
- package/dev-tools/scripts/sync-artifacts.js +0 -46
- package/dev-tools/scripts/sync-price.ts +0 -58
- package/dev-tools/src/contracts.ts +0 -59
- package/dev-tools/src/runner.ts +0 -355
- package/dev-tools/src/svm-local.ts +0 -305
- package/dev-tools/src/sync-price.ts +0 -217
- package/sdk/dist/deployments/v12.generated.d.ts +0 -95
- package/sdk/dist/deployments/v12.generated.d.ts.map +0 -1
- package/sdk/dist/deployments/v12.generated.js +0 -50
- package/sdk/dist/deployments/v12.generated.js.map +0 -1
- package/sdk/dist/swap/index.d.ts +0 -29
- package/sdk/dist/swap/index.d.ts.map +0 -1
- package/sdk/dist/swap/index.js +0 -27
- package/sdk/dist/swap/index.js.map +0 -1
- package/sdk/dist/swap/params.d.ts +0 -29
- package/sdk/dist/swap/params.d.ts.map +0 -1
- package/sdk/dist/swap/params.js +0 -123
- package/sdk/dist/swap/params.js.map +0 -1
- package/sdk/dist/swap/source.d.ts +0 -30
- package/sdk/dist/swap/source.d.ts.map +0 -1
- package/sdk/dist/swap/source.js +0 -101
- package/sdk/dist/swap/source.js.map +0 -1
- package/sdk/dist/swap/types.d.ts +0 -160
- package/sdk/dist/swap/types.d.ts.map +0 -1
- package/sdk/dist/swap/types.js +0 -106
- package/sdk/dist/swap/types.js.map +0 -1
- package/sdk/src/skills/aave-v3.md +0 -134
- package/sdk/src/skills/aave-v4.md +0 -91
- package/sdk/src/skills/abracadabra.md +0 -93
- package/sdk/src/skills/across.md +0 -90
- package/sdk/src/skills/aerodrome-slipstream.md +0 -57
- package/sdk/src/skills/aevo.md +0 -58
- package/sdk/src/skills/axelar.md +0 -80
- package/sdk/src/skills/chainlink.md +0 -62
- package/sdk/src/skills/curve.md +0 -141
- package/sdk/src/skills/eigenlayer.md +0 -71
- package/sdk/src/skills/gamma.md +0 -79
- package/sdk/src/skills/harvest.md +0 -49
- package/sdk/src/skills/index.md +0 -299
- package/sdk/src/skills/kelp.md +0 -60
- package/sdk/src/skills/kyberswap.md +0 -100
- package/sdk/src/skills/loader.ts +0 -46
- package/sdk/src/skills/maker.md +0 -79
- package/sdk/src/skills/mantle-meth.md +0 -60
- package/sdk/src/skills/olympus.md +0 -46
- package/sdk/src/skills/oneinch.md +0 -64
- package/sdk/src/skills/openocean.md +0 -86
- package/sdk/src/skills/pancakeswap-v3.md +0 -104
- package/sdk/src/skills/paraswap.md +0 -67
- package/sdk/src/skills/permit2.md +0 -73
- package/sdk/src/skills/perpetual-protocol.md +0 -73
- package/sdk/src/skills/pyth.md +0 -58
- package/sdk/src/skills/reflexer.md +0 -73
- package/sdk/src/skills/safe.md +0 -56
- package/sdk/src/skills/seaport.md +0 -65
- package/sdk/src/skills/sommelier.md +0 -47
- package/sdk/src/skills/stader.md +0 -53
- package/sdk/src/skills/swell.md +0 -65
- package/sdk/src/skills/synapse.md +0 -63
- package/sdk/src/skills/synthra-v3.md +0 -57
- package/sdk/src/skills/thales.md +0 -74
- package/sdk/src/skills/tokemak.md +0 -48
- package/sdk/src/skills/uniswap-v3.md +0 -202
- package/sdk/src/skills/uniswap-v4.md +0 -125
- package/sdk/src/skills/unitflow-v3.md +0 -62
- package/sdk/src/skills/vertex.md +0 -55
- package/sdk/src/skills/wormhole.md +0 -76
- package/sdk/src/skills/zerox.md +0 -51
|
@@ -0,0 +1,702 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a wallet may send: its policy, `<name>.policy.json` beside it in the wallet directory, and
|
|
3
|
+
* the ledger of what it sent, `<name>.ledger.jsonl`. With no policy file a wallet sends anything
|
|
4
|
+
* its signer could, and every result says no limits are set.
|
|
5
|
+
*
|
|
6
|
+
* A policy (every field optional, every amount a string — whole units, `"1.5"`, or base units
|
|
7
|
+
* ending in `n`, `"1500000n"`, as `--fund` takes them):
|
|
8
|
+
*
|
|
9
|
+
* {
|
|
10
|
+
* "chains": ["base", "ethereum"],
|
|
11
|
+
* "to": ["0x…"],
|
|
12
|
+
* "native": { "perTransaction": "0.01", "perDay": "0.05" },
|
|
13
|
+
* "tokens": { "USDC": { "perTransaction": "100", "perDay": "500" } }
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* - `chains`: the only chains it sends on (slugs, aliases or ids).
|
|
17
|
+
* - `to`: the only addresses a transaction may be sent to — on Solana, the programs its
|
|
18
|
+
* instructions call (the compute-budget program aside).
|
|
19
|
+
* - `native`: the chain's native coin, in its own units (ETH, SOL), leaving the wallet or the Pot
|
|
20
|
+
* a transaction cooks on; on Solana the fee and any rent it pays are included.
|
|
21
|
+
* - `tokens`: by registry symbol or by address (an EVM token, a Solana mint); what leaves the
|
|
22
|
+
* wallet or the Pot it cooks on, and any approval it grants above what is left of the limit
|
|
23
|
+
* (Permit2 aside, which moves nothing without the wallet's signature in a later cook). A token
|
|
24
|
+
* the policy does not name is not limited.
|
|
25
|
+
* - `perDay` is the last 24 hours, every chain together, counted from the ledger.
|
|
26
|
+
*
|
|
27
|
+
* What a transaction moves is MEASURED, not read from its calldata: an EVM transaction is rehearsed
|
|
28
|
+
* by `eth_simulateV1` with transfers traced, and the ERC-20 Transfer and Approval logs and native
|
|
29
|
+
* transfers out of the wallet and its Pot are what count; a Solana one is simulated with the
|
|
30
|
+
* accounts it writes reported, and the wallet's and its Pot's lamports and token accounts compared
|
|
31
|
+
* before and after. What cannot be measured — an endpoint without `eth_simulateV1`, a cook whose
|
|
32
|
+
* native transfers are not traced, a Solana transaction loading accounts from lookup tables — is
|
|
33
|
+
* refused wherever a limit would need it.
|
|
34
|
+
*
|
|
35
|
+
* Every wallet unlocked is GUARDED, policy or not: {@link guardWallet} registers it by address, and
|
|
36
|
+
* the two places every send of this command passes — `chain.ts#sendAndWait` on an EVM chain,
|
|
37
|
+
* `solana.ts`'s `sendAndConfirm` on Solana — ask {@link guardOf} for the sender's guard before
|
|
38
|
+
* sending. A check and its reservation in the ledger happen under a lock file, so two processes
|
|
39
|
+
* cannot both spend the last of a day's limit; the outcome is appended after.
|
|
40
|
+
*
|
|
41
|
+
* NODE-ONLY, like the rest of `cli/`.
|
|
42
|
+
*/
|
|
43
|
+
import { randomUUID } from "node:crypto";
|
|
44
|
+
import { closeSync, openSync, readFileSync, statSync, unlinkSync, writeSync, } from "node:fs";
|
|
45
|
+
import { join } from "node:path";
|
|
46
|
+
import { address as solanaAddress, getBase64EncodedWireTransaction, getBase64Encoder, getCompiledTransactionMessageDecoder, isAddress as isSolanaAddress, } from "@solana/kit";
|
|
47
|
+
import { decodeAbiParameters, formatUnits, getAddress, isAddress, parseUnits, toFunctionSelector, } from "viem";
|
|
48
|
+
import { requireChain } from "../chains/canonical.js";
|
|
49
|
+
import { v12SvmKitchenProgramId } from "../deployments/index.js";
|
|
50
|
+
import { addressOn, getDescriptor } from "../descriptors/query.js";
|
|
51
|
+
import { v12PotAbi } from "../evm/engine.js";
|
|
52
|
+
import { TOKEN_REGISTRY } from "../routes/token-registry.js";
|
|
53
|
+
import { derivePotPda } from "../svm/index.js";
|
|
54
|
+
import { CliError, UsageError } from "./args.js";
|
|
55
|
+
import { nativeSymbol, tokenInfo } from "./effects.js";
|
|
56
|
+
import { requireSupported } from "./support.js";
|
|
57
|
+
import { accountsNow, movedBy, writableAccounts } from "./svm-effects.js";
|
|
58
|
+
/** A policy refused: which limit, and why, in one sentence. */
|
|
59
|
+
export class PolicyRefusal extends CliError {
|
|
60
|
+
limit;
|
|
61
|
+
constructor(
|
|
62
|
+
/** The limit, as the policy file spells its path: `tokens.USDC.perDay`, `chains`, `to`. */
|
|
63
|
+
limit, message) {
|
|
64
|
+
super(message);
|
|
65
|
+
this.limit = limit;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const AMOUNT = /^(?:\d+(?:\.\d+)?|\d+n)$/;
|
|
69
|
+
function amountOf(raw, where) {
|
|
70
|
+
if (typeof raw !== "string" || !AMOUNT.test(raw)) {
|
|
71
|
+
throw new UsageError(`${where} is not an amount: a string of whole units ("1.5") or of base units ending in n ` +
|
|
72
|
+
'("1500000n")');
|
|
73
|
+
}
|
|
74
|
+
return raw.endsWith("n") ? { base: BigInt(raw.slice(0, -1)) } : { units: raw };
|
|
75
|
+
}
|
|
76
|
+
function limitOf(raw, where) {
|
|
77
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
78
|
+
throw new UsageError(`${where} is not { "perTransaction": …, "perDay": … }`);
|
|
79
|
+
}
|
|
80
|
+
const extra = Object.keys(raw).find((key) => key !== "perTransaction" && key !== "perDay");
|
|
81
|
+
if (extra !== undefined) {
|
|
82
|
+
throw new UsageError(`${where}.${extra} is not a limit: perTransaction or perDay`);
|
|
83
|
+
}
|
|
84
|
+
const { perTransaction, perDay } = raw;
|
|
85
|
+
return {
|
|
86
|
+
...(perTransaction === undefined
|
|
87
|
+
? {}
|
|
88
|
+
: { perTransaction: amountOf(perTransaction, `${where}.perTransaction`) }),
|
|
89
|
+
...(perDay === undefined ? {} : { perDay: amountOf(perDay, `${where}.perDay`) }),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const POLICY_KEYS = new Set(["chains", "to", "native", "tokens"]);
|
|
93
|
+
/** A policy file's text, checked whole: an unknown field is an error, never ignored. */
|
|
94
|
+
export function parsePolicy(text, path) {
|
|
95
|
+
let parsed;
|
|
96
|
+
try {
|
|
97
|
+
parsed = JSON.parse(text);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
throw new UsageError(`${path} is not JSON`);
|
|
101
|
+
}
|
|
102
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
103
|
+
throw new UsageError(`${path} is not a JSON object`);
|
|
104
|
+
}
|
|
105
|
+
const fields = parsed;
|
|
106
|
+
const unknown = Object.keys(fields).find((key) => !POLICY_KEYS.has(key));
|
|
107
|
+
if (unknown !== undefined) {
|
|
108
|
+
throw new UsageError(`${path}: ${unknown} is not a policy field (chains, to, native, tokens)`);
|
|
109
|
+
}
|
|
110
|
+
const list = (key) => {
|
|
111
|
+
const value = fields[key];
|
|
112
|
+
if (value === undefined)
|
|
113
|
+
return undefined;
|
|
114
|
+
if (!Array.isArray(value))
|
|
115
|
+
throw new UsageError(`${path}: ${key} is not a list`);
|
|
116
|
+
return value;
|
|
117
|
+
};
|
|
118
|
+
const chains = list("chains")?.map((raw) => {
|
|
119
|
+
try {
|
|
120
|
+
return requireChain(typeof raw === "number" ? raw : String(raw));
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
throw new UsageError(`${path}: chains names ${JSON.stringify(raw)}, which is not a chain`);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
const to = list("to")?.map((raw) => {
|
|
127
|
+
if (typeof raw === "string" && isAddress(raw, { strict: false }))
|
|
128
|
+
return raw.toLowerCase();
|
|
129
|
+
if (typeof raw === "string" && isSolanaAddress(raw))
|
|
130
|
+
return raw;
|
|
131
|
+
throw new UsageError(`${path}: to names ${JSON.stringify(raw)}, which is not an address`);
|
|
132
|
+
});
|
|
133
|
+
const tokens = new Map();
|
|
134
|
+
if (fields.tokens !== undefined) {
|
|
135
|
+
if (fields.tokens === null ||
|
|
136
|
+
typeof fields.tokens !== "object" ||
|
|
137
|
+
Array.isArray(fields.tokens)) {
|
|
138
|
+
throw new UsageError(`${path}: tokens is not an object of token to limit`);
|
|
139
|
+
}
|
|
140
|
+
for (const [key, raw] of Object.entries(fields.tokens)) {
|
|
141
|
+
const named = isAddress(key, { strict: false })
|
|
142
|
+
? key.toLowerCase()
|
|
143
|
+
: isSolanaAddress(key)
|
|
144
|
+
? key
|
|
145
|
+
: /^[A-Za-z][A-Za-z0-9.]{0,15}$/.test(key)
|
|
146
|
+
? key.toUpperCase()
|
|
147
|
+
: undefined;
|
|
148
|
+
if (named === undefined) {
|
|
149
|
+
throw new UsageError(`${path}: tokens.${key} is neither a token symbol nor an address`);
|
|
150
|
+
}
|
|
151
|
+
tokens.set(named, limitOf(raw, `${path}: tokens.${key}`));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
path,
|
|
156
|
+
...(chains === undefined ? {} : { chains }),
|
|
157
|
+
...(to === undefined ? {} : { to }),
|
|
158
|
+
...(fields.native === undefined ? {} : { native: limitOf(fields.native, `${path}: native`) }),
|
|
159
|
+
tokens,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The wallet's policy, `undefined` when it has none. A file that others may write is refused: they
|
|
164
|
+
* could loosen it.
|
|
165
|
+
*/
|
|
166
|
+
export function readPolicy(info) {
|
|
167
|
+
let stats;
|
|
168
|
+
try {
|
|
169
|
+
stats = statSync(info.policyPath);
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
if (error.code === "ENOENT")
|
|
173
|
+
return undefined;
|
|
174
|
+
throw new CliError(`${info.policyPath} is unreadable`);
|
|
175
|
+
}
|
|
176
|
+
if (process.platform !== "win32" && (stats.mode & 0o022) !== 0) {
|
|
177
|
+
throw new CliError(`${info.policyPath} can be written by others (mode ${(stats.mode & 0o777).toString(8)}), ` +
|
|
178
|
+
`who could loosen it: \`chmod 600 ${info.policyPath}\``);
|
|
179
|
+
}
|
|
180
|
+
return parsePolicy(readFileSync(info.policyPath, "utf8"), info.policyPath);
|
|
181
|
+
}
|
|
182
|
+
/** What a send result says of a wallet with no policy. */
|
|
183
|
+
export const noPolicyNote = (info) => `wallet ${info.name} has no policy, so no limits are set on what it sends: ${info.policyPath} ` +
|
|
184
|
+
"sets them (per transaction and per day, by chain, by recipient, native and per token)";
|
|
185
|
+
// ---------------------------------------------------------------------------------------------
|
|
186
|
+
// Amounts, compared across chains
|
|
187
|
+
// ---------------------------------------------------------------------------------------------
|
|
188
|
+
/** Every amount is compared at 36 decimals: exact for any token with up to 36 of its own. */
|
|
189
|
+
const SCALE = 36;
|
|
190
|
+
const scaled = (amount, decimals) => amount * 10n ** BigInt(SCALE - Math.min(decimals, SCALE));
|
|
191
|
+
const limitScaled = (limit, decimals) => "base" in limit ? scaled(limit.base, decimals) : parseUnits(limit.units, SCALE);
|
|
192
|
+
/** `value` at {@link SCALE}, as whole units for a person. */
|
|
193
|
+
const whole = (value) => formatUnits(value, SCALE);
|
|
194
|
+
const TRANSFER = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef";
|
|
195
|
+
const APPROVAL = "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925";
|
|
196
|
+
/** Where `traceTransfers` reports native transfers, as ERC-20 Transfer logs. */
|
|
197
|
+
const NATIVE_EMITTER = getAddress("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE");
|
|
198
|
+
const COOK = toFunctionSelector(v12PotAbi.find((item) => item.type === "function" && item.name === "cook"));
|
|
199
|
+
const topicAddress = (topic) => getAddress(`0x${topic.slice(26)}`);
|
|
200
|
+
const wordOf = (data) => data.length === 66 ? decodeAbiParameters([{ type: "uint256" }], data)[0] : undefined;
|
|
201
|
+
/** The token's registry symbol and decimals on `chain`, else its own decimals. */
|
|
202
|
+
async function evmToken(client, chain, token) {
|
|
203
|
+
const row = (TOKEN_REGISTRY[chain.id] ?? []).find((entry) => getAddress(entry.address) === token);
|
|
204
|
+
if (row !== undefined)
|
|
205
|
+
return { symbol: row.symbol, decimals: row.decimals };
|
|
206
|
+
const info = await tokenInfo(client, chain, token);
|
|
207
|
+
return info.decimals === undefined ? {} : { decimals: info.decimals };
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* `calls` rehearsed in order from `wallet` in one `eth_simulateV1` block, state carried from each to
|
|
211
|
+
* the next and native transfers traced; `undefined` where the endpoint does not run it.
|
|
212
|
+
*/
|
|
213
|
+
export async function rehearsePlan(client, wallet, calls) {
|
|
214
|
+
try {
|
|
215
|
+
const [block] = await client.simulateBlocks({
|
|
216
|
+
blocks: [
|
|
217
|
+
{
|
|
218
|
+
calls: calls.map((call) => ({
|
|
219
|
+
account: wallet,
|
|
220
|
+
to: call.to,
|
|
221
|
+
data: call.data,
|
|
222
|
+
value: call.value,
|
|
223
|
+
})),
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
traceTransfers: true,
|
|
227
|
+
validation: false,
|
|
228
|
+
});
|
|
229
|
+
return (block?.calls ?? []).map((call) => ({
|
|
230
|
+
status: call.status === "success" ? "success" : "failure",
|
|
231
|
+
logs: (call.logs ?? []).map((log) => ({
|
|
232
|
+
address: getAddress(log.address),
|
|
233
|
+
topics: log.topics,
|
|
234
|
+
data: log.data,
|
|
235
|
+
})),
|
|
236
|
+
data: call.data,
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
return undefined;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* What `calls`, sent in order from `wallet`, move out of the wallet and the Pot each cooks on: one
|
|
245
|
+
* {@link Measured} per call, from `rehearsed` (a {@link rehearsePlan} of them; rehearsed here when
|
|
246
|
+
* not given). Where the endpoint does not run `eth_simulateV1` the movements are unmeasured; a call
|
|
247
|
+
* that fails is refused, as a send would be.
|
|
248
|
+
*/
|
|
249
|
+
export async function measureEvm(client, chain, wallet, calls, rehearsed) {
|
|
250
|
+
const results = rehearsed ?? (await rehearsePlan(client, wallet, calls));
|
|
251
|
+
const measured = [];
|
|
252
|
+
for (const [index, call] of calls.entries()) {
|
|
253
|
+
const cook = call.data.slice(0, 10).toLowerCase() === COOK ? getAddress(call.to) : undefined;
|
|
254
|
+
const ours = new Set([getAddress(wallet), ...(cook === undefined ? [] : [cook])]);
|
|
255
|
+
const base = {
|
|
256
|
+
chain,
|
|
257
|
+
to: [call.to.toLowerCase()],
|
|
258
|
+
approvals: [],
|
|
259
|
+
};
|
|
260
|
+
const nativeOf = (amount) => ({
|
|
261
|
+
token: "native",
|
|
262
|
+
symbol: nativeSymbol(chain),
|
|
263
|
+
decimals: 18,
|
|
264
|
+
amount,
|
|
265
|
+
});
|
|
266
|
+
const result = results?.[index];
|
|
267
|
+
if (result === undefined) {
|
|
268
|
+
measured.push({
|
|
269
|
+
...base,
|
|
270
|
+
native: nativeOf(call.value),
|
|
271
|
+
tokens: [],
|
|
272
|
+
unmeasured: {
|
|
273
|
+
tokens: "the endpoint did not run eth_simulateV1, which shows what a transaction moves",
|
|
274
|
+
...(cook === undefined
|
|
275
|
+
? {}
|
|
276
|
+
: {
|
|
277
|
+
native: "the endpoint did not run eth_simulateV1, so what the cook moves from the Pot is not known",
|
|
278
|
+
}),
|
|
279
|
+
},
|
|
280
|
+
});
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
if (result.status !== "success") {
|
|
284
|
+
throw new CliError(`transaction ${index + 1} of ${calls.length} would revert in the rehearsal, so nothing was sent`);
|
|
285
|
+
}
|
|
286
|
+
const logs = result.logs ?? [];
|
|
287
|
+
const traced = logs.some((log) => getAddress(log.address) === NATIVE_EMITTER);
|
|
288
|
+
let native = 0n;
|
|
289
|
+
const tokens = new Map();
|
|
290
|
+
const approvals = [];
|
|
291
|
+
for (const log of logs) {
|
|
292
|
+
const [topic, one, two] = log.topics;
|
|
293
|
+
const amount = wordOf(log.data);
|
|
294
|
+
if (amount === undefined || log.topics.length !== 3)
|
|
295
|
+
continue;
|
|
296
|
+
const emitter = getAddress(log.address);
|
|
297
|
+
if (topic?.toLowerCase() === TRANSFER) {
|
|
298
|
+
const from = topicAddress(one);
|
|
299
|
+
const to = topicAddress(two);
|
|
300
|
+
if (!ours.has(from) || ours.has(to))
|
|
301
|
+
continue;
|
|
302
|
+
if (emitter === NATIVE_EMITTER)
|
|
303
|
+
native += amount;
|
|
304
|
+
else
|
|
305
|
+
tokens.set(emitter, (tokens.get(emitter) ?? 0n) + amount);
|
|
306
|
+
}
|
|
307
|
+
else if (topic?.toLowerCase() === APPROVAL && ours.has(topicAddress(one))) {
|
|
308
|
+
approvals.push({ token: emitter, spender: topicAddress(two), amount });
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
// An account's own native leaves only as a transaction's value, which a trace shows; with no
|
|
312
|
+
// trace, the value is what the wallet sends, and a cook's Pot is not seen.
|
|
313
|
+
const untraced = !traced && (call.value > 0n || cook !== undefined);
|
|
314
|
+
const known = new Map();
|
|
315
|
+
const info = async (token) => {
|
|
316
|
+
if (!known.has(token))
|
|
317
|
+
known.set(token, await evmToken(client, chain, token));
|
|
318
|
+
return known.get(token);
|
|
319
|
+
};
|
|
320
|
+
measured.push({
|
|
321
|
+
...base,
|
|
322
|
+
native: nativeOf(untraced ? call.value : native),
|
|
323
|
+
tokens: await Promise.all([...tokens].map(async ([token, amount]) => ({
|
|
324
|
+
token,
|
|
325
|
+
...(await info(token)),
|
|
326
|
+
amount,
|
|
327
|
+
}))),
|
|
328
|
+
approvals: await Promise.all(approvals.map(async (approval) => ({
|
|
329
|
+
token: approval.token,
|
|
330
|
+
...(await info(approval.token)),
|
|
331
|
+
amount: approval.amount,
|
|
332
|
+
spender: approval.spender,
|
|
333
|
+
}))),
|
|
334
|
+
unmeasured: untraced && cook !== undefined
|
|
335
|
+
? {
|
|
336
|
+
native: "the endpoint does not trace native transfers, so what the cook moves from the Pot is not known",
|
|
337
|
+
}
|
|
338
|
+
: {},
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
return measured;
|
|
342
|
+
}
|
|
343
|
+
/** The Kitchen's two cooks, whose data starts with the Pot's salt. */
|
|
344
|
+
const KITCHEN_COOKS = [
|
|
345
|
+
[147, 233, 205, 239, 200, 21, 190, 159],
|
|
346
|
+
[247, 166, 195, 248, 78, 176, 147, 84],
|
|
347
|
+
];
|
|
348
|
+
/** The compute-budget program: a transaction's plumbing, not where it goes. */
|
|
349
|
+
const COMPUTE_BUDGET = "ComputeBudget111111111111111111111111111111";
|
|
350
|
+
/**
|
|
351
|
+
* What a signed Solana `transaction` moves out of `wallet` and the Pots it cooks on, as a
|
|
352
|
+
* simulation that reports its writable accounts shows it; a transaction that would fail is refused.
|
|
353
|
+
*/
|
|
354
|
+
export async function measureSvm(rpc, chain, wallet, transaction) {
|
|
355
|
+
const message = getCompiledTransactionMessageDecoder().decode(transaction.messageBytes);
|
|
356
|
+
const kitchen = solanaAddress(v12SvmKitchenProgramId());
|
|
357
|
+
const pots = [];
|
|
358
|
+
const programs = new Set();
|
|
359
|
+
for (const instruction of message.instructions) {
|
|
360
|
+
const program = message.staticAccounts[instruction.programAddressIndex];
|
|
361
|
+
if (program !== COMPUTE_BUDGET)
|
|
362
|
+
programs.add(program);
|
|
363
|
+
const data = instruction.data ?? new Uint8Array();
|
|
364
|
+
const owner = message.staticAccounts[instruction.accountIndices?.[0] ?? -1];
|
|
365
|
+
if (program === kitchen &&
|
|
366
|
+
owner === wallet &&
|
|
367
|
+
data.length >= 40 &&
|
|
368
|
+
KITCHEN_COOKS.some((head) => head.every((byte, at) => data[at] === byte))) {
|
|
369
|
+
pots.push((await derivePotPda(kitchen, wallet, data.slice(8, 40))).address);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
const base = { chain, to: [...programs] };
|
|
373
|
+
const native = (amount) => ({
|
|
374
|
+
token: "native",
|
|
375
|
+
symbol: "SOL",
|
|
376
|
+
decimals: 9,
|
|
377
|
+
amount,
|
|
378
|
+
});
|
|
379
|
+
if ((message.addressTableLookups ?? []).length > 0) {
|
|
380
|
+
return {
|
|
381
|
+
...base,
|
|
382
|
+
native: native(0n),
|
|
383
|
+
tokens: [],
|
|
384
|
+
approvals: [],
|
|
385
|
+
unmeasured: {
|
|
386
|
+
native: "it loads accounts from lookup tables, which are not measured",
|
|
387
|
+
tokens: "it loads accounts from lookup tables, which are not measured",
|
|
388
|
+
},
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
const tracked = writableAccounts(transaction);
|
|
392
|
+
const before = await accountsNow(rpc, tracked);
|
|
393
|
+
const wire = getBase64EncodedWireTransaction(transaction);
|
|
394
|
+
const { value } = await rpc
|
|
395
|
+
.simulateTransaction(wire, {
|
|
396
|
+
encoding: "base64",
|
|
397
|
+
sigVerify: false,
|
|
398
|
+
accounts: { addresses: tracked, encoding: "base64" },
|
|
399
|
+
})
|
|
400
|
+
.send();
|
|
401
|
+
if (value.err !== null) {
|
|
402
|
+
throw new CliError("the transaction would fail in the rehearsal, so nothing was sent");
|
|
403
|
+
}
|
|
404
|
+
const after = (value.accounts ?? []).map((account) => account === null
|
|
405
|
+
? null
|
|
406
|
+
: {
|
|
407
|
+
lamports: BigInt(account.lamports),
|
|
408
|
+
owner: account.owner,
|
|
409
|
+
data: new Uint8Array(getBase64Encoder().encode(account.data[0])),
|
|
410
|
+
executable: account.executable,
|
|
411
|
+
});
|
|
412
|
+
const moved = await movedBy(rpc, chain, tracked, before, after, new Map(), wallet);
|
|
413
|
+
const ours = new Set([wallet, ...pots]);
|
|
414
|
+
const lamports = moved.lamports
|
|
415
|
+
.filter((change) => ours.has(change.account))
|
|
416
|
+
.reduce((sum, change) => sum + change.before - change.after, 0n);
|
|
417
|
+
const byMint = new Map();
|
|
418
|
+
for (const change of moved.tokens) {
|
|
419
|
+
if (!ours.has(change.owner))
|
|
420
|
+
continue;
|
|
421
|
+
const seen = byMint.get(change.mint) ?? {
|
|
422
|
+
amount: 0n,
|
|
423
|
+
...(change.symbol === undefined ? {} : { symbol: change.symbol }),
|
|
424
|
+
...(change.decimals === undefined ? {} : { decimals: change.decimals }),
|
|
425
|
+
};
|
|
426
|
+
byMint.set(change.mint, { ...seen, amount: seen.amount + change.before - change.after });
|
|
427
|
+
}
|
|
428
|
+
return {
|
|
429
|
+
...base,
|
|
430
|
+
native: native(lamports > 0n ? lamports : 0n),
|
|
431
|
+
tokens: [...byMint]
|
|
432
|
+
.filter(([, out]) => out.amount > 0n)
|
|
433
|
+
.map(([token, out]) => ({ token, ...out })),
|
|
434
|
+
approvals: [],
|
|
435
|
+
unmeasured: {},
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
439
|
+
/** Each limit's total over the last 24 hours, at {@link SCALE}: every reservation not released. */
|
|
440
|
+
function dayTotals(path, now) {
|
|
441
|
+
let text;
|
|
442
|
+
try {
|
|
443
|
+
text = readFileSync(path, "utf8");
|
|
444
|
+
}
|
|
445
|
+
catch (error) {
|
|
446
|
+
if (error.code === "ENOENT")
|
|
447
|
+
return new Map();
|
|
448
|
+
throw new CliError(`${path} is unreadable`);
|
|
449
|
+
}
|
|
450
|
+
const reserved = new Map();
|
|
451
|
+
const released = new Set();
|
|
452
|
+
for (const line of text.split("\n")) {
|
|
453
|
+
if (line.trim() === "")
|
|
454
|
+
continue;
|
|
455
|
+
let entry;
|
|
456
|
+
try {
|
|
457
|
+
entry = JSON.parse(line);
|
|
458
|
+
}
|
|
459
|
+
catch {
|
|
460
|
+
// A line cut short by a crash: what it reserved is not known, so the policy cannot be held.
|
|
461
|
+
throw new CliError(`${path} has a line that is not JSON: the day's spending cannot be counted. Look at the ` +
|
|
462
|
+
"file, and remove the broken line");
|
|
463
|
+
}
|
|
464
|
+
if (entry.state === "reserved")
|
|
465
|
+
reserved.set(entry.id, entry);
|
|
466
|
+
else if (entry.state === "released")
|
|
467
|
+
released.add(entry.id);
|
|
468
|
+
}
|
|
469
|
+
const totals = new Map();
|
|
470
|
+
for (const [id, entry] of reserved) {
|
|
471
|
+
if (released.has(id) || now - Date.parse(entry.time) >= DAY_MS)
|
|
472
|
+
continue;
|
|
473
|
+
for (const [limit, spent] of Object.entries(entry.spend)) {
|
|
474
|
+
totals.set(limit, (totals.get(limit) ?? 0n) + scaled(BigInt(spent.amount), spent.decimals));
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
return totals;
|
|
478
|
+
}
|
|
479
|
+
/** Appends `line` to the ledger in one write, 0600. */
|
|
480
|
+
function appendLine(path, line) {
|
|
481
|
+
const fd = openSync(path, "a", 0o600);
|
|
482
|
+
try {
|
|
483
|
+
writeSync(fd, `${JSON.stringify(line)}\n`);
|
|
484
|
+
}
|
|
485
|
+
finally {
|
|
486
|
+
closeSync(fd);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
/** Runs `body` holding the wallet's lock file, so a check and its reservation are one step. */
|
|
490
|
+
async function locked(path, body) {
|
|
491
|
+
for (const started = Date.now();;) {
|
|
492
|
+
try {
|
|
493
|
+
closeSync(openSync(path, "wx", 0o600));
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
catch (error) {
|
|
497
|
+
if (error.code !== "EEXIST")
|
|
498
|
+
throw error;
|
|
499
|
+
// A lock older than a minute is a process that died holding it.
|
|
500
|
+
const age = Date.now() - (statSync(path, { throwIfNoEntry: false })?.mtimeMs ?? Date.now());
|
|
501
|
+
if (age > 60_000) {
|
|
502
|
+
unlinkSync(path);
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (Date.now() - started > 15_000) {
|
|
506
|
+
throw new CliError(`${path} has been held for 15s by another send: try again`);
|
|
507
|
+
}
|
|
508
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
try {
|
|
512
|
+
return body();
|
|
513
|
+
}
|
|
514
|
+
finally {
|
|
515
|
+
unlinkSync(path);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
/** Whether the policy's token key `key` names `outflow` on its chain. */
|
|
519
|
+
function names(key, outflow) {
|
|
520
|
+
if (outflow.token === "native")
|
|
521
|
+
return false;
|
|
522
|
+
if (key.startsWith("0x"))
|
|
523
|
+
return outflow.token.toLowerCase() === key;
|
|
524
|
+
if (isSolanaAddress(key))
|
|
525
|
+
return outflow.token === key;
|
|
526
|
+
return outflow.symbol?.toUpperCase() === key;
|
|
527
|
+
}
|
|
528
|
+
const shown = (amount, outflow) => `${outflow.decimals === undefined ? `${amount} base units` : formatUnits(amount, outflow.decimals)} ${outflow.symbol ?? outflow.token}`;
|
|
529
|
+
/** The registry's Permit2 on `chain`, lowercase; `undefined` where it has none. */
|
|
530
|
+
function permit2Of(chain) {
|
|
531
|
+
const descriptor = getDescriptor("permit2", "Permit2");
|
|
532
|
+
return descriptor === undefined ? undefined : addressOn(descriptor, chain)?.toLowerCase();
|
|
533
|
+
}
|
|
534
|
+
/** What `measured` counts against each of `policy`'s limits; a refusal naming the first it breaks. */
|
|
535
|
+
function spendOf(wallet, policy, measured, totals) {
|
|
536
|
+
const refuse = (limit, why) => {
|
|
537
|
+
throw new PolicyRefusal(limit, `refused by the policy of wallet ${wallet} (${policy.path}): ${why}`);
|
|
538
|
+
};
|
|
539
|
+
const { chain } = measured;
|
|
540
|
+
if (policy.chains !== undefined && !policy.chains.some((each) => each.id === chain.id)) {
|
|
541
|
+
refuse("chains", `chains allows ${policy.chains.map((each) => each.slug).join(", ")}, and this transaction is on ${chain.slug}`);
|
|
542
|
+
}
|
|
543
|
+
if (policy.to !== undefined) {
|
|
544
|
+
const off = measured.to.find((to) => !policy.to.includes(to));
|
|
545
|
+
if (off !== undefined) {
|
|
546
|
+
refuse("to", `to allows ${policy.to.length} address(es), and this transaction goes to ${off}`);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
const spend = {};
|
|
550
|
+
const hold = (limitName, limit, amount, unit) => {
|
|
551
|
+
if (unit.decimals === undefined) {
|
|
552
|
+
refuse(limitName, `the decimals of ${unit.symbol ?? unit.token} could not be read, so it cannot be held to the limit`);
|
|
553
|
+
}
|
|
554
|
+
const value = scaled(amount, unit.decimals);
|
|
555
|
+
const text = (at) => `${whole(at)} ${unit.symbol ?? unit.token}`;
|
|
556
|
+
if (limit.perTransaction !== undefined) {
|
|
557
|
+
const cap = limitScaled(limit.perTransaction, unit.decimals);
|
|
558
|
+
if (value > cap) {
|
|
559
|
+
refuse(`${limitName}.perTransaction`, `${limitName}.perTransaction is ${text(cap)}, and this transaction sends ${shown(amount, unit)}`);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
if (limit.perDay !== undefined) {
|
|
563
|
+
const cap = limitScaled(limit.perDay, unit.decimals);
|
|
564
|
+
const before = totals.get(limitName) ?? 0n;
|
|
565
|
+
if (before + value > cap) {
|
|
566
|
+
refuse(`${limitName}.perDay`, `${limitName}.perDay is ${text(cap)}; ${text(before)} went in the last 24 hours, and ` +
|
|
567
|
+
`this transaction sends ${shown(amount, unit)}`);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
if (amount > 0n)
|
|
571
|
+
spend[limitName] = { amount: amount.toString(), decimals: unit.decimals };
|
|
572
|
+
};
|
|
573
|
+
if (policy.native !== undefined) {
|
|
574
|
+
if (measured.unmeasured.native !== undefined) {
|
|
575
|
+
refuse("native", `native is limited, and ${measured.unmeasured.native}`);
|
|
576
|
+
}
|
|
577
|
+
hold("native", policy.native, measured.native.amount, measured.native);
|
|
578
|
+
}
|
|
579
|
+
for (const [key, limit] of policy.tokens) {
|
|
580
|
+
if (measured.unmeasured.tokens !== undefined) {
|
|
581
|
+
refuse(`tokens.${key}`, `tokens.${key} is limited, and ${measured.unmeasured.tokens}`);
|
|
582
|
+
}
|
|
583
|
+
const matching = measured.tokens.filter((outflow) => names(key, outflow));
|
|
584
|
+
for (const outflow of matching)
|
|
585
|
+
hold(`tokens.${key}`, limit, outflow.amount, outflow);
|
|
586
|
+
const permit2 = permit2Of(chain);
|
|
587
|
+
for (const approval of measured.approvals.filter((each) => names(key, each))) {
|
|
588
|
+
if (approval.spender.toLowerCase() === permit2 || approval.decimals === undefined)
|
|
589
|
+
continue;
|
|
590
|
+
const value = scaled(approval.amount, approval.decimals);
|
|
591
|
+
const caps = [
|
|
592
|
+
limit.perTransaction === undefined
|
|
593
|
+
? undefined
|
|
594
|
+
: limitScaled(limit.perTransaction, approval.decimals),
|
|
595
|
+
limit.perDay === undefined
|
|
596
|
+
? undefined
|
|
597
|
+
: limitScaled(limit.perDay, approval.decimals) - (totals.get(`tokens.${key}`) ?? 0n),
|
|
598
|
+
].filter((cap) => cap !== undefined);
|
|
599
|
+
const cap = caps.length === 0 ? undefined : caps.reduce((a, b) => (a < b ? a : b));
|
|
600
|
+
if (cap !== undefined && value > cap) {
|
|
601
|
+
refuse(`tokens.${key}`, `this transaction approves ${approval.spender} for ${shown(approval.amount, approval)}, ` +
|
|
602
|
+
`more than the ${whole(cap > 0n ? cap : 0n)} ${approval.symbol ?? approval.token} tokens.${key} leaves room for`);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
return spend;
|
|
607
|
+
}
|
|
608
|
+
const NOTHING = { sent: () => undefined, released: () => undefined };
|
|
609
|
+
/**
|
|
610
|
+
* The release's chain gate (`support.ts#requireSupported`), for every send a wallet makes: wallets
|
|
611
|
+
* send only where the release sends at all, so a raw transaction a wallet is handed is held to it
|
|
612
|
+
* as a built one is — refused on a preview chain before anything is measured, signed or sent.
|
|
613
|
+
*/
|
|
614
|
+
const releaseGate = (chain) => requireSupported("sending from a wallet", [chain]);
|
|
615
|
+
/** A wallet's guard: its policy (if any), and the ledger and lock beside it. */
|
|
616
|
+
export class SendGuard {
|
|
617
|
+
wallet;
|
|
618
|
+
policy;
|
|
619
|
+
ledger;
|
|
620
|
+
lock;
|
|
621
|
+
constructor(wallet, policy) {
|
|
622
|
+
this.wallet = wallet;
|
|
623
|
+
this.policy = policy;
|
|
624
|
+
const dir = wallet.policyPath.slice(0, -`${wallet.name}.policy.json`.length);
|
|
625
|
+
this.ledger = join(dir, `${wallet.name}.ledger.jsonl`);
|
|
626
|
+
this.lock = join(dir, `${wallet.name}.lock`);
|
|
627
|
+
}
|
|
628
|
+
/** Every check before a send that does not need what the transaction moves. */
|
|
629
|
+
gate(chain) {
|
|
630
|
+
releaseGate(chain);
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Checks a plan's transactions against the policy before any is sent: each one's limits, and
|
|
634
|
+
* the day's totals with the earlier ones counted. Nothing is reserved; each is again when sent.
|
|
635
|
+
*/
|
|
636
|
+
async preflight(measured) {
|
|
637
|
+
for (const each of measured)
|
|
638
|
+
this.gate(each.chain);
|
|
639
|
+
const policy = this.policy;
|
|
640
|
+
if (policy === undefined)
|
|
641
|
+
return;
|
|
642
|
+
await locked(this.lock, () => {
|
|
643
|
+
const totals = dayTotals(this.ledger, Date.now());
|
|
644
|
+
for (const each of measured) {
|
|
645
|
+
for (const [limit, spent] of Object.entries(spendOf(this.wallet.name, policy, each, totals))) {
|
|
646
|
+
totals.set(limit, (totals.get(limit) ?? 0n) + scaled(BigInt(spent.amount), spent.decimals));
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
/** Checks one transaction and reserves what it spends, in one step under the lock. */
|
|
652
|
+
async reserve(policy, measured) {
|
|
653
|
+
const id = randomUUID();
|
|
654
|
+
const ledger = this.ledger;
|
|
655
|
+
const close = (line) => appendLine(ledger, line);
|
|
656
|
+
return locked(this.lock, () => {
|
|
657
|
+
const spend = spendOf(this.wallet.name, policy, measured, dayTotals(ledger, Date.now()));
|
|
658
|
+
close({
|
|
659
|
+
v: 1,
|
|
660
|
+
id,
|
|
661
|
+
state: "reserved",
|
|
662
|
+
time: new Date().toISOString(),
|
|
663
|
+
chain: measured.chain.slug,
|
|
664
|
+
spend,
|
|
665
|
+
});
|
|
666
|
+
return {
|
|
667
|
+
sent: (tx) => close({ v: 1, id, state: "sent", time: new Date().toISOString(), tx }),
|
|
668
|
+
released: (why) => close({ v: 1, id, state: "released", time: new Date().toISOString(), why }),
|
|
669
|
+
};
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
/** Measures and reserves one EVM transaction, just before it is sent. */
|
|
673
|
+
async evm(client, tx) {
|
|
674
|
+
const chain = requireChain(await client.getChainId());
|
|
675
|
+
this.gate(chain);
|
|
676
|
+
if (this.policy === undefined)
|
|
677
|
+
return NOTHING;
|
|
678
|
+
const [measured] = await measureEvm(client, chain, getAddress(this.wallet.address), [tx]);
|
|
679
|
+
return this.reserve(this.policy, measured);
|
|
680
|
+
}
|
|
681
|
+
/** Measures and reserves one signed Solana transaction, just before it is sent. */
|
|
682
|
+
async svm(rpc, transaction) {
|
|
683
|
+
const chain = requireChain("solana");
|
|
684
|
+
this.gate(chain);
|
|
685
|
+
if (this.policy === undefined)
|
|
686
|
+
return NOTHING;
|
|
687
|
+
const measured = await measureSvm(rpc, chain, solanaAddress(this.wallet.address), transaction);
|
|
688
|
+
return this.reserve(this.policy, measured);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
/** Every wallet this process has unlocked, by address: the guard its sends pass. */
|
|
692
|
+
const guards = new Map();
|
|
693
|
+
/** Guards the wallet `info`: from now on every send from its address passes its policy. */
|
|
694
|
+
export function guardWallet(info, policy) {
|
|
695
|
+
const guard = new SendGuard(info, policy);
|
|
696
|
+
guards.set(keyOf(info.address), guard);
|
|
697
|
+
return guard;
|
|
698
|
+
}
|
|
699
|
+
const keyOf = (address) => address.startsWith("0x") ? address.toLowerCase() : address;
|
|
700
|
+
/** The guard of the wallet at `address`, if this process unlocked one there. */
|
|
701
|
+
export const guardOf = (address) => guards.get(keyOf(address));
|
|
702
|
+
//# sourceMappingURL=policy.js.map
|