keyring-agent-core 0.2.19 → 0.2.21
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 +65 -14
- package/dist/index.js +75 -62
- package/dist/index.native.js +1468 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1445,12 +1445,15 @@ interface RewriteResult {
|
|
|
1445
1445
|
*/
|
|
1446
1446
|
mentionedChain: string;
|
|
1447
1447
|
/**
|
|
1448
|
-
* True when answering THIS message
|
|
1449
|
-
* data (current prices, recent news, latest
|
|
1450
|
-
*
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
1453
|
-
*
|
|
1448
|
+
* True when answering THIS message benefits from live/EXTERNAL web data —
|
|
1449
|
+
* covering BOTH time-sensitive data (current prices, recent news, latest
|
|
1450
|
+
* events, "today/now/latest", market comparisons) AND research / information-
|
|
1451
|
+
* seeking questions about a specific external subject (a project, token,
|
|
1452
|
+
* protocol, company, person, event, or technology — "what is X?", "tell me
|
|
1453
|
+
* about Y", "explain how Z works"). False only for greetings, chit-chat,
|
|
1454
|
+
* references to the conversation itself, the assistant's own identity, and
|
|
1455
|
+
* requests another subagent handles. Only consumed on the direct-answer path
|
|
1456
|
+
* (no subagent assignment) to decide whether to enable Google Search grounding.
|
|
1454
1457
|
*/
|
|
1455
1458
|
needsWebSearch: boolean;
|
|
1456
1459
|
/**
|
|
@@ -3541,20 +3544,42 @@ declare class WalletTokenBalancesTool extends BaseTool {
|
|
|
3541
3544
|
*/
|
|
3542
3545
|
private truncateUsd;
|
|
3543
3546
|
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
3544
|
-
error: string;
|
|
3545
|
-
_instructions?: undefined;
|
|
3546
|
-
walletAddress?: undefined;
|
|
3547
|
-
chain?: undefined;
|
|
3548
|
-
totalUsdValue?: undefined;
|
|
3549
|
-
tokens?: undefined;
|
|
3550
|
-
} | {
|
|
3551
3547
|
_instructions: string;
|
|
3552
3548
|
walletAddress: string;
|
|
3553
3549
|
chain: string;
|
|
3554
3550
|
totalUsdValue: string;
|
|
3555
3551
|
tokens: string[];
|
|
3556
|
-
|
|
3552
|
+
} | {
|
|
3553
|
+
_instructions: string;
|
|
3554
|
+
walletAddress: string;
|
|
3555
|
+
chain: string;
|
|
3556
|
+
totalUsdValue: string;
|
|
3557
|
+
chains: {
|
|
3558
|
+
chain: string;
|
|
3559
|
+
totalUsdValue: string;
|
|
3560
|
+
tokens: string[];
|
|
3561
|
+
}[];
|
|
3562
|
+
} | {
|
|
3563
|
+
error: string;
|
|
3557
3564
|
}>;
|
|
3565
|
+
/** One pre-rendered bullet "- name: amount symbol ($value)" for a holding.
|
|
3566
|
+
* Amount is shown in FULL (never shortened/rounded); USD value is truncated to
|
|
3567
|
+
* 2 decimals — built here so the numbers reach the user verbatim. */
|
|
3568
|
+
private toTokenLine;
|
|
3569
|
+
/**
|
|
3570
|
+
* SINGLE-chain render: a flat bullet list in the API's order, plus the chain
|
|
3571
|
+
* total. Used when the user (or their connected wallet) named one chain.
|
|
3572
|
+
*/
|
|
3573
|
+
private renderBalances;
|
|
3574
|
+
/**
|
|
3575
|
+
* ALL-CHAINS render: balances GROUPED BY CHAIN. Each group carries its chain
|
|
3576
|
+
* name, that chain's subtotal, and its token bullets (sorted by USD value,
|
|
3577
|
+
* largest first). Empty chains are dropped; groups are ordered by subtotal so
|
|
3578
|
+
* the chain holding the most leads. The synthesizer renders one section per
|
|
3579
|
+
* chain (chain name → its bullets), so the user sees their holdings organised
|
|
3580
|
+
* per network rather than one undifferentiated list.
|
|
3581
|
+
*/
|
|
3582
|
+
private renderBalancesByChain;
|
|
3558
3583
|
}
|
|
3559
3584
|
|
|
3560
3585
|
type WalletHistoryToolConfig = MoralisServiceConfig;
|
|
@@ -6200,6 +6225,32 @@ declare class BuyTokenTool extends BaseTool {
|
|
|
6200
6225
|
* leaves the LLM's assignment untouched, so a correct call is never worsened.
|
|
6201
6226
|
*/
|
|
6202
6227
|
private correctAmountSide;
|
|
6228
|
+
/**
|
|
6229
|
+
* Drop a PAY token the LLM invented. The model sometimes defaults the payment
|
|
6230
|
+
* side to the native coin — filling `pay_with_symbol` "ETH" / `pay_with_address`
|
|
6231
|
+
* "native" — even when the user only named the token to BUY ("buy A"). That
|
|
6232
|
+
* silently skips the pay-token picker (Branch 1) and spends a token the user
|
|
6233
|
+
* never chose. When a dest token IS named, a pay token IS set, and the raw
|
|
6234
|
+
* query contains NO standalone reference to that pay token (its symbol, its
|
|
6235
|
+
* address, the literal word "native", or the chain's native symbol), clear the
|
|
6236
|
+
* pay side so the picker runs. Conservative: only acts when the query is
|
|
6237
|
+
* available and the pay token is verifiably absent, so a genuinely-named pay
|
|
6238
|
+
* token is never lost.
|
|
6239
|
+
*/
|
|
6240
|
+
private dropUnmentionedPayToken;
|
|
6241
|
+
/**
|
|
6242
|
+
* Drop an AMOUNT the LLM invented. The user may give NO amount ("buy A", "buy
|
|
6243
|
+
* A with USDC") yet the model sometimes fills `buy_amount` / `pay_with_amount`
|
|
6244
|
+
* with a number the user never said — skipping the amount picker and seeding a
|
|
6245
|
+
* quote for a made-up size. When an amount carries DIGITS (a plain number,
|
|
6246
|
+
* "50%", or "5$") and NO number of the same value appears anywhere in the raw
|
|
6247
|
+
* query, it was invented → clear it so the amount picker runs. A digit-less
|
|
6248
|
+
* "max"/"all" intent is left untouched: the LLM normalizes those words across
|
|
6249
|
+
* languages, so the literal can't be matched against the query (and a random
|
|
6250
|
+
* "max" is an unlikely fabrication anyway). Only acts when the raw query is
|
|
6251
|
+
* available; value-based matching tolerates formatting drift ("0.5" vs ".5").
|
|
6252
|
+
*/
|
|
6253
|
+
private dropInventedAmounts;
|
|
6203
6254
|
/**
|
|
6204
6255
|
* Decide which named token an amount sits next to in the raw query by text
|
|
6205
6256
|
* proximity. Returns 'buy' / 'pay' for the closer symbol, or `null` when the
|