@eco-incorp/sauce 0.99.5 → 0.99.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -16
- package/actions/action-program.schema.json +480 -379
- package/actions/dist/abis.d.ts +19 -18
- package/actions/dist/abis.d.ts.map +1 -1
- package/actions/dist/abis.js +29 -29
- package/actions/dist/compile.d.ts +4 -4
- package/actions/dist/compile.d.ts.map +1 -1
- package/actions/dist/compile.js +3 -1
- package/actions/dist/compose.d.ts +63 -6
- package/actions/dist/compose.d.ts.map +1 -1
- package/actions/dist/compose.js +100 -16
- package/actions/dist/index.d.ts +1 -1
- package/actions/dist/index.d.ts.map +1 -1
- package/actions/dist/names.d.ts +88 -0
- package/actions/dist/names.d.ts.map +1 -0
- package/actions/dist/names.js +324 -0
- package/actions/dist/program.d.ts.map +1 -1
- package/actions/dist/program.js +115 -5
- package/actions/dist/registry.d.ts +10 -8
- package/actions/dist/registry.d.ts.map +1 -1
- package/actions/dist/registry.js +10 -8
- package/actions/dist/schema.d.ts.map +1 -1
- package/actions/dist/schema.js +99 -12
- package/actions/dist/semantics.d.ts +12 -2
- package/actions/dist/semantics.d.ts.map +1 -1
- package/actions/dist/semantics.js +78 -8
- package/actions/dist/spec.d.ts +30 -0
- package/actions/dist/spec.d.ts.map +1 -1
- package/actions/dist/spec.js +151 -138
- package/actions/dist/split-swap.d.ts +10 -5
- package/actions/dist/split-swap.d.ts.map +1 -1
- package/actions/dist/split-swap.js +48 -7
- package/actions/dist/to-quote.d.ts +14 -5
- package/actions/dist/to-quote.d.ts.map +1 -1
- package/actions/dist/to-quote.js +210 -244
- package/actions/dist/to-sauce.d.ts +18 -4
- package/actions/dist/to-sauce.d.ts.map +1 -1
- package/actions/dist/to-sauce.js +232 -205
- package/actions/dist/types.d.ts +245 -147
- package/actions/dist/types.d.ts.map +1 -1
- package/actions/dist/types.js +4 -0
- package/docs/README.md +38 -0
- package/docs/api/README.md +37 -23
- package/docs/api/compiler.md +53 -12
- package/docs/api/contracts.md +105 -0
- package/docs/api/coverage.md +80 -57
- package/docs/api/router.md +238 -0
- package/docs/api/routes.md +31 -22
- package/docs/concepts/architecture.md +30 -5
- package/docs/concepts/saucescript.md +53 -56
- package/docs/examples/README.md +21 -14
- package/docs/examples/action-program.ts +51 -35
- package/docs/examples/cross-chain-cascade.sauce.ts +4 -0
- package/docs/examples/cross-chain-intent.sauce.ts +2 -1
- package/docs/examples/evm-execution.ts +2 -4
- package/docs/examples/first-intent.ts +7 -2
- package/docs/examples/pot-router.ts +19 -0
- package/docs/examples/registry-names.ts +52 -0
- package/docs/examples/router-route.sauce.ts +31 -0
- package/docs/examples/router-route.ts +72 -0
- package/docs/examples/router-swap.sauce.ts +16 -0
- package/docs/examples/router-swap.ts +47 -0
- package/docs/examples/venue-where-deployed.sauce.ts +14 -0
- package/docs/guides/actions.md +230 -120
- package/docs/guides/builders-and-actions.md +24 -15
- package/docs/guides/cli.md +1442 -0
- package/docs/guides/compiling.md +24 -10
- package/docs/guides/intents.md +260 -17
- package/docs/guides/mcp.md +539 -0
- package/docs/guides/nested-intents.md +21 -6
- package/docs/guides/protocols-and-tokens.md +235 -36
- package/docs/guides/quick-start.md +5 -0
- package/docs/guides/solana.md +199 -52
- package/docs/guides/verification.md +2 -2
- package/mcp/dist/config.js +78 -0
- package/mcp/dist/config.js.map +1 -0
- package/mcp/dist/entry.js +112 -0
- package/mcp/dist/entry.js.map +1 -0
- package/mcp/dist/files.js +64 -0
- package/mcp/dist/files.js.map +1 -0
- package/mcp/dist/guard.js +262 -0
- package/mcp/dist/guard.js.map +1 -0
- package/mcp/dist/http.js +111 -0
- package/mcp/dist/http.js.map +1 -0
- package/mcp/dist/intents.js +579 -0
- package/mcp/dist/intents.js.map +1 -0
- package/mcp/dist/prompts.js +153 -0
- package/mcp/dist/prompts.js.map +1 -0
- package/mcp/dist/reach.js +98 -0
- package/mcp/dist/reach.js.map +1 -0
- package/mcp/dist/resources.js +154 -0
- package/mcp/dist/resources.js.map +1 -0
- package/mcp/dist/sdk.js +34 -0
- package/mcp/dist/sdk.js.map +1 -0
- package/mcp/dist/server.js +119 -0
- package/mcp/dist/server.js.map +1 -0
- package/mcp/dist/setup.js +189 -0
- package/mcp/dist/setup.js.map +1 -0
- package/mcp/dist/skilltools.js +520 -0
- package/mcp/dist/skilltools.js.map +1 -0
- package/mcp/dist/terms.js +93 -0
- package/mcp/dist/terms.js.map +1 -0
- package/mcp/dist/tools.js +1497 -0
- package/mcp/dist/tools.js.map +1 -0
- package/mcp/dist/wallets.js +168 -0
- package/mcp/dist/wallets.js.map +1 -0
- package/package.json +18 -13
- package/sdk/dist/artifacts/V12Deployments.json +3 -1
- package/sdk/dist/artifacts/V12EngineGate.json +1 -2
- package/sdk/dist/artifacts/V12KitchenProxy.json +1 -0
- package/sdk/dist/chains/canonical.d.ts +15 -24
- package/sdk/dist/chains/canonical.d.ts.map +1 -1
- package/sdk/dist/chains/canonical.js +18 -29
- package/sdk/dist/chains/canonical.js.map +1 -1
- package/sdk/dist/cli/actions.d.ts +29 -0
- package/sdk/dist/cli/actions.d.ts.map +1 -0
- package/sdk/dist/cli/actions.js +122 -0
- package/sdk/dist/cli/actions.js.map +1 -0
- package/sdk/dist/cli/args.d.ts +118 -0
- package/sdk/dist/cli/args.d.ts.map +1 -0
- package/sdk/dist/cli/args.js +354 -0
- package/sdk/dist/cli/args.js.map +1 -0
- package/sdk/dist/cli/assume.d.ts +51 -0
- package/sdk/dist/cli/assume.d.ts.map +1 -0
- package/sdk/dist/cli/assume.js +207 -0
- package/sdk/dist/cli/assume.js.map +1 -0
- package/sdk/dist/cli/chain.d.ts +170 -0
- package/sdk/dist/cli/chain.d.ts.map +1 -0
- package/sdk/dist/cli/chain.js +457 -0
- package/sdk/dist/cli/chain.js.map +1 -0
- package/sdk/dist/cli/commands.d.ts +226 -0
- package/sdk/dist/cli/commands.d.ts.map +1 -0
- package/sdk/dist/cli/commands.js +637 -0
- package/sdk/dist/cli/commands.js.map +1 -0
- package/sdk/dist/cli/create.d.ts +70 -0
- package/sdk/dist/cli/create.d.ts.map +1 -0
- package/sdk/dist/cli/create.js +483 -0
- package/sdk/dist/cli/create.js.map +1 -0
- package/sdk/dist/cli/diagnostics.d.ts +12 -0
- package/sdk/dist/cli/diagnostics.d.ts.map +1 -0
- package/sdk/dist/cli/diagnostics.js +200 -0
- package/sdk/dist/cli/diagnostics.js.map +1 -0
- package/sdk/dist/cli/effects.d.ts +71 -0
- package/sdk/dist/cli/effects.d.ts.map +1 -0
- package/sdk/dist/cli/effects.js +279 -0
- package/sdk/dist/cli/effects.js.map +1 -0
- package/sdk/dist/cli/fill.d.ts +83 -0
- package/sdk/dist/cli/fill.d.ts.map +1 -0
- package/sdk/dist/cli/fill.js +734 -0
- package/sdk/dist/cli/fill.js.map +1 -0
- package/sdk/dist/cli/funding.d.ts +126 -0
- package/sdk/dist/cli/funding.d.ts.map +1 -0
- package/sdk/dist/cli/funding.js +514 -0
- package/sdk/dist/cli/funding.js.map +1 -0
- package/sdk/dist/cli/globals.d.ts +16 -0
- package/sdk/dist/cli/globals.d.ts.map +1 -0
- package/sdk/dist/cli/globals.js +197 -0
- package/sdk/dist/cli/globals.js.map +1 -0
- package/sdk/dist/cli/init.d.ts +34 -0
- package/sdk/dist/cli/init.d.ts.map +1 -0
- package/sdk/dist/cli/init.js +181 -0
- package/sdk/dist/cli/init.js.map +1 -0
- package/sdk/dist/cli/inputs.d.ts +72 -0
- package/sdk/dist/cli/inputs.d.ts.map +1 -0
- package/sdk/dist/cli/inputs.js +152 -0
- package/sdk/dist/cli/inputs.js.map +1 -0
- package/sdk/dist/cli/inspect.d.ts +48 -0
- package/sdk/dist/cli/inspect.d.ts.map +1 -0
- package/sdk/dist/cli/inspect.js +536 -0
- package/sdk/dist/cli/inspect.js.map +1 -0
- package/sdk/dist/cli/intent-commands.d.ts +71 -0
- package/sdk/dist/cli/intent-commands.d.ts.map +1 -0
- package/sdk/dist/cli/intent-commands.js +698 -0
- package/sdk/dist/cli/intent-commands.js.map +1 -0
- package/sdk/dist/cli/intent-svm.d.ts +15 -0
- package/sdk/dist/cli/intent-svm.d.ts.map +1 -0
- package/sdk/dist/cli/intent-svm.js +222 -0
- package/sdk/dist/cli/intent-svm.js.map +1 -0
- package/sdk/dist/cli/intents.d.ts +43 -0
- package/sdk/dist/cli/intents.d.ts.map +1 -0
- package/sdk/dist/cli/intents.js +89 -0
- package/sdk/dist/cli/intents.js.map +1 -0
- package/sdk/dist/cli/interactive.d.ts +11 -0
- package/sdk/dist/cli/interactive.d.ts.map +1 -0
- package/sdk/dist/cli/interactive.js +161 -0
- package/sdk/dist/cli/interactive.js.map +1 -0
- package/sdk/dist/cli/lifecycle-svm.d.ts +109 -0
- package/sdk/dist/cli/lifecycle-svm.d.ts.map +1 -0
- package/sdk/dist/cli/lifecycle-svm.js +299 -0
- package/sdk/dist/cli/lifecycle-svm.js.map +1 -0
- package/sdk/dist/cli/lifecycle.d.ts +439 -0
- package/sdk/dist/cli/lifecycle.d.ts.map +1 -0
- package/sdk/dist/cli/lifecycle.js +1721 -0
- package/sdk/dist/cli/lifecycle.js.map +1 -0
- package/sdk/dist/cli/main.d.ts +3 -0
- package/sdk/dist/cli/main.d.ts.map +1 -0
- package/sdk/dist/cli/main.js +8 -0
- package/sdk/dist/cli/main.js.map +1 -0
- package/sdk/dist/cli/mcp.d.ts +66 -0
- package/sdk/dist/cli/mcp.d.ts.map +1 -0
- package/sdk/dist/cli/mcp.js +169 -0
- package/sdk/dist/cli/mcp.js.map +1 -0
- package/sdk/dist/cli/password.d.ts +54 -0
- package/sdk/dist/cli/password.d.ts.map +1 -0
- package/sdk/dist/cli/password.js +148 -0
- package/sdk/dist/cli/password.js.map +1 -0
- package/sdk/dist/cli/policy.d.ts +130 -0
- package/sdk/dist/cli/policy.d.ts.map +1 -0
- package/sdk/dist/cli/policy.js +702 -0
- package/sdk/dist/cli/policy.js.map +1 -0
- package/sdk/dist/cli/pools.d.ts +140 -0
- package/sdk/dist/cli/pools.d.ts.map +1 -0
- package/sdk/dist/cli/pools.js +658 -0
- package/sdk/dist/cli/pools.js.map +1 -0
- package/sdk/dist/cli/price.d.ts +74 -0
- package/sdk/dist/cli/price.d.ts.map +1 -0
- package/sdk/dist/cli/price.js +321 -0
- package/sdk/dist/cli/price.js.map +1 -0
- package/sdk/dist/cli/prompt.d.ts +30 -0
- package/sdk/dist/cli/prompt.d.ts.map +1 -0
- package/sdk/dist/cli/prompt.js +53 -0
- package/sdk/dist/cli/prompt.js.map +1 -0
- package/sdk/dist/cli/publish.d.ts +48 -0
- package/sdk/dist/cli/publish.d.ts.map +1 -0
- package/sdk/dist/cli/publish.js +480 -0
- package/sdk/dist/cli/publish.js.map +1 -0
- package/sdk/dist/cli/receipt.d.ts +35 -0
- package/sdk/dist/cli/receipt.d.ts.map +1 -0
- package/sdk/dist/cli/receipt.js +63 -0
- package/sdk/dist/cli/receipt.js.map +1 -0
- package/sdk/dist/cli/rehearse.d.ts +80 -0
- package/sdk/dist/cli/rehearse.d.ts.map +1 -0
- package/sdk/dist/cli/rehearse.js +265 -0
- package/sdk/dist/cli/rehearse.js.map +1 -0
- package/sdk/dist/cli/report.d.ts +69 -0
- package/sdk/dist/cli/report.d.ts.map +1 -0
- package/sdk/dist/cli/report.js +206 -0
- package/sdk/dist/cli/report.js.map +1 -0
- package/sdk/dist/cli/returned.d.ts +16 -0
- package/sdk/dist/cli/returned.d.ts.map +1 -0
- package/sdk/dist/cli/returned.js +111 -0
- package/sdk/dist/cli/returned.js.map +1 -0
- package/sdk/dist/cli/run.d.ts +40 -0
- package/sdk/dist/cli/run.d.ts.map +1 -0
- package/sdk/dist/cli/run.js +3162 -0
- package/sdk/dist/cli/run.js.map +1 -0
- package/sdk/dist/cli/signer.d.ts +72 -0
- package/sdk/dist/cli/signer.d.ts.map +1 -0
- package/sdk/dist/cli/signer.js +243 -0
- package/sdk/dist/cli/signer.js.map +1 -0
- package/sdk/dist/cli/simulate.d.ts +11 -0
- package/sdk/dist/cli/simulate.d.ts.map +1 -0
- package/sdk/dist/cli/simulate.js +246 -0
- package/sdk/dist/cli/simulate.js.map +1 -0
- package/sdk/dist/cli/skills.d.ts +77 -0
- package/sdk/dist/cli/skills.d.ts.map +1 -0
- package/sdk/dist/cli/skills.js +527 -0
- package/sdk/dist/cli/skills.js.map +1 -0
- package/sdk/dist/cli/solana.d.ts +183 -0
- package/sdk/dist/cli/solana.d.ts.map +1 -0
- package/sdk/dist/cli/solana.js +1360 -0
- package/sdk/dist/cli/solana.js.map +1 -0
- package/sdk/dist/cli/store.d.ts +60 -0
- package/sdk/dist/cli/store.d.ts.map +1 -0
- package/sdk/dist/cli/store.js +196 -0
- package/sdk/dist/cli/store.js.map +1 -0
- package/sdk/dist/cli/support.d.ts +144 -0
- package/sdk/dist/cli/support.d.ts.map +1 -0
- package/sdk/dist/cli/support.js +217 -0
- package/sdk/dist/cli/support.js.map +1 -0
- package/sdk/dist/cli/svm-effects.d.ts +50 -0
- package/sdk/dist/cli/svm-effects.d.ts.map +1 -0
- package/sdk/dist/cli/svm-effects.js +196 -0
- package/sdk/dist/cli/svm-effects.js.map +1 -0
- package/sdk/dist/cli/terminal.d.ts +42 -0
- package/sdk/dist/cli/terminal.d.ts.map +1 -0
- package/sdk/dist/cli/terminal.js +136 -0
- package/sdk/dist/cli/terminal.js.map +1 -0
- package/sdk/dist/cli/verify.d.ts +32 -0
- package/sdk/dist/cli/verify.d.ts.map +1 -0
- package/sdk/dist/cli/verify.js +185 -0
- package/sdk/dist/cli/verify.js.map +1 -0
- package/sdk/dist/cli/wallet-commands.d.ts +59 -0
- package/sdk/dist/cli/wallet-commands.d.ts.map +1 -0
- package/sdk/dist/cli/wallet-commands.js +222 -0
- package/sdk/dist/cli/wallet-commands.js.map +1 -0
- package/sdk/dist/cli/wallet-send.d.ts +38 -0
- package/sdk/dist/cli/wallet-send.d.ts.map +1 -0
- package/sdk/dist/cli/wallet-send.js +303 -0
- package/sdk/dist/cli/wallet-send.js.map +1 -0
- package/sdk/dist/cli/wallets.d.ts +79 -0
- package/sdk/dist/cli/wallets.d.ts.map +1 -0
- package/sdk/dist/cli/wallets.js +297 -0
- package/sdk/dist/cli/wallets.js.map +1 -0
- package/sdk/dist/deployments/index.d.ts +4 -62
- package/sdk/dist/deployments/index.d.ts.map +1 -1
- package/sdk/dist/deployments/index.js +4 -84
- package/sdk/dist/deployments/index.js.map +1 -1
- package/sdk/dist/deployments/pot.d.ts +17 -7
- package/sdk/dist/deployments/pot.d.ts.map +1 -1
- package/sdk/dist/deployments/pot.js +25 -10
- package/sdk/dist/deployments/pot.js.map +1 -1
- package/sdk/dist/deployments/releases.d.ts +36 -0
- package/sdk/dist/deployments/releases.d.ts.map +1 -0
- package/sdk/dist/deployments/releases.js +61 -0
- package/sdk/dist/deployments/releases.js.map +1 -0
- package/sdk/dist/deployments/releases.json +76 -0
- package/sdk/dist/deployments/v12-addresses.d.ts +13 -0
- package/sdk/dist/deployments/v12-addresses.d.ts.map +1 -1
- package/sdk/dist/deployments/v12-addresses.js +16 -3
- package/sdk/dist/deployments/v12-addresses.js.map +1 -1
- package/sdk/dist/deposit/index.d.ts +6 -6
- package/sdk/dist/deposit/index.d.ts.map +1 -1
- package/sdk/dist/deposit/index.js +1 -1
- package/sdk/dist/deposit/index.js.map +1 -1
- package/sdk/dist/deposit/params.d.ts +4 -4
- package/sdk/dist/deposit/params.d.ts.map +1 -1
- package/sdk/dist/deposit/params.js +7 -4
- package/sdk/dist/deposit/params.js.map +1 -1
- package/sdk/dist/deposit/source.d.ts +3 -30
- package/sdk/dist/deposit/source.d.ts.map +1 -1
- package/sdk/dist/deposit/source.js +7 -83
- package/sdk/dist/deposit/source.js.map +1 -1
- package/sdk/dist/deposit/templates.d.ts +1 -2
- package/sdk/dist/deposit/templates.d.ts.map +1 -1
- package/sdk/dist/deposit/templates.js +10 -2
- package/sdk/dist/deposit/templates.js.map +1 -1
- package/sdk/dist/deposit/types.d.ts +14 -12
- package/sdk/dist/deposit/types.d.ts.map +1 -1
- package/sdk/dist/deposit/types.js +6 -0
- package/sdk/dist/deposit/types.js.map +1 -1
- package/sdk/dist/descriptors/accessors.d.ts +38 -35
- package/sdk/dist/descriptors/accessors.d.ts.map +1 -1
- package/sdk/dist/descriptors/accessors.js +16 -0
- package/sdk/dist/descriptors/accessors.js.map +1 -1
- package/sdk/dist/descriptors/call.d.ts +66 -14
- package/sdk/dist/descriptors/call.d.ts.map +1 -1
- package/sdk/dist/descriptors/call.js +94 -13
- package/sdk/dist/descriptors/call.js.map +1 -1
- package/sdk/dist/descriptors/contracts.generated.d.ts +3393 -0
- package/sdk/dist/descriptors/contracts.generated.d.ts.map +1 -0
- package/sdk/dist/descriptors/contracts.generated.js +728 -0
- package/sdk/dist/descriptors/contracts.generated.js.map +1 -0
- package/sdk/dist/descriptors/derive.d.ts +20 -11
- package/sdk/dist/descriptors/derive.d.ts.map +1 -1
- package/sdk/dist/descriptors/derive.js +68 -30
- package/sdk/dist/descriptors/derive.js.map +1 -1
- package/sdk/dist/descriptors/index.d.ts +6 -7
- package/sdk/dist/descriptors/index.d.ts.map +1 -1
- package/sdk/dist/descriptors/index.js +2 -2
- package/sdk/dist/descriptors/index.js.map +1 -1
- package/sdk/dist/descriptors/links.d.ts +23 -214
- package/sdk/dist/descriptors/links.d.ts.map +1 -1
- package/sdk/dist/descriptors/links.js +1 -232
- package/sdk/dist/descriptors/links.js.map +1 -1
- package/sdk/dist/descriptors/query.d.ts +1 -1
- package/sdk/dist/descriptors/query.d.ts.map +1 -1
- package/sdk/dist/descriptors/query.js +1 -1
- package/sdk/dist/descriptors/query.js.map +1 -1
- package/sdk/dist/descriptors/registry.d.ts +2 -5
- package/sdk/dist/descriptors/registry.d.ts.map +1 -1
- package/sdk/dist/descriptors/registry.js +11 -66
- package/sdk/dist/descriptors/registry.js.map +1 -1
- package/sdk/dist/embedded/resolve.d.ts +4 -4
- package/sdk/dist/embedded/resolve.d.ts.map +1 -1
- package/sdk/dist/embedded/resolve.js +12 -8
- package/sdk/dist/embedded/resolve.js.map +1 -1
- package/sdk/dist/embedded/skills.generated.d.ts +1 -1
- package/sdk/dist/embedded/skills.generated.d.ts.map +1 -1
- package/sdk/dist/embedded/skills.generated.js +137 -136
- package/sdk/dist/embedded/skills.generated.js.map +1 -1
- package/sdk/dist/embedded/sources.generated.d.ts.map +1 -1
- package/sdk/dist/embedded/sources.generated.js +40 -6
- package/sdk/dist/embedded/sources.generated.js.map +1 -1
- package/sdk/dist/evm/engine.d.ts +813 -10
- package/sdk/dist/evm/engine.d.ts.map +1 -1
- package/sdk/dist/evm/engine.js +127 -8
- package/sdk/dist/evm/engine.js.map +1 -1
- package/sdk/dist/index.d.ts +3 -2
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +6 -2
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/plugin/index.d.ts +3 -2
- package/sdk/dist/plugin/index.d.ts.map +1 -1
- package/sdk/dist/plugin/index.js.map +1 -1
- package/sdk/dist/price.d.ts +40 -0
- package/sdk/dist/price.d.ts.map +1 -0
- package/sdk/dist/price.js +101 -0
- package/sdk/dist/price.js.map +1 -0
- package/sdk/dist/protocols/aerodrome/abis.d.ts +76 -0
- package/sdk/dist/protocols/aerodrome/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/aerodrome/abis.js +61 -0
- package/sdk/dist/protocols/aerodrome/abis.js.map +1 -1
- package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts +70 -0
- package/sdk/dist/protocols/aerodrome-slipstream/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/aerodrome-slipstream/abis.js +54 -0
- package/sdk/dist/protocols/aerodrome-slipstream/abis.js.map +1 -1
- package/sdk/dist/protocols/camelot/abis.d.ts +178 -0
- package/sdk/dist/protocols/camelot/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/camelot/abis.js +139 -0
- package/sdk/dist/protocols/camelot/abis.js.map +1 -1
- package/sdk/dist/protocols/cbeth/functions.d.ts +2 -2
- package/sdk/dist/protocols/cbeth/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/cbeth/functions.js +4 -6
- package/sdk/dist/protocols/cbeth/functions.js.map +1 -1
- package/sdk/dist/protocols/crvusd/functions.d.ts +2 -2
- package/sdk/dist/protocols/crvusd/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/crvusd/functions.js +6 -6
- package/sdk/dist/protocols/eco-routes/abis.d.ts +792 -50
- package/sdk/dist/protocols/eco-routes/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/abis.js +1058 -49
- package/sdk/dist/protocols/eco-routes/abis.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts +44 -61
- package/sdk/dist/protocols/eco-routes/addresses.generated.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/addresses.generated.js +45 -62
- package/sdk/dist/protocols/eco-routes/addresses.generated.js.map +1 -1
- package/sdk/dist/protocols/eco-routes/lookup.d.ts +10 -0
- package/sdk/dist/protocols/eco-routes/lookup.d.ts.map +1 -1
- package/sdk/dist/protocols/eco-routes/lookup.js +16 -0
- package/sdk/dist/protocols/eco-routes/lookup.js.map +1 -1
- package/sdk/dist/protocols/erc20/functions.d.ts +3 -3
- package/sdk/dist/protocols/erc20/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/erc20/functions.js +6 -9
- package/sdk/dist/protocols/erc20/functions.js.map +1 -1
- package/sdk/dist/protocols/frax/functions.d.ts +2 -2
- package/sdk/dist/protocols/frax/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/frax/functions.js +6 -6
- package/sdk/dist/protocols/gho/functions.d.ts +2 -2
- package/sdk/dist/protocols/gho/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/gho/functions.js +4 -6
- package/sdk/dist/protocols/gho/functions.js.map +1 -1
- package/sdk/dist/protocols/liquity-v2/functions.d.ts +2 -2
- package/sdk/dist/protocols/liquity-v2/functions.d.ts.map +1 -1
- package/sdk/dist/protocols/liquity-v2/functions.js +4 -6
- package/sdk/dist/protocols/liquity-v2/functions.js.map +1 -1
- package/sdk/dist/protocols/maverick/abis.d.ts +77 -0
- package/sdk/dist/protocols/maverick/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/maverick/abis.js +58 -0
- package/sdk/dist/protocols/maverick/abis.js.map +1 -1
- package/sdk/dist/protocols/maverick/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/maverick/addresses.js +4 -0
- package/sdk/dist/protocols/maverick/addresses.js.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/pancakeswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v2/abis.js +43 -0
- package/sdk/dist/protocols/pancakeswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/pancakeswap-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/pancakeswap-v3/abis.js +56 -0
- package/sdk/dist/protocols/pancakeswap-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/permit2/abis.d.ts +113 -0
- package/sdk/dist/protocols/permit2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/permit2/abis.js +63 -0
- package/sdk/dist/protocols/permit2/abis.js.map +1 -1
- package/sdk/dist/protocols/quickswap/abis.d.ts +148 -0
- package/sdk/dist/protocols/quickswap/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/quickswap/abis.js +119 -0
- package/sdk/dist/protocols/quickswap/abis.js.map +1 -1
- package/sdk/dist/protocols/sushiswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/sushiswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/sushiswap-v2/abis.js +42 -0
- package/sdk/dist/protocols/sushiswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/synthra-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/synthra-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/synthra-v3/abis.js +55 -0
- package/sdk/dist/protocols/synthra-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/trader-joe/abis.d.ts +133 -0
- package/sdk/dist/protocols/trader-joe/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/trader-joe/abis.js +101 -0
- package/sdk/dist/protocols/trader-joe/abis.js.map +1 -1
- package/sdk/dist/protocols/trader-joe/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/trader-joe/addresses.js +5 -0
- package/sdk/dist/protocols/trader-joe/addresses.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v2/abis.d.ts +52 -0
- package/sdk/dist/protocols/uniswap-v2/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v2/abis.js +44 -0
- package/sdk/dist/protocols/uniswap-v2/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/uniswap-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v3/abis.js +55 -0
- package/sdk/dist/protocols/uniswap-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/abis.d.ts +247 -0
- package/sdk/dist/protocols/uniswap-v4/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/abis.js +167 -0
- package/sdk/dist/protocols/uniswap-v4/abis.js.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/addresses.d.ts.map +1 -1
- package/sdk/dist/protocols/uniswap-v4/addresses.js +50 -0
- package/sdk/dist/protocols/uniswap-v4/addresses.js.map +1 -1
- package/sdk/dist/protocols/unitflow-v3/abis.d.ts +73 -0
- package/sdk/dist/protocols/unitflow-v3/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/unitflow-v3/abis.js +56 -0
- package/sdk/dist/protocols/unitflow-v3/abis.js.map +1 -1
- package/sdk/dist/protocols/velodrome/abis.d.ts +76 -0
- package/sdk/dist/protocols/velodrome/abis.d.ts.map +1 -1
- package/sdk/dist/protocols/velodrome/abis.js +61 -0
- package/sdk/dist/protocols/velodrome/abis.js.map +1 -1
- package/sdk/dist/recipes/cctp-split.sauce.ts +5 -3
- package/sdk/dist/recipes/plain-transfer.sauce.ts +5 -2
- package/sdk/dist/routes/accessor-index.d.ts +2 -2
- package/sdk/dist/routes/accessor-index.d.ts.map +1 -1
- package/sdk/dist/routes/accessor-index.js +4 -3
- package/sdk/dist/routes/accessor-index.js.map +1 -1
- package/sdk/dist/routes/ambient.d.ts +5 -0
- package/sdk/dist/routes/ambient.d.ts.map +1 -1
- package/sdk/dist/routes/ambient.js +20 -0
- package/sdk/dist/routes/ambient.js.map +1 -1
- package/sdk/dist/routes/ast-walk.d.ts +21 -3
- package/sdk/dist/routes/ast-walk.d.ts.map +1 -1
- package/sdk/dist/routes/ast-walk.js +33 -4
- package/sdk/dist/routes/ast-walk.js.map +1 -1
- package/sdk/dist/routes/available.d.ts +43 -0
- package/sdk/dist/routes/available.d.ts.map +1 -0
- package/sdk/dist/routes/available.js +230 -0
- package/sdk/dist/routes/available.js.map +1 -0
- package/sdk/dist/routes/builtins.generated.d.ts +180 -0
- package/sdk/dist/routes/builtins.generated.d.ts.map +1 -0
- package/sdk/dist/routes/builtins.generated.js +2 -0
- package/sdk/dist/routes/builtins.generated.js.map +1 -0
- package/sdk/dist/routes/chain-exports.generated.d.ts +13 -8
- package/sdk/dist/routes/chain-exports.generated.d.ts.map +1 -1
- package/sdk/dist/routes/chain-exports.generated.js.map +1 -1
- package/sdk/dist/routes/closure.d.ts.map +1 -1
- package/sdk/dist/routes/closure.js +13 -26
- package/sdk/dist/routes/closure.js.map +1 -1
- package/sdk/dist/routes/composed.d.ts.map +1 -1
- package/sdk/dist/routes/composed.js +20 -8
- package/sdk/dist/routes/composed.js.map +1 -1
- package/sdk/dist/routes/encode.d.ts +17 -0
- package/sdk/dist/routes/encode.d.ts.map +1 -1
- package/sdk/dist/routes/encode.js +14 -11
- package/sdk/dist/routes/encode.js.map +1 -1
- package/sdk/dist/routes/entry.d.ts +76 -0
- package/sdk/dist/routes/entry.d.ts.map +1 -0
- package/sdk/dist/routes/entry.js +478 -0
- package/sdk/dist/routes/entry.js.map +1 -0
- package/sdk/dist/routes/index.d.ts +21 -14
- package/sdk/dist/routes/index.d.ts.map +1 -1
- package/sdk/dist/routes/index.js +12 -9
- package/sdk/dist/routes/index.js.map +1 -1
- package/sdk/dist/routes/intent-body.d.ts +97 -0
- package/sdk/dist/routes/intent-body.d.ts.map +1 -0
- package/sdk/dist/routes/intent-body.js +441 -0
- package/sdk/dist/routes/intent-body.js.map +1 -0
- package/sdk/dist/routes/intent-dsl.d.ts +21 -6
- package/sdk/dist/routes/intent-dsl.d.ts.map +1 -1
- package/sdk/dist/routes/intent-dsl.js +34 -17
- package/sdk/dist/routes/intent-dsl.js.map +1 -1
- package/sdk/dist/routes/intent-sugar.d.ts +77 -4
- package/sdk/dist/routes/intent-sugar.d.ts.map +1 -1
- package/sdk/dist/routes/intent-sugar.js +358 -152
- package/sdk/dist/routes/intent-sugar.js.map +1 -1
- package/sdk/dist/routes/intent.d.ts +13 -1
- package/sdk/dist/routes/intent.d.ts.map +1 -1
- package/sdk/dist/routes/intent.js +37 -1
- package/sdk/dist/routes/intent.js.map +1 -1
- package/sdk/dist/routes/nest.d.ts +3 -2
- package/sdk/dist/routes/nest.d.ts.map +1 -1
- package/sdk/dist/routes/nest.js +5 -3
- package/sdk/dist/routes/nest.js.map +1 -1
- package/sdk/dist/routes/parse.d.ts +6 -0
- package/sdk/dist/routes/parse.d.ts.map +1 -0
- package/sdk/dist/routes/parse.js +39 -0
- package/sdk/dist/routes/parse.js.map +1 -0
- package/sdk/dist/routes/portal.d.ts +258 -4
- package/sdk/dist/routes/portal.d.ts.map +1 -1
- package/sdk/dist/routes/portal.js +588 -9
- package/sdk/dist/routes/portal.js.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts +71 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.js +178 -54
- package/sdk/dist/routes/protocol-rewrite.js.map +1 -1
- package/sdk/dist/routes/rs-compile.d.ts +25 -22
- package/sdk/dist/routes/rs-compile.d.ts.map +1 -1
- package/sdk/dist/routes/rs-compile.js +55 -49
- package/sdk/dist/routes/rs-compile.js.map +1 -1
- package/sdk/dist/routes/sauce-calls.d.ts +26 -12
- package/sdk/dist/routes/sauce-calls.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-calls.js +16 -23
- package/sdk/dist/routes/sauce-calls.js.map +1 -1
- package/sdk/dist/routes/sauce-route.d.ts +74 -7
- package/sdk/dist/routes/sauce-route.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-route.js +249 -96
- package/sdk/dist/routes/sauce-route.js.map +1 -1
- package/sdk/dist/routes/source-globals.d.ts +107 -0
- package/sdk/dist/routes/source-globals.d.ts.map +1 -0
- package/sdk/dist/routes/source-globals.generated.d.ts +5530 -936
- package/sdk/dist/routes/source-globals.generated.d.ts.map +1 -1
- package/sdk/dist/routes/source-globals.generated.js +3 -4
- package/sdk/dist/routes/source-globals.generated.js.map +1 -1
- package/sdk/dist/routes/source-globals.js +174 -0
- package/sdk/dist/routes/source-globals.js.map +1 -0
- package/sdk/dist/routes/stock-tokens.d.ts +69 -0
- package/sdk/dist/routes/stock-tokens.d.ts.map +1 -0
- package/sdk/dist/routes/stock-tokens.generated.d.ts +4 -0
- package/sdk/dist/routes/stock-tokens.generated.d.ts.map +1 -0
- package/sdk/dist/routes/stock-tokens.generated.js +1836 -0
- package/sdk/dist/routes/stock-tokens.generated.js.map +1 -0
- package/sdk/dist/routes/stock-tokens.js +65 -0
- package/sdk/dist/routes/stock-tokens.js.map +1 -0
- package/sdk/dist/routes/token-registry.d.ts +64 -8
- package/sdk/dist/routes/token-registry.d.ts.map +1 -1
- package/sdk/dist/routes/token-registry.js +208 -33
- package/sdk/dist/routes/token-registry.js.map +1 -1
- package/sdk/dist/routes/token-rewrite.d.ts +63 -28
- package/sdk/dist/routes/token-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/token-rewrite.js +387 -123
- package/sdk/dist/routes/token-rewrite.js.map +1 -1
- package/sdk/dist/routes/unknown-global.d.ts +32 -0
- package/sdk/dist/routes/unknown-global.d.ts.map +1 -0
- package/sdk/dist/routes/unknown-global.js +106 -0
- package/sdk/dist/routes/unknown-global.js.map +1 -0
- package/sdk/dist/routes/vault.d.ts +38 -8
- package/sdk/dist/routes/vault.d.ts.map +1 -1
- package/sdk/dist/routes/vault.js +47 -8
- package/sdk/dist/routes/vault.js.map +1 -1
- package/sdk/dist/sauce-script/builtins.d.ts +309 -0
- package/sdk/dist/sauce-script/declarations.d.ts +3 -0
- package/sdk/dist/sauce-script/declarations.d.ts.map +1 -0
- package/sdk/dist/sauce-script/declarations.js +229 -0
- package/sdk/dist/sauce-script/declarations.js.map +1 -0
- package/sdk/dist/sauce-script/index.d.ts +2714 -0
- package/sdk/dist/sauce-script/ts-plugin.cjs +85 -0
- package/sdk/dist/skills/loader.d.ts.map +1 -1
- package/sdk/dist/skills/loader.js +4 -3
- package/sdk/dist/skills/loader.js.map +1 -1
- package/sdk/dist/std/router/balancer-v2-vault.abi.json +78 -0
- package/sdk/dist/std/router/curve-cryptoswap.abi.json +29 -0
- package/sdk/dist/std/router/curve-stableswap.abi.json +29 -0
- package/sdk/dist/std/router/dodo-v2-pool.abi.json +39 -0
- package/sdk/dist/std/router/lb-pair.abi.json +55 -0
- package/sdk/dist/std/router/package.json +7 -0
- package/sdk/dist/std/router/router.evm.js +567 -0
- package/sdk/dist/std/router/sauce-router.abi.json +202 -0
- package/sdk/dist/std/router/uniswap-v2-pair.abi.json +49 -0
- package/sdk/dist/std/router/woo-pp-v2.abi.json +42 -0
- package/sdk/dist/std/token/permit2.abi.json +226 -0
- package/sdk/dist/std/token/token.evm.js +73 -0
- package/sdk/dist/std/token/token.svm.js +194 -41
- package/sdk/dist/svm/client.d.ts +62 -15
- package/sdk/dist/svm/client.d.ts.map +1 -1
- package/sdk/dist/svm/client.js +103 -42
- package/sdk/dist/svm/client.js.map +1 -1
- package/sdk/dist/svm/engine.d.ts +66 -5
- package/sdk/dist/svm/engine.d.ts.map +1 -1
- package/sdk/dist/svm/engine.js +73 -5
- package/sdk/dist/svm/engine.js.map +1 -1
- package/sdk/dist/svm/index.d.ts +2 -0
- package/sdk/dist/svm/index.d.ts.map +1 -1
- package/sdk/dist/svm/index.js +2 -0
- package/sdk/dist/svm/index.js.map +1 -1
- package/sdk/dist/svm/instructions.d.ts +72 -1
- package/sdk/dist/svm/instructions.d.ts.map +1 -1
- package/sdk/dist/svm/instructions.js +81 -2
- package/sdk/dist/svm/instructions.js.map +1 -1
- package/sdk/dist/svm/kitchen.d.ts +20 -1
- package/sdk/dist/svm/kitchen.d.ts.map +1 -1
- package/sdk/dist/svm/kitchen.js +47 -1
- package/sdk/dist/svm/kitchen.js.map +1 -1
- package/sdk/dist/svm/portal.d.ts +250 -0
- package/sdk/dist/svm/portal.d.ts.map +1 -0
- package/sdk/dist/svm/portal.js +462 -0
- package/sdk/dist/svm/portal.js.map +1 -0
- package/sdk/dist/svm/send.d.ts +18 -2
- package/sdk/dist/svm/send.d.ts.map +1 -1
- package/sdk/dist/svm/send.js +28 -3
- package/sdk/dist/svm/send.js.map +1 -1
- package/sdk/dist/svm/token-accounts.d.ts +49 -0
- package/sdk/dist/svm/token-accounts.d.ts.map +1 -0
- package/sdk/dist/svm/token-accounts.js +58 -0
- package/sdk/dist/svm/token-accounts.js.map +1 -0
- package/sdk/dist/svm/token-extensions.d.ts +18 -7
- package/sdk/dist/svm/token-extensions.d.ts.map +1 -1
- package/sdk/dist/svm/token-extensions.js +58 -5
- package/sdk/dist/svm/token-extensions.js.map +1 -1
- package/sdk/dist/token/api.d.ts +7 -4
- package/sdk/dist/token/api.d.ts.map +1 -1
- package/sdk/dist/token/api.js.map +1 -1
- package/sdk/dist/token/evm.js +2 -2
- package/sdk/dist/token/index.d.ts +4 -4
- package/sdk/dist/token/index.js +4 -4
- package/sdk/dist/token/params.js +1 -1
- package/sdk/dist/token/source.js +3 -3
- package/sdk/dist/token/source.js.map +1 -1
- package/sdk/dist/token/types.d.ts +2 -2
- package/sdk/dist/token/types.js +2 -2
- package/sdk/src/protocols/aerodrome/AerodromePoolABI.json +105 -0
- package/sdk/src/protocols/aerodrome/abis.ts +62 -0
- package/sdk/src/protocols/aerodrome-slipstream/AerodromeSlipstreamPoolABI.json +96 -0
- package/sdk/src/protocols/aerodrome-slipstream/abis.ts +55 -0
- package/sdk/src/protocols/camelot/CamelotV2FactoryABI.json +25 -0
- package/sdk/src/protocols/camelot/CamelotV2PairABI.json +109 -0
- package/sdk/src/protocols/camelot/CamelotV3FactoryABI.json +25 -0
- package/sdk/src/protocols/camelot/CamelotV3PoolABI.json +92 -0
- package/sdk/src/protocols/camelot/abis.ts +143 -0
- package/sdk/src/protocols/cbeth/functions.ts +4 -6
- package/sdk/src/protocols/crvusd/functions.ts +6 -6
- package/sdk/src/protocols/eco-routes/PortalABI.json +1448 -0
- package/sdk/src/protocols/eco-routes/ProverABI.json +162 -0
- package/sdk/src/protocols/eco-routes/abis.ts +1060 -51
- package/sdk/src/protocols/eco-routes/addresses.generated.ts +45 -62
- package/sdk/src/protocols/eco-routes/lookup.ts +18 -0
- package/sdk/src/protocols/erc20/functions.ts +6 -9
- package/sdk/src/protocols/frax/functions.ts +6 -6
- package/sdk/src/protocols/gho/functions.ts +4 -6
- package/sdk/src/protocols/liquity-v2/functions.ts +4 -6
- package/sdk/src/protocols/maverick/MaverickV2PoolABI.json +107 -0
- package/sdk/src/protocols/maverick/abis.ts +59 -0
- package/sdk/src/protocols/maverick/addresses.ts +4 -0
- package/sdk/src/protocols/pancakeswap-v2/PancakeSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/pancakeswap-v2/abis.ts +44 -0
- package/sdk/src/protocols/pancakeswap-v3/PancakeSwapV3PoolABI.json +100 -0
- package/sdk/src/protocols/pancakeswap-v3/abis.ts +57 -0
- package/sdk/src/protocols/permit2/Permit2ABI.json +154 -0
- package/sdk/src/protocols/permit2/abis.ts +63 -0
- package/sdk/src/protocols/quickswap/QuickSwapV2FactoryABI.json +25 -0
- package/sdk/src/protocols/quickswap/QuickSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/quickswap/QuickSwapV3FactoryABI.json +25 -0
- package/sdk/src/protocols/quickswap/QuickSwapV3PoolABI.json +88 -0
- package/sdk/src/protocols/quickswap/abis.ts +123 -0
- package/sdk/src/protocols/sushiswap-v2/SushiSwapV2PairABI.json +72 -0
- package/sdk/src/protocols/sushiswap-v2/abis.ts +43 -0
- package/sdk/src/protocols/synthra-v3/SynthraV3PoolABI.json +100 -0
- package/sdk/src/protocols/synthra-v3/abis.ts +56 -0
- package/sdk/src/protocols/trader-joe/LBPairABI.json +185 -0
- package/sdk/src/protocols/trader-joe/abis.ts +102 -0
- package/sdk/src/protocols/trader-joe/addresses.ts +5 -0
- package/sdk/src/protocols/uniswap-v2/UniswapV2PairABI.json +72 -0
- package/sdk/src/protocols/uniswap-v2/abis.ts +45 -0
- package/sdk/src/protocols/uniswap-v3/UniswapV3PoolABI.json +100 -0
- package/sdk/src/protocols/uniswap-v3/abis.ts +56 -0
- package/sdk/src/protocols/uniswap-v4/UniswapV4PoolManagerABI.json +38 -0
- package/sdk/src/protocols/uniswap-v4/UniswapV4StateViewABI.json +307 -0
- package/sdk/src/protocols/uniswap-v4/abis.ts +168 -0
- package/sdk/src/protocols/uniswap-v4/addresses.ts +50 -0
- package/sdk/src/protocols/unitflow-v3/UnitFlowV3PoolABI.json +100 -0
- package/sdk/src/protocols/unitflow-v3/abis.ts +57 -0
- package/sdk/src/protocols/velodrome/VelodromePoolABI.json +105 -0
- package/sdk/src/protocols/velodrome/abis.ts +62 -0
- package/skills/sauce-actions/SKILL.md +166 -0
- package/skills/sauce-actions/examples/swap-and-supply.json +24 -0
- package/skills/sauce-actions/examples/swap-by-key.json +15 -0
- package/skills/sauce-actions/references/actions.md +731 -0
- package/skills/sauce-chains/SKILL.md +137 -0
- package/skills/sauce-chains/examples/chains.sauce.ts +25 -0
- package/skills/sauce-chains/references/arbitrum.md +158 -0
- package/skills/sauce-chains/references/arc.md +107 -0
- package/skills/sauce-chains/references/aurora.md +33 -0
- package/skills/sauce-chains/references/avalanche.md +106 -0
- package/skills/sauce-chains/references/base-stocks.md +77 -0
- package/skills/sauce-chains/references/base.md +141 -0
- package/skills/sauce-chains/references/berachain.md +33 -0
- package/skills/sauce-chains/references/blast.md +60 -0
- package/skills/sauce-chains/references/boba.md +33 -0
- package/skills/sauce-chains/references/bsc.md +97 -0
- package/skills/sauce-chains/references/celo.md +57 -0
- package/skills/sauce-chains/references/core.md +33 -0
- package/skills/sauce-chains/references/cronos.md +33 -0
- package/skills/sauce-chains/references/ethereum-stocks.md +1741 -0
- package/skills/sauce-chains/references/ethereum.md +255 -0
- package/skills/sauce-chains/references/evmos.md +33 -0
- package/skills/sauce-chains/references/fantom.md +61 -0
- package/skills/sauce-chains/references/fuse.md +33 -0
- package/skills/sauce-chains/references/gnosis.md +57 -0
- package/skills/sauce-chains/references/index.md +58 -0
- package/skills/sauce-chains/references/ink.md +55 -0
- package/skills/sauce-chains/references/kava.md +33 -0
- package/skills/sauce-chains/references/klaytn.md +33 -0
- package/skills/sauce-chains/references/linea.md +65 -0
- package/skills/sauce-chains/references/manta.md +33 -0
- package/skills/sauce-chains/references/mantle.md +33 -0
- package/skills/sauce-chains/references/metis.md +54 -0
- package/skills/sauce-chains/references/mode.md +55 -0
- package/skills/sauce-chains/references/monad.md +79 -0
- package/skills/sauce-chains/references/moonbeam.md +33 -0
- package/skills/sauce-chains/references/opbnb.md +55 -0
- package/skills/sauce-chains/references/optimism.md +123 -0
- package/skills/sauce-chains/references/plasma.md +35 -0
- package/skills/sauce-chains/references/polygon.md +123 -0
- package/skills/sauce-chains/references/pulsechain.md +33 -0
- package/skills/sauce-chains/references/ronin.md +35 -0
- package/skills/sauce-chains/references/scroll.md +62 -0
- package/skills/sauce-chains/references/sei.md +55 -0
- package/skills/sauce-chains/references/solana.md +53 -0
- package/skills/sauce-chains/references/sonic.md +57 -0
- package/skills/sauce-chains/references/unichain.md +61 -0
- package/skills/sauce-chains/references/zetachain.md +33 -0
- package/skills/sauce-chains/references/zksync.md +59 -0
- package/skills/sauce-chains/references/zora.md +57 -0
- package/skills/sauce-cli/SKILL.md +366 -0
- package/skills/sauce-cli/examples/pay.sauce.ts +23 -0
- package/skills/sauce-cli/examples/split.sauce.ts +30 -0
- package/skills/sauce-distributed-swap/SKILL.md +392 -0
- package/skills/sauce-distributed-swap/examples/distributed-swap.mts +251 -0
- package/skills/sauce-distributed-swap/examples/distributed-swap.sauce.ts +115 -0
- package/skills/sauce-examples/SKILL.md +96 -0
- package/skills/sauce-globals/SKILL.md +175 -0
- package/skills/sauce-globals/examples/globals.mts +111 -0
- package/skills/sauce-globals/examples/globals.sauce.ts +47 -0
- package/skills/sauce-globals/references/chains.md +53 -0
- package/skills/sauce-globals/references/protocols.md +405 -0
- package/skills/sauce-globals/references/stocks.md +1824 -0
- package/skills/sauce-globals/references/tokens.md +53 -0
- package/skills/sauce-intents/SKILL.md +505 -0
- package/skills/sauce-intents/examples/cross-chain.sauce.ts +37 -0
- package/skills/sauce-intents/examples/fund-by-transfer.sauce.ts +54 -0
- package/skills/sauce-intents/examples/intents.mts +343 -0
- package/skills/sauce-intents/examples/swap-on-base.sauce.ts +135 -0
- package/skills/sauce-intents/references/portal.md +77 -0
- package/skills/sauce-overview/SKILL.md +161 -0
- package/skills/sauce-protocols/SKILL.md +118 -0
- package/skills/sauce-protocols/examples/protocols.mts +77 -0
- package/skills/sauce-protocols/examples/protocols.sauce.ts +27 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/aave-v2.md +35 -17
- package/skills/sauce-protocols/references/aave-v3.md +144 -0
- package/skills/sauce-protocols/references/aave-v4.md +50 -0
- package/skills/sauce-protocols/references/abracadabra.md +72 -0
- package/skills/sauce-protocols/references/across.md +73 -0
- package/skills/sauce-protocols/references/aerodrome-slipstream.md +50 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/aerodrome.md +43 -24
- package/skills/sauce-protocols/references/aevo.md +49 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/alchemix.md +10 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/ambient.md +14 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/arbitrum-bridge.md +11 -14
- package/{sdk/src/skills → skills/sauce-protocols/references}/arrakis.md +10 -26
- package/skills/sauce-protocols/references/axelar.md +56 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/balancer-v2.md +13 -29
- package/{sdk/src/skills → skills/sauce-protocols/references}/base-bridge.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/baseswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/beefy.md +10 -30
- package/{sdk/src/skills → skills/sauce-protocols/references}/benqi.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/camelot.md +13 -27
- package/skills/sauce-protocols/references/cbeth.md +48 -0
- package/skills/sauce-protocols/references/cctp.md +47 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/celer.md +11 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/chainlink-ccip.md +11 -21
- package/skills/sauce-protocols/references/chainlink.md +47 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/circle-gateway.md +12 -38
- package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v2.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/compound-v3.md +43 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/connext.md +11 -15
- package/{sdk/src/skills → skills/sauce-protocols/references}/convex.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/cowswap.md +12 -19
- package/skills/sauce-protocols/references/crvusd.md +49 -0
- package/skills/sauce-protocols/references/curve.md +98 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/debridge.md +11 -33
- package/{sdk/src/skills → skills/sauce-protocols/references}/dodo.md +13 -18
- package/skills/sauce-protocols/references/eigenlayer.md +48 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/ens.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc20.md +18 -34
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc3156.md +10 -13
- package/{sdk/src/skills → skills/sauce-protocols/references}/erc4626.md +11 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/ethena.md +10 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/etherfi.md +10 -32
- package/{sdk/src/skills → skills/sauce-protocols/references}/euler-v2.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/fenix.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/fluid.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/frax-ether.md +10 -26
- package/skills/sauce-protocols/references/frax.md +48 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/gains-network.md +11 -28
- package/skills/sauce-protocols/references/gamma.md +57 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/gelato.md +12 -20
- package/skills/sauce-protocols/references/gho.md +50 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v1.md +12 -34
- package/{sdk/src/skills → skills/sauce-protocols/references}/gmx-v2.md +15 -28
- package/skills/sauce-protocols/references/harvest.md +41 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/hegic.md +10 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/hop.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/hyperlane.md +11 -21
- package/skills/sauce-protocols/references/index.md +355 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/instadapp.md +10 -18
- package/skills/sauce-protocols/references/kelp.md +46 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/kim.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/kyberswap-aggregator.md +12 -35
- package/skills/sauce-protocols/references/kyberswap.md +72 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/layerbank.md +11 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/layerzero.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/level-finance.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/lido.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/lifi.md +11 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/linea-bridge.md +11 -14
- package/{sdk/src/skills → skills/sauce-protocols/references}/liquity-v1.md +10 -21
- package/skills/sauce-protocols/references/liquity-v2.md +48 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/lynex.md +12 -18
- package/skills/sauce-protocols/references/maker.md +57 -0
- package/skills/sauce-protocols/references/mantle-meth.md +43 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/maverick.md +13 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/moonwell.md +11 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/morpho-blue.md +44 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/mux-protocol.md +10 -30
- package/skills/sauce-protocols/references/olympus.md +39 -0
- package/skills/sauce-protocols/references/oneinch.md +81 -0
- package/skills/sauce-protocols/references/openocean.md +69 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/optimism-bridge.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/opyn.md +10 -21
- package/{sdk/src/skills → skills/sauce-protocols/references}/pancakeswap-v2.md +39 -41
- package/skills/sauce-protocols/references/pancakeswap-v3.md +72 -0
- package/skills/sauce-protocols/references/paraswap.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/pendle.md +47 -29
- package/skills/sauce-protocols/references/permit2.md +101 -0
- package/skills/sauce-protocols/references/perpetual-protocol.md +53 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/polygon-bridge.md +11 -17
- package/{sdk/src/skills → skills/sauce-protocols/references}/premia.md +10 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/puffer.md +10 -21
- package/skills/sauce-protocols/references/pyth.md +45 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/quickswap.md +13 -27
- package/{sdk/src/skills → skills/sauce-protocols/references}/radiant.md +11 -15
- package/{sdk/src/skills → skills/sauce-protocols/references}/ramses.md +12 -18
- package/skills/sauce-protocols/references/reflexer.md +52 -0
- package/skills/sauce-protocols/references/registry/aave-v2.md +43 -0
- package/skills/sauce-protocols/references/registry/aave-v3.md +62 -0
- package/skills/sauce-protocols/references/registry/aave-v4.md +80 -0
- package/skills/sauce-protocols/references/registry/abracadabra.md +54 -0
- package/skills/sauce-protocols/references/registry/across.md +57 -0
- package/skills/sauce-protocols/references/registry/aerodrome-slipstream.md +72 -0
- package/skills/sauce-protocols/references/registry/aerodrome.md +58 -0
- package/skills/sauce-protocols/references/registry/aevo.md +39 -0
- package/skills/sauce-protocols/references/registry/alchemix.md +46 -0
- package/skills/sauce-protocols/references/registry/ambient.md +40 -0
- package/skills/sauce-protocols/references/registry/arbitrum-bridge.md +40 -0
- package/skills/sauce-protocols/references/registry/arrakis.md +49 -0
- package/skills/sauce-protocols/references/registry/axelar.md +65 -0
- package/skills/sauce-protocols/references/registry/balancer-v2.md +50 -0
- package/skills/sauce-protocols/references/registry/base-bridge.md +42 -0
- package/skills/sauce-protocols/references/registry/baseswap.md +40 -0
- package/skills/sauce-protocols/references/registry/beefy.md +51 -0
- package/skills/sauce-protocols/references/registry/benqi.md +49 -0
- package/skills/sauce-protocols/references/registry/camelot.md +82 -0
- package/skills/sauce-protocols/references/registry/cbeth.md +43 -0
- package/skills/sauce-protocols/references/registry/cctp.md +48 -0
- package/skills/sauce-protocols/references/registry/celer.md +44 -0
- package/skills/sauce-protocols/references/registry/chainlink-ccip.md +45 -0
- package/skills/sauce-protocols/references/registry/chainlink.md +49 -0
- package/skills/sauce-protocols/references/registry/circle-gateway.md +70 -0
- package/skills/sauce-protocols/references/registry/compound-v2.md +53 -0
- package/skills/sauce-protocols/references/registry/compound-v3.md +52 -0
- package/skills/sauce-protocols/references/registry/connext.md +41 -0
- package/skills/sauce-protocols/references/registry/convex.md +51 -0
- package/skills/sauce-protocols/references/registry/cowswap.md +40 -0
- package/skills/sauce-protocols/references/registry/crvusd.md +40 -0
- package/skills/sauce-protocols/references/registry/curve.md +81 -0
- package/skills/sauce-protocols/references/registry/debridge.md +59 -0
- package/skills/sauce-protocols/references/registry/dodo.md +39 -0
- package/skills/sauce-protocols/references/registry/eco-routes.md +65 -0
- package/skills/sauce-protocols/references/registry/eigenlayer.md +58 -0
- package/skills/sauce-protocols/references/registry/ens.md +49 -0
- package/skills/sauce-protocols/references/registry/erc20.md +44 -0
- package/skills/sauce-protocols/references/registry/erc3156.md +38 -0
- package/skills/sauce-protocols/references/registry/erc4626.md +51 -0
- package/skills/sauce-protocols/references/registry/ethena.md +50 -0
- package/skills/sauce-protocols/references/registry/etherfi.md +57 -0
- package/skills/sauce-protocols/references/registry/euler-v2.md +49 -0
- package/skills/sauce-protocols/references/registry/fenix.md +39 -0
- package/skills/sauce-protocols/references/registry/fluid.md +48 -0
- package/skills/sauce-protocols/references/registry/frax-ether.md +49 -0
- package/skills/sauce-protocols/references/registry/frax.md +40 -0
- package/skills/sauce-protocols/references/registry/gains-network.md +43 -0
- package/skills/sauce-protocols/references/registry/gamma.md +56 -0
- package/skills/sauce-protocols/references/registry/gelato.md +45 -0
- package/skills/sauce-protocols/references/registry/gho.md +40 -0
- package/skills/sauce-protocols/references/registry/gmx-v1.md +59 -0
- package/skills/sauce-protocols/references/registry/gmx-v2.md +41 -0
- package/skills/sauce-protocols/references/registry/harvest.md +44 -0
- package/skills/sauce-protocols/references/registry/hegic.md +39 -0
- package/skills/sauce-protocols/references/registry/hop.md +49 -0
- package/skills/sauce-protocols/references/registry/hyperlane.md +48 -0
- package/skills/sauce-protocols/references/registry/instadapp.md +39 -0
- package/skills/sauce-protocols/references/registry/kelp.md +47 -0
- package/skills/sauce-protocols/references/registry/kim.md +39 -0
- package/skills/sauce-protocols/references/registry/kyberswap-aggregator.md +49 -0
- package/skills/sauce-protocols/references/registry/kyberswap.md +63 -0
- package/skills/sauce-protocols/references/registry/layerbank.md +54 -0
- package/skills/sauce-protocols/references/registry/layerzero.md +49 -0
- package/skills/sauce-protocols/references/registry/level-finance.md +41 -0
- package/skills/sauce-protocols/references/registry/lido.md +51 -0
- package/skills/sauce-protocols/references/registry/lifi.md +48 -0
- package/skills/sauce-protocols/references/registry/linea-bridge.md +40 -0
- package/skills/sauce-protocols/references/registry/liquity-v1.md +42 -0
- package/skills/sauce-protocols/references/registry/liquity-v2.md +40 -0
- package/skills/sauce-protocols/references/registry/lynex.md +39 -0
- package/skills/sauce-protocols/references/registry/maker.md +55 -0
- package/skills/sauce-protocols/references/registry/mantle-meth.md +48 -0
- package/skills/sauce-protocols/references/registry/maverick.md +60 -0
- package/skills/sauce-protocols/references/registry/moonwell.md +49 -0
- package/skills/sauce-protocols/references/registry/morpho-blue.md +47 -0
- package/skills/sauce-protocols/references/registry/mux-protocol.md +49 -0
- package/skills/sauce-protocols/references/registry/olympus.md +42 -0
- package/skills/sauce-protocols/references/registry/oneinch.md +45 -0
- package/skills/sauce-protocols/references/registry/openocean.md +44 -0
- package/skills/sauce-protocols/references/registry/optimism-bridge.md +42 -0
- package/skills/sauce-protocols/references/registry/opyn.md +42 -0
- package/skills/sauce-protocols/references/registry/pancakeswap-v2.md +71 -0
- package/skills/sauce-protocols/references/registry/pancakeswap-v3.md +76 -0
- package/skills/sauce-protocols/references/registry/paraswap.md +51 -0
- package/skills/sauce-protocols/references/registry/pendle.md +43 -0
- package/skills/sauce-protocols/references/registry/permit2.md +50 -0
- package/skills/sauce-protocols/references/registry/perpetual-protocol.md +49 -0
- package/skills/sauce-protocols/references/registry/polygon-bridge.md +43 -0
- package/skills/sauce-protocols/references/registry/premia.md +40 -0
- package/skills/sauce-protocols/references/registry/puffer.md +43 -0
- package/skills/sauce-protocols/references/registry/pyth.md +40 -0
- package/skills/sauce-protocols/references/registry/quickswap.md +80 -0
- package/skills/sauce-protocols/references/registry/radiant.md +41 -0
- package/skills/sauce-protocols/references/registry/ramses.md +39 -0
- package/skills/sauce-protocols/references/registry/reflexer.md +56 -0
- package/skills/sauce-protocols/references/registry/renzo.md +47 -0
- package/skills/sauce-protocols/references/registry/rocket-pool.md +49 -0
- package/skills/sauce-protocols/references/registry/sablier.md +40 -0
- package/skills/sauce-protocols/references/registry/safe.md +47 -0
- package/skills/sauce-protocols/references/registry/scroll-bridge.md +48 -0
- package/skills/sauce-protocols/references/registry/seamless.md +42 -0
- package/skills/sauce-protocols/references/registry/seaport.md +44 -0
- package/skills/sauce-protocols/references/registry/silo.md +48 -0
- package/skills/sauce-protocols/references/registry/socket.md +44 -0
- package/skills/sauce-protocols/references/registry/sommelier.md +43 -0
- package/skills/sauce-protocols/references/registry/spark.md +42 -0
- package/skills/sauce-protocols/references/registry/spookyswap.md +40 -0
- package/skills/sauce-protocols/references/registry/squid.md +45 -0
- package/skills/sauce-protocols/references/registry/stader.md +47 -0
- package/skills/sauce-protocols/references/registry/stargate.md +45 -0
- package/skills/sauce-protocols/references/registry/superfluid.md +49 -0
- package/skills/sauce-protocols/references/registry/sushiswap-v2.md +71 -0
- package/skills/sauce-protocols/references/registry/swell.md +49 -0
- package/skills/sauce-protocols/references/registry/synapse.md +46 -0
- package/skills/sauce-protocols/references/registry/syncswap.md +38 -0
- package/skills/sauce-protocols/references/registry/synthetix-v3.md +48 -0
- package/skills/sauce-protocols/references/registry/synthra-v3.md +77 -0
- package/skills/sauce-protocols/references/registry/thales.md +51 -0
- package/skills/sauce-protocols/references/registry/thena.md +39 -0
- package/skills/sauce-protocols/references/registry/thruster.md +38 -0
- package/skills/sauce-protocols/references/registry/tokemak.md +45 -0
- package/skills/sauce-protocols/references/registry/trader-joe.md +66 -0
- package/skills/sauce-protocols/references/registry/uniswap-v2.md +77 -0
- package/skills/sauce-protocols/references/registry/uniswap-v3.md +113 -0
- package/skills/sauce-protocols/references/registry/uniswap-v4.md +117 -0
- package/skills/sauce-protocols/references/registry/unitflow-v3.md +65 -0
- package/skills/sauce-protocols/references/registry/velodrome.md +58 -0
- package/skills/sauce-protocols/references/registry/venus.md +62 -0
- package/skills/sauce-protocols/references/registry/vertex.md +46 -0
- package/skills/sauce-protocols/references/registry/wormhole.md +59 -0
- package/skills/sauce-protocols/references/registry/yearn-v3.md +46 -0
- package/skills/sauce-protocols/references/registry/zerolend.md +41 -0
- package/skills/sauce-protocols/references/registry/zerox.md +44 -0
- package/skills/sauce-protocols/references/registry/zksync-bridge.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/renzo.md +10 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/rocket-pool.md +10 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/sablier.md +10 -27
- package/skills/sauce-protocols/references/safe.md +42 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/scroll-bridge.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/seamless.md +11 -16
- package/skills/sauce-protocols/references/seaport.md +38 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/silo.md +11 -20
- package/{sdk/src/skills → skills/sauce-protocols/references}/socket.md +11 -18
- package/skills/sauce-protocols/references/sommelier.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/spark.md +11 -16
- package/{sdk/src/skills → skills/sauce-protocols/references}/spookyswap.md +12 -19
- package/{sdk/src/skills → skills/sauce-protocols/references}/squid.md +11 -21
- package/skills/sauce-protocols/references/stader.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/stargate.md +11 -22
- package/{sdk/src/skills → skills/sauce-protocols/references}/superfluid.md +10 -28
- package/{sdk/src/skills → skills/sauce-protocols/references}/sushiswap-v2.md +38 -43
- package/skills/sauce-protocols/references/swell.md +49 -0
- package/skills/sauce-protocols/references/synapse.md +54 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/syncswap.md +12 -17
- package/{sdk/src/skills → skills/sauce-protocols/references}/synthetix-v3.md +10 -29
- package/skills/sauce-protocols/references/synthra-v3.md +63 -0
- package/skills/sauce-protocols/references/thales.md +58 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/thena.md +12 -18
- package/{sdk/src/skills → skills/sauce-protocols/references}/thruster.md +13 -18
- package/skills/sauce-protocols/references/tokemak.md +40 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/trader-joe.md +13 -26
- package/{sdk/src/skills → skills/sauce-protocols/references}/uniswap-v2.md +46 -44
- package/skills/sauce-protocols/references/uniswap-v3.md +188 -0
- package/skills/sauce-protocols/references/uniswap-v4.md +155 -0
- package/skills/sauce-protocols/references/unitflow-v3.md +63 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/velodrome.md +12 -24
- package/{sdk/src/skills → skills/sauce-protocols/references}/venus.md +12 -31
- package/skills/sauce-protocols/references/vertex.md +42 -0
- package/skills/sauce-protocols/references/wormhole.md +57 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/yearn-v3.md +10 -25
- package/{sdk/src/skills → skills/sauce-protocols/references}/zerolend.md +11 -15
- package/skills/sauce-protocols/references/zerox.md +39 -0
- package/{sdk/src/skills → skills/sauce-protocols/references}/zksync-bridge.md +11 -14
- package/skills/sauce-script/SKILL.md +407 -0
- package/skills/sauce-script/examples/IOracle.json +12 -0
- package/skills/sauce-script/examples/saucescript.mts +167 -0
- package/skills/sauce-script/examples/twap.sauce.ts +29 -0
- package/skills/sauce-script/references/builtins.json +823 -0
- package/skills/sauce-script/references/builtins.md +674 -0
- package/skills/sauce-solana/SKILL.md +322 -0
- package/skills/sauce-solana/examples/solana.mts +166 -0
- package/skills/sauce-solana/examples/solana.sauce.ts +45 -0
- package/skills/sauce-solana/examples/token-2022.sauce.ts +38 -0
- package/skills/sauce-swaps/SKILL.md +200 -0
- package/skills/sauce-swaps/examples/swap-leg.sauce.ts +50 -0
- package/skills/sauce-swaps/examples/swaps.mts +124 -0
- package/skills/sauce-typescript/SKILL.md +178 -0
- package/skills/sauce-typescript/examples/actions.mts +100 -0
- package/skills/sauce-typescript/examples/compiler.mts +69 -0
- package/skills/sauce-typescript/examples/cook.mts +65 -0
- package/skills/sauce-typescript/examples/verify.mts +104 -0
- package/dev-tools/README.md +0 -16
- package/dev-tools/artifacts/IERC20.json +0 -1
- package/dev-tools/artifacts/ISauceRouter.json +0 -1
- package/dev-tools/artifacts/IUniswapV3Pool.json +0 -1
- package/dev-tools/artifacts/Router.json +0 -1
- package/dev-tools/hardhat.config.cjs +0 -18
- package/dev-tools/sauce/js/add.js +0 -4
- package/dev-tools/sauce/js/call.js +0 -8
- package/dev-tools/sauce/js/erc20.js +0 -18
- package/dev-tools/sauce/js/example.js +0 -6
- package/dev-tools/sauce/js/fibonacci.js +0 -13
- package/dev-tools/sauce/ts/add.ts +0 -4
- package/dev-tools/sauce/ts/call.ts +0 -8
- package/dev-tools/sauce/ts/erc20.ts +0 -18
- package/dev-tools/sauce/ts/example.ts +0 -6
- package/dev-tools/sauce/ts/fibonacci.ts +0 -13
- package/dev-tools/sauce/ts/saucescript.d.ts +0 -1
- package/dev-tools/sauce/ts/tsconfig.json +0 -12
- package/dev-tools/scripts/deploy.ts +0 -107
- package/dev-tools/scripts/init.js +0 -132
- package/dev-tools/scripts/run.ts +0 -67
- package/dev-tools/scripts/start-fork.sh +0 -92
- package/dev-tools/scripts/start-local.sh +0 -120
- package/dev-tools/scripts/stop-local.sh +0 -40
- package/dev-tools/scripts/sync-artifacts.js +0 -46
- package/dev-tools/scripts/sync-price.ts +0 -58
- package/dev-tools/src/contracts.ts +0 -59
- package/dev-tools/src/runner.ts +0 -355
- package/dev-tools/src/svm-local.ts +0 -305
- package/dev-tools/src/sync-price.ts +0 -217
- package/sdk/dist/deployments/v12.generated.d.ts +0 -95
- package/sdk/dist/deployments/v12.generated.d.ts.map +0 -1
- package/sdk/dist/deployments/v12.generated.js +0 -50
- package/sdk/dist/deployments/v12.generated.js.map +0 -1
- package/sdk/dist/swap/index.d.ts +0 -29
- package/sdk/dist/swap/index.d.ts.map +0 -1
- package/sdk/dist/swap/index.js +0 -27
- package/sdk/dist/swap/index.js.map +0 -1
- package/sdk/dist/swap/params.d.ts +0 -29
- package/sdk/dist/swap/params.d.ts.map +0 -1
- package/sdk/dist/swap/params.js +0 -123
- package/sdk/dist/swap/params.js.map +0 -1
- package/sdk/dist/swap/source.d.ts +0 -30
- package/sdk/dist/swap/source.d.ts.map +0 -1
- package/sdk/dist/swap/source.js +0 -101
- package/sdk/dist/swap/source.js.map +0 -1
- package/sdk/dist/swap/types.d.ts +0 -160
- package/sdk/dist/swap/types.d.ts.map +0 -1
- package/sdk/dist/swap/types.js +0 -106
- package/sdk/dist/swap/types.js.map +0 -1
- package/sdk/src/skills/aave-v3.md +0 -134
- package/sdk/src/skills/aave-v4.md +0 -91
- package/sdk/src/skills/abracadabra.md +0 -93
- package/sdk/src/skills/across.md +0 -90
- package/sdk/src/skills/aerodrome-slipstream.md +0 -57
- package/sdk/src/skills/aevo.md +0 -58
- package/sdk/src/skills/axelar.md +0 -80
- package/sdk/src/skills/cbeth.md +0 -62
- package/sdk/src/skills/chainlink.md +0 -62
- package/sdk/src/skills/crvusd.md +0 -58
- package/sdk/src/skills/curve.md +0 -141
- package/sdk/src/skills/eigenlayer.md +0 -71
- package/sdk/src/skills/frax.md +0 -57
- package/sdk/src/skills/gamma.md +0 -79
- package/sdk/src/skills/gho.md +0 -61
- package/sdk/src/skills/harvest.md +0 -49
- package/sdk/src/skills/index.md +0 -299
- package/sdk/src/skills/kelp.md +0 -60
- package/sdk/src/skills/kyberswap.md +0 -100
- package/sdk/src/skills/liquity-v2.md +0 -59
- package/sdk/src/skills/loader.ts +0 -46
- package/sdk/src/skills/maker.md +0 -79
- package/sdk/src/skills/mantle-meth.md +0 -60
- package/sdk/src/skills/olympus.md +0 -46
- package/sdk/src/skills/oneinch.md +0 -64
- package/sdk/src/skills/openocean.md +0 -86
- package/sdk/src/skills/pancakeswap-v3.md +0 -104
- package/sdk/src/skills/paraswap.md +0 -67
- package/sdk/src/skills/permit2.md +0 -73
- package/sdk/src/skills/perpetual-protocol.md +0 -73
- package/sdk/src/skills/pyth.md +0 -58
- package/sdk/src/skills/reflexer.md +0 -73
- package/sdk/src/skills/safe.md +0 -56
- package/sdk/src/skills/seaport.md +0 -65
- package/sdk/src/skills/sommelier.md +0 -47
- package/sdk/src/skills/stader.md +0 -53
- package/sdk/src/skills/swell.md +0 -65
- package/sdk/src/skills/synapse.md +0 -63
- package/sdk/src/skills/synthra-v3.md +0 -57
- package/sdk/src/skills/thales.md +0 -74
- package/sdk/src/skills/tokemak.md +0 -48
- package/sdk/src/skills/uniswap-v3.md +0 -202
- package/sdk/src/skills/uniswap-v4.md +0 -125
- package/sdk/src/skills/unitflow-v3.md +0 -62
- package/sdk/src/skills/vertex.md +0 -55
- package/sdk/src/skills/wormhole.md +0 -76
- package/sdk/src/skills/zerox.md +0 -51
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sauce-solana
|
|
3
|
+
description: Writing and running Sauce programs on Solana (the SVM target) — declaring every account as an Account parameter with Writable/Signer roles, the account manifest the compile returns, passing accounts by name with --account, the @sauce/token arm for SPL Token and Token-2022 (balanceOf and the other reads, transferChecked and approveChecked for either program, the legacy transfer and approve) and what Token-2022's extensions do to a program (transfer fees, scaled UI amounts, pauses, frozen accounts, transfer hooks), svm.call CPIs and svm.sload byte reads, account .owner and .dataLen checks, a 32-byte key as a define, runtime arguments without Account slots, and how a program runs with sauce run --chain solana, through the Kitchen on the owner's Pot or directly on the engine (--via engine). Use when the user targets Solana, SPL tokens, Token-2022, PYUSD or tokenized stocks on Solana, PDAs or CPIs, account manifests, lamport fees, CPI depth, LiteSVM, or Solana venues such as Raydium, Orca or Meteora.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sauce on Solana
|
|
7
|
+
|
|
8
|
+
A Solana program must declare every account it touches before it runs. In SauceScript those are
|
|
9
|
+
`Account` parameters of `main`; the compile returns them, in order and with their roles, as the
|
|
10
|
+
**account manifest**, and each is attached by name when the program runs. A program for Solana is
|
|
11
|
+
compiled with `--chain solana`. Its signatures are annotated. Protocol namespaces and the token
|
|
12
|
+
methods (`USDC.transfer(...)`) do not exist there; the `@sauce/token` functions do, with no import,
|
|
13
|
+
and a registered token symbol (`USDC`, `USDT`, `WSOL`, `PYUSD`) is its mint's 32-byte key, a value
|
|
14
|
+
they take: `balanceOf(USDC, account)`. `sauce globals --chain solana` lists the mints, devnet's, and
|
|
15
|
+
which are Token-2022 mints.
|
|
16
|
+
|
|
17
|
+
```sauce chain=solana define=MINT
|
|
18
|
+
const MINT = 0n; // the SPL mint's 32-byte key: a define replaces it
|
|
19
|
+
|
|
20
|
+
function main(
|
|
21
|
+
tokenProgram: Account,
|
|
22
|
+
source: Account<Writable>,
|
|
23
|
+
destination: Account<Writable>,
|
|
24
|
+
authority: Account<Signer>,
|
|
25
|
+
amount: Uint256
|
|
26
|
+
): Uint256 {
|
|
27
|
+
require(MINT != 0n, "set MINT");
|
|
28
|
+
const before = balanceOf(MINT, destination);
|
|
29
|
+
transfer(MINT, tokenProgram, source, destination, authority, amount);
|
|
30
|
+
const after = balanceOf(MINT, destination);
|
|
31
|
+
require(after - before == amount, "destination did not receive the amount");
|
|
32
|
+
return after;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
npx sauce compile solana.sauce.ts --chain solana --define MINT=<mint> --json
|
|
38
|
+
npx sauce run solana.sauce.ts --chain solana --config sauce.config.json --keypair <keypair> \
|
|
39
|
+
--define MINT=<mint> --account tokenProgram=<SPL Token program> \
|
|
40
|
+
--account source=<the Pot's token account> --account destination=<token account> \
|
|
41
|
+
--account authority=pot --args 400
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Accounts
|
|
45
|
+
|
|
46
|
+
- `Account` is read-only; `Account<Writable>` and `Account<Signer>` declare the role the
|
|
47
|
+
transaction must grant. The manifest records `readonly`, `writable`, `readonly_signer` or
|
|
48
|
+
`writable_signer` per slot. Roles are the author's declaration; nothing infers them from what a
|
|
49
|
+
CPI needs.
|
|
50
|
+
- Each slot is passed by its name: `--account NAME=<address>`, `NAME=pot` for the Pot, which the
|
|
51
|
+
Kitchen signs for, or `NAME=owner` for the signer. `sauce compile --json` lists the slots in its
|
|
52
|
+
`manifest`, and a missing one is named with the role it needs.
|
|
53
|
+
- An `Account` compares by identity (`tokenProgram == SPL_TOKEN_PROGRAM`, with the SPL Token
|
|
54
|
+
program `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` as a define, in base58 or as
|
|
55
|
+
`0x06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a9`) and exposes `.owner` and
|
|
56
|
+
`.dataLen`. Check the owner before trusting bytes: a hand-made account can carry any layout.
|
|
57
|
+
- `svm.sload(account, offset, length)` reads bytes; `.toLe()`/`.toBe()` make a number.
|
|
58
|
+
`svm.call(program, [accounts...], data)` is a CPI to an attached program account.
|
|
59
|
+
- Scalar parameters are runtime arguments (`--args`); `Account` parameters are not encoded. A
|
|
60
|
+
32-byte key chosen per compile, such as a mint, is a module constant (`const MINT = 0n;`) that
|
|
61
|
+
`--define MINT=<key>` replaces, the key in base58 or as 32-byte hex. A define also overrides a
|
|
62
|
+
registered symbol, which is how a devnet program names devnet's USDC; a module `const USDC = …`
|
|
63
|
+
does not, since the symbol is itself a define and a define wins. A key that changes per call is
|
|
64
|
+
an `Address` argument of `main`, passed as a base58 public key and encoded as one ABI word (not
|
|
65
|
+
with `--compact-args`), or an `Account` parameter when the program reads or writes that account.
|
|
66
|
+
- On Solana `ctx.self()` is the engine's program id, which owns every Pot account, **not the
|
|
67
|
+
Pot**; `ctx.msgSender()` is the first signer among the accounts the engine receives (the Pot,
|
|
68
|
+
when a `pot` slot is attached as the Pot), not proof of who sent the transaction; and
|
|
69
|
+
`ctx.balance(acct.address)` is an attached account's lamports.
|
|
70
|
+
`ctx.msgValue`, `ctx.gasLeft`, `ctx.codeSize` and the other EVM reads are rejected; move lamports with a
|
|
71
|
+
system-program CPI through `svm.call`. Every read, per target, is in
|
|
72
|
+
[../sauce-script/references/builtins.md](../sauce-script/references/builtins.md).
|
|
73
|
+
|
|
74
|
+
## The Pot's key
|
|
75
|
+
|
|
76
|
+
The Pot is an account the program is given: declare it as `pot: Account<Signer>`, pass it as
|
|
77
|
+
`--account pot=pot`, and read `pot.address`. Nothing about the slot alone proves it is the Pot:
|
|
78
|
+
|
|
79
|
+
- a `Signer` slot takes any signer (`pot=owner` satisfies it too);
|
|
80
|
+
- `ctx.msgSender()` is only the first signer among the accounts the engine receives;
|
|
81
|
+
- `pot.owner == ctx.self()` says only that the engine owns the account. **The engine owns every
|
|
82
|
+
Pot, but not only Pots**: a keypair account assigned to the engine, which the transaction signs,
|
|
83
|
+
passes the check as well. It keeps the owner's wallet out (the System program owns that) and
|
|
84
|
+
lets a lookalike in.
|
|
85
|
+
|
|
86
|
+
**To bind the slot to the Pot, re-derive the Pot's address and require the slot to be it.** The Pot
|
|
87
|
+
is the Kitchen's program address for the seeds `"pot"`, its owner and the 32-byte salt (zero unless
|
|
88
|
+
`--salt` names another), and only a Kitchen cook can make that address sign, so a signing slot at
|
|
89
|
+
that address is the Pot. Take the owner as a signer slot of its own (`--account wallet=owner`).
|
|
90
|
+
`KITCHEN` is the Kitchen program, as a define: `--define KITCHEN=SauceYLdWyabKFwtevSAgsSDoMjCoTKtx1HTb63eJot`
|
|
91
|
+
(or its 32-byte hex, `0x068ddbf2073c779081c9b11a48aea267e5545cb7f387144de6b7ff8c7138818b`). Bind an
|
|
92
|
+
account's key to a local before calling a method on it.
|
|
93
|
+
|
|
94
|
+
```sauce chain=solana define=KITCHEN
|
|
95
|
+
const SALT = 0n; // the Pot's salt, zero by default
|
|
96
|
+
|
|
97
|
+
function main(pot: Account<Signer>, wallet: Account<Signer>) {
|
|
98
|
+
const owner = wallet.address;
|
|
99
|
+
const [expected] = crypto.findPDA(KITCHEN, ["pot", owner.toBytesBe(32n), SALT.toBytesBe(32n)]);
|
|
100
|
+
require(pot.address == expected, "pot is not the wallet's Pot");
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
npx sauce run pot.sauce.ts --chain solana --config sauce.config.json --keypair <keypair> \
|
|
106
|
+
--define KITCHEN=SauceYLdWyabKFwtevSAgsSDoMjCoTKtx1HTb63eJot --account pot=pot --account wallet=owner
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
A Pot under another salt is the same program with `--define SALT=<the salt, as 32-byte hex>`.
|
|
110
|
+
This binding is a Kitchen cook's. A direct cook (`--via engine`) runs as no Pot: nothing signs for
|
|
111
|
+
one, so a slot that must sign cannot be `pot` there.
|
|
112
|
+
|
|
113
|
+
## Token accounts
|
|
114
|
+
|
|
115
|
+
An SPL token account is 165 bytes, and `acct.owner` is the program that owns it (the SPL Token
|
|
116
|
+
program, or Token-2022), not whose balance it is. A Token-2022 account has the same first 165 bytes,
|
|
117
|
+
then its extensions:
|
|
118
|
+
|
|
119
|
+
| Bytes | Field | Read |
|
|
120
|
+
| ------- | ---------------------------------- | ---------------------------------- |
|
|
121
|
+
| 0–32 | mint | `svm.sload(acct, 0n, 32n).toBe()` |
|
|
122
|
+
| 32–64 | owner: whose balance it is | `ownerOf(mint, acct)` |
|
|
123
|
+
| 64–72 | amount (u64, little-endian) | `svm.sload(acct, 64n, 8n).toLe()` |
|
|
124
|
+
| 72–76 | delegate tag (u32: 0 none, 1 some) | `svm.sload(acct, 72n, 4n).toLe()` |
|
|
125
|
+
| 76–108 | delegate | `svm.sload(acct, 76n, 32n).toBe()` |
|
|
126
|
+
| 121–129 | delegated amount (u64) | `svm.sload(acct, 121n, 8n).toLe()` |
|
|
127
|
+
|
|
128
|
+
**Check the owner before calling a balance the Pot's**: a transfer with the Pot as `authority` also
|
|
129
|
+
succeeds from an account where the Pot is only a delegate, up to the delegated amount.
|
|
130
|
+
`ownerOf(mint, acct)` (below) checks the account's program and mint, then reads its owner.
|
|
131
|
+
|
|
132
|
+
## USDC, and the Pot's token account
|
|
133
|
+
|
|
134
|
+
`USDC` on Solana is mainnet's USDC mint, `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`, whose
|
|
135
|
+
32-byte key is `0xc6fa7af3bedbad3a3d65f36aabc97431b1bbe4c2d2f6e0e47ca60203452f5d61`;
|
|
136
|
+
`balanceOf(USDC, account)` takes it with no define. On devnet USDC is another mint,
|
|
137
|
+
`4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU`: pass it as `--define USDC=<key>`, which wins over
|
|
138
|
+
the symbol. The Solana file in `sauce-chains` lists every registered mint, mainnet's and devnet's.
|
|
139
|
+
|
|
140
|
+
`--account <name>=pot` attaches **the Pot's own account**, not its USDC. The Pot's USDC is a token
|
|
141
|
+
account of its own, so a program reading it takes that account as a parameter and checks whose it
|
|
142
|
+
is:
|
|
143
|
+
|
|
144
|
+
```sauce chain=solana define=KITCHEN
|
|
145
|
+
const SALT = 0n; // the Pot's salt, zero by default
|
|
146
|
+
|
|
147
|
+
function main(pot: Account<Signer>, wallet: Account<Signer>, potUsdc: Account): Uint256 {
|
|
148
|
+
const owner = wallet.address;
|
|
149
|
+
const [expected] = crypto.findPDA(KITCHEN, ["pot", owner.toBytesBe(32n), SALT.toBytesBe(32n)]);
|
|
150
|
+
require(pot.address == expected, "pot is not the wallet's Pot");
|
|
151
|
+
require(ownerOf(USDC, potUsdc) == pot.address, "not the Pot's USDC account");
|
|
152
|
+
return balanceOf(USDC, potUsdc);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
run with `--account pot=pot --account wallet=owner`, the Pot's USDC account in the third slot and
|
|
157
|
+
`--define KITCHEN=…` as above: `--account potUsdc=pot:USDC` passes it, the Pot's associated token
|
|
158
|
+
account for the mint (`pot:<mint>` for any mint, `owner:USDC` for the owner's). The first check
|
|
159
|
+
binds `pot` to the wallet's Pot; the second binds the token account to `pot`. Passing the Pot for
|
|
160
|
+
that slot fails the checks with no message (the Pot is not an SPL token account), and so does an
|
|
161
|
+
account that does not exist: **a Pot with no USDC account holds no USDC**. `sauce simulate` names
|
|
162
|
+
a given account the cluster does not have, and
|
|
163
|
+
`sauce pot --chain solana --owner <pubkey> --config sauce.config.json` lists the Pot's account for
|
|
164
|
+
each registered mint, whether it exists and what it holds.
|
|
165
|
+
|
|
166
|
+
The Pot's USDC sits in its associated token account, the ATA of (Pot, mint) under the mint's token
|
|
167
|
+
program. Derive it with `findAssociatedTokenPda` and create it with
|
|
168
|
+
`getCreateAssociatedTokenIdempotentInstruction`, both from `@solana-program/token`, passing the
|
|
169
|
+
mint's token program as `tokenProgram` (Token-2022 for PYUSD), then fund it with an ordinary
|
|
170
|
+
transfer from any wallet: `--fund` is EVM only. `@solana/kit` and `@solana-program/token` are dependencies of the package, not of your
|
|
171
|
+
project: add them to it before importing them (to build a payer, derive an ATA or send a transfer).
|
|
172
|
+
|
|
173
|
+
## Transaction size
|
|
174
|
+
|
|
175
|
+
A Solana transaction is at most **1,232 bytes**, and the cook carries the program and its
|
|
176
|
+
arguments, so a program that does not fit has to be staged first, which only `sauce run` does. The
|
|
177
|
+
cook adds about 404 bytes and 33 more per account (538 with four accounts), so with four accounts a
|
|
178
|
+
program and its arguments have about 694 bytes. A direct cook (`--via engine`) carries no
|
|
179
|
+
Kitchen, Pot or salt and adds about 100 bytes less: about 798 for the program and its arguments with
|
|
180
|
+
four accounts. What costs bytes:
|
|
181
|
+
|
|
182
|
+
- each `require` message, byte for byte;
|
|
183
|
+
- each `@sauce/token` function, which carries its own checks and their reasons: a `transfer` about
|
|
184
|
+
280 bytes and a second about 50, a `transferChecked` about 500, a first read (`balanceOf`) about
|
|
185
|
+
260, and a read of another kind about 40 more (the reads share their checks). A program that moves
|
|
186
|
+
a Token-2022 token and measures what arrived is past one transaction, and `sauce run` stages it;
|
|
187
|
+
- each account, about 33 bytes;
|
|
188
|
+
- arguments: `--compact-args` encodes them compactly (a `Uint256` takes 7 bytes instead of 32).
|
|
189
|
+
|
|
190
|
+
## `@sauce/token` on Solana
|
|
191
|
+
|
|
192
|
+
Solana has two token programs, and every mint belongs to one, with every token account of it: the
|
|
193
|
+
SPL Token program (`TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`) or Token-2022
|
|
194
|
+
(`TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb`). USDC, USDT and WSOL are SPL Token mints; PYUSD and
|
|
195
|
+
the tokenized stocks are Token-2022 mints. The arm takes the mint first, then the accounts:
|
|
196
|
+
|
|
197
|
+
- **Reads, either program:** `balanceOf(mint, account)`, `allowance(mint, account, spender)`,
|
|
198
|
+
`ownerOf(mint, account)`, `totalSupply(mintAccount)`, `decimals(mintAccount)`.
|
|
199
|
+
- **Checked writes, either program:** `transferChecked(mint, tokenProgram, source, mintAccount, dest,
|
|
200
|
+
authority, amount, decimals)` and `approveChecked(mint, tokenProgram, source, mintAccount,
|
|
201
|
+
delegate, authority, amount, decimals)`. `tokenProgram` is the program that owns the mint, the
|
|
202
|
+
source and the destination; the account after the source is the mint's own, which must be the
|
|
203
|
+
mint named first; `decimals` must be the mint's.
|
|
204
|
+
- **Legacy writes, SPL Token only:** `transfer(mint, tokenProgram, source, dest, authority, amount)`,
|
|
205
|
+
`approve(mint, tokenProgram, source, delegate, authority, amount)`, and `transferFrom` (the same
|
|
206
|
+
instruction: SPL has one transfer for owners and delegates). They refuse a Token-2022 account or
|
|
207
|
+
program. Move a Token-2022 token with `transferChecked`: Token-2022 refuses its plain transfer for
|
|
208
|
+
a mint with a transfer fee, a transfer hook or a pause.
|
|
209
|
+
|
|
210
|
+
Every function checks the account's program and mint, and every write rejects an amount above
|
|
211
|
+
`u64`. Each check reverts with its reason, which `sauce simulate` prints: `not a token account`,
|
|
212
|
+
`wrong mint`, `not a mint`, `uninitialized mint`, `not the token program`, `amount over u64`,
|
|
213
|
+
`wrong decimals` and `transfer hook`. SPL tracks one delegate per account, so a second approval
|
|
214
|
+
replaces the first.
|
|
215
|
+
|
|
216
|
+
A transfer's `authority` may be the source's owner or its delegate, so a transfer that succeeds does
|
|
217
|
+
not show whose account `source` is. `ownerOf(mint, account)` reads the token account's owner (the
|
|
218
|
+
wallet or PDA whose balance it is, not `account.owner`, the token program): before treating a
|
|
219
|
+
balance as the Pot's, `require(ownerOf(USDC, source) == authority, "not the Pot's account")`.
|
|
220
|
+
|
|
221
|
+
### Token-2022 mints and their extensions
|
|
222
|
+
|
|
223
|
+
A Token-2022 mint carries extensions, which the token program applies to every transfer. What each
|
|
224
|
+
does to a program:
|
|
225
|
+
|
|
226
|
+
| Extension | What a program sees |
|
|
227
|
+
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
228
|
+
| Transfer fee | The destination receives the amount less the fee, which the mint withholds. Measure what arrived (`balanceOf` before and after), never the amount sent. |
|
|
229
|
+
| Scaled UI amount | A display multiplier, for wallets. Balances, amounts and transfers are raw base units; a program never sees a UI amount. |
|
|
230
|
+
| Pausable | While the issuer has paused the mint, every transfer fails: `Token-2022 refused: Transferring, minting, and burning is paused on this mint`. |
|
|
231
|
+
| Default account state, frozen | A new account starts frozen until the issuer thaws it, and a transfer into or out of a frozen account fails: `Token-2022 refused: Account is frozen`. |
|
|
232
|
+
| Transfer hook with no program | No hook: the mint transfers as any other. Tokenized stocks carry one. |
|
|
233
|
+
| Transfer hook that names a program | Refused, `transfer hook`, before anything moves: the hook's own accounts are not passed. |
|
|
234
|
+
| Permanent delegate, confidential transfers, metadata | Nothing for a program: reads and checked writes work as on a legacy mint. |
|
|
235
|
+
|
|
236
|
+
A paused mint or a frozen account fails the whole transaction with the token program's error, as
|
|
237
|
+
any failed call does; `sauce simulate` prints it.
|
|
238
|
+
|
|
239
|
+
```sauce chain=solana
|
|
240
|
+
function main(
|
|
241
|
+
tokenProgram: Account,
|
|
242
|
+
source: Account<Writable>,
|
|
243
|
+
mint: Account,
|
|
244
|
+
destination: Account<Writable>,
|
|
245
|
+
pot: Account<Signer>,
|
|
246
|
+
amount: Uint256
|
|
247
|
+
): Uint256 {
|
|
248
|
+
require(ownerOf(PYUSD, source) == pot.address, "not the Pot's account");
|
|
249
|
+
const before = balanceOf(PYUSD, destination);
|
|
250
|
+
transferChecked(PYUSD, tokenProgram, source, mint, destination, pot, amount, 6n);
|
|
251
|
+
return balanceOf(PYUSD, destination) - before;
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
`--account` names each of its accounts by its token: `program:PYUSD` is the token program that owns
|
|
256
|
+
the mint, `mint:PYUSD` the mint, `pot:PYUSD` the Pot's account for it and `owner:PYUSD` the
|
|
257
|
+
owner's; any other mint by its base58 address (`program:<mint>`), its program read from the
|
|
258
|
+
cluster. A token account's address derives from its owner, its mint and the mint's token program, so
|
|
259
|
+
the Pot's PYUSD account is not where an SPL Token derivation puts it:
|
|
260
|
+
|
|
261
|
+
```sh
|
|
262
|
+
npx sauce run token-2022.sauce.ts --chain solana --config sauce.config.json --keypair <keypair> \
|
|
263
|
+
--account tokenProgram=program:PYUSD --account source=pot:PYUSD --account mint=mint:PYUSD \
|
|
264
|
+
--account destination=<token account> --account pot=pot --args 400
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Running
|
|
268
|
+
|
|
269
|
+
Solana is one of the three chains the initial release supports, with Ethereum and Base: its cooks,
|
|
270
|
+
Pots and intent steps are built and sent there.
|
|
271
|
+
|
|
272
|
+
- **The Pot** is the Kitchen's address for the owner and salt.
|
|
273
|
+
`npx sauce pot --chain solana --owner <pubkey>` prints it;
|
|
274
|
+
`npx sauce pot --deploy --chain solana --config sauce.config.json --keypair <keypair>` creates it.
|
|
275
|
+
A cook names its Pot by `--owner` (and `--salt`), never `--pot`.
|
|
276
|
+
- **The cook** pays the execution fee in lamports, read from the cluster and printed as `fee`, so
|
|
277
|
+
there is no `--value`; `--max-execution-fee <lamports>` refuses a cook whose fee is above it.
|
|
278
|
+
`sauce simulate` runs it from `--owner` with no signature and prints the compute units, or the
|
|
279
|
+
reason (a `throw` or `require` message, decoded) and the program logs. A Pot the Kitchen has not
|
|
280
|
+
created yet is created in the same simulated transaction, ahead of the cook. Solana's simulation
|
|
281
|
+
takes no account overrides, so the owner must hold the Pot's rent and the fees, and the accounts
|
|
282
|
+
hold what they hold: there is no `--assume-balance` on Solana. `sauce run` signs with
|
|
283
|
+
`--keypair`; `sauce tx` prints a base64 transaction for the owner's wallet.
|
|
284
|
+
- **Through the Kitchen or directly.** `--via kitchen`, the default, is the Kitchen's cook on the
|
|
285
|
+
owner's Pot: the program holds and spends what the Pot owns and can write the Pot's storage.
|
|
286
|
+
`--via engine` calls the engine itself, with no Kitchen and no Pot: nothing is created, and the
|
|
287
|
+
signer (`--keypair`, or `--owner` for `simulate` and `tx`) pays the fee and is the authority the
|
|
288
|
+
program acts with. Spend from the signer's own token accounts and pass `NAME=owner` where an
|
|
289
|
+
authority signs. A direct cook leaves the program one more level of CPI depth, for a program that
|
|
290
|
+
calls a program that calls others. Both pay the same fee into the Kitchen's treasury:
|
|
291
|
+
|
|
292
|
+
```sh
|
|
293
|
+
npx sauce run solana.sauce.ts --chain solana --config sauce.config.json --keypair <keypair> \
|
|
294
|
+
--via engine --define MINT=<mint> --account tokenProgram=<SPL Token program> \
|
|
295
|
+
--account source=<the signer's token account> --account destination=<token account> \
|
|
296
|
+
--account authority=owner --args 400
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
- A program too large for one transaction is staged through the Kitchen by `sauce run`. `simulate`
|
|
300
|
+
and `tx` refuse it, naming how many bytes the payload (the program and its arguments) must
|
|
301
|
+
shrink by to fit.
|
|
302
|
+
- The engine program is `2HH8xZ7ZN8SSDD8B3ALYANTVKBbMKGxTzjX7LTzvtSzT` and the Kitchen
|
|
303
|
+
`SauceYLdWyabKFwtevSAgsSDoMjCoTKtx1HTb63eJot` ([../sauce-chains/references/solana.md](../sauce-chains/references/solana.md));
|
|
304
|
+
confirm both are deployed on the cluster (`getAccountInfo` returns an executable account).
|
|
305
|
+
- `sauce intent publish` does not work from Solana; open an intent from Ethereum or Base. Its
|
|
306
|
+
destination may be Solana: `sauce intent fill`, `prove` and `cancel` act on it there with
|
|
307
|
+
`--keypair` (`sauce-intents`), and take no `--via`: an intent's program on Solana runs
|
|
308
|
+
through the Kitchen. A failed `sauce run` prints the program logs.
|
|
309
|
+
- For a local run, the package ships the engine and Kitchen programs, to load into a local
|
|
310
|
+
validator or LiteSVM; `sauce-typescript` says where they are. Setting one up is outside this
|
|
311
|
+
skill.
|
|
312
|
+
- From TypeScript, the SVM client (`createSauceSvmClient`) builds the same cooks: `via: "engine"`
|
|
313
|
+
for the direct one, and `executionFee()` quotes the fee to set `maxExecutionFee` from. Venue
|
|
314
|
+
adapters build swaps on Solana venues such as Raydium (`sauce-typescript`). A venue swap they
|
|
315
|
+
build uses a minimum output of one: enforce the real minimum with a balance delta in the program.
|
|
316
|
+
|
|
317
|
+
## Example
|
|
318
|
+
|
|
319
|
+
[examples/solana.sauce.ts](examples/solana.sauce.ts) is the program above;
|
|
320
|
+
[examples/token-2022.sauce.ts](examples/token-2022.sauce.ts) moves PYUSD with `transferChecked`;
|
|
321
|
+
[examples/solana.mts](examples/solana.mts) compiles both, checks the manifest order and roles and the
|
|
322
|
+
arguments, the mints' token programs, and confirms the client refuses to run without an `rpcUrl`.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// Compiles solana.sauce.ts the way `sauce compile --chain solana` does and checks what the
|
|
2
|
+
// sauce-solana skill says about it: the manifest lists the Account parameters in order with their
|
|
3
|
+
// roles, the mint is a module constant a define replaces, only the scalar parameters are
|
|
4
|
+
// arguments, execution needs an rpcUrl the caller supplies, the USDC mint's hex is the skill's, the
|
|
5
|
+
// Pot is the Kitchen's address for its seeds, and a cook's size is what the skill budgets. Then
|
|
6
|
+
// token-2022.sauce.ts: its accounts, PYUSD's token program, the two programs the skill names, and
|
|
7
|
+
// that moving a Token-2022 token and measuring what arrived is past one transaction. Offline:
|
|
8
|
+
// nothing is sent.
|
|
9
|
+
//
|
|
10
|
+
// node solana.mts
|
|
11
|
+
import { readFileSync } from "node:fs";
|
|
12
|
+
|
|
13
|
+
import { routes } from "@eco-incorp/sauce";
|
|
14
|
+
import { v12SvmEngineProgramId, v12SvmKitchenProgramId } from "@eco-incorp/sauce/deployments";
|
|
15
|
+
import {
|
|
16
|
+
POT_SEED,
|
|
17
|
+
TOKEN_2022_PROGRAM_ID,
|
|
18
|
+
TOKEN_PROGRAM_ID,
|
|
19
|
+
USDC_MINT,
|
|
20
|
+
buildCookInstruction,
|
|
21
|
+
buildExecuteTransaction,
|
|
22
|
+
buildHeapFramePrepend,
|
|
23
|
+
createSauceSvmClient,
|
|
24
|
+
deriveExecutionFeeConfigPda,
|
|
25
|
+
derivePotPda,
|
|
26
|
+
getTransactionSize,
|
|
27
|
+
} from "@eco-incorp/sauce/svm";
|
|
28
|
+
import { getSetComputeUnitLimitInstruction } from "@solana-program/compute-budget";
|
|
29
|
+
import {
|
|
30
|
+
AccountRole,
|
|
31
|
+
TRANSACTION_SIZE_LIMIT,
|
|
32
|
+
address,
|
|
33
|
+
blockhash,
|
|
34
|
+
generateKeyPairSigner,
|
|
35
|
+
getAddressEncoder,
|
|
36
|
+
getProgramDerivedAddress,
|
|
37
|
+
} from "@solana/kit";
|
|
38
|
+
|
|
39
|
+
function check(condition: unknown, message: string): asserts condition {
|
|
40
|
+
if (!condition) throw new Error(`check failed: ${message}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// A public key is a 32-byte scalar: decode the SDK's base58 USDC mint into the define's value.
|
|
44
|
+
const BASE58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
45
|
+
const usdcMint = [...USDC_MINT].reduce((n, c) => n * 58n + BigInt(BASE58.indexOf(c)), 0n);
|
|
46
|
+
|
|
47
|
+
const source = readFileSync(new URL("./solana.sauce.ts", import.meta.url), "utf8");
|
|
48
|
+
const program = routes.compileSauceProgram("solana", source, { defines: { MINT: usdcMint } });
|
|
49
|
+
|
|
50
|
+
// The manifest: every Account parameter, in order, with its declared role.
|
|
51
|
+
const slots = (program.manifest?.accounts ?? []).map((a) =>
|
|
52
|
+
a.kind === "slot" ? `${a.name}:${a.requires}` : "remaining",
|
|
53
|
+
);
|
|
54
|
+
check(
|
|
55
|
+
slots.join() ===
|
|
56
|
+
"tokenProgram:readonly,source:writable,destination:writable,authority:readonly_signer",
|
|
57
|
+
"manifest order and roles",
|
|
58
|
+
);
|
|
59
|
+
// Accounts are attached by name (`--account`), not encoded: the one argument is `amount`.
|
|
60
|
+
check(
|
|
61
|
+
program.entryParams.map((param) => `${param.name}: ${param.type}`).join() === "amount: Uint256",
|
|
62
|
+
"the arguments are the scalar parameters",
|
|
63
|
+
);
|
|
64
|
+
const args = routes.encodeEntryArguments(program, [5_000_000n]);
|
|
65
|
+
check(routes.decodeEntryArguments(program, args)[0] === 5_000_000n, "arguments round trip");
|
|
66
|
+
|
|
67
|
+
// Execution goes through the Kitchen client, which has no default endpoint.
|
|
68
|
+
let message = "";
|
|
69
|
+
try {
|
|
70
|
+
await createSauceSvmClient({} as Parameters<typeof createSauceSvmClient>[0]);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
message = (error as Error).message;
|
|
73
|
+
}
|
|
74
|
+
check(message.includes("rpcUrl"), "createSauceSvmClient requires rpcUrl");
|
|
75
|
+
|
|
76
|
+
const skill = readFileSync(new URL("../SKILL.md", import.meta.url), "utf8");
|
|
77
|
+
// The mint is a module constant: without the define it is 0 and the program refuses to run, with
|
|
78
|
+
// it the value is folded in. The skill quotes the USDC mint's 32-byte hex.
|
|
79
|
+
const unset = routes.compileSauceProgram("solana", source);
|
|
80
|
+
check(Buffer.compare(unset.bytecode, program.bytecode) !== 0, "a define replaces MINT");
|
|
81
|
+
const mintHex = `0x${usdcMint.toString(16).padStart(64, "0")}`;
|
|
82
|
+
check(skill.includes(USDC_MINT) && skill.includes(mintHex), `the skill quotes ${mintHex}`);
|
|
83
|
+
|
|
84
|
+
// The Pot is the Kitchen's program address for ["pot", owner, salt], the seeds the skill gives.
|
|
85
|
+
const kitchen = address(v12SvmKitchenProgramId());
|
|
86
|
+
const owner = await generateKeyPairSigner();
|
|
87
|
+
const salt = new Uint8Array(32);
|
|
88
|
+
const pot = await derivePotPda(kitchen, owner.address, salt);
|
|
89
|
+
const [byHand] = await getProgramDerivedAddress({
|
|
90
|
+
programAddress: kitchen,
|
|
91
|
+
seeds: ["pot", getAddressEncoder().encode(owner.address), salt],
|
|
92
|
+
});
|
|
93
|
+
check(POT_SEED === "pot" && pot.address === byHand, "the Pot's seeds are pot, owner, salt");
|
|
94
|
+
// The skill gives the Kitchen and engine program ids, and the Kitchen's 32-byte hex for the define.
|
|
95
|
+
const kitchenHex = `0x${Buffer.from(getAddressEncoder().encode(kitchen)).toString("hex")}`;
|
|
96
|
+
for (const value of [v12SvmKitchenProgramId(), v12SvmEngineProgramId(), kitchenHex])
|
|
97
|
+
check(skill.includes(value), `the skill quotes ${value}`);
|
|
98
|
+
|
|
99
|
+
// A cook as `sauce run` builds it: the heap frame, a compute-unit limit, the Kitchen's cook.
|
|
100
|
+
async function cookSize(accounts: number): Promise<number> {
|
|
101
|
+
const { address: feeConfig } = await deriveExecutionFeeConfigPda(kitchen);
|
|
102
|
+
const tail = await Promise.all(
|
|
103
|
+
Array.from({ length: accounts }, async () => ({
|
|
104
|
+
address: (await generateKeyPairSigner()).address,
|
|
105
|
+
role: AccountRole.WRITABLE,
|
|
106
|
+
})),
|
|
107
|
+
);
|
|
108
|
+
const transaction = await buildExecuteTransaction({
|
|
109
|
+
payer: owner,
|
|
110
|
+
instructions: [
|
|
111
|
+
buildHeapFramePrepend(),
|
|
112
|
+
getSetComputeUnitLimitInstruction({ units: 1_400_000 }),
|
|
113
|
+
buildCookInstruction({
|
|
114
|
+
kitchen,
|
|
115
|
+
owner: owner.address,
|
|
116
|
+
engineProgram: address(v12SvmEngineProgramId()),
|
|
117
|
+
potSalt: salt,
|
|
118
|
+
pot: pot.address,
|
|
119
|
+
feeConfig,
|
|
120
|
+
bytecode: new Uint8Array([...program.bytecode, ...args]),
|
|
121
|
+
maxExecutionFee: 1_000_000n,
|
|
122
|
+
tail,
|
|
123
|
+
}),
|
|
124
|
+
],
|
|
125
|
+
latestBlockhash: {
|
|
126
|
+
blockhash: blockhash("11111111111111111111111111111111"),
|
|
127
|
+
lastValidBlockHeight: 0n,
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
return getTransactionSize(transaction) - program.bytecode.length - args.length;
|
|
131
|
+
}
|
|
132
|
+
check(TRANSACTION_SIZE_LIMIT === 1232, "a Solana transaction is at most 1,232 bytes");
|
|
133
|
+
const four = await cookSize(4);
|
|
134
|
+
const five = await cookSize(5);
|
|
135
|
+
check(four === 538, `with four accounts the cook adds 538 bytes, not ${four}`);
|
|
136
|
+
check(five - four === 33, `an account costs 33 bytes, not ${five - four}`);
|
|
137
|
+
|
|
138
|
+
// The Token-2022 example: PYUSD is a registered symbol, its row names Token-2022, and the program
|
|
139
|
+
// takes the mint as an account between the source and the destination.
|
|
140
|
+
const checked = routes.compileSauceProgram(
|
|
141
|
+
"solana",
|
|
142
|
+
readFileSync(new URL("./token-2022.sauce.ts", import.meta.url), "utf8"),
|
|
143
|
+
);
|
|
144
|
+
check(
|
|
145
|
+
(checked.manifest?.accounts ?? [])
|
|
146
|
+
.map((a) => (a.kind === "slot" ? `${a.name}:${a.requires}` : "remaining"))
|
|
147
|
+
.join() ===
|
|
148
|
+
"tokenProgram:readonly,source:writable,mint:readonly,destination:writable,pot:readonly_signer",
|
|
149
|
+
"the Token-2022 example's manifest order and roles",
|
|
150
|
+
);
|
|
151
|
+
const pyusd = routes.SVM_TOKEN_REGISTRY["mainnet-beta"].find((row) => row.symbol === "PYUSD");
|
|
152
|
+
check(pyusd?.tokenProgram === TOKEN_2022_PROGRAM_ID, "PYUSD is a Token-2022 mint");
|
|
153
|
+
for (const id of [TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID])
|
|
154
|
+
check(skill.includes(id), `the skill names the token program ${id}`);
|
|
155
|
+
// Its cook, with five accounts and its argument, does not fit one transaction: `sauce run` stages it.
|
|
156
|
+
const fiveAccounts = await cookSize(5);
|
|
157
|
+
check(
|
|
158
|
+
checked.bytecode.length + 32 + fiveAccounts > TRANSACTION_SIZE_LIMIT,
|
|
159
|
+
"a Token-2022 transfer that measures what arrived is past one transaction",
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
console.log(
|
|
163
|
+
`SVM program ${program.bytecode.length} bytes, ${slots.length} account slots, ${args.length}-byte arguments`,
|
|
164
|
+
);
|
|
165
|
+
console.log(`Token-2022 program ${checked.bytecode.length} bytes`);
|
|
166
|
+
console.log(`released engine ${v12SvmEngineProgramId()}, Kitchen ${v12SvmKitchenProgramId()}`);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Pays `amount` of the SPL mint MINT from `source` to `destination`, and proves it arrived.
|
|
2
|
+
//
|
|
3
|
+
// A Solana program declares every account it touches as an `Account` parameter; the compiler
|
|
4
|
+
// returns them as the manifest, in this order, with these roles, and each is passed by name with
|
|
5
|
+
// `--account`. `amount` is the one runtime argument; MINT, a 32-byte key chosen per compile, is a
|
|
6
|
+
// module constant that `--define MINT=<mint>` replaces (base58, or 32-byte hex). The @sauce/token
|
|
7
|
+
// SVM arm checks each account's owner and mint before it reads or writes, and requires
|
|
8
|
+
// `tokenProgram` to be the SPL Token program.
|
|
9
|
+
//
|
|
10
|
+
// sauce run solana.sauce.ts --chain <chain> --config sauce.config.json --keypair <keypair> \
|
|
11
|
+
// --define MINT=<mint> --account tokenProgram=<SPL Token program> \
|
|
12
|
+
// --account source=<the Pot's token account> --account destination=<token account> \
|
|
13
|
+
// --account authority=pot --args <amount>
|
|
14
|
+
//
|
|
15
|
+
// MINT: define the SPL mint paid, base58
|
|
16
|
+
// tokenProgram: Account the SPL Token program
|
|
17
|
+
// source: Account<Writable> the token account paying, the Pot's: pot:<mint>
|
|
18
|
+
// destination: Account<Writable> the token account paid
|
|
19
|
+
// authority: Account<Signer> who signs for `source`: pot, the Pot itself
|
|
20
|
+
// amount: Uint256 how much, in the mint's smallest units: USDC has 6 decimals, so
|
|
21
|
+
// 1000000 is 1 USDC
|
|
22
|
+
//
|
|
23
|
+
// On Solana, 1 USDC from the Pot's USDC account:
|
|
24
|
+
//
|
|
25
|
+
// sauce run solana.sauce.ts --chain solana --config sauce.config.json --keypair <keypair> \
|
|
26
|
+
// --define MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
|
|
27
|
+
// --account tokenProgram=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA \
|
|
28
|
+
// --account source=pot:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
|
|
29
|
+
// --account destination=<token account> --account authority=pot --args 1000000
|
|
30
|
+
const MINT = 0n; // the SPL mint's 32-byte key: a define replaces it
|
|
31
|
+
|
|
32
|
+
function main(
|
|
33
|
+
tokenProgram: Account,
|
|
34
|
+
source: Account<Writable>,
|
|
35
|
+
destination: Account<Writable>,
|
|
36
|
+
authority: Account<Signer>,
|
|
37
|
+
amount: Uint256,
|
|
38
|
+
): Uint256 {
|
|
39
|
+
require(MINT != 0n, "set MINT");
|
|
40
|
+
const before = balanceOf(MINT, destination);
|
|
41
|
+
transfer(MINT, tokenProgram, source, destination, authority, amount);
|
|
42
|
+
const after = balanceOf(MINT, destination);
|
|
43
|
+
require(after - before == amount, "destination did not receive the amount");
|
|
44
|
+
return after;
|
|
45
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Pays `amount` of PYUSD, a Token-2022 mint, from the Pot's own account, and returns what the
|
|
2
|
+
// destination received: the amount less any transfer fee the mint withholds.
|
|
3
|
+
//
|
|
4
|
+
// `transferChecked` takes the mint as an account and its decimals, and calls the token program that
|
|
5
|
+
// owns the mint, the source and the destination: Token-2022 here, the SPL Token program for a legacy
|
|
6
|
+
// mint, the same call either way. Each account is passed by its token: `program:PYUSD` is the mint's
|
|
7
|
+
// token program, `mint:PYUSD` the mint, `pot:PYUSD` the Pot's account for it.
|
|
8
|
+
//
|
|
9
|
+
// sauce run token-2022.sauce.ts --chain <chain> --config sauce.config.json --keypair <keypair> \
|
|
10
|
+
// --account tokenProgram=program:PYUSD --account source=pot:PYUSD --account mint=mint:PYUSD \
|
|
11
|
+
// --account destination=<token account> --account pot=pot --args <amount>
|
|
12
|
+
//
|
|
13
|
+
// tokenProgram: Account the token program that owns PYUSD, Token-2022: program:PYUSD
|
|
14
|
+
// source: Account<Writable> the token account paying, the Pot's: pot:PYUSD
|
|
15
|
+
// mint: Account the PYUSD mint: mint:PYUSD
|
|
16
|
+
// destination: Account<Writable> the PYUSD token account paid
|
|
17
|
+
// pot: Account<Signer> the Pot, which owns `source` and signs for it: pot
|
|
18
|
+
// amount: Uint256 how much, in PYUSD's smallest units: it has 6 decimals, so
|
|
19
|
+
// 1000000 is 1 PYUSD
|
|
20
|
+
//
|
|
21
|
+
// On Solana, 1 PYUSD from the Pot's PYUSD account:
|
|
22
|
+
//
|
|
23
|
+
// sauce run token-2022.sauce.ts --chain solana --config sauce.config.json --keypair <keypair> \
|
|
24
|
+
// --account tokenProgram=program:PYUSD --account source=pot:PYUSD --account mint=mint:PYUSD \
|
|
25
|
+
// --account destination=<token account> --account pot=pot --args 1000000
|
|
26
|
+
function main(
|
|
27
|
+
tokenProgram: Account,
|
|
28
|
+
source: Account<Writable>,
|
|
29
|
+
mint: Account,
|
|
30
|
+
destination: Account<Writable>,
|
|
31
|
+
pot: Account<Signer>,
|
|
32
|
+
amount: Uint256,
|
|
33
|
+
): Uint256 {
|
|
34
|
+
require(ownerOf(PYUSD, source) == pot.address, "not the Pot's account");
|
|
35
|
+
const before = balanceOf(PYUSD, destination);
|
|
36
|
+
transferChecked(PYUSD, tokenProgram, source, mint, destination, pot, amount, 6n);
|
|
37
|
+
return balanceOf(PYUSD, destination) - before;
|
|
38
|
+
}
|