@elizaos/plugin-wallet 2.0.0-beta.1 → 2.0.3-beta.6
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 +70 -45
- package/auto-enable.ts +1 -1
- package/dist/actions/failure-codes.d.ts +12 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/analytics/birdeye/actions/wallet-search-address.d.ts +7 -0
- package/dist/analytics/birdeye/birdeye-task.d.ts +27 -0
- package/dist/analytics/birdeye/birdeye.d.ts +140 -0
- package/dist/analytics/birdeye/constants.d.ts +68 -0
- package/dist/analytics/birdeye/providers/agent-portfolio-provider.d.ts +8 -0
- package/dist/analytics/birdeye/providers/market.d.ts +18 -0
- package/dist/analytics/birdeye/providers/portfolio-factory.d.ts +10 -0
- package/dist/analytics/birdeye/providers/trending.d.ts +19 -0
- package/dist/analytics/birdeye/providers/wallet.d.ts +5 -0
- package/dist/analytics/birdeye/search-category.d.ts +52 -0
- package/dist/analytics/birdeye/service.d.ts +94 -0
- package/dist/analytics/birdeye/types/api/common.d.ts +199 -0
- package/dist/analytics/birdeye/types/api/defi.d.ts +187 -0
- package/dist/analytics/birdeye/types/api/pair.d.ts +182 -0
- package/dist/analytics/birdeye/types/api/search.d.ts +64 -0
- package/dist/analytics/birdeye/types/api/token.d.ts +580 -0
- package/dist/analytics/birdeye/types/api/trader.d.ts +70 -0
- package/dist/analytics/birdeye/types/api/wallet.d.ts +161 -0
- package/dist/analytics/birdeye/types/shared.d.ts +83 -0
- package/dist/analytics/birdeye/utils.d.ts +74 -0
- package/dist/analytics/dexscreener/errors.d.ts +2 -0
- package/dist/analytics/dexscreener/index.d.ts +3 -0
- package/dist/analytics/dexscreener/search-category.d.ts +3 -0
- package/dist/analytics/dexscreener/service.d.ts +34 -0
- package/dist/analytics/dexscreener/types.d.ts +131 -0
- package/dist/analytics/lpinfo/index.d.ts +31 -0
- package/dist/analytics/lpinfo/kamino/index.d.ts +7 -0
- package/dist/analytics/lpinfo/kamino/providers/kaminoLiquidityProvider.d.ts +6 -0
- package/dist/analytics/lpinfo/kamino/providers/kaminoPoolProvider.d.ts +6 -0
- package/dist/analytics/lpinfo/kamino/providers/kaminoProvider.d.ts +6 -0
- package/dist/analytics/lpinfo/kamino/services/kaminoLiquidityService.d.ts +203 -0
- package/dist/analytics/lpinfo/kamino/services/kaminoService.d.ts +171 -0
- package/dist/analytics/lpinfo/steer/index.d.ts +7 -0
- package/dist/analytics/lpinfo/steer/providers/steerLiquidityProvider.d.ts +6 -0
- package/dist/analytics/lpinfo/steer/services/steerLiquidityService.d.ts +208 -0
- package/dist/analytics/lpinfo/steer/steer-display-types.d.ts +97 -0
- package/dist/analytics/news/index.d.ts +32 -0
- package/dist/analytics/news/interfaces/types.d.ts +177 -0
- package/dist/analytics/news/providers/defiNewsProvider.d.ts +106 -0
- package/dist/analytics/news/services/newsDataService.d.ts +72 -0
- package/dist/analytics/news/utils/formatters.d.ts +54 -0
- package/dist/analytics/token-info/action.d.ts +6 -0
- package/dist/analytics/token-info/index.d.ts +3 -0
- package/dist/analytics/token-info/params.d.ts +10 -0
- package/dist/analytics/token-info/providers.d.ts +4 -0
- package/dist/analytics/token-info/service.d.ts +19 -0
- package/dist/analytics/token-info/types.d.ts +45 -0
- package/dist/api/wallet-routes.d.ts +100 -0
- package/dist/audit/audit-log.d.ts +29 -0
- package/dist/browser-shim/build-shim.d.ts +31 -0
- package/dist/browser-shim/index.d.ts +1 -0
- package/dist/chains/evm/actions/helpers.d.ts +31 -0
- package/dist/chains/evm/actions/swap.d.ts +53 -0
- package/dist/chains/evm/actions/transfer.d.ts +10 -0
- package/dist/chains/evm/bridge-router.d.ts +44 -0
- package/dist/chains/evm/build.d.ts +2 -0
- package/dist/chains/evm/chain-handler.d.ts +37 -0
- package/dist/chains/evm/constants.d.ts +16 -0
- package/dist/chains/evm/dex/aerodrome/index.d.ts +6 -0
- package/dist/chains/evm/dex/aerodrome/services/AerodromeLpService.d.ts +27 -0
- package/dist/chains/evm/dex/aerodrome/types.d.ts +435 -0
- package/dist/chains/evm/dex/pancakeswp/index.d.ts +6 -0
- package/dist/chains/evm/dex/pancakeswp/services/PancakeSwapV3LpService.d.ts +28 -0
- package/dist/chains/evm/dex/pancakeswp/types.d.ts +19 -0
- package/dist/chains/evm/dex/uniswap/index.d.ts +6 -0
- package/dist/chains/evm/dex/uniswap/services/UniswapV3LpService.d.ts +28 -0
- package/dist/chains/evm/dex/uniswap/types.d.ts +458 -0
- package/dist/chains/evm/generated/specs/spec-helpers.d.ts +35 -0
- package/dist/chains/evm/generated/specs/specs.d.ts +99 -0
- package/dist/chains/evm/gov-router.d.ts +6 -0
- package/dist/chains/evm/index.browser.d.ts +3 -0
- package/dist/chains/evm/index.d.ts +6 -0
- package/dist/chains/evm/prompts.d.ts +24 -0
- package/dist/chains/evm/providers/get-balance.d.ts +2 -0
- package/dist/chains/evm/providers/wallet.d.ts +35 -0
- package/dist/chains/evm/routes/sign.d.ts +13 -0
- package/dist/chains/evm/rpc-providers.d.ts +26 -0
- package/dist/chains/evm/service.d.ts +26 -0
- package/dist/chains/evm/templates/index.d.ts +1 -0
- package/dist/chains/evm/types/index.d.ts +296 -0
- package/dist/chains/evm/vitest.config.d.ts +2 -0
- package/dist/chains/registry.d.ts +3 -0
- package/dist/chains/solana/actions/confirmation.d.ts +9 -0
- package/dist/chains/solana/bn.d.ts +6 -0
- package/dist/chains/solana/build.d.ts +2 -0
- package/dist/chains/solana/constants.d.ts +2 -0
- package/dist/chains/solana/dex/meteora/e2e/scenarios.d.ts +10 -0
- package/dist/chains/solana/dex/meteora/e2e/test-utils.d.ts +28 -0
- package/dist/chains/solana/dex/meteora/index.d.ts +3 -0
- package/dist/chains/solana/dex/meteora/providers/positionProvider.d.ts +9 -0
- package/dist/chains/solana/dex/meteora/services/MeteoraLpService.d.ts +37 -0
- package/dist/chains/solana/dex/meteora/utils/dlmm.d.ts +6 -0
- package/dist/chains/solana/dex/meteora/utils/loadWallet.d.ts +14 -0
- package/dist/chains/solana/dex/meteora/utils/sendTransaction.d.ts +2 -0
- package/dist/chains/solana/dex/orca/index.d.ts +6 -0
- package/dist/chains/solana/dex/orca/providers/positionProvider.d.ts +10 -0
- package/dist/chains/solana/dex/orca/services/srv_orca.d.ts +10 -0
- package/dist/chains/solana/dex/orca/types.d.ts +61 -0
- package/dist/chains/solana/dex/orca/utils/loadWallet.d.ts +1 -0
- package/dist/chains/solana/dex/orca/utils/sendTransaction.d.ts +2 -0
- package/dist/chains/solana/dex/raydium/index.d.ts +6 -0
- package/dist/chains/solana/dex/raydium/providers/positionProvider.d.ts +10 -0
- package/dist/chains/solana/dex/raydium/services/srv_raydium.d.ts +104 -0
- package/dist/chains/solana/dex/raydium/types.d.ts +42 -0
- package/dist/chains/solana/environment.d.ts +15 -0
- package/dist/chains/solana/generated/specs/spec-helpers.d.ts +35 -0
- package/dist/chains/solana/generated/specs/specs.d.ts +73 -0
- package/dist/chains/solana/index.browser.d.ts +3 -0
- package/dist/chains/solana/index.d.ts +7 -0
- package/dist/chains/solana/keypairUtils.d.ts +7 -0
- package/dist/chains/solana/prompts.d.ts +12 -0
- package/dist/chains/solana/providers/wallet.d.ts +2 -0
- package/dist/chains/solana/routes/index.d.ts +2 -0
- package/dist/chains/solana/routes/sign.d.ts +16 -0
- package/dist/chains/solana/service.d.ts +237 -0
- package/dist/chains/solana/types.d.ts +377 -0
- package/dist/chains/solana/vitest.config.d.ts +2 -0
- package/dist/chains/wallet-action.d.ts +3 -0
- package/dist/contracts.d.ts +58 -0
- package/dist/core-augmentation.d.ts +9 -0
- package/dist/index.d.mts +27 -34727
- package/dist/index.d.ts +27 -0
- package/dist/index.mjs +28246 -21186
- package/dist/index.mjs.map +153 -0
- package/dist/lib/server-wallet-trade.d.ts +22 -0
- package/dist/lib/server-wallet-trade.js +333 -0
- package/dist/lib/server-wallet-trade.js.map +11 -0
- package/dist/lib/wallet-export-guard.d.ts +45 -0
- package/dist/lp/actions/liquidity.d.ts +2 -0
- package/dist/lp/e2e/real-token-tests.d.ts +6 -0
- package/dist/lp/e2e/scenarios.d.ts +9 -0
- package/dist/lp/e2e/test-utils.d.ts +28 -0
- package/dist/lp/lp-manager-entry.d.ts +18 -0
- package/dist/lp/services/ConcentratedLiquidityService.d.ts +32 -0
- package/dist/lp/services/DexInteractionService.d.ts +34 -0
- package/dist/lp/services/LpManagementService.d.ts +116 -0
- package/dist/lp/services/UserLpProfileService.d.ts +18 -0
- package/dist/lp/services/VaultService.d.ts +21 -0
- package/dist/lp/services/YieldOptimizationService.d.ts +59 -0
- package/dist/lp/services/__tests__/MockLpService.d.ts +17 -0
- package/dist/lp/types.d.ts +439 -0
- package/dist/lp/utils/solanaClient.d.ts +26 -0
- package/dist/plugin.d.ts +7 -0
- package/dist/policy/policy.d.ts +14 -0
- package/dist/providers/canonical-provider.d.ts +19 -0
- package/dist/providers/wallet-provider.d.ts +5 -0
- package/dist/register-routes.d.ts +1 -0
- package/dist/routes/plugin.d.ts +14 -0
- package/dist/routes/wallet-market-overview-route.d.ts +7 -0
- package/dist/sdk/abi.d.ts +396 -0
- package/dist/sdk/bridge/abis.d.ts +63 -0
- package/dist/sdk/bridge/client.d.ts +48 -0
- package/dist/sdk/bridge/index.d.ts +14 -0
- package/dist/sdk/bridge/solana.d.ts +131 -0
- package/dist/sdk/bridge/types.d.ts +92 -0
- package/dist/sdk/convenience.d.ts +104 -0
- package/dist/sdk/escrow/MutualStakeEscrow.d.ts +75 -0
- package/dist/sdk/escrow/types.d.ts +58 -0
- package/dist/sdk/escrow/verifiers.d.ts +25 -0
- package/dist/sdk/identity/erc8004.d.ts +304 -0
- package/dist/sdk/identity/reputation.d.ts +317 -0
- package/dist/sdk/identity/uaid.d.ts +192 -0
- package/dist/sdk/identity/validation.d.ts +282 -0
- package/dist/sdk/index.d.ts +133 -0
- package/dist/sdk/index.js +5284 -0
- package/dist/sdk/index.js.map +40 -0
- package/dist/sdk/policy/SpendingPolicy.d.ts +105 -0
- package/dist/sdk/policy/UptoBillingPolicy.d.ts +87 -0
- package/dist/sdk/router/PaymentRouter.d.ts +77 -0
- package/dist/sdk/router/index.d.ts +2 -0
- package/dist/sdk/swap/SwapModule.d.ts +47 -0
- package/dist/sdk/swap/abi.d.ts +50 -0
- package/dist/sdk/swap/index.d.ts +11 -0
- package/dist/sdk/swap/types.d.ts +101 -0
- package/dist/sdk/tokens/decimals.d.ts +64 -0
- package/dist/sdk/tokens/registry.d.ts +81 -0
- package/dist/sdk/tokens/solana.d.ts +107 -0
- package/dist/sdk/tokens/transfers.d.ts +94 -0
- package/dist/sdk/types.d.ts +129 -0
- package/dist/sdk/wallet-core.d.ts +29450 -0
- package/dist/sdk/x402/budget.d.ts +51 -0
- package/dist/sdk/x402/chains/abstract/index.d.ts +134 -0
- package/dist/sdk/x402/client.d.ts +66 -0
- package/dist/sdk/x402/index.d.ts +8 -0
- package/dist/sdk/x402/middleware.d.ts +37 -0
- package/dist/sdk/x402/multi-asset.d.ts +53 -0
- package/dist/sdk/x402/types.d.ts +109 -0
- package/dist/security/wallet-context-safety.d.ts +7 -0
- package/dist/security/wallet-financial-confirmation.d.ts +23 -0
- package/dist/services/wallet-backend-service.d.ts +39 -0
- package/dist/types/wallet-router.d.ts +130 -0
- package/dist/utils/intent-trajectory.d.ts +34 -0
- package/dist/wallet/backend.d.ts +41 -0
- package/dist/wallet/errors.d.ts +17 -0
- package/dist/wallet/index.d.ts +6 -0
- package/dist/wallet/local-eoa-backend.d.ts +37 -0
- package/dist/wallet/pending.d.ts +47 -0
- package/dist/wallet/select-backend.d.ts +11 -0
- package/dist/wallet/steward-backend.d.ts +22 -0
- package/dist/wallet-action.d.ts +1 -0
- package/dist/wallet-action.js +6292 -0
- package/dist/wallet-action.js.map +44 -0
- package/package.json +35 -21
- package/registry-entry.json +134 -0
- package/src/analytics/birdeye/actions/wallet-search-address.ts +85 -5
- package/src/analytics/birdeye/birdeye-task.ts +25 -9
- package/src/analytics/birdeye/birdeye.ts +6 -7
- package/src/analytics/birdeye/constants.ts +0 -1
- package/src/analytics/birdeye/providers/agent-portfolio-provider.ts +0 -1
- package/src/analytics/birdeye/providers/market.ts +51 -45
- package/src/analytics/birdeye/providers/portfolio-factory.ts +79 -38
- package/src/analytics/birdeye/providers/trending.ts +43 -46
- package/src/analytics/birdeye/providers/wallet.ts +0 -1
- package/src/analytics/birdeye/search-category.test.ts +1 -1
- package/src/analytics/birdeye/search-category.ts +77 -12
- package/src/analytics/birdeye/service.test.ts +146 -0
- package/src/analytics/birdeye/service.ts +220 -105
- package/src/analytics/birdeye/types/api/common.ts +0 -1
- package/src/analytics/birdeye/types/api/defi.ts +0 -1
- package/src/analytics/birdeye/types/api/pair.ts +0 -1
- package/src/analytics/birdeye/types/api/search.ts +0 -1
- package/src/analytics/birdeye/types/api/token.ts +0 -1
- package/src/analytics/birdeye/types/api/trader.ts +0 -1
- package/src/analytics/birdeye/types/api/wallet.ts +0 -1
- package/src/analytics/birdeye/types/shared.ts +0 -11
- package/src/analytics/birdeye/utils.test.ts +69 -0
- package/src/analytics/birdeye/utils.ts +11 -8
- package/src/analytics/dexscreener/search-category.ts +0 -1
- package/src/analytics/dexscreener/service.ts +7 -12
- package/src/analytics/dexscreener/types.ts +0 -1
- package/src/analytics/lpinfo/index.ts +5 -2
- package/src/analytics/lpinfo/kamino/README.md +2 -2
- package/src/analytics/lpinfo/kamino/index.ts +9 -2
- package/src/analytics/lpinfo/kamino/providers/kaminoLiquidityProvider.ts +6 -26
- package/src/analytics/lpinfo/kamino/providers/kaminoPoolProvider.ts +11 -12
- package/src/analytics/lpinfo/kamino/providers/kaminoProvider.ts +76 -32
- package/src/analytics/lpinfo/kamino/services/kaminoLiquidityService.ts +78 -38
- package/src/analytics/lpinfo/kamino/services/kaminoService.ts +71 -31
- package/src/analytics/lpinfo/steer/index.ts +7 -2
- package/src/analytics/lpinfo/steer/providers/steerLiquidityProvider.ts +25 -26
- package/src/analytics/lpinfo/steer/services/steerLiquidityService.ts +367 -149
- package/src/analytics/news/index.ts +7 -2
- package/src/analytics/news/interfaces/types.ts +0 -1
- package/src/analytics/news/providers/defiNewsProvider.ts +17 -44
- package/src/analytics/news/services/newsDataService.ts +1 -22
- package/src/analytics/news/utils/formatters.test.ts +60 -0
- package/src/analytics/news/utils/formatters.ts +0 -1
- package/src/analytics/token-info/action.ts +52 -212
- package/src/analytics/token-info/index.ts +1 -1
- package/src/analytics/token-info/params.test.ts +69 -0
- package/src/analytics/token-info/params.ts +13 -11
- package/src/analytics/token-info/providers.ts +46 -17
- package/src/analytics/token-info/service.ts +3 -3
- package/src/analytics/token-info/types.ts +2 -2
- package/src/api/wallet-routes.test.ts +56 -0
- package/src/api/wallet-routes.ts +1728 -0
- package/src/audit/audit-log.ts +57 -2
- package/src/browser-shim/build-shim.ts +1 -1
- package/src/browser-shim/shim.template.js +107 -117
- package/src/chains/{wallet-router.test.ts → __tests__/wallet-router.test.ts} +57 -10
- package/src/chains/evm/actions/helpers.ts +9 -7
- package/src/chains/evm/actions/swap.ts +176 -22
- package/src/chains/evm/actions/transfer.ts +29 -22
- package/src/chains/evm/biome.json +1 -1
- package/src/chains/evm/build.ts +6 -1
- package/src/chains/evm/constants.ts +19 -0
- package/src/chains/evm/contracts/artifacts/OZGovernor.json +25 -1682
- package/src/chains/evm/dex/aerodrome/index.ts +6 -1
- package/src/chains/evm/dex/aerodrome/services/AerodromeLpService.ts +41 -15
- package/src/chains/evm/dex/aerodrome/types.ts +1 -2
- package/src/chains/evm/dex/pancakeswp/index.ts +6 -1
- package/src/chains/evm/dex/pancakeswp/services/PancakeSwapV3LpService.ts +54 -17
- package/src/chains/evm/dex/pancakeswp/types.ts +1 -2
- package/src/chains/evm/dex/uniswap/index.ts +6 -1
- package/src/chains/evm/dex/uniswap/services/UniswapV3LpService.ts +20 -9
- package/src/chains/evm/dex/uniswap/types.ts +1 -2
- package/src/chains/evm/gov-router.ts +3 -1
- package/src/chains/evm/index.browser.ts +1 -1
- package/src/chains/evm/index.ts +5 -1
- package/src/chains/evm/prompts.ts +5 -0
- package/src/chains/evm/providers/get-balance.ts +1 -1
- package/src/chains/evm/providers/wallet.ts +80 -9
- package/src/chains/evm/routes/sign.ts +35 -26
- package/src/chains/evm/rpc-providers.ts +1 -1
- package/src/chains/evm/types/index.ts +22 -2
- package/src/chains/registry.ts +1 -1
- package/src/chains/wallet-action.ts +301 -91
- package/src/index.ts +9 -5
- package/src/lib/wallet-export-guard.test.ts +233 -0
- package/src/lib/wallet-export-guard.ts +1 -1
- package/src/lp/actions/liquidity.ts +53 -26
- package/src/lp/e2e/real-token-tests.ts +0 -1
- package/src/lp/e2e/scenarios.ts +1 -2
- package/src/lp/e2e/test-utils.ts +20 -7
- package/src/lp/lp-manager-entry.ts +2 -5
- package/src/lp/services/ConcentratedLiquidityService.ts +3 -10
- package/src/lp/services/DexInteractionService.ts +1 -2
- package/src/lp/services/LpManagementService.test.ts +0 -1
- package/src/lp/services/LpManagementService.ts +75 -35
- package/src/lp/services/UserLpProfileService.ts +2 -3
- package/src/lp/services/VaultService.ts +10 -4
- package/src/lp/services/YieldOptimizationService.ts +29 -13
- package/src/lp/services/__tests__/MockLpService.ts +1 -2
- package/src/lp/types.ts +9 -13
- package/src/lp/utils/solanaClient.ts +4 -2
- package/src/plugin.routes.test.ts +24 -0
- package/src/plugin.ts +30 -13
- package/src/providers/canonical-provider.ts +1 -1
- package/src/providers/{unified-wallet-provider.ts → wallet-provider.ts} +3 -3
- package/src/routes/__fixtures__/coingecko-markets.recorded.json +97 -0
- package/src/routes/wallet-market-overview-route.ts +1 -1
- package/src/routes/wallet-market-overview.contract.test.ts +139 -0
- package/src/routes/wallet-market-overview.real.test.ts +83 -0
- package/src/sdk/escrow/MutualStakeEscrow.ts +1 -2
- package/src/sdk/identity/erc8004.ts +1 -1
- package/src/sdk/identity/validation.ts +3 -4
- package/src/sdk/index.ts +2 -2
- package/src/sdk/policy/SpendingPolicy.ts +1 -1
- package/src/sdk/router/PaymentRouter.ts +8 -11
- package/src/sdk/swap/SwapModule.ts +1 -1
- package/src/sdk/tokens/registry.ts +1 -1
- package/src/sdk/x402/middleware.ts +2 -8
- package/src/security/__tests__/wallet-context-safety.test.ts +79 -0
- package/src/security/__tests__/wallet-financial-confirmation.test.ts +88 -0
- package/src/security/wallet-context-safety.ts +128 -0
- package/src/security/wallet-financial-confirmation.ts +150 -0
- package/src/services/wallet-backend-service.ts +15 -1
- package/src/utils/intent-trajectory.ts +2 -2
- package/src/wallet/steward-backend.ts +4 -4
- package/dist/LpManagementService-BWrQ5-cO.mjs +0 -353
- package/dist/MockLpService-D_Apn4Fd.mjs +0 -99
- package/dist/aerodrome-CfnESC32.mjs +0 -890
- package/dist/chunk-hT5z_Zn9.mjs +0 -35
- package/dist/lib/server-wallet-trade.d.mts +0 -34
- package/dist/lib/server-wallet-trade.mjs +0 -306
- package/dist/meteora-BPX39hZo.mjs +0 -22640
- package/dist/orca-Bybp1HXO.mjs +0 -249
- package/dist/pancakeswp-CkEXlXti.mjs +0 -604
- package/dist/plugin-ZO_MTyd0.mjs +0 -529
- package/dist/raydium-rfaM9yEf.mjs +0 -539
- package/dist/sdk/index.d.mts +0 -32492
- package/dist/sdk/index.mjs +0 -6415
- package/dist/types-D5252NZk.mjs +0 -487
- package/dist/uniswap-CReXgXVN.mjs +0 -573
- package/dist/wallet-action.d.mts +0 -6
- package/dist/wallet-action.mjs +0 -820
- package/src/analytics/birdeye/tasks/birdeye.ts +0 -232
- package/src/analytics/lpinfo/index.d.ts +0 -7
- package/src/chains/evm/contracts/artifacts/TimelockController.json +0 -1007
- package/src/chains/evm/contracts/artifacts/VoteToken.json +0 -895
- package/src/lp/tasks/LpAutoRebalanceTask.ts +0 -117
- package/src/lp/tasks/__tests__/LpAutoRebalanceTask.test.ts +0 -370
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type IAgentRuntime } from "@elizaos/core";
|
|
2
|
+
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
|
|
3
|
+
/**
|
|
4
|
+
* Gets a Solana RPC connection configured from runtime settings
|
|
5
|
+
*/
|
|
6
|
+
export declare function getConnection(runtime: IAgentRuntime): Connection;
|
|
7
|
+
export declare function getWalletPublicKey(runtime: IAgentRuntime): string | null;
|
|
8
|
+
export declare function getWalletPrivateKey(runtime: IAgentRuntime): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Wallet result containing either a signer or public address
|
|
11
|
+
*/
|
|
12
|
+
export interface WalletResult {
|
|
13
|
+
signer?: Keypair;
|
|
14
|
+
address: PublicKey;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Loads a Solana wallet from runtime settings
|
|
18
|
+
* @param runtime The agent runtime
|
|
19
|
+
* @param requirePrivateKey Whether to require a full keypair (true) or just public key (false)
|
|
20
|
+
* @returns WalletResult containing either keypair or public key
|
|
21
|
+
*/
|
|
22
|
+
export declare function loadWallet(runtime: IAgentRuntime, requirePrivateKey?: boolean): Promise<WalletResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Sends a transaction with proper error handling and confirmation
|
|
25
|
+
*/
|
|
26
|
+
export declare function sendTransaction(connection: Connection, instructions: import("@solana/web3.js").TransactionInstruction[], signer: Keypair): Promise<string>;
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ApprovalSummary, SignScope } from "../wallet/pending.js";
|
|
2
|
+
export interface PolicyEvaluation {
|
|
3
|
+
readonly kind: "ok" | "requires_approval" | "blocked";
|
|
4
|
+
readonly reason?: string;
|
|
5
|
+
readonly rule?: string;
|
|
6
|
+
readonly cooldownUntil?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Business rules for size limits, allowlists, and cooldowns. Actions never
|
|
10
|
+
* inline policy checks — they delegate here after zod parse + plugin checks.
|
|
11
|
+
*/
|
|
12
|
+
export interface PolicyModule {
|
|
13
|
+
evaluate(scope: SignScope, summary: ApprovalSummary): Promise<PolicyEvaluation>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IAgentRuntime, Memory, ProviderResult, State } from "@elizaos/core";
|
|
2
|
+
export type HealthStatus = {
|
|
3
|
+
ok: true;
|
|
4
|
+
} | {
|
|
5
|
+
ok: false;
|
|
6
|
+
reason: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Typed venue / data-source adapter. Canonical actions dispatch into concrete
|
|
10
|
+
* provider classes registered on the runtime provider registry.
|
|
11
|
+
*
|
|
12
|
+
* See docs/architecture/wallet-and-trading.md §B.3.
|
|
13
|
+
*/
|
|
14
|
+
export interface CanonicalProvider {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly contextBudgetTokens: number;
|
|
17
|
+
getContext(runtime: IAgentRuntime, message: Memory, state: State): Promise<ProviderResult>;
|
|
18
|
+
healthcheck(runtime: IAgentRuntime): Promise<HealthStatus>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet route plugin — registers wallet HTTP route handlers with the
|
|
3
|
+
* elizaOS runtime plugin route system.
|
|
4
|
+
*
|
|
5
|
+
* All routes use `rawPath: true` to preserve the legacy `/api/wallet/*`
|
|
6
|
+
* paths without a plugin-name prefix. This module is node-only — the main
|
|
7
|
+
* runtime plugin (services, actions, providers) lives in `../plugin.ts`
|
|
8
|
+
* and is browser-safe; this `plugin.ts` is loaded only on the server via
|
|
9
|
+
* `../register-routes.ts`.
|
|
10
|
+
*
|
|
11
|
+
* Migrated from packages/app-core/src/api/wallet-market-overview-route.ts.
|
|
12
|
+
*/
|
|
13
|
+
import type { Plugin } from "@elizaos/core";
|
|
14
|
+
export declare const walletRoutePlugin: Plugin;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type http from "node:http";
|
|
2
|
+
declare function fetchWithTimeoutGuard(input: string | URL, init: RequestInit, timeoutMs: number): Promise<Response>;
|
|
3
|
+
type WalletMarketOverviewFetch = typeof fetchWithTimeoutGuard;
|
|
4
|
+
export declare function handleWalletMarketOverviewRoute(req: http.IncomingMessage, res: http.ServerResponse): Promise<boolean>;
|
|
5
|
+
export declare function __resetWalletMarketOverviewCacheForTests(): void;
|
|
6
|
+
export declare function __setWalletMarketOverviewFetchForTests(fetcher: WalletMarketOverviewFetch): void;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
export declare const AgentAccountV2Abi: readonly [{
|
|
2
|
+
readonly name: "setSpendPolicy";
|
|
3
|
+
readonly type: "function";
|
|
4
|
+
readonly stateMutability: "nonpayable";
|
|
5
|
+
readonly inputs: readonly [{
|
|
6
|
+
readonly name: "token";
|
|
7
|
+
readonly type: "address";
|
|
8
|
+
}, {
|
|
9
|
+
readonly name: "perTxLimit";
|
|
10
|
+
readonly type: "uint256";
|
|
11
|
+
}, {
|
|
12
|
+
readonly name: "periodLimit";
|
|
13
|
+
readonly type: "uint256";
|
|
14
|
+
}, {
|
|
15
|
+
readonly name: "periodLength";
|
|
16
|
+
readonly type: "uint256";
|
|
17
|
+
}];
|
|
18
|
+
readonly outputs: readonly [];
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: "setOperator";
|
|
21
|
+
readonly type: "function";
|
|
22
|
+
readonly stateMutability: "nonpayable";
|
|
23
|
+
readonly inputs: readonly [{
|
|
24
|
+
readonly name: "operator";
|
|
25
|
+
readonly type: "address";
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "authorized";
|
|
28
|
+
readonly type: "bool";
|
|
29
|
+
}];
|
|
30
|
+
readonly outputs: readonly [];
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "execute";
|
|
33
|
+
readonly type: "function";
|
|
34
|
+
readonly stateMutability: "payable";
|
|
35
|
+
readonly inputs: readonly [{
|
|
36
|
+
readonly name: "to";
|
|
37
|
+
readonly type: "address";
|
|
38
|
+
}, {
|
|
39
|
+
readonly name: "value";
|
|
40
|
+
readonly type: "uint256";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "data";
|
|
43
|
+
readonly type: "bytes";
|
|
44
|
+
}];
|
|
45
|
+
readonly outputs: readonly [{
|
|
46
|
+
readonly name: "";
|
|
47
|
+
readonly type: "bytes";
|
|
48
|
+
}];
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "approvePending";
|
|
51
|
+
readonly type: "function";
|
|
52
|
+
readonly stateMutability: "nonpayable";
|
|
53
|
+
readonly inputs: readonly [{
|
|
54
|
+
readonly name: "txId";
|
|
55
|
+
readonly type: "uint256";
|
|
56
|
+
}];
|
|
57
|
+
readonly outputs: readonly [];
|
|
58
|
+
}, {
|
|
59
|
+
readonly name: "cancelPending";
|
|
60
|
+
readonly type: "function";
|
|
61
|
+
readonly stateMutability: "nonpayable";
|
|
62
|
+
readonly inputs: readonly [{
|
|
63
|
+
readonly name: "txId";
|
|
64
|
+
readonly type: "uint256";
|
|
65
|
+
}];
|
|
66
|
+
readonly outputs: readonly [];
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "agentExecute";
|
|
69
|
+
readonly type: "function";
|
|
70
|
+
readonly stateMutability: "payable";
|
|
71
|
+
readonly inputs: readonly [{
|
|
72
|
+
readonly name: "to";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
}, {
|
|
75
|
+
readonly name: "value";
|
|
76
|
+
readonly type: "uint256";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "data";
|
|
79
|
+
readonly type: "bytes";
|
|
80
|
+
}];
|
|
81
|
+
readonly outputs: readonly [{
|
|
82
|
+
readonly name: "";
|
|
83
|
+
readonly type: "bytes";
|
|
84
|
+
}];
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "agentTransferToken";
|
|
87
|
+
readonly type: "function";
|
|
88
|
+
readonly stateMutability: "nonpayable";
|
|
89
|
+
readonly inputs: readonly [{
|
|
90
|
+
readonly name: "token";
|
|
91
|
+
readonly type: "address";
|
|
92
|
+
}, {
|
|
93
|
+
readonly name: "to";
|
|
94
|
+
readonly type: "address";
|
|
95
|
+
}, {
|
|
96
|
+
readonly name: "amount";
|
|
97
|
+
readonly type: "uint256";
|
|
98
|
+
}];
|
|
99
|
+
readonly outputs: readonly [];
|
|
100
|
+
}, {
|
|
101
|
+
readonly name: "remainingBudget";
|
|
102
|
+
readonly type: "function";
|
|
103
|
+
readonly stateMutability: "view";
|
|
104
|
+
readonly inputs: readonly [{
|
|
105
|
+
readonly name: "token";
|
|
106
|
+
readonly type: "address";
|
|
107
|
+
}];
|
|
108
|
+
readonly outputs: readonly [{
|
|
109
|
+
readonly name: "perTx";
|
|
110
|
+
readonly type: "uint256";
|
|
111
|
+
}, {
|
|
112
|
+
readonly name: "inPeriod";
|
|
113
|
+
readonly type: "uint256";
|
|
114
|
+
}];
|
|
115
|
+
}, {
|
|
116
|
+
readonly name: "getPending";
|
|
117
|
+
readonly type: "function";
|
|
118
|
+
readonly stateMutability: "view";
|
|
119
|
+
readonly inputs: readonly [{
|
|
120
|
+
readonly name: "txId";
|
|
121
|
+
readonly type: "uint256";
|
|
122
|
+
}];
|
|
123
|
+
readonly outputs: readonly [{
|
|
124
|
+
readonly name: "to";
|
|
125
|
+
readonly type: "address";
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "value";
|
|
128
|
+
readonly type: "uint256";
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: "token";
|
|
131
|
+
readonly type: "address";
|
|
132
|
+
}, {
|
|
133
|
+
readonly name: "amount";
|
|
134
|
+
readonly type: "uint256";
|
|
135
|
+
}, {
|
|
136
|
+
readonly name: "createdAt";
|
|
137
|
+
readonly type: "uint256";
|
|
138
|
+
}, {
|
|
139
|
+
readonly name: "executed";
|
|
140
|
+
readonly type: "bool";
|
|
141
|
+
}, {
|
|
142
|
+
readonly name: "cancelled";
|
|
143
|
+
readonly type: "bool";
|
|
144
|
+
}];
|
|
145
|
+
}, {
|
|
146
|
+
readonly name: "spendPolicies";
|
|
147
|
+
readonly type: "function";
|
|
148
|
+
readonly stateMutability: "view";
|
|
149
|
+
readonly inputs: readonly [{
|
|
150
|
+
readonly name: "token";
|
|
151
|
+
readonly type: "address";
|
|
152
|
+
}];
|
|
153
|
+
readonly outputs: readonly [{
|
|
154
|
+
readonly name: "perTxLimit";
|
|
155
|
+
readonly type: "uint256";
|
|
156
|
+
}, {
|
|
157
|
+
readonly name: "periodLimit";
|
|
158
|
+
readonly type: "uint256";
|
|
159
|
+
}, {
|
|
160
|
+
readonly name: "periodLength";
|
|
161
|
+
readonly type: "uint256";
|
|
162
|
+
}, {
|
|
163
|
+
readonly name: "periodSpent";
|
|
164
|
+
readonly type: "uint256";
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "periodStart";
|
|
167
|
+
readonly type: "uint256";
|
|
168
|
+
}];
|
|
169
|
+
}, {
|
|
170
|
+
readonly name: "operators";
|
|
171
|
+
readonly type: "function";
|
|
172
|
+
readonly stateMutability: "view";
|
|
173
|
+
readonly inputs: readonly [{
|
|
174
|
+
readonly name: "operator";
|
|
175
|
+
readonly type: "address";
|
|
176
|
+
}];
|
|
177
|
+
readonly outputs: readonly [{
|
|
178
|
+
readonly name: "";
|
|
179
|
+
readonly type: "bool";
|
|
180
|
+
}];
|
|
181
|
+
}, {
|
|
182
|
+
readonly name: "pendingNonce";
|
|
183
|
+
readonly type: "function";
|
|
184
|
+
readonly stateMutability: "view";
|
|
185
|
+
readonly inputs: readonly [];
|
|
186
|
+
readonly outputs: readonly [{
|
|
187
|
+
readonly name: "";
|
|
188
|
+
readonly type: "uint256";
|
|
189
|
+
}];
|
|
190
|
+
}, {
|
|
191
|
+
readonly name: "nonce";
|
|
192
|
+
readonly type: "function";
|
|
193
|
+
readonly stateMutability: "view";
|
|
194
|
+
readonly inputs: readonly [];
|
|
195
|
+
readonly outputs: readonly [{
|
|
196
|
+
readonly name: "";
|
|
197
|
+
readonly type: "uint256";
|
|
198
|
+
}];
|
|
199
|
+
}, {
|
|
200
|
+
readonly name: "tokenContract";
|
|
201
|
+
readonly type: "function";
|
|
202
|
+
readonly stateMutability: "view";
|
|
203
|
+
readonly inputs: readonly [];
|
|
204
|
+
readonly outputs: readonly [{
|
|
205
|
+
readonly name: "";
|
|
206
|
+
readonly type: "address";
|
|
207
|
+
}];
|
|
208
|
+
}, {
|
|
209
|
+
readonly name: "tokenId";
|
|
210
|
+
readonly type: "function";
|
|
211
|
+
readonly stateMutability: "view";
|
|
212
|
+
readonly inputs: readonly [];
|
|
213
|
+
readonly outputs: readonly [{
|
|
214
|
+
readonly name: "";
|
|
215
|
+
readonly type: "uint256";
|
|
216
|
+
}];
|
|
217
|
+
}, {
|
|
218
|
+
readonly name: "operatorEpoch";
|
|
219
|
+
readonly type: "function";
|
|
220
|
+
readonly stateMutability: "view";
|
|
221
|
+
readonly inputs: readonly [];
|
|
222
|
+
readonly outputs: readonly [{
|
|
223
|
+
readonly name: "";
|
|
224
|
+
readonly type: "uint256";
|
|
225
|
+
}];
|
|
226
|
+
}, {
|
|
227
|
+
readonly name: "isOperatorActive";
|
|
228
|
+
readonly type: "function";
|
|
229
|
+
readonly stateMutability: "view";
|
|
230
|
+
readonly inputs: readonly [{
|
|
231
|
+
readonly name: "operator";
|
|
232
|
+
readonly type: "address";
|
|
233
|
+
}];
|
|
234
|
+
readonly outputs: readonly [{
|
|
235
|
+
readonly name: "";
|
|
236
|
+
readonly type: "bool";
|
|
237
|
+
}];
|
|
238
|
+
}, {
|
|
239
|
+
readonly name: "TransactionExecuted";
|
|
240
|
+
readonly type: "event";
|
|
241
|
+
readonly inputs: readonly [{
|
|
242
|
+
readonly name: "target";
|
|
243
|
+
readonly type: "address";
|
|
244
|
+
readonly indexed: true;
|
|
245
|
+
}, {
|
|
246
|
+
readonly name: "value";
|
|
247
|
+
readonly type: "uint256";
|
|
248
|
+
readonly indexed: false;
|
|
249
|
+
}, {
|
|
250
|
+
readonly name: "data";
|
|
251
|
+
readonly type: "bytes";
|
|
252
|
+
readonly indexed: false;
|
|
253
|
+
}, {
|
|
254
|
+
readonly name: "executor";
|
|
255
|
+
readonly type: "address";
|
|
256
|
+
readonly indexed: true;
|
|
257
|
+
}];
|
|
258
|
+
}, {
|
|
259
|
+
readonly name: "SpendPolicyUpdated";
|
|
260
|
+
readonly type: "event";
|
|
261
|
+
readonly inputs: readonly [{
|
|
262
|
+
readonly name: "token";
|
|
263
|
+
readonly type: "address";
|
|
264
|
+
readonly indexed: true;
|
|
265
|
+
}, {
|
|
266
|
+
readonly name: "perTxLimit";
|
|
267
|
+
readonly type: "uint256";
|
|
268
|
+
readonly indexed: false;
|
|
269
|
+
}, {
|
|
270
|
+
readonly name: "periodLimit";
|
|
271
|
+
readonly type: "uint256";
|
|
272
|
+
readonly indexed: false;
|
|
273
|
+
}, {
|
|
274
|
+
readonly name: "periodLength";
|
|
275
|
+
readonly type: "uint256";
|
|
276
|
+
readonly indexed: false;
|
|
277
|
+
}];
|
|
278
|
+
}, {
|
|
279
|
+
readonly name: "OperatorUpdated";
|
|
280
|
+
readonly type: "event";
|
|
281
|
+
readonly inputs: readonly [{
|
|
282
|
+
readonly name: "operator";
|
|
283
|
+
readonly type: "address";
|
|
284
|
+
readonly indexed: true;
|
|
285
|
+
}, {
|
|
286
|
+
readonly name: "authorized";
|
|
287
|
+
readonly type: "bool";
|
|
288
|
+
readonly indexed: false;
|
|
289
|
+
}];
|
|
290
|
+
}, {
|
|
291
|
+
readonly name: "TransactionQueued";
|
|
292
|
+
readonly type: "event";
|
|
293
|
+
readonly inputs: readonly [{
|
|
294
|
+
readonly name: "txId";
|
|
295
|
+
readonly type: "uint256";
|
|
296
|
+
readonly indexed: true;
|
|
297
|
+
}, {
|
|
298
|
+
readonly name: "to";
|
|
299
|
+
readonly type: "address";
|
|
300
|
+
readonly indexed: true;
|
|
301
|
+
}, {
|
|
302
|
+
readonly name: "value";
|
|
303
|
+
readonly type: "uint256";
|
|
304
|
+
readonly indexed: false;
|
|
305
|
+
}, {
|
|
306
|
+
readonly name: "token";
|
|
307
|
+
readonly type: "address";
|
|
308
|
+
readonly indexed: false;
|
|
309
|
+
}, {
|
|
310
|
+
readonly name: "amount";
|
|
311
|
+
readonly type: "uint256";
|
|
312
|
+
readonly indexed: false;
|
|
313
|
+
}];
|
|
314
|
+
}, {
|
|
315
|
+
readonly name: "TransactionApproved";
|
|
316
|
+
readonly type: "event";
|
|
317
|
+
readonly inputs: readonly [{
|
|
318
|
+
readonly name: "txId";
|
|
319
|
+
readonly type: "uint256";
|
|
320
|
+
readonly indexed: true;
|
|
321
|
+
}];
|
|
322
|
+
}, {
|
|
323
|
+
readonly name: "TransactionCancelled";
|
|
324
|
+
readonly type: "event";
|
|
325
|
+
readonly inputs: readonly [{
|
|
326
|
+
readonly name: "txId";
|
|
327
|
+
readonly type: "uint256";
|
|
328
|
+
readonly indexed: true;
|
|
329
|
+
}];
|
|
330
|
+
}];
|
|
331
|
+
export declare const AgentAccountFactoryV2Abi: readonly [{
|
|
332
|
+
readonly name: "createAccount";
|
|
333
|
+
readonly type: "function";
|
|
334
|
+
readonly stateMutability: "nonpayable";
|
|
335
|
+
readonly inputs: readonly [{
|
|
336
|
+
readonly name: "tokenContract";
|
|
337
|
+
readonly type: "address";
|
|
338
|
+
}, {
|
|
339
|
+
readonly name: "tokenId";
|
|
340
|
+
readonly type: "uint256";
|
|
341
|
+
}];
|
|
342
|
+
readonly outputs: readonly [{
|
|
343
|
+
readonly name: "wallet";
|
|
344
|
+
readonly type: "address";
|
|
345
|
+
}];
|
|
346
|
+
}, {
|
|
347
|
+
readonly name: "getAddress";
|
|
348
|
+
readonly type: "function";
|
|
349
|
+
readonly stateMutability: "view";
|
|
350
|
+
readonly inputs: readonly [{
|
|
351
|
+
readonly name: "tokenContract";
|
|
352
|
+
readonly type: "address";
|
|
353
|
+
}, {
|
|
354
|
+
readonly name: "tokenId";
|
|
355
|
+
readonly type: "uint256";
|
|
356
|
+
}];
|
|
357
|
+
readonly outputs: readonly [{
|
|
358
|
+
readonly name: "";
|
|
359
|
+
readonly type: "address";
|
|
360
|
+
}];
|
|
361
|
+
}, {
|
|
362
|
+
readonly name: "wallets";
|
|
363
|
+
readonly type: "function";
|
|
364
|
+
readonly stateMutability: "view";
|
|
365
|
+
readonly inputs: readonly [{
|
|
366
|
+
readonly name: "tokenContract";
|
|
367
|
+
readonly type: "address";
|
|
368
|
+
}, {
|
|
369
|
+
readonly name: "tokenId";
|
|
370
|
+
readonly type: "uint256";
|
|
371
|
+
}];
|
|
372
|
+
readonly outputs: readonly [{
|
|
373
|
+
readonly name: "";
|
|
374
|
+
readonly type: "address";
|
|
375
|
+
}];
|
|
376
|
+
}, {
|
|
377
|
+
readonly name: "WalletCreated";
|
|
378
|
+
readonly type: "event";
|
|
379
|
+
readonly inputs: readonly [{
|
|
380
|
+
readonly name: "wallet";
|
|
381
|
+
readonly type: "address";
|
|
382
|
+
readonly indexed: true;
|
|
383
|
+
}, {
|
|
384
|
+
readonly name: "tokenContract";
|
|
385
|
+
readonly type: "address";
|
|
386
|
+
readonly indexed: true;
|
|
387
|
+
}, {
|
|
388
|
+
readonly name: "tokenId";
|
|
389
|
+
readonly type: "uint256";
|
|
390
|
+
readonly indexed: true;
|
|
391
|
+
}, {
|
|
392
|
+
readonly name: "deployer";
|
|
393
|
+
readonly type: "address";
|
|
394
|
+
readonly indexed: false;
|
|
395
|
+
}];
|
|
396
|
+
}];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CCTP V2 TokenMessengerV2 ABI (source chain)
|
|
3
|
+
* Key function: depositForBurn — burns USDC and emits a MessageSent event
|
|
4
|
+
*/
|
|
5
|
+
export declare const TokenMessengerV2Abi: {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
stateMutability: string;
|
|
9
|
+
inputs: {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
}[];
|
|
13
|
+
outputs: {
|
|
14
|
+
name: string;
|
|
15
|
+
type: string;
|
|
16
|
+
}[];
|
|
17
|
+
}[];
|
|
18
|
+
/**
|
|
19
|
+
* CCTP V2 MessageTransmitterV2 ABI (destination chain)
|
|
20
|
+
* Key function: receiveMessage — mints USDC using attested message
|
|
21
|
+
*/
|
|
22
|
+
export declare const MessageTransmitterV2Abi: {
|
|
23
|
+
name: string;
|
|
24
|
+
type: string;
|
|
25
|
+
stateMutability: string;
|
|
26
|
+
inputs: {
|
|
27
|
+
name: string;
|
|
28
|
+
type: string;
|
|
29
|
+
}[];
|
|
30
|
+
outputs: {
|
|
31
|
+
name: string;
|
|
32
|
+
type: string;
|
|
33
|
+
}[];
|
|
34
|
+
}[];
|
|
35
|
+
/**
|
|
36
|
+
* Minimal ERC20 ABI — approve + allowance + balanceOf
|
|
37
|
+
*/
|
|
38
|
+
export declare const ERC20BridgeAbi: {
|
|
39
|
+
name: string;
|
|
40
|
+
type: string;
|
|
41
|
+
stateMutability: string;
|
|
42
|
+
inputs: {
|
|
43
|
+
name: string;
|
|
44
|
+
type: string;
|
|
45
|
+
}[];
|
|
46
|
+
outputs: {
|
|
47
|
+
name: string;
|
|
48
|
+
type: string;
|
|
49
|
+
}[];
|
|
50
|
+
}[];
|
|
51
|
+
/**
|
|
52
|
+
* MessageTransmitter MessageSent event ABI — emitted during depositForBurn
|
|
53
|
+
* Used to extract the CCTP message bytes and hash for attestation polling.
|
|
54
|
+
*/
|
|
55
|
+
export declare const MessageSentEventAbi: {
|
|
56
|
+
name: string;
|
|
57
|
+
type: string;
|
|
58
|
+
inputs: {
|
|
59
|
+
name: string;
|
|
60
|
+
type: string;
|
|
61
|
+
indexed: boolean;
|
|
62
|
+
}[];
|
|
63
|
+
}[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module bridge/client
|
|
3
|
+
* BridgeModule — CCTP V2 cross-chain USDC bridge for AgentWallet (EVM↔EVM).
|
|
4
|
+
*
|
|
5
|
+
* Implements a full EVM-to-EVM USDC bridge using Circle's CCTP V2 protocol.
|
|
6
|
+
* Non-custodial: all signing is done locally via the agent's viem WalletClient.
|
|
7
|
+
*
|
|
8
|
+
* For EVM↔Solana bridging, see bridge/solana.ts.
|
|
9
|
+
*
|
|
10
|
+
* Supported chains: Ethereum, Avalanche, Optimism, Arbitrum, Base, Polygon,
|
|
11
|
+
* Unichain, Linea, Sonic, Worldchain.
|
|
12
|
+
*
|
|
13
|
+
* Flow: approve USDC → depositForBurn → poll Circle IRIS → receiveMessage
|
|
14
|
+
*/
|
|
15
|
+
import { type Hash, type Hex, type WalletClient } from "viem";
|
|
16
|
+
import type { BridgeChain, BridgeOptions, BridgeResult, BurnResult, EVMBridgeChain } from "./types.js";
|
|
17
|
+
import { BRIDGE_CHAIN_IDS, CCTP_DOMAIN_IDS, FINALITY_THRESHOLD, MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_V2, USDC_CONTRACT } from "./types.js";
|
|
18
|
+
export declare class BridgeModule {
|
|
19
|
+
private readonly walletClient;
|
|
20
|
+
private readonly signerAccount;
|
|
21
|
+
private readonly publicClient;
|
|
22
|
+
private readonly fromChain;
|
|
23
|
+
constructor(walletClient: WalletClient, fromChain?: EVMBridgeChain, options?: {
|
|
24
|
+
rpcUrl?: string;
|
|
25
|
+
});
|
|
26
|
+
bridge(amount: bigint, toChain: EVMBridgeChain, options?: BridgeOptions): Promise<BridgeResult>;
|
|
27
|
+
burn(amount: bigint, toChain: EVMBridgeChain, options?: BridgeOptions): Promise<BurnResult>;
|
|
28
|
+
waitForAttestation(messageHash: Hex, apiUrl?: string): Promise<Hex>;
|
|
29
|
+
mint(messageBytes: Hex, attestation: Hex, toChain: EVMBridgeChain, destinationRpcUrl?: string): Promise<Hash>;
|
|
30
|
+
getUsdcBalance(): Promise<bigint>;
|
|
31
|
+
getUsdcAllowance(): Promise<bigint>;
|
|
32
|
+
private approveUsdc;
|
|
33
|
+
private depositForBurn;
|
|
34
|
+
private extractMessageSent;
|
|
35
|
+
private pollForAttestation;
|
|
36
|
+
private receiveMessage;
|
|
37
|
+
private validateBridgeParams;
|
|
38
|
+
private sleep;
|
|
39
|
+
}
|
|
40
|
+
export declare class BridgeError extends Error {
|
|
41
|
+
readonly code: string;
|
|
42
|
+
constructor(code: string, message: string);
|
|
43
|
+
}
|
|
44
|
+
export declare function createBridge(walletClient: WalletClient, fromChain?: EVMBridgeChain, options?: {
|
|
45
|
+
rpcUrl?: string;
|
|
46
|
+
}): BridgeModule;
|
|
47
|
+
export type { BridgeChain, BridgeOptions, BridgeResult, BurnResult, EVMBridgeChain, };
|
|
48
|
+
export { BRIDGE_CHAIN_IDS, CCTP_DOMAIN_IDS, FINALITY_THRESHOLD, MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_V2, USDC_CONTRACT, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module bridge
|
|
3
|
+
* Re-exports for the bridge module: EVM↔EVM CCTP V2 bridge and EVM↔Solana bridge.
|
|
4
|
+
*
|
|
5
|
+
* Import from 'agentwallet-sdk/bridge' or 'agentwallet-sdk' (re-exported from root).
|
|
6
|
+
*
|
|
7
|
+
* EVM↔EVM: use BridgeModule or createBridge()
|
|
8
|
+
* EVM↔Solana: use bridgeEVMToSolana() and receiveFromSolanaOnEVM()
|
|
9
|
+
*/
|
|
10
|
+
export { ERC20BridgeAbi, MessageTransmitterV2Abi, TokenMessengerV2Abi, } from "./abis.js";
|
|
11
|
+
export { BRIDGE_CHAIN_IDS, BridgeError, BridgeModule, CCTP_DOMAIN_IDS, createBridge, FINALITY_THRESHOLD, MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_V2, USDC_CONTRACT, } from "./client.js";
|
|
12
|
+
export type { EVMToSolanaOptions, EVMToSolanaResult, SolanaBridgeErrorCode, SolanaToEVMBurnParams, SolanaToEVMOptions, SolanaToEVMResult, } from "./solana.js";
|
|
13
|
+
export { bridgeEVMToSolana, bytes32ToSolanaPubkey, receiveFromSolanaOnEVM, SOLANA_CCTP_DOMAIN, SOLANA_DEFAULT_RPC, SOLANA_MESSAGE_TRANSMITTER, SOLANA_TOKEN_MESSENGER, SOLANA_USDC_MINT, SolanaBridgeError, } from "./solana.js";
|
|
14
|
+
export type { AttestationResponse, AttestationStatus, BridgeChain, BridgeOptions, BridgeResult, BurnResult, EVMBridgeChain, } from "./types.js";
|