keyring-agent-core 0.2.13 → 0.2.15
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 +24 -10
- package/dist/index.js +51 -51
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1220,9 +1220,9 @@ interface AgentConfig {
|
|
|
1220
1220
|
subgraph?: {
|
|
1221
1221
|
/** The Graph gateway API key. Falls back to a public demo key. */
|
|
1222
1222
|
theGraphApiKey?: string;
|
|
1223
|
-
/** CoinPool pair
|
|
1223
|
+
/** CoinPool pair API base url (`<base>/pair/v2?chainId=…`). */
|
|
1224
1224
|
coinPoolBaseUrl?: string;
|
|
1225
|
-
/**
|
|
1225
|
+
/** @deprecated No longer used — CoinPool `/pair/v2` returns APR + ranges directly. */
|
|
1226
1226
|
keyringPoolBaseUrl?: string;
|
|
1227
1227
|
/** Override subgraph URLs per hex chain id. */
|
|
1228
1228
|
subgraphUrls?: Record<string, string>;
|
|
@@ -1521,6 +1521,14 @@ declare class AgentCore {
|
|
|
1521
1521
|
private suggestionsEnabled;
|
|
1522
1522
|
private historyLoaded;
|
|
1523
1523
|
private historyLoadingPromise;
|
|
1524
|
+
/**
|
|
1525
|
+
* The currently-running chat() turn, if any. A turn writes the user + assistant
|
|
1526
|
+
* (and tool) messages into history at its END, so a clearHistory() that lands
|
|
1527
|
+
* mid-turn must wait for it to finish before wiping — otherwise the turn
|
|
1528
|
+
* repopulates the working window (which the Router/Subagents read) right after
|
|
1529
|
+
* the clear. Null when no turn is in flight.
|
|
1530
|
+
*/
|
|
1531
|
+
private inFlightTurn;
|
|
1524
1532
|
/**
|
|
1525
1533
|
* Resolves once the initial persisted-history load attempt has finished
|
|
1526
1534
|
* (success or failure). Only meaningful when `persistHistory: true` and a
|
|
@@ -3484,19 +3492,25 @@ declare class WalletTokenBalancesTool extends BaseTool {
|
|
|
3484
3492
|
parameters: ToolParameter[];
|
|
3485
3493
|
private service;
|
|
3486
3494
|
constructor(config?: WalletTokenBalancesToolConfig);
|
|
3495
|
+
/**
|
|
3496
|
+
* Format a USD number to EXACTLY 2 decimals by TRUNCATING (never rounding).
|
|
3497
|
+
* Uses string slicing rather than `Math.trunc(v * 100) / 100`, which is unsafe
|
|
3498
|
+
* for values like 0.29 (0.29 * 100 === 28.999999999999996 → would yield 0.28).
|
|
3499
|
+
*/
|
|
3500
|
+
private truncateUsd;
|
|
3487
3501
|
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
3488
3502
|
error: string;
|
|
3503
|
+
_instructions?: undefined;
|
|
3489
3504
|
walletAddress?: undefined;
|
|
3490
3505
|
chain?: undefined;
|
|
3491
|
-
tokenCount?: undefined;
|
|
3492
|
-
tokens?: undefined;
|
|
3493
3506
|
totalUsdValue?: undefined;
|
|
3507
|
+
tokens?: undefined;
|
|
3494
3508
|
} | {
|
|
3509
|
+
_instructions: string;
|
|
3495
3510
|
walletAddress: string;
|
|
3496
3511
|
chain: string;
|
|
3497
|
-
|
|
3512
|
+
totalUsdValue: string;
|
|
3498
3513
|
tokens: string[];
|
|
3499
|
-
totalUsdValue: number;
|
|
3500
3514
|
error?: undefined;
|
|
3501
3515
|
}>;
|
|
3502
3516
|
}
|
|
@@ -5060,9 +5074,9 @@ declare class EstimatePoolYieldTool extends BaseTool {
|
|
|
5060
5074
|
interface SubgraphServiceConfig {
|
|
5061
5075
|
/** The Graph API key. Falls back to a public demo key. */
|
|
5062
5076
|
theGraphApiKey?: string;
|
|
5063
|
-
/** CoinPool pair
|
|
5077
|
+
/** CoinPool pair API base url (`/pair/v2`). */
|
|
5064
5078
|
coinPoolBaseUrl?: string;
|
|
5065
|
-
/**
|
|
5079
|
+
/** @deprecated No longer used — CoinPool `/pair/v2` returns APR + ranges directly. */
|
|
5066
5080
|
keyringPoolBaseUrl?: string;
|
|
5067
5081
|
/** Override a subgraph URL by chain hex id. */
|
|
5068
5082
|
subgraphUrls?: Record<string, string>;
|
|
@@ -5469,8 +5483,8 @@ type SubgraphCoinPoolPairsToolConfig = SubgraphServiceConfig;
|
|
|
5469
5483
|
* user asks about price ranges, "which range to pick", or "best range"
|
|
5470
5484
|
* for a known token pair.
|
|
5471
5485
|
*
|
|
5472
|
-
*
|
|
5473
|
-
*
|
|
5486
|
+
* Backed by the CoinPool `/pair/v2` endpoint (`coinPoolBaseUrl`). Returns an
|
|
5487
|
+
* empty list when that base url is unset or the chain is unsupported.
|
|
5474
5488
|
*/
|
|
5475
5489
|
declare class SubgraphCoinPoolPairsTool extends BaseTool {
|
|
5476
5490
|
name: string;
|