@elizaos/plugin-wallet 2.0.0-beta.1 → 2.0.3-beta.5
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
package/README.md
CHANGED
|
@@ -1,64 +1,89 @@
|
|
|
1
1
|
# @elizaos/plugin-wallet
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Non-custodial wallet plugin for elizaOS agents. Provides EVM and Solana signing, token transfers, swaps, cross-chain bridging, on-chain governance, LP management, and market analytics behind a single unified action+provider surface.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Replaces the former fan-out across `plugin-evm`, `plugin-solana`, `plugin-raydium`, `plugin-orca`, `plugin-meteora`, `plugin-jupiter`, `plugin-lp-manager`, and `plugin-clanker`.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Capabilities
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|--------|---------|
|
|
11
|
-
| `TRADE` | Open positions, swap, bridge. Discriminated by `kind`: `perp` (Hyperliquid), `prediction` (Polymarket), `spot` / `swap` (Li.Fi on EVM, Jupiter on Solana), `bridge` (Li.Fi / CCTP). |
|
|
12
|
-
| `MANAGE_POSITION` | Close, modify, cancel orders. |
|
|
13
|
-
| `QUERY_MARKET` | Read-only price / depth / funding / chart / news / sentiment. No wallet required. |
|
|
14
|
-
| `QUERY_PORTFOLIO` | Balances, positions, P&L, history. |
|
|
15
|
-
| `LEND` | Supply / borrow / repay / withdraw on Aave or Morpho. |
|
|
16
|
-
| `MANAGE_LP` | Open / close / collect / rebalance LP positions. EVM (Uniswap V3, Aerodrome) + Solana (Raydium, Orca Whirlpools, Meteora DLMM) behind one surface. |
|
|
17
|
-
| `TRANSFER` | Move value to an arbitrary external address. EVM + Solana. Always policy-checked. |
|
|
18
|
-
| `SET_AUTOMATION` | DCA, threshold triggers, P&L exits. |
|
|
19
|
-
| `MANAGE_AUTOMATION` | List / pause / resume / delete automations. |
|
|
20
|
-
| `MINT` | Token launches via Clanker on Base. |
|
|
9
|
+
### On-chain actions (via the `WALLET` action)
|
|
21
10
|
|
|
22
|
-
|
|
11
|
+
| Subaction | What it does |
|
|
12
|
+
|-----------|-------------|
|
|
13
|
+
| `transfer` | Send tokens to an external address. EVM or Solana. Always requires user confirmation. |
|
|
14
|
+
| `swap` | Token swap via Li.Fi (EVM) or Jupiter (Solana). |
|
|
15
|
+
| `bridge` | Cross-chain transfer via Li.Fi route finding or CCTP (Circle's native USDC bridge). |
|
|
16
|
+
| `gov` | On-chain governance: propose, vote, queue, execute via OpenZeppelin Governor. |
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
All write operations default to `mode=prepare` (stages the transaction but does not sign or send). The agent asks the user to confirm before submitting. `dryRun=true` returns metadata without signing.
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
### Analytics subactions (no wallet required)
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
| Subaction | What it does |
|
|
23
|
+
|-----------|-------------|
|
|
24
|
+
| `token_info` | Token and market data from DexScreener, Birdeye, or CoinGecko. |
|
|
25
|
+
| `search_address` | Birdeye wallet portfolio lookup by address. |
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
### LP management
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
Multi-DEX LP management for both EVM and Solana chains:
|
|
34
30
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
index.ts # Plugin export
|
|
38
|
-
plugin.ts # Plugin object: actions + providers + services
|
|
39
|
-
sdk/ # Lifted from agent-wallet-sdk (ERC-6551, x402, CCTP, swap, escrow, identity, multi-token, payment router)
|
|
40
|
-
wallet/ # WalletBackend interface + LocalEoa + Steward
|
|
41
|
-
policy/ # PolicyModule (local + steward bridge)
|
|
42
|
-
providers/ # Canonical providers (one per venue / data source)
|
|
43
|
-
actions/ # Canonical actions (TRADE, MANAGE_POSITION, ...)
|
|
44
|
-
audit/ # Append-only hash-chained audit log
|
|
45
|
-
```
|
|
31
|
+
- **EVM:** Uniswap V3, Aerodrome, PancakeSwap V3
|
|
32
|
+
- **Solana:** Raydium CLMM, Orca Whirlpools, Meteora DLMM
|
|
46
33
|
|
|
47
|
-
|
|
34
|
+
Access via the `lpManagerPlugin` export; LP actions are surfaced as the `LIQUIDITY` action (via `liquidityAction`).
|
|
48
35
|
|
|
49
|
-
|
|
36
|
+
### Market analytics
|
|
50
37
|
|
|
51
|
-
|
|
38
|
+
- **Birdeye:** real-time prices, trending tokens, portfolio valuation.
|
|
39
|
+
- **DexScreener:** pair search, token lookups.
|
|
40
|
+
- **Token info:** multi-provider dispatcher (DexScreener, Birdeye, CoinGecko).
|
|
41
|
+
- **DeFi news:** via `defiNewsPlugin`.
|
|
52
42
|
|
|
53
|
-
|
|
54
|
-
- **Phase 1** — backend impls + `@elizaos/plugin-wallet` composes legacy `plugin-evm` + `plugin-solana`; migrate call sites to consume `WalletBackend` only.
|
|
55
|
-
- **Phase 2** — provider lifts (13+ providers).
|
|
56
|
-
- **Phase 3** — canonical action implementations.
|
|
57
|
-
- **Phase 4** — approval-queue surface (SSE + decision endpoint + tray + Capacitor bridge).
|
|
58
|
-
- **Phase 5** — EVM + Solana chain implementations live under `src/chains/`; migrate remaining callsites to `WalletBackend` only; expand test coverage.
|
|
43
|
+
## Wallet backends
|
|
59
44
|
|
|
60
|
-
|
|
45
|
+
The plugin supports two signing backends, selected by `ELIZA_WALLET_BACKEND`:
|
|
61
46
|
|
|
62
|
-
|
|
47
|
+
- **`local`** — raw EOA private keys from environment variables or the OS keychain. Default for desktop.
|
|
48
|
+
- **`steward`** — multi-tenant Steward signing service. Required for cloud and mobile deployments.
|
|
49
|
+
- **`auto`** (default) — uses Steward when `ELIZA_CLOUD_PROVISIONED=1` or `ELIZA_WALLET_STEWARD_AUTO=1`, otherwise local.
|
|
63
50
|
|
|
64
|
-
|
|
51
|
+
## Required configuration
|
|
52
|
+
|
|
53
|
+
None of the variables below are strictly required at load time; the plugin degrades gracefully. To get signing:
|
|
54
|
+
|
|
55
|
+
| Variable | When needed |
|
|
56
|
+
|----------|-------------|
|
|
57
|
+
| `EVM_PRIVATE_KEY` | EVM operations with local backend |
|
|
58
|
+
| `SOLANA_PRIVATE_KEY` | Solana operations with local backend |
|
|
59
|
+
| `STEWARD_API_URL` + `STEWARD_AGENT_TOKEN` | Steward backend or cloud deployments |
|
|
60
|
+
| `SOLANA_RPC_URL` | Any Solana operation |
|
|
61
|
+
|
|
62
|
+
Additional optional variables:
|
|
63
|
+
|
|
64
|
+
| Variable | Purpose |
|
|
65
|
+
|----------|---------|
|
|
66
|
+
| `ELIZA_WALLET_BACKEND` | `local` \| `steward` \| `auto` |
|
|
67
|
+
| `BIRDEYE_API_KEY` | Direct Birdeye access (falls back to Eliza Cloud route) |
|
|
68
|
+
| `BIRDEYE_WALLET_ADDR` | Enables portfolio provider for a specific address |
|
|
69
|
+
| `BIRDEYE_NO_TRENDING` | Disable trending provider |
|
|
70
|
+
| `ELIZA_AGENT_WALLET_AUTO_ENABLE` | Set to `0` to disable auto-enable |
|
|
71
|
+
| `X402_SUPPORTED_NETWORKS` | Comma-separated networks for x402 micropayments |
|
|
72
|
+
| `X402_GLOBAL_DAILY_LIMIT` | Daily USDC spending cap for x402 |
|
|
73
|
+
| `X402_PER_REQUEST_MAX` | Per-request USDC cap for x402 |
|
|
74
|
+
|
|
75
|
+
EVM RPC per chain: `ETHEREUM_RPC_URL` / `EVM_PROVIDER_MAINNET`, `BASE_RPC_URL` / `EVM_PROVIDER_BASE`, `BSC_RPC_URL` / `EVM_PROVIDER_BSC`, `ARBITRUM_RPC_URL` / `EVM_PROVIDER_ARBITRUM`.
|
|
76
|
+
|
|
77
|
+
## Enabling the plugin
|
|
78
|
+
|
|
79
|
+
The plugin auto-enables when any signing path is present (EVM or Solana private key, or Steward credentials). To opt out of auto-enable, set `ELIZA_AGENT_WALLET_AUTO_ENABLE=0`. To explicitly disable, set `enabled: false` for plugin id `wallet` in the agent config.
|
|
80
|
+
|
|
81
|
+
## Security model
|
|
82
|
+
|
|
83
|
+
All on-chain writes (`transfer`, `swap`, `bridge`, `gov`) require an explicit user confirmation before execution. The LLM cannot authorize a transaction by itself — a confirmed human reply turn is always required. EVM recipient addresses on transfers are additionally validated via `assertEvmTransferRecipientAuthorized`.
|
|
84
|
+
|
|
85
|
+
`src/audit/audit-log.ts` defines `AuditLogRow` plus hash-chain helpers for action validate/handler lifecycle events and signing requests. Runtime callers own where those rows are stored.
|
|
86
|
+
|
|
87
|
+
## SDK
|
|
88
|
+
|
|
89
|
+
`src/sdk/` provides lower-level ERC-6551 token-bound account primitives, x402 micropayment protocol types, CCTP bridge helpers, and spend-policy tooling. These are primarily for plugin internals but are re-exported from the package barrel for external use. SDK source is MIT-licensed (attribution: agent-wallet-sdk); see `SDK-LICENSE`.
|
package/auto-enable.ts
CHANGED
|
@@ -60,7 +60,7 @@ export function shouldEnable(ctx: PluginAutoEnableContext): boolean {
|
|
|
60
60
|
|
|
61
61
|
if (env.ELIZA_AGENT_WALLET_AUTO_ENABLE === "0") return false;
|
|
62
62
|
|
|
63
|
-
const entries = (config
|
|
63
|
+
const entries = (config.plugins as Record<string, unknown> | undefined)
|
|
64
64
|
?.entries as Record<string, { enabled?: boolean } | undefined> | undefined;
|
|
65
65
|
if (entries) {
|
|
66
66
|
for (const id of ["wallet", "agent-wallet", "evm", "solana"] as const) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for action failure modes. Every error returned to the
|
|
3
|
+
* planner carries a code from one of these unions; the `detail` string is for
|
|
4
|
+
* humans, the code is for the planner to react on.
|
|
5
|
+
*
|
|
6
|
+
* See docs/architecture/wallet-and-trading.md §E.
|
|
7
|
+
*/
|
|
8
|
+
export type ValidateFailureCode = "INVALID_PARAMS" | "PLUGIN_DISABLED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_AUTH_MISSING" | "WALLET_NOT_AVAILABLE" | "VENUE_NOT_SUPPORTED_ON_BACKEND" | "VENUE_NOT_SUPPORTED_FOR_KIND" | "POLICY_REQUIRES_APPROVAL" | "POLICY_BLOCKED" | "INSUFFICIENT_BALANCE" | "MARKET_CLOSED" | "INSTRUMENT_NOT_FOUND" | "LEVERAGE_OUT_OF_RANGE" | "SLIPPAGE_EXCEEDED" | "WITHDRAWAL_NOT_ALLOWLISTED" | "VENUE_GEO_RESTRICTED" | "INVALID_ADDRESS" | "TOKEN_NOT_SUPPORTED" | "POOL_NOT_FOUND" | "RANGE_OUT_OF_BOUNDS";
|
|
9
|
+
export type ActionFailureCode = "PROVIDER_REJECTED" | "SIGNATURE_REJECTED" | "STEWARD_UNAVAILABLE" | "ROUTE_NOT_FOUND" | "TRANSACTION_REVERTED" | "TIMEOUT";
|
|
10
|
+
export type FailureCode = ValidateFailureCode | ActionFailureCode;
|
|
11
|
+
export declare const isValidateFailureCode: (code: string) => code is ValidateFailureCode;
|
|
12
|
+
export declare const isActionFailureCode: (code: string) => code is ActionFailureCode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./failure-codes.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ActionResult, HandlerCallback, HandlerOptions, IAgentRuntime, Memory, State } from "@elizaos/core";
|
|
2
|
+
/**
|
|
3
|
+
* Folded into WALLET as `action=search_address`. Forces the TokenInfoService
|
|
4
|
+
* route through the Birdeye provider with the `wallet` subaction so callers get
|
|
5
|
+
* Birdeye portfolio data for a wallet address.
|
|
6
|
+
*/
|
|
7
|
+
export declare function walletSearchAddressHandler(runtime: IAgentRuntime, message: Memory, state?: State, options?: HandlerOptions | Record<string, unknown>, callback?: HandlerCallback): Promise<ActionResult>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Content, type IAgentRuntime, type UUID } from "@elizaos/core";
|
|
2
|
+
import type { BirdeyeService } from "./service";
|
|
3
|
+
export interface SentimentContent extends Content {
|
|
4
|
+
text: string;
|
|
5
|
+
source: "sentiment-analysis";
|
|
6
|
+
metadata: {
|
|
7
|
+
timeslot: string;
|
|
8
|
+
processed: boolean;
|
|
9
|
+
occuringTokens?: Array<{
|
|
10
|
+
token: string;
|
|
11
|
+
sentiment: number;
|
|
12
|
+
reason: string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export default class Birdeye {
|
|
17
|
+
apiKey: string;
|
|
18
|
+
sentimentRoomId: UUID;
|
|
19
|
+
twitterFeedRoomId: UUID;
|
|
20
|
+
runtime: IAgentRuntime;
|
|
21
|
+
pSrvBirdeye: Promise<unknown>;
|
|
22
|
+
beService: BirdeyeService;
|
|
23
|
+
constructor(runtime: IAgentRuntime);
|
|
24
|
+
private syncWalletHistory;
|
|
25
|
+
private syncWalletPortfolio;
|
|
26
|
+
syncWallet(): Promise<boolean | undefined>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { type IAgentRuntime } from "@elizaos/core";
|
|
2
|
+
import type { BaseQuoteParams, BaseQuoteResponse, DefiHistoryPriceParams, DefiHistoryPriceResponse, DefiMultiPriceParams, DefiMultiPriceParamsPOST, DefiMultiPriceResponse, DefiNetworksResponse, DefiPriceParams, DefiPriceResponse, DefiTradesTokenParams, DefiTradesTokenResponse, HistoricalPriceUnixParams, HistoricalPriceUnixResponse, MultiPriceVolumeParams, MultiPriceVolumeResponse, OHLCVParams, OHLCVResponse, PriceVolumeParams, PriceVolumeResponse } from "./types/api/defi";
|
|
3
|
+
import type { OHLCVPairParams, OHLCVPairResponse, PairOverviewMultiParams, PairOverviewMultiResponse, PairOverviewSingleParams, PairOverviewSingleResponse } from "./types/api/pair";
|
|
4
|
+
import type { TokenMarketSearchParams, TokenMarketSearchResponse } from "./types/api/search";
|
|
5
|
+
import type { AllMarketsParams, AllMarketsResponse, MintBurnParams, MintBurnResponse, NewListingParams, NewListingResponse, TokenCreationInfoParams, TokenCreationInfoResponse, TokenHoldersParams, TokenHoldersResponse, TokenListParams, TokenListResponse, TokenListV2Response, TokenMarketDataParams, TokenMarketDataResponse, TokenMetadataMultiParams, TokenMetadataMultiResponse, TokenMetadataSingleParams, TokenMetadataSingleResponse, TokenOverviewParams, TokenOverviewResponse, TokenSecurityParams, TokenSecurityResponse, TokenTradeDataMultiParams, TokenTradeDataMultiResponse, TokenTradeDataSingleParams, TokenTradeDataSingleResponse, TokenTrendingParams, TokenTrendingResponse, TopTradersParams, TopTradersResponse } from "./types/api/token";
|
|
6
|
+
import type { GainersLosersParams, GainersLosersResponse, TraderTransactionsSeekParams, TraderTransactionsSeekResponse } from "./types/api/trader";
|
|
7
|
+
import type { WalletPortfolioParams, WalletPortfolioResponse, WalletSimulationParams, WalletSimulationResponse, WalletTokenBalanceParams, WalletTokenBalanceResponse, WalletTransactionHistoryParams, WalletTransactionHistoryResponse } from "./types/api/wallet";
|
|
8
|
+
type FetchParams<T> = T & {
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
};
|
|
11
|
+
export declare class BirdeyeProvider {
|
|
12
|
+
private runtime;
|
|
13
|
+
private maxRetries;
|
|
14
|
+
constructor(runtime: Pick<IAgentRuntime, "getCache" | "setCache">, _symbolMap?: Record<string, string>, maxRetries?: number);
|
|
15
|
+
private fetchWithRetry;
|
|
16
|
+
private fetchWithCacheAndRetry;
|
|
17
|
+
fetchDefiSupportedNetworks(): Promise<DefiNetworksResponse>;
|
|
18
|
+
fetchDefiPrice(params: DefiPriceParams, options?: {
|
|
19
|
+
headers?: Record<string, string>;
|
|
20
|
+
}): Promise<DefiPriceResponse>;
|
|
21
|
+
fetchDefiPriceMultiple(params: DefiMultiPriceParams, options?: {
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
}): Promise<DefiMultiPriceResponse>;
|
|
24
|
+
fetchDefiPriceMultiple_POST(params: DefiMultiPriceParamsPOST, options?: {
|
|
25
|
+
headers?: Record<string, string>;
|
|
26
|
+
}): Promise<DefiMultiPriceResponse>;
|
|
27
|
+
fetchDefiPriceHistorical(params: DefiHistoryPriceParams, options?: {
|
|
28
|
+
headers?: Record<string, string>;
|
|
29
|
+
}): Promise<DefiHistoryPriceResponse>;
|
|
30
|
+
fetchDefiPriceHistoricalByUnixTime(params: HistoricalPriceUnixParams, options?: {
|
|
31
|
+
headers?: Record<string, string>;
|
|
32
|
+
}): Promise<HistoricalPriceUnixResponse>;
|
|
33
|
+
fetchDefiTradesToken(params: DefiTradesTokenParams, options?: {
|
|
34
|
+
headers?: Record<string, string>;
|
|
35
|
+
}): Promise<DefiTradesTokenResponse>;
|
|
36
|
+
fetchDefiTradesPair(params: DefiTradesTokenParams, options?: {
|
|
37
|
+
headers?: Record<string, string>;
|
|
38
|
+
}): Promise<DefiTradesTokenResponse>;
|
|
39
|
+
fetchDefiTradesTokenSeekByTime(params: DefiTradesTokenParams, options?: {
|
|
40
|
+
headers?: Record<string, string>;
|
|
41
|
+
}): Promise<DefiTradesTokenResponse>;
|
|
42
|
+
fetchDefiTradesPairSeekByTime(params: DefiTradesTokenParams, options?: {
|
|
43
|
+
headers?: Record<string, string>;
|
|
44
|
+
}): Promise<DefiTradesTokenResponse>;
|
|
45
|
+
fetchDefiOHLCV(params: OHLCVParams, options?: {
|
|
46
|
+
headers?: Record<string, string>;
|
|
47
|
+
}): Promise<OHLCVResponse>;
|
|
48
|
+
fetchDefiOHLCVPair(params: OHLCVPairParams, options?: {
|
|
49
|
+
headers?: Record<string, string>;
|
|
50
|
+
}): Promise<OHLCVPairResponse>;
|
|
51
|
+
fetchDefiOHLCVBaseQuote(params: BaseQuoteParams, options?: {
|
|
52
|
+
headers?: Record<string, string>;
|
|
53
|
+
}): Promise<BaseQuoteResponse>;
|
|
54
|
+
fetchDefiPriceVolume(params: PriceVolumeParams, options?: {
|
|
55
|
+
headers?: Record<string, string>;
|
|
56
|
+
}): Promise<PriceVolumeResponse>;
|
|
57
|
+
fetchDefiPriceVolumeMulti_POST(params: MultiPriceVolumeParams, options?: {
|
|
58
|
+
headers?: Record<string, string>;
|
|
59
|
+
}): Promise<MultiPriceVolumeResponse>;
|
|
60
|
+
fetchTokenList(params: TokenListParams, options?: {
|
|
61
|
+
headers?: Record<string, string>;
|
|
62
|
+
}): Promise<TokenListResponse>;
|
|
63
|
+
fetchTokenSecurityByAddress(params: TokenSecurityParams, options?: {
|
|
64
|
+
headers?: Record<string, string>;
|
|
65
|
+
}): Promise<TokenSecurityResponse>;
|
|
66
|
+
fetchTokenOverview(params: TokenOverviewParams, options?: {
|
|
67
|
+
headers?: Record<string, string>;
|
|
68
|
+
}): Promise<TokenOverviewResponse>;
|
|
69
|
+
fetchTokenCreationInfo(params: TokenCreationInfoParams, options?: {
|
|
70
|
+
headers?: Record<string, string>;
|
|
71
|
+
}): Promise<TokenCreationInfoResponse>;
|
|
72
|
+
fetchTokenTrending(params?: TokenTrendingParams, options?: {
|
|
73
|
+
headers?: Record<string, string>;
|
|
74
|
+
}): Promise<TokenTrendingResponse>;
|
|
75
|
+
fetchTokenListV2_POST(params: FetchParams<Record<string, never>>): Promise<TokenListV2Response>;
|
|
76
|
+
fetchTokenNewListing(params?: NewListingParams, options?: {
|
|
77
|
+
headers?: Record<string, string>;
|
|
78
|
+
}): Promise<NewListingResponse>;
|
|
79
|
+
fetchTokenTopTraders(params: TopTradersParams, options?: {
|
|
80
|
+
headers?: Record<string, string>;
|
|
81
|
+
}): Promise<TopTradersResponse>;
|
|
82
|
+
fetchTokenAllMarketsList(params: AllMarketsParams, options?: {
|
|
83
|
+
headers?: Record<string, string>;
|
|
84
|
+
}): Promise<AllMarketsResponse>;
|
|
85
|
+
fetchTokenMetadataSingle(params: TokenMetadataSingleParams, options?: {
|
|
86
|
+
headers?: Record<string, string>;
|
|
87
|
+
}): Promise<TokenMetadataSingleResponse>;
|
|
88
|
+
fetchTokenMetadataMulti(params: TokenMetadataMultiParams, options?: {
|
|
89
|
+
headers?: Record<string, string>;
|
|
90
|
+
}): Promise<TokenMetadataMultiResponse>;
|
|
91
|
+
fetchTokenMarketData(params: TokenMarketDataParams, options?: {
|
|
92
|
+
headers?: Record<string, string>;
|
|
93
|
+
}): Promise<TokenMarketDataResponse>;
|
|
94
|
+
fetchTokenTradeDataSingle(params: TokenTradeDataSingleParams, options?: {
|
|
95
|
+
headers?: Record<string, string>;
|
|
96
|
+
}): Promise<TokenTradeDataSingleResponse>;
|
|
97
|
+
fetchTokenTradeDataMultiple(params: TokenTradeDataMultiParams, options?: {
|
|
98
|
+
headers?: Record<string, string>;
|
|
99
|
+
}): Promise<TokenTradeDataMultiResponse>;
|
|
100
|
+
fetchTokenHolders(params: TokenHoldersParams, options?: {
|
|
101
|
+
headers?: Record<string, string>;
|
|
102
|
+
}): Promise<TokenHoldersResponse>;
|
|
103
|
+
fetchTokenMintBurn(params: MintBurnParams, options?: {
|
|
104
|
+
headers?: Record<string, string>;
|
|
105
|
+
}): Promise<MintBurnResponse>;
|
|
106
|
+
fetchWalletSupportedNetworks(options?: {
|
|
107
|
+
headers?: Record<string, string>;
|
|
108
|
+
}): Promise<DefiNetworksResponse>;
|
|
109
|
+
fetchWalletPortfolio(params: WalletPortfolioParams, options?: {
|
|
110
|
+
headers?: Record<string, string>;
|
|
111
|
+
}): Promise<WalletPortfolioResponse>;
|
|
112
|
+
fetchWalletTokenBalance(params: WalletTokenBalanceParams, options?: {
|
|
113
|
+
headers?: Record<string, string>;
|
|
114
|
+
}): Promise<WalletTokenBalanceResponse>;
|
|
115
|
+
fetchWalletTransactionHistory(params: WalletTransactionHistoryParams, options?: {
|
|
116
|
+
headers?: Record<string, string>;
|
|
117
|
+
}): Promise<WalletTransactionHistoryResponse>;
|
|
118
|
+
fetchWalletTransactionSimulate_POST(params: WalletSimulationParams, options?: {
|
|
119
|
+
headers?: Record<string, string>;
|
|
120
|
+
}): Promise<WalletSimulationResponse>;
|
|
121
|
+
fetchTraderGainersLosers(params: GainersLosersParams, options?: {
|
|
122
|
+
headers?: Record<string, string>;
|
|
123
|
+
}): Promise<GainersLosersResponse>;
|
|
124
|
+
fetchTraderTransactionsSeek(params: TraderTransactionsSeekParams, options?: {
|
|
125
|
+
headers?: Record<string, string>;
|
|
126
|
+
}): Promise<TraderTransactionsSeekResponse>;
|
|
127
|
+
fetchPairOverviewSingle(params: PairOverviewSingleParams, options?: {
|
|
128
|
+
headers?: Record<string, string>;
|
|
129
|
+
}): Promise<PairOverviewSingleResponse>;
|
|
130
|
+
fetchMultiPairOverview(params: PairOverviewMultiParams, options?: {
|
|
131
|
+
headers?: Record<string, string>;
|
|
132
|
+
}): Promise<PairOverviewMultiResponse>;
|
|
133
|
+
fetchPairOverviewMultiple(params: PairOverviewMultiParams, options?: {
|
|
134
|
+
headers?: Record<string, string>;
|
|
135
|
+
}): Promise<PairOverviewMultiResponse>;
|
|
136
|
+
fetchSearchTokenMarketData(params: TokenMarketSearchParams, options?: {
|
|
137
|
+
headers?: Record<string, string>;
|
|
138
|
+
}): Promise<TokenMarketSearchResponse>;
|
|
139
|
+
}
|
|
140
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare const DEFAULT_MAX_RETRIES = 3;
|
|
2
|
+
export declare const BIRDEYE_SERVICE_NAME = "birdeye";
|
|
3
|
+
export declare const DEFAULT_SUPPORTED_SYMBOLS: {
|
|
4
|
+
SOL: string;
|
|
5
|
+
BTC: string;
|
|
6
|
+
ETH: string;
|
|
7
|
+
Example: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const API_BASE_URL = "https://public-api.birdeye.so";
|
|
10
|
+
export declare const RETRY_DELAY_MS = 2000;
|
|
11
|
+
export declare const BIRDEYE_ENDPOINTS: {
|
|
12
|
+
defi: {
|
|
13
|
+
networks: string;
|
|
14
|
+
price: string;
|
|
15
|
+
price_multi: string;
|
|
16
|
+
price_multi_POST: string;
|
|
17
|
+
history_price: string;
|
|
18
|
+
historical_price_unix: string;
|
|
19
|
+
trades_token: string;
|
|
20
|
+
trades_pair: string;
|
|
21
|
+
trades_token_seek: string;
|
|
22
|
+
trades_pair_seek: string;
|
|
23
|
+
ohlcv: string;
|
|
24
|
+
ohlcv_pair: string;
|
|
25
|
+
ohlcv_base_quote: string;
|
|
26
|
+
price_volume: string;
|
|
27
|
+
price_volume_multi: string;
|
|
28
|
+
price_volume_multi_POST: string;
|
|
29
|
+
};
|
|
30
|
+
token: {
|
|
31
|
+
list_all: string;
|
|
32
|
+
security: string;
|
|
33
|
+
overview: string;
|
|
34
|
+
creation_info: string;
|
|
35
|
+
trending: string;
|
|
36
|
+
list_all_v2_POST: string;
|
|
37
|
+
new_listing: string;
|
|
38
|
+
top_traders: string;
|
|
39
|
+
all_markets: string;
|
|
40
|
+
metadata_single: string;
|
|
41
|
+
metadata_multi: string;
|
|
42
|
+
market_data: string;
|
|
43
|
+
trade_data_single: string;
|
|
44
|
+
trade_data_multi: string;
|
|
45
|
+
holders: string;
|
|
46
|
+
mint_burn: string;
|
|
47
|
+
};
|
|
48
|
+
wallet: {
|
|
49
|
+
networks: string;
|
|
50
|
+
portfolio: string;
|
|
51
|
+
portfolio_multichain: string;
|
|
52
|
+
token_balance: string;
|
|
53
|
+
transaction_history: string;
|
|
54
|
+
transaction_history_multichain: string;
|
|
55
|
+
transaction_simulation_POST: string;
|
|
56
|
+
};
|
|
57
|
+
trader: {
|
|
58
|
+
gainers_losers: string;
|
|
59
|
+
trades_seek: string;
|
|
60
|
+
};
|
|
61
|
+
pair: {
|
|
62
|
+
overview_multi: string;
|
|
63
|
+
overview_single: string;
|
|
64
|
+
};
|
|
65
|
+
search: {
|
|
66
|
+
token_market: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { formatPortfolio } from "./portfolio-factory";
|
|
2
|
+
/**
|
|
3
|
+
* Agent portfolio data provider that queries Birdeye API for the agent's wallet address.
|
|
4
|
+
* When a wallet address is set, this provider fetches current token balances and makes
|
|
5
|
+
* compact JSON portfolio context available to the planner.
|
|
6
|
+
*/
|
|
7
|
+
export declare const agentPortfolioProvider: import("@elizaos/core").Provider;
|
|
8
|
+
export { formatPortfolio };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IAgentRuntime, Provider } from "@elizaos/core";
|
|
2
|
+
import type { GetCacheTimedOptions } from "../types/shared";
|
|
3
|
+
export declare function getCacheTimed<T>(runtime: IAgentRuntime, key: string, options?: GetCacheTimedOptions): Promise<T | undefined>;
|
|
4
|
+
/**
|
|
5
|
+
* Provider for Birdeye market data
|
|
6
|
+
*
|
|
7
|
+
* @type {Provider}
|
|
8
|
+
* @property {string} name - The name of the provider
|
|
9
|
+
* @property {string} description - Description of the provider
|
|
10
|
+
* @property {number} position - The position of the provider
|
|
11
|
+
* @property {Function} get - Asynchronous function to get actions that validate for a given message
|
|
12
|
+
*
|
|
13
|
+
* @param {IAgentRuntime} runtime - The agent runtime
|
|
14
|
+
* @param {Memory} message - The message memory
|
|
15
|
+
* @param {State} state - The state of the agent
|
|
16
|
+
* @returns {Object} Object containing data, values, and text related to actions
|
|
17
|
+
*/
|
|
18
|
+
export declare const marketProvider: Provider;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Provider } from "@elizaos/core";
|
|
2
|
+
import type { WalletPortfolioResponse } from "../types/api/wallet";
|
|
3
|
+
export interface BirdeyePortfolioProviderOptions {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
descriptionCompressed: string;
|
|
7
|
+
includeTrades?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const formatPortfolio: (response: WalletPortfolioResponse) => string;
|
|
10
|
+
export declare function createBirdeyePortfolioProvider(options: BirdeyePortfolioProviderOptions): Provider;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IAgentRuntime, Provider } from "@elizaos/core";
|
|
2
|
+
export declare function getCacheTimed<T>(runtime: IAgentRuntime, key: string, options?: {
|
|
3
|
+
notOlderThan?: number;
|
|
4
|
+
}): Promise<T | false>;
|
|
5
|
+
/**
|
|
6
|
+
* Provider for Birdeye trending coins
|
|
7
|
+
*
|
|
8
|
+
* @type {Provider}
|
|
9
|
+
* @property {string} name - The name of the provider
|
|
10
|
+
* @property {string} description - Description of the provider
|
|
11
|
+
* @property {number} position - The position of the provider
|
|
12
|
+
* @property {Function} get - Asynchronous function to get actions that validate for a given message
|
|
13
|
+
*
|
|
14
|
+
* @param {IAgentRuntime} runtime - The agent runtime
|
|
15
|
+
* @param {Memory} message - The message memory
|
|
16
|
+
* @param {State} state - The state of the agent
|
|
17
|
+
* @returns {Object} Object containing data, values, and text related to actions
|
|
18
|
+
*/
|
|
19
|
+
export declare const trendingProvider: Provider;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { IAgentRuntime, SearchCategoryRegistration } from "@elizaos/core";
|
|
2
|
+
import { BirdeyeProvider } from "./birdeye";
|
|
3
|
+
import type { TokenResult } from "./types/api/search";
|
|
4
|
+
import type { TokenMarketDataResponse, TokenOverviewResponse, TokenSecurityResponse, TokenTradeDataSingleResponse } from "./types/api/token";
|
|
5
|
+
import type { BaseAddress } from "./types/shared";
|
|
6
|
+
export declare const BIRDEYE_TOKEN_SEARCH_CATEGORY: SearchCategoryRegistration;
|
|
7
|
+
export declare const BIRDEYE_SEARCH_CATEGORIES: readonly [SearchCategoryRegistration];
|
|
8
|
+
export interface BirdeyeSearchCategoryOptions {
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
disabledReason?: string;
|
|
11
|
+
}
|
|
12
|
+
export type BirdeyeTokenSearchMode = "auto" | "symbol" | "address";
|
|
13
|
+
export interface BirdeyeTokenSearchRequest {
|
|
14
|
+
query: string;
|
|
15
|
+
mode?: BirdeyeTokenSearchMode;
|
|
16
|
+
filters?: Record<string, unknown>;
|
|
17
|
+
limit?: number;
|
|
18
|
+
}
|
|
19
|
+
type BirdeyeTokenAddressSearchResult = {
|
|
20
|
+
address: BaseAddress;
|
|
21
|
+
chain: string;
|
|
22
|
+
overview?: TokenOverviewResponse;
|
|
23
|
+
marketData?: TokenMarketDataResponse;
|
|
24
|
+
security?: TokenSecurityResponse;
|
|
25
|
+
tradeData?: TokenTradeDataSingleResponse;
|
|
26
|
+
};
|
|
27
|
+
type BirdeyeTokenSymbolSearchResult = {
|
|
28
|
+
symbol: string;
|
|
29
|
+
tokens: TokenResult[];
|
|
30
|
+
};
|
|
31
|
+
type BirdeyeTokenSearchProvider = Pick<BirdeyeProvider, "fetchSearchTokenMarketData" | "fetchTokenOverview" | "fetchTokenMarketData" | "fetchTokenSecurityByAddress" | "fetchTokenTradeDataSingle">;
|
|
32
|
+
export declare function registerBirdeyeSearchCategories(runtime: IAgentRuntime, options?: BirdeyeSearchCategoryOptions): void;
|
|
33
|
+
export declare function searchBirdeyeTokens(runtime: IAgentRuntime, request: BirdeyeTokenSearchRequest, provider?: BirdeyeTokenSearchProvider): Promise<{
|
|
34
|
+
query: string;
|
|
35
|
+
mode: "symbol" | "address";
|
|
36
|
+
resultCount: number;
|
|
37
|
+
results: never[];
|
|
38
|
+
text: string;
|
|
39
|
+
} | {
|
|
40
|
+
query: string;
|
|
41
|
+
mode: "address";
|
|
42
|
+
resultCount: number;
|
|
43
|
+
results: BirdeyeTokenAddressSearchResult[];
|
|
44
|
+
text: string;
|
|
45
|
+
} | {
|
|
46
|
+
query: string;
|
|
47
|
+
mode: "symbol";
|
|
48
|
+
resultCount: number;
|
|
49
|
+
results: BirdeyeTokenSymbolSearchResult[];
|
|
50
|
+
text: string;
|
|
51
|
+
}>;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { type RouteSpec } from "@elizaos/cloud-routing";
|
|
2
|
+
import { type IAgentRuntime, Service } from "@elizaos/core";
|
|
3
|
+
import type { TokenMarketSearchParams, TokenMarketSearchResponse } from "./types/api/search";
|
|
4
|
+
import type { TokenMarketDataParams, TokenMarketDataResponse, TokenOverviewParams, TokenOverviewResponse, TokenSecurityParams, TokenSecurityResponse, TokenTradeDataSingleParams, TokenTradeDataSingleResponse } from "./types/api/token";
|
|
5
|
+
import type { WalletPortfolioResponse, WalletTransactionHistoryResponse } from "./types/api/wallet";
|
|
6
|
+
import type { BirdeyeSupportedChain, GetCacheTimedOptions, IToken } from "./types/shared";
|
|
7
|
+
/** Route spec for {@link resolveCloudRoute} — local X-API-KEY or Eliza Cloud `/apis/birdeye` proxy. */
|
|
8
|
+
export declare const BIRDEYE_ROUTE_SPEC: RouteSpec;
|
|
9
|
+
type Chain = string;
|
|
10
|
+
type BirdeyeHeaders = {
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
};
|
|
13
|
+
export interface BirdeyeTokenMarketSnapshot {
|
|
14
|
+
symbol?: string;
|
|
15
|
+
priceUsd: number;
|
|
16
|
+
priceSol?: number;
|
|
17
|
+
liquidity: number;
|
|
18
|
+
priceChange24h: number;
|
|
19
|
+
marketCapUsd?: number;
|
|
20
|
+
}
|
|
21
|
+
type WalletTransaction = WalletTransactionHistoryResponse["data"][string][number];
|
|
22
|
+
export declare class BirdeyeService extends Service {
|
|
23
|
+
static serviceType: string;
|
|
24
|
+
capabilityDescription: string;
|
|
25
|
+
private readonly access;
|
|
26
|
+
constructor(runtime?: IAgentRuntime);
|
|
27
|
+
private birdeyeUrl;
|
|
28
|
+
private getBirdeyeFetchOptions;
|
|
29
|
+
private fetchBirdeyeJson;
|
|
30
|
+
fetchSearchTokenMarketData(params: TokenMarketSearchParams): Promise<TokenMarketSearchResponse>;
|
|
31
|
+
fetchTokenOverview(params: TokenOverviewParams, options?: BirdeyeHeaders): Promise<TokenOverviewResponse>;
|
|
32
|
+
fetchTokenMarketData(params: TokenMarketDataParams, options?: BirdeyeHeaders): Promise<TokenMarketDataResponse>;
|
|
33
|
+
fetchTokenSecurityByAddress(params: TokenSecurityParams, options?: BirdeyeHeaders): Promise<TokenSecurityResponse>;
|
|
34
|
+
fetchTokenTradeDataSingle(params: TokenTradeDataSingleParams, options?: BirdeyeHeaders): Promise<TokenTradeDataSingleResponse>;
|
|
35
|
+
search(query: string, options?: Record<string, unknown>): Promise<{
|
|
36
|
+
query: string;
|
|
37
|
+
mode: "symbol" | "address";
|
|
38
|
+
resultCount: number;
|
|
39
|
+
results: never[];
|
|
40
|
+
text: string;
|
|
41
|
+
} | {
|
|
42
|
+
query: string;
|
|
43
|
+
mode: "address";
|
|
44
|
+
resultCount: number;
|
|
45
|
+
results: {
|
|
46
|
+
address: import("./types/shared").BaseAddress;
|
|
47
|
+
chain: string;
|
|
48
|
+
overview?: TokenOverviewResponse;
|
|
49
|
+
marketData?: TokenMarketDataResponse;
|
|
50
|
+
security?: TokenSecurityResponse;
|
|
51
|
+
tradeData?: TokenTradeDataSingleResponse;
|
|
52
|
+
}[];
|
|
53
|
+
text: string;
|
|
54
|
+
} | {
|
|
55
|
+
query: string;
|
|
56
|
+
mode: "symbol";
|
|
57
|
+
resultCount: number;
|
|
58
|
+
results: {
|
|
59
|
+
symbol: string;
|
|
60
|
+
tokens: import("./types/api/search").TokenResult[];
|
|
61
|
+
}[];
|
|
62
|
+
text: string;
|
|
63
|
+
}>;
|
|
64
|
+
getTrending(): Promise<IToken[] | undefined>;
|
|
65
|
+
private getTrendingTokensForChain;
|
|
66
|
+
getTrendingTokens(chains: Chain[], options?: {
|
|
67
|
+
notOlderThan?: number;
|
|
68
|
+
}): Promise<Record<Chain, IToken[]>>;
|
|
69
|
+
getTokenMarketData(tokenAddress: string, chain?: string): Promise<{
|
|
70
|
+
price: number;
|
|
71
|
+
marketCap: number;
|
|
72
|
+
liquidity: number;
|
|
73
|
+
volume24h: number;
|
|
74
|
+
priceHistory: number[];
|
|
75
|
+
} | false>;
|
|
76
|
+
getTokenTradeData(chain: string, tokenAddress: string, frames?: string, options?: GetCacheTimedOptions): Promise<TokenTradeDataSingleResponse | false>;
|
|
77
|
+
getTokensMarketData(chain: string, tokenAddresses: string[], options?: GetCacheTimedOptions): Promise<Record<string, BirdeyeTokenMarketSnapshot | undefined>>;
|
|
78
|
+
getTokenSecurityData(chain: string, tokenAddress: string, options?: GetCacheTimedOptions): Promise<TokenSecurityResponse | false>;
|
|
79
|
+
lookupToken(chain: string, ca: string, options?: GetCacheTimedOptions): Promise<BirdeyeTokenMarketSnapshot | undefined>;
|
|
80
|
+
lookupTokens(chainAndAddresses: Array<{
|
|
81
|
+
chain: string;
|
|
82
|
+
address: string;
|
|
83
|
+
}>, options?: GetCacheTimedOptions): Promise<Record<string, BirdeyeTokenMarketSnapshot | undefined>>;
|
|
84
|
+
fetchSearchTokenMarketDataChain(chain: string, _params: unknown, _options?: GetCacheTimedOptions): Promise<TokenMarketSearchResponse>;
|
|
85
|
+
lookupSymbolAllChains(symbol: string, options?: GetCacheTimedOptions): Promise<TokenMarketSearchResponse["data"]["items"] | false>;
|
|
86
|
+
fetchWalletTokenList(chain: BirdeyeSupportedChain, publicKey: string, options?: GetCacheTimedOptions): Promise<WalletPortfolioResponse["data"] | false>;
|
|
87
|
+
fetchWalletTxList(chain: BirdeyeSupportedChain, publicKey: string, options?: GetCacheTimedOptions): Promise<WalletTransaction[] | false>;
|
|
88
|
+
static start(runtime: IAgentRuntime): Promise<BirdeyeService>;
|
|
89
|
+
static stop(runtime: IAgentRuntime): Promise<void>;
|
|
90
|
+
stop(): Promise<void>;
|
|
91
|
+
getCacheTimed<T>(key: string, options?: GetCacheTimedOptions): Promise<false | T>;
|
|
92
|
+
setCacheTimed<T>(key: string, val: T, tsInMs?: number): Promise<boolean>;
|
|
93
|
+
}
|
|
94
|
+
export {};
|