@elizaos/plugin-wallet 2.0.0-beta.1
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/LICENSE +21 -0
- package/README.md +64 -0
- package/auto-enable.ts +76 -0
- package/dist/LpManagementService-BWrQ5-cO.mjs +353 -0
- package/dist/MockLpService-D_Apn4Fd.mjs +99 -0
- package/dist/aerodrome-CfnESC32.mjs +890 -0
- package/dist/chunk-hT5z_Zn9.mjs +35 -0
- package/dist/index.d.mts +34727 -0
- package/dist/index.mjs +21590 -0
- package/dist/lib/server-wallet-trade.d.mts +34 -0
- package/dist/lib/server-wallet-trade.mjs +306 -0
- package/dist/meteora-BPX39hZo.mjs +22640 -0
- package/dist/orca-Bybp1HXO.mjs +249 -0
- package/dist/pancakeswp-CkEXlXti.mjs +604 -0
- package/dist/plugin-ZO_MTyd0.mjs +529 -0
- package/dist/raydium-rfaM9yEf.mjs +539 -0
- package/dist/sdk/index.d.mts +32492 -0
- package/dist/sdk/index.mjs +6415 -0
- package/dist/types-D5252NZk.mjs +487 -0
- package/dist/uniswap-CReXgXVN.mjs +573 -0
- package/dist/wallet-action.d.mts +6 -0
- package/dist/wallet-action.mjs +820 -0
- package/package.json +152 -0
- package/src/actions/failure-codes.ts +79 -0
- package/src/actions/index.ts +1 -0
- package/src/analytics/birdeye/actions/wallet-search-address.ts +9 -0
- package/src/analytics/birdeye/birdeye-task.ts +175 -0
- package/src/analytics/birdeye/birdeye.ts +813 -0
- package/src/analytics/birdeye/constants.ts +74 -0
- package/src/analytics/birdeye/providers/agent-portfolio-provider.ts +18 -0
- package/src/analytics/birdeye/providers/market.ts +227 -0
- package/src/analytics/birdeye/providers/portfolio-factory.test.ts +138 -0
- package/src/analytics/birdeye/providers/portfolio-factory.ts +252 -0
- package/src/analytics/birdeye/providers/trending.ts +365 -0
- package/src/analytics/birdeye/providers/wallet.ts +14 -0
- package/src/analytics/birdeye/search-category.test.ts +207 -0
- package/src/analytics/birdeye/search-category.ts +506 -0
- package/src/analytics/birdeye/service.ts +992 -0
- package/src/analytics/birdeye/tasks/birdeye.ts +232 -0
- package/src/analytics/birdeye/types/api/common.ts +305 -0
- package/src/analytics/birdeye/types/api/defi.ts +220 -0
- package/src/analytics/birdeye/types/api/pair.ts +200 -0
- package/src/analytics/birdeye/types/api/search.ts +86 -0
- package/src/analytics/birdeye/types/api/token.ts +635 -0
- package/src/analytics/birdeye/types/api/trader.ts +76 -0
- package/src/analytics/birdeye/types/api/wallet.ts +181 -0
- package/src/analytics/birdeye/types/shared.ts +106 -0
- package/src/analytics/birdeye/utils.ts +700 -0
- package/src/analytics/dexscreener/errors.ts +28 -0
- package/src/analytics/dexscreener/index.ts +3 -0
- package/src/analytics/dexscreener/search-category.test.ts +49 -0
- package/src/analytics/dexscreener/search-category.ts +42 -0
- package/src/analytics/dexscreener/service.ts +595 -0
- package/src/analytics/dexscreener/types.ts +128 -0
- package/src/analytics/lpinfo/index.d.ts +7 -0
- package/src/analytics/lpinfo/index.ts +52 -0
- package/src/analytics/lpinfo/kamino/README.md +102 -0
- package/src/analytics/lpinfo/kamino/index.ts +24 -0
- package/src/analytics/lpinfo/kamino/providers/kaminoLiquidityProvider.ts +422 -0
- package/src/analytics/lpinfo/kamino/providers/kaminoPoolProvider.ts +365 -0
- package/src/analytics/lpinfo/kamino/providers/kaminoProvider.ts +496 -0
- package/src/analytics/lpinfo/kamino/services/kaminoLiquidityService.ts +1123 -0
- package/src/analytics/lpinfo/kamino/services/kaminoService.ts +758 -0
- package/src/analytics/lpinfo/steer/README.md +169 -0
- package/src/analytics/lpinfo/steer/index.ts +23 -0
- package/src/analytics/lpinfo/steer/providers/steerLiquidityProvider.ts +544 -0
- package/src/analytics/lpinfo/steer/services/steerLiquidityService.ts +1690 -0
- package/src/analytics/lpinfo/steer/steer-display-types.ts +99 -0
- package/src/analytics/news/index.ts +52 -0
- package/src/analytics/news/interfaces/types.ts +222 -0
- package/src/analytics/news/providers/defiNewsProvider.ts +734 -0
- package/src/analytics/news/services/newsDataService.ts +332 -0
- package/src/analytics/news/utils/formatters.ts +151 -0
- package/src/analytics/token-info/action.ts +240 -0
- package/src/analytics/token-info/index.ts +3 -0
- package/src/analytics/token-info/params.ts +215 -0
- package/src/analytics/token-info/providers.ts +681 -0
- package/src/analytics/token-info/service.ts +168 -0
- package/src/analytics/token-info/types.ts +74 -0
- package/src/audit/audit-log.ts +45 -0
- package/src/browser-shim/build-shim.ts +123 -0
- package/src/browser-shim/index.ts +5 -0
- package/src/browser-shim/shim.template.js +563 -0
- package/src/chains/evm/.github/workflows/npm-deploy.yml +112 -0
- package/src/chains/evm/LICENSE +21 -0
- package/src/chains/evm/README.md +106 -0
- package/src/chains/evm/actions/helpers.ts +147 -0
- package/src/chains/evm/actions/swap.ts +839 -0
- package/src/chains/evm/actions/transfer.ts +254 -0
- package/src/chains/evm/biome.json +61 -0
- package/src/chains/evm/bridge-router.ts +660 -0
- package/src/chains/evm/build.ts +89 -0
- package/src/chains/evm/chain-handler.ts +416 -0
- package/src/chains/evm/constants.ts +23 -0
- package/src/chains/evm/contracts/artifacts/OZGovernor.json +1707 -0
- package/src/chains/evm/contracts/artifacts/TimelockController.json +1007 -0
- package/src/chains/evm/contracts/artifacts/VoteToken.json +895 -0
- package/src/chains/evm/dex/aerodrome/index.ts +34 -0
- package/src/chains/evm/dex/aerodrome/services/AerodromeLpService.ts +558 -0
- package/src/chains/evm/dex/aerodrome/types.ts +318 -0
- package/src/chains/evm/dex/pancakeswp/index.ts +35 -0
- package/src/chains/evm/dex/pancakeswp/services/PancakeSwapV3LpService.ts +743 -0
- package/src/chains/evm/dex/pancakeswp/types.ts +65 -0
- package/src/chains/evm/dex/uniswap/index.ts +35 -0
- package/src/chains/evm/dex/uniswap/services/UniswapV3LpService.ts +759 -0
- package/src/chains/evm/dex/uniswap/types.ts +390 -0
- package/src/chains/evm/generated/specs/spec-helpers.ts +73 -0
- package/src/chains/evm/generated/specs/specs.ts +151 -0
- package/src/chains/evm/gov-router.ts +250 -0
- package/src/chains/evm/index.browser.ts +16 -0
- package/src/chains/evm/index.ts +31 -0
- package/src/chains/evm/prompts.ts +193 -0
- package/src/chains/evm/providers/get-balance.ts +123 -0
- package/src/chains/evm/providers/wallet.ts +715 -0
- package/src/chains/evm/routes/sign.ts +333 -0
- package/src/chains/evm/rpc-providers.ts +410 -0
- package/src/chains/evm/service.ts +140 -0
- package/src/chains/evm/templates/index.ts +10 -0
- package/src/chains/evm/types/index.ts +432 -0
- package/src/chains/evm/vitest.config.ts +18 -0
- package/src/chains/registry.ts +668 -0
- package/src/chains/solana/README.md +367 -0
- package/src/chains/wallet-action.ts +533 -0
- package/src/chains/wallet-router.test.ts +296 -0
- package/src/contracts.ts +65 -0
- package/src/core-augmentation.ts +10 -0
- package/src/index.ts +71 -0
- package/src/lib/server-wallet-trade.ts +192 -0
- package/src/lib/wallet-export-guard.ts +330 -0
- package/src/lp/actions/liquidity.ts +827 -0
- package/src/lp/e2e/real-token-tests.ts +428 -0
- package/src/lp/e2e/scenarios.ts +470 -0
- package/src/lp/e2e/test-utils.ts +145 -0
- package/src/lp/lp-manager-entry.ts +303 -0
- package/src/lp/services/ConcentratedLiquidityService.ts +120 -0
- package/src/lp/services/DexInteractionService.ts +226 -0
- package/src/lp/services/LpManagementService.test.ts +148 -0
- package/src/lp/services/LpManagementService.ts +632 -0
- package/src/lp/services/UserLpProfileService.ts +163 -0
- package/src/lp/services/VaultService.ts +153 -0
- package/src/lp/services/YieldOptimizationService.ts +344 -0
- package/src/lp/services/__tests__/MockLpService.ts +146 -0
- package/src/lp/tasks/LpAutoRebalanceTask.ts +117 -0
- package/src/lp/tasks/__tests__/LpAutoRebalanceTask.test.ts +370 -0
- package/src/lp/types.ts +582 -0
- package/src/lp/utils/solanaClient.ts +143 -0
- package/src/plugin.ts +125 -0
- package/src/policy/policy.ts +19 -0
- package/src/providers/canonical-provider.ts +27 -0
- package/src/providers/unified-wallet-provider.ts +79 -0
- package/src/register-routes.ts +11 -0
- package/src/routes/plugin.ts +47 -0
- package/src/routes/wallet-market-overview-route.ts +869 -0
- package/src/sdk/abi.ts +258 -0
- package/src/sdk/bridge/abis.ts +126 -0
- package/src/sdk/bridge/client.ts +518 -0
- package/src/sdk/bridge/index.ts +56 -0
- package/src/sdk/bridge/solana.ts +604 -0
- package/src/sdk/bridge/types.ts +202 -0
- package/src/sdk/convenience.ts +347 -0
- package/src/sdk/escrow/MutualStakeEscrow.ts +480 -0
- package/src/sdk/escrow/types.ts +64 -0
- package/src/sdk/escrow/verifiers.ts +73 -0
- package/src/sdk/identity/erc8004.ts +692 -0
- package/src/sdk/identity/reputation.ts +449 -0
- package/src/sdk/identity/uaid.ts +497 -0
- package/src/sdk/identity/validation.ts +372 -0
- package/src/sdk/index.ts +763 -0
- package/src/sdk/policy/SpendingPolicy.ts +260 -0
- package/src/sdk/policy/UptoBillingPolicy.ts +320 -0
- package/src/sdk/router/PaymentRouter.ts +215 -0
- package/src/sdk/router/index.ts +8 -0
- package/src/sdk/swap/SwapModule.ts +310 -0
- package/src/sdk/swap/abi.ts +117 -0
- package/src/sdk/swap/index.ts +34 -0
- package/src/sdk/swap/types.ts +135 -0
- package/src/sdk/tokens/decimals.ts +140 -0
- package/src/sdk/tokens/registry.ts +911 -0
- package/src/sdk/tokens/solana.ts +419 -0
- package/src/sdk/tokens/transfers.ts +327 -0
- package/src/sdk/types.ts +158 -0
- package/src/sdk/wallet-core.ts +115 -0
- package/src/sdk/x402/budget.ts +168 -0
- package/src/sdk/x402/chains/abstract/index.ts +280 -0
- package/src/sdk/x402/client.ts +320 -0
- package/src/sdk/x402/index.ts +46 -0
- package/src/sdk/x402/middleware.ts +92 -0
- package/src/sdk/x402/multi-asset.ts +144 -0
- package/src/sdk/x402/types.ts +156 -0
- package/src/services/wallet-backend-service.ts +328 -0
- package/src/types/wallet-router.ts +227 -0
- package/src/utils/intent-trajectory.ts +106 -0
- package/src/wallet/backend.ts +62 -0
- package/src/wallet/errors.ts +49 -0
- package/src/wallet/index.ts +27 -0
- package/src/wallet/local-eoa-backend.ts +201 -0
- package/src/wallet/pending.ts +60 -0
- package/src/wallet/select-backend.ts +47 -0
- package/src/wallet/steward-backend.ts +161 -0
- package/src/wallet-action.ts +1 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display-layer shapes for Steer vaults/pools rendered in steerLiquidityProvider.
|
|
3
|
+
* These mirror the enriched objects built in SteerLiquidityService.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface SteerGraphqlTokenRef {
|
|
7
|
+
name: string;
|
|
8
|
+
creator: { id: string };
|
|
9
|
+
admin: string;
|
|
10
|
+
executionBundle?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SteerGraphqlEnrichment {
|
|
14
|
+
weeklyFeeAPR: number;
|
|
15
|
+
token0Symbol: string;
|
|
16
|
+
token0Decimals: number;
|
|
17
|
+
token1Symbol: string;
|
|
18
|
+
token1Decimals: number;
|
|
19
|
+
token0Balance: string;
|
|
20
|
+
token1Balance: string;
|
|
21
|
+
totalLPTokensIssued: string;
|
|
22
|
+
feeTier: number;
|
|
23
|
+
fees0: string;
|
|
24
|
+
fees1: string;
|
|
25
|
+
strategyToken?: SteerGraphqlTokenRef;
|
|
26
|
+
beaconName: string;
|
|
27
|
+
payloadIpfs: string;
|
|
28
|
+
deployer: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface SteerVaultPositionRow {
|
|
32
|
+
type: string;
|
|
33
|
+
range: string;
|
|
34
|
+
liquidity: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Token slot may be raw address string or `{ address?: string }` */
|
|
38
|
+
export type SteerVaultTokenSide = string | { address?: string };
|
|
39
|
+
|
|
40
|
+
export interface SteerVaultDetailInput {
|
|
41
|
+
address: string;
|
|
42
|
+
/** Present on some SDK responses alongside `address` */
|
|
43
|
+
vaultAddress?: string;
|
|
44
|
+
name: string;
|
|
45
|
+
chainId: number;
|
|
46
|
+
tvl: number;
|
|
47
|
+
volume24h: number;
|
|
48
|
+
apy: number;
|
|
49
|
+
strategyType: string;
|
|
50
|
+
fee: number;
|
|
51
|
+
createdAt: number;
|
|
52
|
+
isActive: boolean;
|
|
53
|
+
token0?: SteerVaultTokenSide | "Unknown";
|
|
54
|
+
token1?: SteerVaultTokenSide | "Unknown";
|
|
55
|
+
graphqlData?: SteerGraphqlEnrichment;
|
|
56
|
+
calculatedTvl?: number;
|
|
57
|
+
positions?: SteerVaultPositionRow[];
|
|
58
|
+
/** Present on some SDK/GraphQL paths for downstream transactions */
|
|
59
|
+
poolAddress?: string;
|
|
60
|
+
singleAssetDepositContract?: `0x${string}`;
|
|
61
|
+
weeklyFeeAPR?: number;
|
|
62
|
+
/** Flattened GraphQL fields sometimes attached on `getVaultDetails` results */
|
|
63
|
+
token0Symbol?: string;
|
|
64
|
+
token1Symbol?: string;
|
|
65
|
+
token0Balance?: string;
|
|
66
|
+
token1Balance?: string;
|
|
67
|
+
totalLPTokensIssued?: string;
|
|
68
|
+
feeTier?: number;
|
|
69
|
+
fees0?: string;
|
|
70
|
+
fees1?: string;
|
|
71
|
+
strategyToken?: SteerGraphqlTokenRef;
|
|
72
|
+
beaconName?: string;
|
|
73
|
+
deployer?: string;
|
|
74
|
+
/** Extra SDK fields merged in `processVaultData` */
|
|
75
|
+
ammType?: string | number;
|
|
76
|
+
protocol?: string;
|
|
77
|
+
protocolBaseType?: string;
|
|
78
|
+
targetProtocol?: string;
|
|
79
|
+
apr?: number;
|
|
80
|
+
apr1d?: number;
|
|
81
|
+
apr7d?: number;
|
|
82
|
+
apr14d?: number;
|
|
83
|
+
feeApr?: number;
|
|
84
|
+
stakingApr?: number;
|
|
85
|
+
merklApr?: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface SteerStakingPoolDetailInput {
|
|
89
|
+
address: string;
|
|
90
|
+
name: string;
|
|
91
|
+
chainId: number;
|
|
92
|
+
totalStakedUSD: number;
|
|
93
|
+
apr: number;
|
|
94
|
+
stakingToken: string;
|
|
95
|
+
rewardToken: string;
|
|
96
|
+
rewardRate: number;
|
|
97
|
+
periodFinish: number;
|
|
98
|
+
isActive: boolean;
|
|
99
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// @ts-nocheck — legacy code from absorbed plugins (lp-manager, lpinfo, dexscreener, defi-news, birdeye); strict types pending cleanup
|
|
2
|
+
import type { Plugin } from "@elizaos/core";
|
|
3
|
+
// Providers
|
|
4
|
+
import { defiNewsProvider } from "./providers/defiNewsProvider";
|
|
5
|
+
// Services
|
|
6
|
+
import { NewsDataService } from "./services/newsDataService";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* DeFi News Plugin
|
|
10
|
+
*
|
|
11
|
+
* A comprehensive plugin that automatically provides DeFi and crypto market context to conversations through providers.
|
|
12
|
+
*
|
|
13
|
+
* Features:
|
|
14
|
+
* - Global DeFi market statistics (market cap, volume, dominance) - requires CoinGecko service
|
|
15
|
+
* - Global crypto market data (active cryptocurrencies, total market cap, dominance) - requires CoinGecko service
|
|
16
|
+
* - Latest crypto news from Brave New Coin RSS feed (always available)
|
|
17
|
+
* - Token information (price, market cap, community stats, developer activity) - requires CoinGecko service
|
|
18
|
+
*
|
|
19
|
+
* Optional Dependencies:
|
|
20
|
+
* - COINGECKO_SERVICE: Provided by analytics plugin or similar for market data
|
|
21
|
+
* - birdeye: For Solana token lookups
|
|
22
|
+
* - chain_solana: For Solana blockchain interactions
|
|
23
|
+
*
|
|
24
|
+
* Required Services:
|
|
25
|
+
* - NEWS_DATA_SERVICE: Provided by this plugin for news data
|
|
26
|
+
*
|
|
27
|
+
* Note: This plugin works standalone with news data only. For full functionality,
|
|
28
|
+
* ensure the analytics plugin (or similar) is loaded to provide the COINGECKO_SERVICE.
|
|
29
|
+
*
|
|
30
|
+
* @author ElizaOS
|
|
31
|
+
* @version 2.0.0
|
|
32
|
+
*/
|
|
33
|
+
export const defiNewsPlugin: Plugin = {
|
|
34
|
+
name: "defi-news",
|
|
35
|
+
description:
|
|
36
|
+
"DeFi News plugin that provides comprehensive market context including global DeFi/crypto statistics, token data, and real-world crypto news from CoinGecko and Brave New Coin RSS feed",
|
|
37
|
+
providers: [defiNewsProvider],
|
|
38
|
+
actions: [],
|
|
39
|
+
services: [NewsDataService],
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default defiNewsPlugin;
|
|
43
|
+
|
|
44
|
+
// Export types for external use
|
|
45
|
+
export * from "./interfaces/types";
|
|
46
|
+
// Export providers
|
|
47
|
+
export { defiNewsProvider } from "./providers/defiNewsProvider";
|
|
48
|
+
// Export services for direct access if needed
|
|
49
|
+
export { NewsDataService } from "./services/newsDataService";
|
|
50
|
+
|
|
51
|
+
// Export utilities
|
|
52
|
+
export * from "./utils/formatters";
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
// @ts-nocheck — legacy code from absorbed plugins (lp-manager, lpinfo, dexscreener, defi-news, birdeye); strict types pending cleanup
|
|
2
|
+
import type { IAgentRuntime, Memory, State } from "@elizaos/core";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* DeFi News data types
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// ============================================
|
|
9
|
+
// CoinGecko DeFi Market Data Types
|
|
10
|
+
// ============================================
|
|
11
|
+
|
|
12
|
+
export interface GlobalDefiData {
|
|
13
|
+
defi_market_cap: string;
|
|
14
|
+
eth_market_cap: string;
|
|
15
|
+
defi_to_eth_ratio: string;
|
|
16
|
+
trading_volume_24h: string;
|
|
17
|
+
defi_dominance: string;
|
|
18
|
+
top_coin_name: string;
|
|
19
|
+
top_coin_defi_dominance: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface GlobalCryptoData {
|
|
23
|
+
active_cryptocurrencies: number;
|
|
24
|
+
upcoming_icos: number;
|
|
25
|
+
ongoing_icos: number;
|
|
26
|
+
ended_icos: number;
|
|
27
|
+
markets: number;
|
|
28
|
+
total_market_cap: Record<string, number>;
|
|
29
|
+
total_volume: Record<string, number>;
|
|
30
|
+
market_cap_percentage: Record<string, number>;
|
|
31
|
+
market_cap_change_percentage_24h_usd: number;
|
|
32
|
+
updated_at: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface TokenNewsData {
|
|
36
|
+
tokenId: string;
|
|
37
|
+
tokenName: string;
|
|
38
|
+
symbol: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
market_data?: {
|
|
41
|
+
current_price?: Record<string, number>;
|
|
42
|
+
market_cap?: Record<string, number>;
|
|
43
|
+
total_volume?: Record<string, number>;
|
|
44
|
+
price_change_percentage_24h?: number;
|
|
45
|
+
price_change_percentage_7d?: number;
|
|
46
|
+
price_change_percentage_30d?: number;
|
|
47
|
+
};
|
|
48
|
+
community_data?: {
|
|
49
|
+
twitter_followers?: number;
|
|
50
|
+
reddit_subscribers?: number;
|
|
51
|
+
telegram_channel_user_count?: number;
|
|
52
|
+
};
|
|
53
|
+
developer_data?: {
|
|
54
|
+
forks?: number;
|
|
55
|
+
stars?: number;
|
|
56
|
+
subscribers?: number;
|
|
57
|
+
total_issues?: number;
|
|
58
|
+
closed_issues?: number;
|
|
59
|
+
pull_requests_merged?: number;
|
|
60
|
+
pull_request_contributors?: number;
|
|
61
|
+
};
|
|
62
|
+
last_updated?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface DexPairData {
|
|
66
|
+
base: string;
|
|
67
|
+
target: string;
|
|
68
|
+
market: {
|
|
69
|
+
name: string;
|
|
70
|
+
identifier: string;
|
|
71
|
+
has_trading_incentive: boolean;
|
|
72
|
+
};
|
|
73
|
+
last: number;
|
|
74
|
+
volume: number;
|
|
75
|
+
converted_last: Record<string, number>;
|
|
76
|
+
converted_volume: Record<string, number>;
|
|
77
|
+
trust_score: string;
|
|
78
|
+
bid_ask_spread_percentage: number;
|
|
79
|
+
timestamp: string;
|
|
80
|
+
last_traded_at: string;
|
|
81
|
+
last_fetch_at: string;
|
|
82
|
+
is_anomaly: boolean;
|
|
83
|
+
is_stale: boolean;
|
|
84
|
+
trade_url: string;
|
|
85
|
+
token_info_url: string | null;
|
|
86
|
+
coin_id: string;
|
|
87
|
+
target_coin_id?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface OHLCVData {
|
|
91
|
+
timestamp: number;
|
|
92
|
+
open: number;
|
|
93
|
+
high: number;
|
|
94
|
+
low: number;
|
|
95
|
+
close: number;
|
|
96
|
+
volume?: number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ============================================
|
|
100
|
+
// NewsData.io Real World Events Types
|
|
101
|
+
// ============================================
|
|
102
|
+
|
|
103
|
+
export interface RealWorldNewsArticle {
|
|
104
|
+
article_id: string;
|
|
105
|
+
title: string;
|
|
106
|
+
link: string;
|
|
107
|
+
keywords?: string[];
|
|
108
|
+
creator?: string[];
|
|
109
|
+
video_url?: string | null;
|
|
110
|
+
description?: string;
|
|
111
|
+
content?: string;
|
|
112
|
+
pubDate: string;
|
|
113
|
+
image_url?: string;
|
|
114
|
+
source_id: string;
|
|
115
|
+
source_priority: number;
|
|
116
|
+
source_url?: string;
|
|
117
|
+
source_icon?: string;
|
|
118
|
+
language: string;
|
|
119
|
+
country?: string[];
|
|
120
|
+
category?: string[];
|
|
121
|
+
ai_tag?: string;
|
|
122
|
+
sentiment?: string;
|
|
123
|
+
sentiment_stats?: string;
|
|
124
|
+
ai_region?: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface RealWorldNewsResponse {
|
|
128
|
+
status: string;
|
|
129
|
+
totalResults: number;
|
|
130
|
+
results: RealWorldNewsArticle[];
|
|
131
|
+
nextPage?: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// ============================================
|
|
135
|
+
// Request/Response Types
|
|
136
|
+
// ============================================
|
|
137
|
+
|
|
138
|
+
export interface DefiNewsRequest {
|
|
139
|
+
tokenId?: string;
|
|
140
|
+
tokenAddress?: string;
|
|
141
|
+
chain?: string;
|
|
142
|
+
includeMarketData?: boolean;
|
|
143
|
+
includeCommunityData?: boolean;
|
|
144
|
+
includeDeveloperData?: boolean;
|
|
145
|
+
includeRealWorldNews?: boolean;
|
|
146
|
+
newsQuery?: string;
|
|
147
|
+
newsLanguage?: string;
|
|
148
|
+
newsCategory?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface DexLiquidityRequest {
|
|
152
|
+
tokenId: string;
|
|
153
|
+
includePairs?: boolean;
|
|
154
|
+
includeOHLCV?: boolean;
|
|
155
|
+
ohlcvDays?: number;
|
|
156
|
+
timeframe?: "1h" | "4h" | "1d" | "1w";
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface GlobalDefiRequest {
|
|
160
|
+
includeCryptoData?: boolean;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface DefiNewsResponse {
|
|
164
|
+
success: boolean;
|
|
165
|
+
data: {
|
|
166
|
+
tokenNews?: TokenNewsData;
|
|
167
|
+
globalDefi?: GlobalDefiData;
|
|
168
|
+
globalCrypto?: GlobalCryptoData;
|
|
169
|
+
dexPairs?: DexPairData[];
|
|
170
|
+
ohlcvData?: OHLCVData[];
|
|
171
|
+
realWorldNews?: RealWorldNewsArticle[];
|
|
172
|
+
};
|
|
173
|
+
timestamp: number;
|
|
174
|
+
error?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// ============================================
|
|
178
|
+
// Service Interfaces
|
|
179
|
+
// ============================================
|
|
180
|
+
|
|
181
|
+
export interface DefiNewsService {
|
|
182
|
+
// CoinGecko DeFi Data
|
|
183
|
+
getGlobalDefiData(): Promise<GlobalDefiData>;
|
|
184
|
+
getGlobalCryptoData(): Promise<GlobalCryptoData>;
|
|
185
|
+
getTokenData(
|
|
186
|
+
tokenId: string,
|
|
187
|
+
options?: {
|
|
188
|
+
includeMarketData?: boolean;
|
|
189
|
+
includeCommunityData?: boolean;
|
|
190
|
+
includeDeveloperData?: boolean;
|
|
191
|
+
},
|
|
192
|
+
): Promise<TokenNewsData>;
|
|
193
|
+
getDexPairs(tokenId: string): Promise<DexPairData[]>;
|
|
194
|
+
getOHLCVData(tokenId: string, days: number): Promise<OHLCVData[]>;
|
|
195
|
+
|
|
196
|
+
// Real World News
|
|
197
|
+
getRealWorldNews(
|
|
198
|
+
query: string,
|
|
199
|
+
options?: {
|
|
200
|
+
language?: string;
|
|
201
|
+
category?: string;
|
|
202
|
+
limit?: number;
|
|
203
|
+
},
|
|
204
|
+
): Promise<RealWorldNewsArticle[]>;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// ============================================
|
|
208
|
+
// Action Types
|
|
209
|
+
// ============================================
|
|
210
|
+
|
|
211
|
+
export interface ActionRequest {
|
|
212
|
+
runtime: IAgentRuntime;
|
|
213
|
+
message: Memory;
|
|
214
|
+
state?: State;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface ActionResponse {
|
|
218
|
+
success: boolean;
|
|
219
|
+
text: string;
|
|
220
|
+
data?: Record<string, unknown>;
|
|
221
|
+
error?: string;
|
|
222
|
+
}
|