keyring-agent-core 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -448,6 +448,43 @@ declare class PoolService {
448
448
  _keccak(hex: string): string;
449
449
  }
450
450
 
451
+ /**
452
+ * Canonical hex ids of every chain this core CAN support (EVM only). This is the
453
+ * immutable CATALOG; the ACTIVE set may be narrowed at runtime via
454
+ * {@link configureSupportedChains} and can only ever be a subset of this.
455
+ */
456
+ declare const SUPPORTED_CHAINS: readonly ["0x1", "0xa", "0x38", "0x89", "0x2105", "0xa4b1", "0xa86a", "0xe708"];
457
+ /** Canonical hex id of a built-in chain (the immutable catalog), e.g. "0x2105". */
458
+ type SupportedChainId = (typeof SUPPORTED_CHAINS)[number];
459
+ /** Human-readable name of a built-in chain — the other accepted selector form. */
460
+ type SupportedChainName = 'ethereum' | 'optimism' | 'bsc' | 'polygon' | 'base' | 'arbitrum' | 'avalanche' | 'linea';
461
+ /**
462
+ * Any identifier accepted where a built-in chain must be named (e.g.
463
+ * {@link configureSupportedChains} / `AgentConfig.excludeChains`): the canonical
464
+ * hex id OR its human name. Decimal ids ("10") still resolve at runtime but are
465
+ * intentionally left out of the type so editor autocomplete stays clean and
466
+ * typos are caught at compile time.
467
+ */
468
+ type ChainSelector = SupportedChainId | SupportedChainName;
469
+ /** Preferred default if still active, otherwise the first remaining active chain. */
470
+ declare let DEFAULT_CHAIN: string;
471
+ /** Human-readable list of ACTIVE supported chains, for user-facing messages. */
472
+ declare let SUPPORTED_CHAINS_LABEL: string;
473
+ /**
474
+ * Narrow the ACTIVE supported-chain set by REMOVING the given chains from the
475
+ * catalog. You can only ever remove — the active set is always a subset of
476
+ * {@link SUPPORTED_CHAINS}. Guards (per design):
477
+ * - entries that aren't a catalog chain (unknown id/name, non-EVM) are ignored;
478
+ * - an exclude list that would remove EVERY chain is ignored (the set is left
479
+ * at the full catalog) — we never produce an empty supported set;
480
+ * - if the preferred default (Ethereum) is removed, {@link DEFAULT_CHAIN} falls
481
+ * back to the first still-active chain.
482
+ *
483
+ * Call once at startup (AgentCore does this from `config.excludeChains`). Updates
484
+ * every resolver plus the exported `DEFAULT_CHAIN` / `SUPPORTED_CHAINS_LABEL`.
485
+ */
486
+ declare function configureSupportedChains(exclude?: Iterable<ChainSelector>): void;
487
+
451
488
  /** Role inside a conversation */
452
489
  type ChatRole = 'user' | 'assistant' | 'system' | 'tool';
453
490
  /** A single message in the conversation */
@@ -1064,6 +1101,15 @@ interface AgentConfig {
1064
1101
  * built-in public default for that chain.
1065
1102
  */
1066
1103
  rpcUrls?: Record<string, string>;
1104
+ /**
1105
+ * Restrict which of the built-in supported chains are active by REMOVING the
1106
+ * listed ones. Each entry is a {@link ChainSelector} — the chain's canonical
1107
+ * hex id ("0xa") or its human name ("optimism") — so typos are caught at
1108
+ * compile time. You can ONLY remove chains from the built-in set; a list
1109
+ * covering every chain is ignored (the full set is kept). Omit to keep all
1110
+ * built-in chains enabled.
1111
+ */
1112
+ excludeChains?: ChainSelector[];
1067
1113
  /** Maximum number of ReAct iterations before forcing an answer */
1068
1114
  maxIterations?: number;
1069
1115
  /** Maximum number of messages to keep in history before summarising */
@@ -3370,7 +3416,7 @@ type TopGainersToolConfig = MoralisServiceConfig;
3370
3416
  * Queries Pantograph's `GET /token-list/top-gainers/{chain}?duration=…` — the
3371
3417
  * tokens with the largest USD price increase over a chosen window. Single-chain
3372
3418
  * (Pantograph has no cross-chain feed); defaults to the connected chain, then
3373
- * Base. Returns the canonical trending-token shape: price, market cap, 24h
3419
+ * Ethereum. Returns the canonical trending-token shape: price, market cap, 24h
3374
3420
  * volume, and the price change over the selected window.
3375
3421
  */
3376
3422
  declare class TopGainersTool extends BaseTool {
@@ -6286,8 +6332,8 @@ declare class SendNftTool extends BaseWalletActionTool {
6286
6332
  /**
6287
6333
  * Shared JSON-RPC client + default public RPC endpoints.
6288
6334
  *
6289
- * Kept dependency-free (no imports from PoolService / swap) so both
6290
- * `PoolService` and the swap adapters can use it without a circular import.
6335
+ * Kept free of PoolService / swap imports so both `PoolService` and the swap
6336
+ * adapters can use it without a circular import.
6291
6337
  */
6292
6338
  /** Default public RPC endpoint per hex chain id. Single source of truth. */
6293
6339
  declare const DEFAULT_RPC_BY_CHAIN: Record<string, string>;
@@ -6381,7 +6427,7 @@ declare class PantographService {
6381
6427
  * `tokenAddress` work unchanged.
6382
6428
  *
6383
6429
  * Pantograph scopes results to a single chain (it has no cross-chain feed),
6384
- * so when no `chain` is given we fall back to Base ("0x2105").
6430
+ * so when no `chain` is given we fall back to {@link DEFAULT_CHAIN} (Ethereum).
6385
6431
  */
6386
6432
  getTrendingTokens(params?: {
6387
6433
  chain?: string;
@@ -6405,7 +6451,7 @@ declare class PantographService {
6405
6451
  * returned in the canonical {@link TrendingToken} shape.
6406
6452
  *
6407
6453
  * Pantograph scopes results to a single chain (no cross-chain feed), so when
6408
- * no `chain` is given we fall back to Base ("0x2105").
6454
+ * no `chain` is given we fall back to {@link DEFAULT_CHAIN} (Ethereum).
6409
6455
  *
6410
6456
  * `duration` accepts Pantograph windows: "1h", "24h", "7d", "30d".
6411
6457
  */
@@ -6684,4 +6730,4 @@ declare class Summarizer {
6684
6730
  summarize(messages: ChatMessage[]): Promise<string>;
6685
6731
  }
6686
6732
 
6687
- export { AI_AGENT_TOOL_NAMES, type AddLiquidityFormProps, type AddLiquiditySummary, type AffiliateFee, type AgentConfig, AgentCore, type AgentResponse, ApproveTokenTool, BaseNftMessageTool, BaseSwapService, BaseTool, BaseWalletActionTool, type BuyTokenConfirmTxProps, type BuyTokenSide, BuyTokenTool, type ChainMeta, type ChainRef, ChatHistory, type ChatMessage, type ChatOptions, type ChatRole, type CheckApprovalParams, type CheckApprovalResult, type ConfirmAddLiquidityTxProps, type CortexResponse, DEFAULT_PROVIDER, DEFAULT_RPC_BY_CHAIN, DebridgeAdapter, type DecodedCall, type DecodedEvent, type DecodedParam, type DefaultSubagentName, type DefiPosition, type DefiPositionDetails, type DefiPositionToken, type DefiProtocolSummary, EstimatePoolYieldTool, type EstimatePoolYieldToolConfig, type ExchangeProviderConfig, type ExecuteSwapParams, type ExecuteSwapResult, GeminiProvider, GeminiSearchAiTool, type GeminiSearchAiToolConfig, HEX_TO_PANTOGRAPH, type HolderChangePeriod, type HolderSupplyTier, type IngestKnowledgeBaseInput, type IngestKnowledgeBaseResult, type InputTokenInfo, type KBSearchResult, KnowledgeBase, type KnowledgeBaseEntry, type KnowledgeBaseProvider, type LLMProvider, type LLMProviderConfig, type LLMResponse, type LLMToolCall, type MoralisApiResponse, MoralisService, type MoralisServiceConfig, NFTContractInfoTool, type NFTContractInfoToolConfig, type NFTContractMetadata, type NFTItem, type NFTLastSale, type NFTMetadata, NFTMetadataTool, type NFTMetadataToolConfig, NFT_AGENT_TOOL_NAMES, type NativeTokenInfo, type NftMessageToolConfig, type NftTransferLastSale, OpenAddLiquidityFormTool, type OpenAddLiquidityFormToolConfig, POOL_AGENT_TOOL_NAMES, PantographService, type PantographServiceConfig, type PaymentToken, PoolByAddressTool, type PoolByAddressToolConfig, PoolDetailTool, type PoolDetailToolConfig, type PoolDisplayInfo, type PoolOnchainInfo, PoolSearchTool, type PoolSearchToolConfig, PoolService, type PoolServiceConfig, type PresetInputs, PreviewAddLiquidityTool, type PreviewAddLiquidityToolConfig, type PriceBounds, type PriceRangePrefill, type ProviderName, type QuickRate, type RangePreset, type ReActPhase, type ReActStep, type ReActTrace, RelayAdapter, type ResolvedRange, Router, type RouterAssignment, type RouterDecision, SWAP_PROVIDER_CONFIG, SendNativeTool, SendNftTool, SendTokenTool, type StorageProvider, Subagent, type SubagentCard, type SubagentOptions, type SubagentParams, type SubagentResult, type SubagentTask, type SubagentToggles, SubgraphCoinPoolPairsTool, type SubgraphCoinPoolPairsToolConfig, SubgraphPoolByAddressTool, type SubgraphPoolByAddressToolConfig, SubgraphPoolByPositionIdTool, type SubgraphPoolByPositionIdToolConfig, SubgraphPoolSearchTool, type SubgraphPoolSearchToolConfig, SubgraphPositionDetailTool, type SubgraphPositionDetailToolConfig, SubgraphTrendingPoolsTool, type SubgraphTrendingPoolsToolConfig, type SuggestedAction, Summarizer, type SwapQuoteParams, type SwapQuoteResult, type SwapServiceConfig, SwapServiceFactory, type SwapTokenConfirmTxProps, SwapTokenTool, type SwapTxData, Synthesizer, TOKEN_AGENT_TOOL_NAMES, TRANSFER_TOPIC, TRENDING_DEFAULT_BY_HEX_CHAIN, type TokenAnalyticsResponse, type TokenAnalyticsTimeframeBuckets, TokenAnalyticsTool, type TokenAnalyticsToolConfig, type TokenApproval, type TokenApprovalSpender, type TokenApprovalToken, type TokenBalance, type TokenDisplay, type TokenHoldersResponse, TokenHoldersTool, type TokenHoldersToolConfig, TokenInfoTool, type TokenInfoToolConfig, type TokenMetadata, type TokenScoreMetrics, type TokenScoreResponse, type TokenScoreSupply, type TokenScoreTimeframeBuckets, TokenScoreTool, type TokenScoreToolConfig, type Tool, type ToolDefinition, type ToolKind, type ToolParameter, ToolRegistry, type ToolResult, type TopGainerTimeFrames, type TopGainerToken, type TopGainersTimeFrame, TopGainersTool, type TopGainersToolConfig, TopPoolsTool, type TopPoolsToolConfig, type TrackStatus, type TrackTransactionParams, type TrackTransactionResult, type TransactionByHashResponse, TransactionByHashTool, type TransactionByHashToolConfig, type TransactionLog, type TransactionReceipt, type TransactionReceiptLog, type TrendingToken, type TrendingTokenTimeframeBuckets, TrendingTokensTool, type TrendingTokensToolConfig, type UIPayload, UNISWAP_CHAIN_SLUG, type UnsignedTx, type UpstashEmbedStrategy, type UpstashFusionAlgorithm, type UpstashKBUpsertEntry, UpstashKnowledgeBase, type UpstashKnowledgeBaseConfig, type UserContext, type VectorKBConfig, WALLET_ACTION_AGENT_TOOL_NAMES, WALLET_AGENT_TOOL_NAMES, type WalletActionProps, type WalletActionType, type WalletApprovalsResponse, WalletApprovalsTool, type WalletApprovalsToolConfig, type WalletDefiPositionSummary, WalletDefiPositionsTool, type WalletDefiPositionsToolConfig, type WalletDefiPositionsV1Response, type WalletDefiProtocolPositionsResponse, WalletDefiProtocolPositionsTool, type WalletDefiProtocolPositionsToolConfig, type WalletDefiProtocolPositionsV1Response, type WalletDefiSummaryResponse, WalletDefiSummaryTool, type WalletDefiSummaryToolConfig, type WalletHistoryCategory, type WalletHistoryContractInteraction, type WalletHistoryErc20Transfer, type WalletHistoryItem, type WalletHistoryNativeTransfer, type WalletHistoryNftTransfer, type WalletHistoryResponse, WalletHistoryTool, type WalletHistoryToolConfig, WalletNFTsTool, type WalletNFTsToolConfig, type WalletNetWorthChainBreakdown, type WalletNetWorthResponse, WalletNetWorthTool, type WalletNetWorthToolConfig, type WalletNetWorthUnavailableChain, type WalletNftTransferItem, type WalletNftTransfersResponse, WalletNftTransfersTool, type WalletNftTransfersToolConfig, type WalletPnlDaysWindow, type WalletPnlResponse, type WalletPnlSummaryResponse, WalletPnlSummaryTool, type WalletPnlSummaryToolConfig, type WalletPnlTokenItem, WalletPnlTool, type WalletPnlToolConfig, WalletTokenBalancesTool, type WalletTokenBalancesToolConfig, type WalletTokenTransferItem, type WalletTokenTransfersResponse, WalletTokenTransfersTool, type WalletTokenTransfersToolConfig, ZERO_ADDRESS, buildRangePresets, buildUniswapPoolUrl, clampTick, createAiAgent, createDefaultSubagents, createNftAgent, createPoolAgent, createTokenAgent, createWalletActionAgent, createWalletAgent, ethCallAt, ethCallByChain, getAffiliateFee, getChainMeta, getDefaultRpcUrl, getGatewayAddress, getNativeTokenInfo, getPositionManagerAddress, getProviderByChain, ingestKnowledgeBase, priceToTick, resolveRpcUrl, roundTickToSpacing, rpcCall, setRpcOverrides, swapServiceFactory, tickToPrice, toPantographChain };
6733
+ export { AI_AGENT_TOOL_NAMES, type AddLiquidityFormProps, type AddLiquiditySummary, type AffiliateFee, type AgentConfig, AgentCore, type AgentResponse, ApproveTokenTool, BaseNftMessageTool, BaseSwapService, BaseTool, BaseWalletActionTool, type BuyTokenConfirmTxProps, type BuyTokenSide, BuyTokenTool, type ChainMeta, type ChainRef, type ChainSelector, ChatHistory, type ChatMessage, type ChatOptions, type ChatRole, type CheckApprovalParams, type CheckApprovalResult, type ConfirmAddLiquidityTxProps, type CortexResponse, DEFAULT_CHAIN, DEFAULT_PROVIDER, DEFAULT_RPC_BY_CHAIN, DebridgeAdapter, type DecodedCall, type DecodedEvent, type DecodedParam, type DefaultSubagentName, type DefiPosition, type DefiPositionDetails, type DefiPositionToken, type DefiProtocolSummary, EstimatePoolYieldTool, type EstimatePoolYieldToolConfig, type ExchangeProviderConfig, type ExecuteSwapParams, type ExecuteSwapResult, GeminiProvider, GeminiSearchAiTool, type GeminiSearchAiToolConfig, HEX_TO_PANTOGRAPH, type HolderChangePeriod, type HolderSupplyTier, type IngestKnowledgeBaseInput, type IngestKnowledgeBaseResult, type InputTokenInfo, type KBSearchResult, KnowledgeBase, type KnowledgeBaseEntry, type KnowledgeBaseProvider, type LLMProvider, type LLMProviderConfig, type LLMResponse, type LLMToolCall, type MoralisApiResponse, MoralisService, type MoralisServiceConfig, NFTContractInfoTool, type NFTContractInfoToolConfig, type NFTContractMetadata, type NFTItem, type NFTLastSale, type NFTMetadata, NFTMetadataTool, type NFTMetadataToolConfig, NFT_AGENT_TOOL_NAMES, type NativeTokenInfo, type NftMessageToolConfig, type NftTransferLastSale, OpenAddLiquidityFormTool, type OpenAddLiquidityFormToolConfig, POOL_AGENT_TOOL_NAMES, PantographService, type PantographServiceConfig, type PaymentToken, PoolByAddressTool, type PoolByAddressToolConfig, PoolDetailTool, type PoolDetailToolConfig, type PoolDisplayInfo, type PoolOnchainInfo, PoolSearchTool, type PoolSearchToolConfig, PoolService, type PoolServiceConfig, type PresetInputs, PreviewAddLiquidityTool, type PreviewAddLiquidityToolConfig, type PriceBounds, type PriceRangePrefill, type ProviderName, type QuickRate, type RangePreset, type ReActPhase, type ReActStep, type ReActTrace, RelayAdapter, type ResolvedRange, Router, type RouterAssignment, type RouterDecision, SUPPORTED_CHAINS, SUPPORTED_CHAINS_LABEL, SWAP_PROVIDER_CONFIG, SendNativeTool, SendNftTool, SendTokenTool, type StorageProvider, Subagent, type SubagentCard, type SubagentOptions, type SubagentParams, type SubagentResult, type SubagentTask, type SubagentToggles, SubgraphCoinPoolPairsTool, type SubgraphCoinPoolPairsToolConfig, SubgraphPoolByAddressTool, type SubgraphPoolByAddressToolConfig, SubgraphPoolByPositionIdTool, type SubgraphPoolByPositionIdToolConfig, SubgraphPoolSearchTool, type SubgraphPoolSearchToolConfig, SubgraphPositionDetailTool, type SubgraphPositionDetailToolConfig, SubgraphTrendingPoolsTool, type SubgraphTrendingPoolsToolConfig, type SuggestedAction, Summarizer, type SupportedChainId, type SupportedChainName, type SwapQuoteParams, type SwapQuoteResult, type SwapServiceConfig, SwapServiceFactory, type SwapTokenConfirmTxProps, SwapTokenTool, type SwapTxData, Synthesizer, TOKEN_AGENT_TOOL_NAMES, TRANSFER_TOPIC, TRENDING_DEFAULT_BY_HEX_CHAIN, type TokenAnalyticsResponse, type TokenAnalyticsTimeframeBuckets, TokenAnalyticsTool, type TokenAnalyticsToolConfig, type TokenApproval, type TokenApprovalSpender, type TokenApprovalToken, type TokenBalance, type TokenDisplay, type TokenHoldersResponse, TokenHoldersTool, type TokenHoldersToolConfig, TokenInfoTool, type TokenInfoToolConfig, type TokenMetadata, type TokenScoreMetrics, type TokenScoreResponse, type TokenScoreSupply, type TokenScoreTimeframeBuckets, TokenScoreTool, type TokenScoreToolConfig, type Tool, type ToolDefinition, type ToolKind, type ToolParameter, ToolRegistry, type ToolResult, type TopGainerTimeFrames, type TopGainerToken, type TopGainersTimeFrame, TopGainersTool, type TopGainersToolConfig, TopPoolsTool, type TopPoolsToolConfig, type TrackStatus, type TrackTransactionParams, type TrackTransactionResult, type TransactionByHashResponse, TransactionByHashTool, type TransactionByHashToolConfig, type TransactionLog, type TransactionReceipt, type TransactionReceiptLog, type TrendingToken, type TrendingTokenTimeframeBuckets, TrendingTokensTool, type TrendingTokensToolConfig, type UIPayload, UNISWAP_CHAIN_SLUG, type UnsignedTx, type UpstashEmbedStrategy, type UpstashFusionAlgorithm, type UpstashKBUpsertEntry, UpstashKnowledgeBase, type UpstashKnowledgeBaseConfig, type UserContext, type VectorKBConfig, WALLET_ACTION_AGENT_TOOL_NAMES, WALLET_AGENT_TOOL_NAMES, type WalletActionProps, type WalletActionType, type WalletApprovalsResponse, WalletApprovalsTool, type WalletApprovalsToolConfig, type WalletDefiPositionSummary, WalletDefiPositionsTool, type WalletDefiPositionsToolConfig, type WalletDefiPositionsV1Response, type WalletDefiProtocolPositionsResponse, WalletDefiProtocolPositionsTool, type WalletDefiProtocolPositionsToolConfig, type WalletDefiProtocolPositionsV1Response, type WalletDefiSummaryResponse, WalletDefiSummaryTool, type WalletDefiSummaryToolConfig, type WalletHistoryCategory, type WalletHistoryContractInteraction, type WalletHistoryErc20Transfer, type WalletHistoryItem, type WalletHistoryNativeTransfer, type WalletHistoryNftTransfer, type WalletHistoryResponse, WalletHistoryTool, type WalletHistoryToolConfig, WalletNFTsTool, type WalletNFTsToolConfig, type WalletNetWorthChainBreakdown, type WalletNetWorthResponse, WalletNetWorthTool, type WalletNetWorthToolConfig, type WalletNetWorthUnavailableChain, type WalletNftTransferItem, type WalletNftTransfersResponse, WalletNftTransfersTool, type WalletNftTransfersToolConfig, type WalletPnlDaysWindow, type WalletPnlResponse, type WalletPnlSummaryResponse, WalletPnlSummaryTool, type WalletPnlSummaryToolConfig, type WalletPnlTokenItem, WalletPnlTool, type WalletPnlToolConfig, WalletTokenBalancesTool, type WalletTokenBalancesToolConfig, type WalletTokenTransferItem, type WalletTokenTransfersResponse, WalletTokenTransfersTool, type WalletTokenTransfersToolConfig, ZERO_ADDRESS, buildRangePresets, buildUniswapPoolUrl, clampTick, configureSupportedChains, createAiAgent, createDefaultSubagents, createNftAgent, createPoolAgent, createTokenAgent, createWalletActionAgent, createWalletAgent, ethCallAt, ethCallByChain, getAffiliateFee, getChainMeta, getDefaultRpcUrl, getGatewayAddress, getNativeTokenInfo, getPositionManagerAddress, getProviderByChain, ingestKnowledgeBase, priceToTick, resolveRpcUrl, roundTickToSpacing, rpcCall, setRpcOverrides, swapServiceFactory, tickToPrice, toPantographChain };