keyring-agent-core 0.4.14 → 0.4.16

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
@@ -240,6 +240,74 @@ declare class DebridgeProvider extends BaseSwapProvider {
240
240
  private get;
241
241
  }
242
242
 
243
+ /** An amount in a `/requests/v3` route: `{ currency, amount, amountFormatted, amountUsd }`. */
244
+ interface RelayRouteAmount {
245
+ currency?: {
246
+ chainId?: number;
247
+ address?: string;
248
+ symbol?: string;
249
+ decimals?: number;
250
+ };
251
+ amount?: string;
252
+ amountFormatted?: string;
253
+ amountUsd?: string | null;
254
+ }
255
+ interface RelayRouteSide {
256
+ inputCurrency?: RelayRouteAmount;
257
+ outputCurrency?: RelayRouteAmount;
258
+ }
259
+ interface RelayRequestTx {
260
+ txHash?: string;
261
+ chainId?: number;
262
+ status?: string;
263
+ }
264
+ /** One entry of `GET /requests/v3` → `requests[]`, the fields read here. */
265
+ interface RelayRequestItem {
266
+ id?: string;
267
+ status?: string;
268
+ data?: {
269
+ failReason?: string | null;
270
+ route?: {
271
+ quoted?: {
272
+ origin?: RelayRouteSide;
273
+ destination?: RelayRouteSide;
274
+ };
275
+ actual?: {
276
+ origin?: RelayRouteSide;
277
+ destination?: RelayRouteSide;
278
+ };
279
+ };
280
+ inTxs?: RelayRequestTx[];
281
+ outTxs?: RelayRequestTx[];
282
+ };
283
+ }
284
+ /** Lookup key for {@link RelayProvider.getRequestDetail}: the request id, or any tx hash of it. */
285
+ interface RelayRequestDetailParams {
286
+ requestId?: string;
287
+ txHash?: string;
288
+ }
289
+ /** What a settled (or still running) Relay request delivered. */
290
+ interface RelayRequestDetail {
291
+ success: boolean;
292
+ /** Relay's status mapped onto the tracker's: `success`/`refund` → COMPLETED, `failure` → FAILED. */
293
+ status: TrackStatus;
294
+ /** Relay's own status string (`success`, `pending`, `refund`, …). */
295
+ relayStatus?: string;
296
+ requestId?: string;
297
+ /**
298
+ * What the user RECEIVED, in the out token's smallest units — read from
299
+ * `route.actual`, so it is the executed figure, not the quote. Only set when
300
+ * Relay's status is `success`: before that `actual` mirrors the quote, and a
301
+ * `refund` (COMPLETED too) never delivered the out token.
302
+ */
303
+ amountOut?: string;
304
+ amountOutFormatted?: string;
305
+ amountOutUsd?: string | null;
306
+ currencyOut?: RelayRouteAmount['currency'];
307
+ failReason?: string | null;
308
+ raw?: RelayRequestItem;
309
+ error?: string;
310
+ }
243
311
  /**
244
312
  * Relay.link adapter. Relay bundles approval + swap into a single quote, so
245
313
  * `hasIntegratedApproval` is true.
@@ -267,6 +335,21 @@ declare class RelayProvider extends BaseSwapProvider {
267
335
  */
268
336
  checkApproval(params: CheckApprovalParams): Promise<CheckApprovalResult>;
269
337
  trackTransaction(params: TrackTransactionParams): Promise<TrackTransactionResult>;
338
+ /**
339
+ * One request's executed result from `GET /requests/v3` — above all what the
340
+ * user actually RECEIVED (`route.actual`), which can differ from the quote.
341
+ * Looks up by `requestId` when given, then (nothing found) by any of its tx
342
+ * hashes (`term`). `/requests/v2` (and its `hash` filter) was retired on 2026-11-24.
343
+ * @param params `{ requestId?, txHash? }`.
344
+ * @returns The request's status and received amount; never throws.
345
+ */
346
+ getRequestDetail(params: RelayRequestDetailParams): Promise<RelayRequestDetail>;
347
+ /**
348
+ * `GET /requests/v3` with one filter, pending requests included.
349
+ * @param filter `{ id }` or `{ term }`.
350
+ * @returns `requests[]`, empty when none matched.
351
+ */
352
+ private findRequests;
270
353
  private request;
271
354
  }
272
355
 
@@ -889,10 +972,10 @@ declare class PoolService {
889
972
  * value1_in_t1 = amount1_raw / 10^d1
890
973
  * ratio0 = value0_in_t1 / (value0 + value1)
891
974
  *
892
- * Note: this assumes 1 native ↔ 1 token0 / 1 token1 in *value* — fine when
893
- * native is one of the pool tokens. When neither is native, swap
894
- * fees/spreads pull the deposit slightly off ratio and the gateway's
895
- * refund leg picks up the dust.
975
+ * Note: this values both legs at the POOL price. When the market the swap
976
+ * legs trade at disagrees with it, the caller re-splits with the quoted
977
+ * rates (`rebalanceSplitForRates`). `amount0PerL` / `amount1PerL` are
978
+ * returned for that.
896
979
  */
897
980
  splitNativeAmountForRange(args: {
898
981
  nativeAmountWei: bigint;
@@ -906,14 +989,43 @@ declare class PoolService {
906
989
  ratio1: number;
907
990
  amountInFor0Wei: bigint;
908
991
  amountInFor1Wei: bigint;
992
+ amount0PerL: number;
993
+ amount1PerL: number;
909
994
  };
995
+ /**
996
+ * Re-split a native deposit with the rates the swap quotes actually gave.
997
+ *
998
+ * `splitNativeAmountForRange` values both legs at the POOL price. When the
999
+ * market (what the swap legs pay) disagrees with the pool — an illiquid pool
1000
+ * left behind the market — the legs come back off the pool's ratio and the
1001
+ * mint uses only part of one side. Solving with the quoted rates instead:
1002
+ * in0·r0·k = in1·r1, in0 + in1 = N → in0 = N·r1 / (r1 + k·r0)
1003
+ * where k = amount1PerL / amount0PerL (raw token1 per raw token0 the range needs).
1004
+ *
1005
+ * @param args.nativeAmountWei Total native input (wei).
1006
+ * @param args.amount0PerL Raw token0 per unit of liquidity (from the pool split).
1007
+ * @param args.amount1PerL Raw token1 per unit of liquidity (from the pool split).
1008
+ * @param args.rate0 Raw token0 out per wei in (from the token0 leg's quote).
1009
+ * @param args.rate1 Raw token1 out per wei in (from the token1 leg's quote).
1010
+ * @returns The new wei split, or null when the rates can't be used.
1011
+ */
1012
+ rebalanceSplitForRates(args: {
1013
+ nativeAmountWei: bigint;
1014
+ amount0PerL: number;
1015
+ amount1PerL: number;
1016
+ rate0: number;
1017
+ rate1: number;
1018
+ }): {
1019
+ amountInFor0Wei: bigint;
1020
+ amountInFor1Wei: bigint;
1021
+ } | null;
910
1022
  /**
911
1023
  * Fetches a single-leg same-chain swap quote (native → token) used to mix
912
1024
  * the user's native input into pool token0 / token1 before minting.
913
1025
  *
914
1026
  * Provider is picked by `SwapProviderFactory` on the `'pool'` route: the
915
1027
  * coinpool `bridgeProviderByChain` config, keyed on the chain id. The return
916
- * shape is normalised: `{ to, data, value, minAmountOut }`, regardless of
1028
+ * shape is normalised: `{ to, data, value, minAmountOut, amountOut? }`, regardless of
917
1029
  * provider.
918
1030
  *
919
1031
  * Throws on failure; caller decides whether to surface or skip.
@@ -938,6 +1050,8 @@ declare class PoolService {
938
1050
  data: string;
939
1051
  value: string;
940
1052
  minAmountOut: string;
1053
+ /** Expected out (before slippage), when the provider gives it. */
1054
+ amountOut?: string;
941
1055
  }>;
942
1056
  }
943
1057
 
@@ -1382,6 +1496,13 @@ interface ChatMessage {
1382
1496
  * don't appear as duplicate model turns alongside the synthesised answer.
1383
1497
  */
1384
1498
  _intermediate?: boolean;
1499
+ /**
1500
+ * Raw model parts of an assistant turn that made function calls (from
1501
+ * {@link LLMResponse.modelParts}). Replayed verbatim so each
1502
+ * `thoughtSignature` stays on its original part. Absent on history saved by
1503
+ * older versions: the turn is then rebuilt from `toolCalls`.
1504
+ */
1505
+ modelParts?: ModelPart[];
1385
1506
  timestamp: number;
1386
1507
  }
1387
1508
  /**
@@ -1606,6 +1727,12 @@ interface PredictionEventCardProps {
1606
1727
  detailPrompt: string;
1607
1728
  /** Localized detail-button label. Empty → the FE uses its own translation. */
1608
1729
  detailLabel: string;
1730
+ /**
1731
+ * One or two sentences in the turn language on what the market asks and how it
1732
+ * is decided (deadline, resolution source) — no odds. Absent when it could not
1733
+ * be written in time; the card then shows none.
1734
+ */
1735
+ summary?: string;
1609
1736
  /**
1610
1737
  * A recurring crypto "Up or Down" window: the trade drawer opened from the card
1611
1738
  * adds its live panel (price to beat, current price, countdown, then the
@@ -2491,6 +2618,12 @@ interface UserContext {
2491
2618
  * it's the buy-side or pay-side amount. Optional; absent on programmatic calls.
2492
2619
  */
2493
2620
  query?: string;
2621
+ /**
2622
+ * BCP-47 language of the current turn (e.g. "vi", "en"), set per tool call by
2623
+ * the subagent from the rewriter's detection. Tools that show third-party text
2624
+ * (e.g. Polymarket's English rules) translate it into this. Absent when undetected.
2625
+ */
2626
+ language?: string;
2494
2627
  }
2495
2628
  /**
2496
2629
  * Platform-agnostic storage interface.
@@ -2559,12 +2692,10 @@ interface VectorKBConfig {
2559
2692
  provider?: KnowledgeBaseProvider;
2560
2693
  }
2561
2694
  interface LLMProviderConfig {
2562
- /** Model name, e.g. "gemini-2.5-flash" */
2695
+ /** Model name. Only "gemini-3.5-flash-lite" (the default) is supported. */
2563
2696
  model?: string;
2564
2697
  /** Max tokens for generation */
2565
2698
  maxTokens?: number;
2566
- /** Temperature (0-2) */
2567
- temperature?: number;
2568
2699
  /**
2569
2700
  * Bring-your-own Gemini API key. When set, the core talks DIRECTLY to
2570
2701
  * `https://generativelanguage.googleapis.com` with this key instead of
@@ -2575,21 +2706,18 @@ interface LLMProviderConfig {
2575
2706
  apiKey?: string;
2576
2707
  /**
2577
2708
  * Base URL override. Defaults to the Keyring proxy
2578
- * ("https://nft.keyring.app/api/gemini-stable"), or to
2709
+ * ("https://nft.keyring.app/api/gemini-stable-v2"), or to
2579
2710
  * "https://generativelanguage.googleapis.com" when {@link apiKey} is set.
2580
2711
  */
2581
2712
  baseUrl?: string;
2582
2713
  /**
2583
- * Provider-wide default Gemini thinking budget, used by every call that does
2584
- * not pass its own {@link ChatOptions.thinkingBudget}. Defaults to `0`
2585
- * (thinking OFF): on `gemini-2.5-flash` thinking is otherwise dynamic and its
2586
- * reasoning tokens are generated sequentially before any visible output — the
2587
- * single biggest per-call latency cost. The agent's prompts are tuned for
2588
- * no-thinking (the Flash-Lite default). `null` omits `thinkingConfig` entirely
2589
- * (the model's native default); a positive number sets a fixed budget. Models
2590
- * whose thinking cannot be disabled (e.g. 2.5 Pro, floor 128) need a value here.
2714
+ * Provider-wide default thinking level, used by every call that does not pass
2715
+ * its own {@link ChatOptions.thinkingLevel}. Defaults to `'minimal'`
2716
+ * (near-off): thinking tokens are generated before any visible output and
2717
+ * count against `maxOutputTokens`, so they are pure latency on calls that
2718
+ * don't need them. `null` omits `thinkingConfig` (the model's own default).
2591
2719
  */
2592
- thinkingBudget?: number | null;
2720
+ thinkingLevel?: ThinkingLevel | null;
2593
2721
  }
2594
2722
  interface AgentConfig {
2595
2723
  /**
@@ -2622,7 +2750,9 @@ interface AgentConfig {
2622
2750
  * runs, so quotes taken through the agent carry the same key (rate limits,
2623
2751
  * attribution) as the ones the app takes directly.
2624
2752
  *
2625
- * Omit it and the providers fall back to their built-in public endpoints.
2753
+ * Omit it and the providers fall back to their built-in public endpoints —
2754
+ * except Relay: `/quote/v3` and `/requests/v3` require an API key, so without
2755
+ * `relay.apiKey` every Relay quote fails with 401.
2626
2756
  */
2627
2757
  swapProviders?: Partial<Record<'debridge' | 'relay', {
2628
2758
  apiKey?: string;
@@ -2887,15 +3017,32 @@ interface LLMToolCall {
2887
3017
  args: Record<string, unknown>;
2888
3018
  callId: string;
2889
3019
  }
3020
+ /**
3021
+ * One raw Gemini content part (`text`, `functionCall`, `thoughtSignature`, …),
3022
+ * kept opaque so it can be replayed exactly as the API returned it.
3023
+ */
3024
+ type ModelPart = Record<string, unknown>;
3025
+ /**
3026
+ * Gemini thinking level. `minimal` is near-off (the gemini-3.5-flash-lite
3027
+ * default); thinking cannot be turned fully off.
3028
+ */
3029
+ type ThinkingLevel = 'minimal' | 'low' | 'medium' | 'high';
2890
3030
  interface LLMResponse {
2891
3031
  text: string;
2892
3032
  toolCalls: LLMToolCall[];
3033
+ /**
3034
+ * The model turn's parts exactly as returned. Store them on the assistant
3035
+ * message ({@link ChatMessage.modelParts}) when it is replayed in history:
3036
+ * Gemini validates the `thoughtSignature` on function calls and requires it
3037
+ * back in the exact part it came in.
3038
+ */
3039
+ modelParts?: ModelPart[];
2893
3040
  /** Raw usage stats from the provider */
2894
3041
  usage?: {
2895
3042
  promptTokens: number;
2896
3043
  completionTokens: number;
2897
3044
  totalTokens: number;
2898
- /** Reasoning tokens spent before the visible output (Gemini 2.5 thinking). */
3045
+ /** Reasoning tokens spent before the visible output (Gemini thinking). */
2899
3046
  thoughtsTokens?: number;
2900
3047
  /** Prompt tokens served from Gemini's (implicit) context cache. */
2901
3048
  cachedTokens?: number;
@@ -2924,17 +3071,14 @@ interface ChatOptions {
2924
3071
  */
2925
3072
  maxOutputTokens?: number;
2926
3073
  /**
2927
- * Gemini 2.5 thinking budget, in tokens. These models spend reasoning
2928
- * ("thinking") tokens that count AGAINST `maxOutputTokens` and are generated
2929
- * before any visible output — so thinking is pure added latency on calls that
2930
- * don't need it, and a tight cap can be consumed entirely by reasoning
2931
- * (`MAX_TOKENS` with no output). Thinking is therefore OFF by default for every
2932
- * call (see {@link LLMProviderConfig.thinkingBudget}). Override per call: `0`
2933
- * forces it off, `-1` dynamic, a positive number a fixed budget, and `null`
2934
- * omits `thinkingConfig` so the model's native default applies. Leave unset to
2935
- * use the provider default.
3074
+ * Thinking level for this call, overriding
3075
+ * {@link LLMProviderConfig.thinkingLevel}. Thinking tokens count AGAINST
3076
+ * `maxOutputTokens`, so a tight cap can be consumed entirely by reasoning
3077
+ * (`MAX_TOKENS` with no output): raise the cap with the level. `null` omits
3078
+ * `thinkingConfig` so the model's own default applies. Leave unset to use the
3079
+ * provider default.
2936
3080
  */
2937
- thinkingBudget?: number | null;
3081
+ thinkingLevel?: ThinkingLevel | null;
2938
3082
  /**
2939
3083
  * Force the model to call one of the supplied `tools` instead of answering in
2940
3084
  * text (Gemini `functionCallingConfig.mode = "ANY"`). Used by action subagents
@@ -3536,7 +3680,7 @@ declare class AgentCore {
3536
3680
  */
3537
3681
  interface WebsiteTrustKeyringAgentConfig {
3538
3682
  /**
3539
- * Gemini LLM config (model / baseUrl / temperature). Omit to use the default
3683
+ * Gemini LLM config (model / baseUrl / apiKey). Omit to use the default
3540
3684
  * proxy. Ignored when an explicit `provider` is supplied.
3541
3685
  */
3542
3686
  llm?: LLMProviderConfig;
@@ -3754,13 +3898,6 @@ declare class WebsiteTrustKeyringAgent {
3754
3898
  * phishing) — features of a flagged look-alike are never advertised.
3755
3899
  */
3756
3900
  private present;
3757
- /**
3758
- * Resolve a caller-supplied language (a BCP-47 tag like "vi" or a name) to an
3759
- * explicit English language NAME the model cannot misread. Bare tags like "vi"
3760
- * are sometimes ignored; "Vietnamese" is unambiguous. Unknown values pass
3761
- * through unchanged (a full name like "Tiếng Việt" already works).
3762
- */
3763
- private languageLabel;
3764
3901
  /**
3765
3902
  * System instruction for user-facing presentation calls. Reinforces — at the
3766
3903
  * system level — the inline language directive in the prompt. Pass an explicit
@@ -3790,13 +3927,13 @@ declare class WebsiteTrustKeyringAgent {
3790
3927
  * sized just above the real output keeps latency from the odd rambling turn
3791
3928
  * without ever truncating a valid reply. Omit to fall back to the provider
3792
3929
  * default (4096).
3793
- * - `thinkingBudget` controls the Gemini 2.5 reasoning budget (tokens count
3794
- * AGAINST `maxOutputTokens`). The provider defaults it to 0 (off), so a
3795
- * formatting/extraction call spends its
3796
- * whole budget on real output. The one call that needs real reasoning —
3797
- * {@link investigate}, which must correctly judge official vs. look-alike —
3798
- * passes an explicit positive budget AND a cap wide enough to hold thinking +
3799
- * JSON, so accuracy is preserved without re-triggering MAX_TOKENS.
3930
+ * - `thinkingLevel` controls Gemini reasoning (thinking tokens count AGAINST
3931
+ * `maxOutputTokens`). The provider defaults it to `minimal` (near-off), so a
3932
+ * formatting/extraction call spends its whole budget on real output. The one
3933
+ * call that needs real reasoning — {@link investigate}, which must correctly
3934
+ * judge official vs. look-alike — passes a higher level AND a cap wide enough
3935
+ * to hold thinking + JSON, so accuracy is preserved without re-triggering
3936
+ * MAX_TOKENS.
3800
3937
  */
3801
3938
  private askJson;
3802
3939
  /**
@@ -3904,6 +4041,99 @@ declare class WebsiteTrustKeyringAgent {
3904
4041
  private dedupe;
3905
4042
  }
3906
4043
 
4044
+ /**
4045
+ * Configuration for {@link TranslateKeyringAgent}.
4046
+ *
4047
+ * Self-contained like {@link WebsiteTrustKeyringAgent}: no {@link AgentCore}
4048
+ * pipeline needed. Construct once and call {@link TranslateKeyringAgent.chat}.
4049
+ */
4050
+ interface TranslateKeyringAgentConfig {
4051
+ /** Gemini LLM config (model / baseUrl / apiKey). Ignored when `provider` is supplied. */
4052
+ llm?: LLMProviderConfig;
4053
+ /** Bring your own LLM provider (e.g. a shared instance). Overrides `llm`. */
4054
+ provider?: LLMProvider;
4055
+ /**
4056
+ * License key gating use of the Keyring-hosted Gemini proxy, exactly as in
4057
+ * {@link AgentCore.secretKey}. Validated lazily on the first `chat()` call.
4058
+ * Optional only when `llm.apiKey` is set (bring-your-own-key mode).
4059
+ */
4060
+ secretKey?: string;
4061
+ /**
4062
+ * How long (ms) a translation is reused for the same text + languages + context.
4063
+ * Defaults to 30 days — the key is the text itself, so a changed text is a new
4064
+ * entry; `0` disables caching. The in-memory cache is shared by every instance.
4065
+ */
4066
+ cacheTtlMs?: number;
4067
+ /** Persist the cache across restarts — Web: `localStorage`, React Native: `AsyncStorage`. */
4068
+ cacheStorage?: StorageProvider;
4069
+ /** Enable debug logging. */
4070
+ debug?: boolean;
4071
+ }
4072
+ /** Input for one translation ({@link TranslateKeyringAgent.chat}). */
4073
+ interface TranslateInput {
4074
+ /** The text to translate. Markdown, line breaks and emoji are preserved. */
4075
+ text: string;
4076
+ /** Desired output language — a BCP-47 tag ("vi", "en", "zh-TW") or a language name. */
4077
+ targetLanguage: string;
4078
+ /** Language of `text`, if known. Omit to let the model detect it. */
4079
+ sourceLanguage?: string;
4080
+ /**
4081
+ * Optional hint about where the text comes from (e.g. "chat reply from a crypto
4082
+ * wallet assistant"), so domain terms are translated the way that audience expects.
4083
+ */
4084
+ context?: string;
4085
+ /** Cancels the underlying LLM request when aborted. */
4086
+ signal?: AbortSignal;
4087
+ }
4088
+ /** Result of {@link TranslateKeyringAgent.chat}. */
4089
+ interface TranslateResult {
4090
+ /** The translated text (or the original, unchanged, when it was already in the target language). */
4091
+ translatedText: string;
4092
+ /** The resolved target language name (e.g. "Vietnamese" for "vi"). */
4093
+ targetLanguage: string;
4094
+ /**
4095
+ * True when the model hit its output-token cap, so `translatedText` is cut off.
4096
+ * Split very long input into smaller chunks if this happens.
4097
+ */
4098
+ truncated: boolean;
4099
+ }
4100
+ /**
4101
+ * Standalone translation agent: translates any text into the requested language
4102
+ * with a single Gemini call (no web search, no thinking), preserving formatting
4103
+ * and keeping addresses, amounts, symbols and links verbatim.
4104
+ *
4105
+ * ```ts
4106
+ * const translator = new TranslateKeyringAgent({ secretKey });
4107
+ * const { translatedText } = await translator.chat({ text: 'Hello', targetLanguage: 'vi' });
4108
+ * ```
4109
+ */
4110
+ declare class TranslateKeyringAgent {
4111
+ private readonly llm;
4112
+ private readonly debug;
4113
+ private readonly secretKey;
4114
+ private readonly ownGeminiKey;
4115
+ private licenseChecked;
4116
+ private readonly cache;
4117
+ private readonly cacheTtlMs;
4118
+ constructor(config?: TranslateKeyringAgentConfig);
4119
+ /** Same gate as {@link WebsiteTrustKeyringAgent}: waived in bring-your-own-key mode. */
4120
+ private assertLicense;
4121
+ chat(input: TranslateInput): Promise<TranslateResult>;
4122
+ /**
4123
+ * One uncached translation, with the amounts shielded (see {@link maskAmounts}).
4124
+ * When the model drops or repeats a slot, the text is translated again
4125
+ * unshielded rather than shown with an amount missing.
4126
+ */
4127
+ private translate;
4128
+ /** One translation call. */
4129
+ private translateOnce;
4130
+ /**
4131
+ * Drop a code fence the model wrapped around the whole reply despite the
4132
+ * instructions — unless the source itself was a fenced block.
4133
+ */
4134
+ private stripFence;
4135
+ }
4136
+
3907
4137
  /**
3908
4138
  * Router — top-level orchestrator in the Router → Subagent → Tool architecture.
3909
4139
  *
@@ -4013,9 +4243,8 @@ declare function createDefaultSubagents(llm: LLMProvider, registry: ToolRegistry
4013
4243
  declare class GeminiProvider implements LLMProvider {
4014
4244
  private model;
4015
4245
  private maxTokens;
4016
- private temperature;
4017
- /** Default thinking budget for calls that don't set one. `null` = model default. */
4018
- private thinkingBudget;
4246
+ /** Default thinking level for calls that don't set one. `null` = model default. */
4247
+ private thinkingLevel;
4019
4248
  private baseUrl;
4020
4249
  /** Caller's own Gemini key. Empty when running through the proxy. */
4021
4250
  private apiKey;
@@ -4027,6 +4256,21 @@ declare class GeminiProvider implements LLMProvider {
4027
4256
  /** @see LLMProvider.setRequestSignal */
4028
4257
  setRequestSignal(signal?: AbortSignal): void;
4029
4258
  chat(messages: ChatMessage[], tools?: ToolDefinition[], options?: ChatOptions): Promise<LLMResponse>;
4259
+ /**
4260
+ * Convert the chat history into Gemini `contents`.
4261
+ *
4262
+ * - System messages become `systemInstruction`.
4263
+ * - A model turn that called functions is replayed from its raw parts, so
4264
+ * every `thoughtSignature` stays on the part it came in (required for
4265
+ * function calls). History without raw parts is rebuilt from `toolCalls`
4266
+ * with the documented skip signature on the first call.
4267
+ * - Tool results become one 'user' turn of functionResponse parts per step,
4268
+ * right after the model turn that made the calls.
4269
+ * - Turns that would break the order rules are dropped rather than failing
4270
+ * the request: responses with no call before them, calls with no
4271
+ * responses after them, leading non-user turns, and trailing model turns
4272
+ * (a request ending with a model turn is a 400).
4273
+ */
4030
4274
  private toContents;
4031
4275
  private toFunctionDeclarations;
4032
4276
  }
@@ -5875,7 +6119,7 @@ declare class MoralisService {
5875
6119
  }
5876
6120
 
5877
6121
  interface TokenInfoToolConfig extends MoralisServiceConfig {
5878
- /** LLM config (model, temperature, …) for the token-research call. */
6122
+ /** LLM config (model, apiKey, …) for the token-research call. */
5879
6123
  llm?: LLMProviderConfig;
5880
6124
  }
5881
6125
  /**
@@ -11327,6 +11571,29 @@ interface RedeemResult {
11327
11571
  */
11328
11572
  declare function redeemPredictionPositions(options: RedeemOptions): Promise<RedeemResult>;
11329
11573
 
11574
+ /** Options shared by the prediction tools that render event cards or rules. */
11575
+ interface PredictionTextOptions {
11576
+ /** Translates an event's rules (Polymarket publishes them in English only). */
11577
+ translator?: TranslateKeyringAgent;
11578
+ /** Writes the short description under each event card of a list. */
11579
+ summarizer?: PredictionSummarizer;
11580
+ }
11581
+ /**
11582
+ * Writes the description under each event card — what the market asks and how
11583
+ * it resolves — in the turn language, for every card of a list in ONE LLM call.
11584
+ * Each summary is cached by language and the event's own text.
11585
+ */
11586
+ declare class PredictionSummarizer {
11587
+ private readonly llm;
11588
+ private readonly cache;
11589
+ constructor(llm: LLMProvider, storage?: StorageProvider);
11590
+ /**
11591
+ * slug → description in `language` (English when absent). Events it could not
11592
+ * describe are left out; never throws — a card without one just shows none.
11593
+ */
11594
+ summarize(events: PredictionEvent[], language: string | undefined): Promise<Map<string, string>>;
11595
+ }
11596
+
11330
11597
  /**
11331
11598
  * Tool: get-prediction-markets
11332
11599
  *
@@ -11344,8 +11611,9 @@ declare class PredictionMarketsTool extends BaseTool {
11344
11611
  description: string;
11345
11612
  parameters: ToolParameter[];
11346
11613
  private service;
11347
- constructor(config?: PolymarketServiceConfig);
11348
- protected run(args: Record<string, unknown>): Promise<{
11614
+ private readonly text;
11615
+ constructor(config?: PolymarketServiceConfig, options?: PredictionTextOptions);
11616
+ protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
11349
11617
  requestedCategory: string;
11350
11618
  categoriesAvailable: ("Politics" | "Sports" | "Crypto" | "Esports" | "Iran" | "Finance" | "Geopolitics" | "Tech" | "Elections" | "Culture" | "Economy" | "Weather" | "Science" | "Awards")[];
11351
11619
  _instructions: string;
@@ -11394,7 +11662,8 @@ declare class PredictionMarketDetailTool extends BaseTool {
11394
11662
  description: string;
11395
11663
  parameters: ToolParameter[];
11396
11664
  private service;
11397
- constructor(config?: PolymarketServiceConfig);
11665
+ private readonly text;
11666
+ constructor(config?: PolymarketServiceConfig, options?: PredictionTextOptions);
11398
11667
  protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
11399
11668
  ui: UIPayload<PredictionMarketDetailProps>;
11400
11669
  title: string;
@@ -11573,7 +11842,8 @@ declare class PredictionTradeTool extends BaseTool {
11573
11842
  description: string;
11574
11843
  parameters: ToolParameter[];
11575
11844
  private service;
11576
- constructor(config?: PolymarketServiceConfig);
11845
+ private readonly text;
11846
+ constructor(config?: PolymarketServiceConfig, options?: PredictionTextOptions);
11577
11847
  protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
11578
11848
  error: string;
11579
11849
  _instructions: string;
@@ -12578,6 +12848,22 @@ declare class PreviewAddLiquidityTool extends BaseTool {
12578
12848
  /** Forward `ui` from run() into the ToolResult envelope. */
12579
12849
  execute(args: Record<string, unknown>, userContext?: UserContext): Promise<ToolResult>;
12580
12850
  protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<Record<string, unknown>>;
12851
+ /**
12852
+ * Quote both swap legs (native → token0, native → token1). A leg whose token
12853
+ * is native, or that spends nothing, needs no swap.
12854
+ * @param args Chain, wallet, gateway (swap recipient), pool tokens, slippage and the wei split.
12855
+ * @returns The two legs, token0 first.
12856
+ */
12857
+ private fetchLegs;
12858
+ /**
12859
+ * amount0Min / amount1Min for the mint: `mintMinPercent` of what the mint will
12860
+ * use from each leg's min-out, given the range's token ratio.
12861
+ * @param legs The two swap legs, token0 first.
12862
+ * @param amount0PerL Raw token0 per unit of liquidity.
12863
+ * @param amount1PerL Raw token1 per unit of liquidity.
12864
+ * @returns The two mins (raw units).
12865
+ */
12866
+ private mintMins;
12581
12867
  /**
12582
12868
  * Display metadata for the pool's tokens. The chain is the source of truth:
12583
12869
  * `symbol()` is read from each contract and `decimals` are the values the
@@ -16286,4 +16572,4 @@ declare class AbortError extends Error {
16286
16572
  */
16287
16573
  declare function isAbortError(err: unknown): boolean;
16288
16574
 
16289
- export { AI_AGENT_TOOL_NAMES, type Abi, type AbiItem, type AbiParameter, AbortError, type AccountActionOptions, type AddLiquidityFormProps, type AddLiquiditySummary, type Address, type AffiliateFee, type AgentConfig, AgentCore, type AgentResponse, type ApprovalTx, ApproveTokenTool, type ApyPoint, BRIDGE_MIN_BUFFER_USD, BRIDGE_NON_EVM_CHAIN_FAMILY, BRIDGE_STATUS_POLL_MS, BRIDGE_SUPPORT_URL, BUILDER_CODE, BaseNftAiTool, BaseSwapProvider, BaseTool, BaseWalletActionTool, type BlockParameters, type BlockTag, type BookLevel, type BookStreamStatus, type BridgeAddresses, type BridgeAsset, type BridgeQuote, type BridgeTransfer, type BuildApprovalsParams, type BuilderAuthRequest, type BuilderAuthorization, type BuyTokenSide, BuyTokenTool, CONDITIONAL_TOKENS, CachedResource, type CallParameters, type Chain, type ChainMeta, type ChainRef, type ChainSelector, ChatHistory, type ChatMessage, type ChatOptions, type ChatRole, type CheckApprovalParams, type CheckApprovalResult, type Client, type ClientBatchConfig, type ClobCredentials, CoinpoolConfigApi, type ConfirmAddLiquidityTxProps, type ContractFunctionParameters, type CortexResponse, type CryptoPriceTick, DEFAULT_CHAIN, DEFAULT_PROVIDER, DEFAULT_RPC_BY_CHAIN, DEFILLAMA_EXTRA_SIGNALS, DEFILLAMA_POOL_CHAIN_HEXES, DEFILLAMA_POOL_CHAIN_PARAM_DESCRIPTION, DELAYED_ORDER, DEPOSIT_REFERENCE_USD, DebridgeProvider, type DecodedCall, type DecodedEvent, type DecodedParam, type DefaultSubagentName, DefiLlamaEstimatePoolYieldTool, type DefiLlamaEstimatePoolYieldToolConfig, type DefiLlamaPool, DefiLlamaPoolByAddressTool, type DefiLlamaPoolByAddressToolConfig, DefiLlamaPoolCandidateResolver, DefiLlamaPoolDetailTool, type DefiLlamaPoolDetailToolConfig, DefiLlamaPoolSearchTool, type DefiLlamaPoolSearchToolConfig, DefiLlamaPoolService, type DefiLlamaPoolServiceConfig, type DefiLlamaProtocolVersion, type DefiLlamaServiceResponse, type DefiLlamaSortBy, DefiLlamaTopPoolsTool, type DefiLlamaTopPoolsToolConfig, type DefiPosition, type DefiPositionDetails, type DefiPositionToken, type DefiProtocolSummary, type DeployDepositWalletResult, type DepositQuote, type EIP1193RequestFn, ERC1967_INIT_CODE, EstimatePoolYieldTool, type EstimatePoolYieldToolConfig, type EvmDepositAsset, type FeeContext, type FormattedDefiLlamaPool, GAMES_TAG_ID, GeminiProvider, GeminiSearchAiTool, type GeminiSearchAiToolConfig, HEX_TO_PANTOGRAPH, HIDE_FROM_NEW_TAG_ID, type Hex, type HolderChangePeriod, type HolderSupplyTier, type HttpMethod, type IngestKnowledgeBaseInput, type IngestKnowledgeBaseResult, type InputTokenInfo, type KBSearchResult, KeyringSettingApi, KnowledgeBase, type KnowledgeBaseEntry, type KnowledgeBaseProvider, type LLMProvider, type LLMProviderConfig, type LLMResponse, type LLMToolCall, type LendingMarket, type LendingMarketCardProps, LendingMarketDetailTool, type LendingMarketDetailToolConfig, type LendingMarketListProps, type LendingMarketOverview, LendingMarketsTool, type LendingMarketsToolConfig, type LendingProtocolType, LendingReadService, LendingService, type LendingServiceConfig, type LendingSupplyPosition, LendingSupplyService, MARKET_ORDER, MARKET_STREAM, MULTICALL3_ADDRESS, ManageLiquidityRedirectTool, type MarketFee, type MarketOrder, type MarketOrderInput, type MarketQuote, type MarketTradeInfo, type MarketplaceLink, type MoralisApiResponse, MoralisService, type MoralisServiceConfig, type MulticallParameters, type MulticallRawParameters, type MulticallResult, NATIVE_GAS_LIMIT, NATIVE_TOKEN_PLACEHOLDER, NEG_RISK_ADAPTER, NFC_AGENT_TOOL_NAMES, NFC_AMAZON_DEFAULT_DOMAIN, NFC_AMAZON_DOMAINS, type NFTCollectionItem, NFTContractInfoTool, type NFTContractMetadata, type NFTItem, type NFTLastSale, type NFTMetadata, NFTMetadataTool, NFT_AGENT_TOOL_NAMES, type NativeActionKind, type NativeGasGap, type NativeTokenInfo, NfcBuyTool, NfcInfoTool, type NftTransferLastSale, NoFormTool, type NoFormToolMessages, ONBOARDING_STEP, ONBOARDING_TRACKING, ORDER_INPUT_ERROR, type OnboardingResult, type OnboardingSnapshot, type OnboardingStep, OpenAddLiquidityFormTool, type OpenAddLiquidityFormToolConfig, OpenSupplyFormTool, type OpenSupplyFormToolConfig, type OrderBookSnapshot, type OrderBookWatch, type OrderInputError, PERPS_DEPOSIT_CONTRACT, POLYGON_CHAIN_ID, POLYGON_HEX_CHAIN_ID, POLYGON_NATIVE_PRECOMPILE, POLYMARKET_API, POLYMARKET_LIVE_DATA_WS, POLYMARKET_WEB_URL, POOL_UNISWAP_AGENT_TOOL_NAMES, POSITION_DUST_SHARES, PREDICTION_ACTIVITY_TYPES, PREDICTION_AGENT_TOOL_NAMES, PREDICTION_CATEGORIES, PREDICTION_SORTS, PUSD_ADDRESS, PUSD_DECIMALS, PantographService, type PantographServiceConfig, type PantographYieldIdentity, type PaymentToken, type PlaceOrderOptions, type PlacedOrder, type PolymarketAccount, PolymarketApiError, type PolymarketBuilderAuth, type PolymarketBuilderCredentials, PolymarketOnboardingError, PolymarketRedeemError, type PolymarketSdkSigner, PolymarketService, type PolymarketServiceConfig, type PolymarketSignerBridge, PolymarketTradeError, type PolymarketTypedData, PolymarketWithdrawError, PoolByAddressTool, type PoolByAddressToolConfig, PoolDetailTool, type PoolDetailToolConfig, type PoolDisplayInfo, PoolFallbackAiTool, type PoolFallbackAiToolConfig, type PoolOnchainInfo, PoolPriceRangesTool, type PoolPriceRangesToolConfig, PoolSearchTool, type PoolSearchToolConfig, PoolService, type PoolServiceConfig, PoolSwapRouter, type PredictionActivityItem, type PredictionActivityItemProps, type PredictionActivityProps, PredictionActivityTool, type PredictionCategoryKey, type PredictionDepositAssetProps, type PredictionDepositNetworkProps, type PredictionDepositOptionProps, type PredictionDepositProps, PredictionDepositTool, type PredictionEvent, type PredictionEventCardProps, type PredictionHeadline, type PredictionMarket, type PredictionMarketDetailProps, PredictionMarketDetailTool, type PredictionMarketListProps, type PredictionMarketRowProps, PredictionMarketsTool, type PredictionOutcome, type PredictionOutcomeProps, type PredictionPortfolioProps, PredictionPortfolioTool, type PredictionPosition, type PredictionPositionProps, type PredictionSetupProps, PredictionSetupTool, type PredictionSortKey, type PredictionTradeMarketProps, type PredictionTradeProps, PredictionTradeTool, type PredictionWithdrawDestinationProps, type PredictionWithdrawProps, PredictionWithdrawTool, type PreparedOrder, type PresetInputs, PreviewAddLiquidityTool, type PreviewAddLiquidityToolConfig, type PriceBounds, type PriceRangePrefill, type ProtocolVersion, type ProviderName, PublicClient, type PublicClientConfig, type QuickRate, type QuoteGas, REDEEM, RELAYER_DEPLOY_POLL, RELAYER_SUBMIT_PATH, type RangePreset, type RawYieldIdentityRow, type ReActPhase, type ReActStep, type ReActTrace, type ReadContractParameters, type RedeemErrorCode, type RedeemOptions, type RedeemResult, RelayProvider, type RemoteBuilderSigningConfig, type ResolvedRange, Router, type RouterAssignment, type RouterDecision, type RunOnboardingOptions, SUPPLIABLE_TYPES, SUPPORTED_CHAINS, SUPPORTED_CHAINS_LABEL, SWAP_PROVIDER_CONFIG, SendNativeTool, SendNftTool, SendTokenTool, type SpendableBalance, type StateOverride, type StorageProvider, Subagent, type SubagentCard, type SubagentOptions, type SubagentParams, type SubagentResult, type SubagentTask, type SubagentToggles, SubgraphAddPoolTool, type SubgraphAddPoolToolConfig, SubgraphCoinPoolPairsTool, type SubgraphCoinPoolPairsToolConfig, SubgraphPoolByAddressTool, type SubgraphPoolByAddressToolConfig, SubgraphPoolByPositionIdTool, type SubgraphPoolByPositionIdToolConfig, SubgraphPoolSearchTool, type SubgraphPoolSearchToolConfig, SubgraphPositionDetailTool, type SubgraphPositionDetailToolConfig, SubgraphTrendingPoolsTool, type SubgraphTrendingPoolsToolConfig, type SuggestedAction, Summarizer, type SuppliableMarket, type SupplyProtocolType, type SupplyUsdcProps, type SupportedChainId, type SupportedChainName, type SwapProviderConfig, type SwapProviderConfigMap, SwapProviderFactory, type SwapQuoteParams, type SwapQuoteResult, type SwapRoute, type SwapRouteRequest, SwapRouter, SwapRouterRegistry, type SwapTokenFormProps, SwapTokenTool, type SwapTxData, Synthesizer, TOKEN_AGENT_TOOL_NAMES, TRADE_ERROR, TRADING_APPROVALS_METADATA, 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 TradeErrorCode, type TradingApprovalsStatus, type TransactionByHashResponse, TransactionByHashTool, type TransactionByHashToolConfig, type TransactionLog, type TransactionReceipt, type TransactionReceiptLog, type Transport, type TransportConfig, type TrendingToken, type TrendingTokenTimeframeBuckets, TrendingTokensTool, type TrendingTokensToolConfig, type UIPayload, UNISWAP_CHAIN_SLUG, UNRESOLVED_ASSET, UP_OR_DOWN_TAG_ID, type UnsignedTx, type UpDownPrices, type UpDownWindow, type UpstashEmbedStrategy, type UpstashFusionAlgorithm, type UpstashKBUpsertEntry, UpstashKnowledgeBase, type UpstashKnowledgeBaseConfig, type UserContext, UserSwapRouter, type VectorKBConfig, WALLET_ACTION_AGENT_TOOL_NAMES, WALLET_AGENT_TOOL_NAMES, WALLET_DERIVATION, WITHDRAW, 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, type WalletDefiSummaryV1Response, type WalletDepositOption, type WalletHistoryCategory, type WalletHistoryContractInteraction, type WalletHistoryErc20Transfer, type WalletHistoryItem, type WalletHistoryNativeTransfer, type WalletHistoryNftTransfer, type WalletHistoryResponse, WalletHistoryTool, type WalletHistoryToolConfig, WalletLendingPositionsTool, type WalletLendingPositionsToolConfig, WalletNFTsTool, type WalletNFTsToolConfig, type WalletNftCardProps, type WalletNftListProps, 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, type WatchOrderBooksOptions, type WebsiteTrustExtraData, type WebsiteTrustInput, WebsiteTrustKeyringAgent, type WebsiteTrustKeyringAgentConfig, type WebsiteTrustResult, type WithdrawDestination, type WithdrawErrorCode, type WithdrawOptions, type WithdrawQuote, type WithdrawResult, type WithdrawTarget, type X402Authorization, type X402Challenge, type X402Display, type X402Outcome, type X402PaymentRequiredProps, type X402Receipt, type X402RequestSpec, type X402Requirements, type X402SignRequest, type X402Signer, type X402TypedData, type X402Version, type YieldAssetInfo, type YieldConversionCall, type YieldConversionPlan, type YieldPricingOptions, type YieldPricingToken, type YieldTokenInput, type YieldTokenValue, ZERO_ADDRESS, adjustBuyAmountForFees, allInBuyNotional, amazonDomainForLanguage, apiClient, applyMarketEvent, applyYieldConversions, bestPrice, bridgeMinUsd, buildApprovalCalls, buildApprovals, buildBuilderSignature, buildChallenge, buildRangePresets, buildUniswapPoolUrl, builderApiKey, buyFeePrice, buyNotional, buyNotionalAfterFee, buyNotionalForCash, call, canDeriveV3PoolAddress, ceil2, chains, checkNativeGasAffordable, checksumAddress, clampTick, classifyTradeError, classifyWithdrawError, clearPublicClientCache, coinpoolConfigApi, compareBridgeTokens, compareDecimal, completeX402, configureSupportedChains, configureSwapProvider, convertSusdsShares, createAiAgent, createDefaultSubagents, createNfcAgent, createNftAgent, createPolymarketSigner, createPoolUniswapAgent, createPredictionAgent, createPublicClient, createTokenAgent, createTransport, createWalletActionAgent, createWalletAgent, createX402SignatureProvider, decodeAbiParameters, decodeErrorResult, decodeFunctionData, decodeFunctionResult, defiLlamaPoolInfoScope, defiLlamaPoolSupportsLabel, deployDepositWallet, depositPriceImpact, deriveBeaconDepositWallet, deriveDepositWallet, deriveSafeWallet, deriveUupsDepositWallet, deriveV3PoolAddress, displayFromChallenge, effectivePriceUSD, encodeAbiParameters, encodeApprove, encodeErrorResult, encodeFunctionData, encodeSignedHeader, erc1155Abi, erc20Abi, erc20Abi_bytes32, erc721Abi, estimateGas, estimateNativeGasReserveWei, estimateTransactionFeeWei, ethCallAt, ethCallByChain, eventHeadline, eventUrl, evmDepositAssets, exactAmountString, extractOutRaw, extractQuoteError, fallback, feePerShare, feeWeiToNative, fetchOnboardingSnapshot, fetchTopMarketplaces, fetchTradingApprovalsStatus, fetchUnderlyingPricesUSD, findWalletDepositOptions, floor2, floorToDecimals, formatDefiLlamaPool, getAbiItem, getAddress, getBalance, getBlock, getBlockNumber, getCashBalance, getCashBalanceBaseUnits, getChain, getChainContractAddress, getChainId, getChainMeta, getCode, getDefaultRpcUrl, getGasPrice, getNativeTokenInfo, getPolymarketBuilderCode, getPublicClient, getRevertReason, getRpcOverrides, getShareBalances, getStorageAt, getTokenPriceUSD, getTransactionCount, http, humanToWei, ingestKnowledgeBase, isAbortError, isAddress, isAddressEqual, isBelowWithdrawMinimum, isEvmAddress, isMarketOpen, isPaymentRequired, isShareBasedProtocol, isShareBasedYieldToken, isSupplyChain, keyringSettingApi, listCandidateChains, listSupplyChains, mapEvent, mapMarket, marketFee, marketProtocol, moneylineMarket, mulDivFloor, multicall, multicall3Abi, multicallRaw, nativeGasShortfall, nfcAmazonSearchUrl, normaliseCountry, normalizeDecimal, normalizeLevels, normalizePriceRangeToPool, normalizeText, onboardingStep, openSecureClient, parseAbi, parseAbiItem, parseAbiParameters, parsePolymarketUrl, parsePredictionHint, pickLogo, placePredictionOrder, planYieldTokenConversions, predictionHint, prepareMarketOrder, priceToTick, protocolLabelFor, psm3For, pusdFromBaseUnits, pusdToBaseUnits, quoteBuyAsPolymarket, quoteBuyUsd, quoteDeposit, quoteMarketOrder, quoteSellShares, quoteWithdrawal, readContract, readPaymentError, readPaymentRequired, readProtocolFeeWei, readReceipt, readSpendableBalance, readTokenUsdPrice, redeemPredictionPositions, registerMaybeNoForm, remoteBuilderSigning, requestWithX402, resolveAccountWallet, resolveCategory, resolveGasLimit, resolveNfcShopLinks, resolveRawYieldAsset, resolveRawYieldIdentity, resolveRawYieldProtocol, resolveRpcUrl, resolveRpcUrls, resolveTokenPriceUSD, roundTickToSpacing, rpcCall, runPolymarketOnboarding, setPolymarketBuilderCode, setRpcOverrides, slippagePrice, spendableNative, swapProviderFactory, swapRouterRegistry, tickToPrice, ticketFee, toBuilderAuthorization, toEventSelector, toFunctionSelector, toPantographChain, toPlainDecimal, unitPriceUSD, upDownWindow, valueYieldTokens, walletDepositAssets, watchCryptoPrice, watchOrderBooks, weiToHuman, withdrawDestinations, withdrawFromPolymarket };
16575
+ export { AI_AGENT_TOOL_NAMES, type Abi, type AbiItem, type AbiParameter, AbortError, type AccountActionOptions, type AddLiquidityFormProps, type AddLiquiditySummary, type Address, type AffiliateFee, type AgentConfig, AgentCore, type AgentResponse, type ApprovalTx, ApproveTokenTool, type ApyPoint, BRIDGE_MIN_BUFFER_USD, BRIDGE_NON_EVM_CHAIN_FAMILY, BRIDGE_STATUS_POLL_MS, BRIDGE_SUPPORT_URL, BUILDER_CODE, BaseNftAiTool, BaseSwapProvider, BaseTool, BaseWalletActionTool, type BlockParameters, type BlockTag, type BookLevel, type BookStreamStatus, type BridgeAddresses, type BridgeAsset, type BridgeQuote, type BridgeTransfer, type BuildApprovalsParams, type BuilderAuthRequest, type BuilderAuthorization, type BuyTokenSide, BuyTokenTool, CONDITIONAL_TOKENS, CachedResource, type CallParameters, type Chain, type ChainMeta, type ChainRef, type ChainSelector, ChatHistory, type ChatMessage, type ChatOptions, type ChatRole, type CheckApprovalParams, type CheckApprovalResult, type Client, type ClientBatchConfig, type ClobCredentials, CoinpoolConfigApi, type ConfirmAddLiquidityTxProps, type ContractFunctionParameters, type CortexResponse, type CryptoPriceTick, DEFAULT_CHAIN, DEFAULT_PROVIDER, DEFAULT_RPC_BY_CHAIN, DEFILLAMA_EXTRA_SIGNALS, DEFILLAMA_POOL_CHAIN_HEXES, DEFILLAMA_POOL_CHAIN_PARAM_DESCRIPTION, DELAYED_ORDER, DEPOSIT_REFERENCE_USD, DebridgeProvider, type DecodedCall, type DecodedEvent, type DecodedParam, type DefaultSubagentName, DefiLlamaEstimatePoolYieldTool, type DefiLlamaEstimatePoolYieldToolConfig, type DefiLlamaPool, DefiLlamaPoolByAddressTool, type DefiLlamaPoolByAddressToolConfig, DefiLlamaPoolCandidateResolver, DefiLlamaPoolDetailTool, type DefiLlamaPoolDetailToolConfig, DefiLlamaPoolSearchTool, type DefiLlamaPoolSearchToolConfig, DefiLlamaPoolService, type DefiLlamaPoolServiceConfig, type DefiLlamaProtocolVersion, type DefiLlamaServiceResponse, type DefiLlamaSortBy, DefiLlamaTopPoolsTool, type DefiLlamaTopPoolsToolConfig, type DefiPosition, type DefiPositionDetails, type DefiPositionToken, type DefiProtocolSummary, type DeployDepositWalletResult, type DepositQuote, type EIP1193RequestFn, ERC1967_INIT_CODE, EstimatePoolYieldTool, type EstimatePoolYieldToolConfig, type EvmDepositAsset, type FeeContext, type FormattedDefiLlamaPool, GAMES_TAG_ID, GeminiProvider, GeminiSearchAiTool, type GeminiSearchAiToolConfig, HEX_TO_PANTOGRAPH, HIDE_FROM_NEW_TAG_ID, type Hex, type HolderChangePeriod, type HolderSupplyTier, type HttpMethod, type IngestKnowledgeBaseInput, type IngestKnowledgeBaseResult, type InputTokenInfo, type KBSearchResult, KeyringSettingApi, KnowledgeBase, type KnowledgeBaseEntry, type KnowledgeBaseProvider, type LLMProvider, type LLMProviderConfig, type LLMResponse, type LLMToolCall, type LendingMarket, type LendingMarketCardProps, LendingMarketDetailTool, type LendingMarketDetailToolConfig, type LendingMarketListProps, type LendingMarketOverview, LendingMarketsTool, type LendingMarketsToolConfig, type LendingProtocolType, LendingReadService, LendingService, type LendingServiceConfig, type LendingSupplyPosition, LendingSupplyService, MARKET_ORDER, MARKET_STREAM, MULTICALL3_ADDRESS, ManageLiquidityRedirectTool, type MarketFee, type MarketOrder, type MarketOrderInput, type MarketQuote, type MarketTradeInfo, type MarketplaceLink, type ModelPart, type MoralisApiResponse, MoralisService, type MoralisServiceConfig, type MulticallParameters, type MulticallRawParameters, type MulticallResult, NATIVE_GAS_LIMIT, NATIVE_TOKEN_PLACEHOLDER, NEG_RISK_ADAPTER, NFC_AGENT_TOOL_NAMES, NFC_AMAZON_DEFAULT_DOMAIN, NFC_AMAZON_DOMAINS, type NFTCollectionItem, NFTContractInfoTool, type NFTContractMetadata, type NFTItem, type NFTLastSale, type NFTMetadata, NFTMetadataTool, NFT_AGENT_TOOL_NAMES, type NativeActionKind, type NativeGasGap, type NativeTokenInfo, NfcBuyTool, NfcInfoTool, type NftTransferLastSale, NoFormTool, type NoFormToolMessages, ONBOARDING_STEP, ONBOARDING_TRACKING, ORDER_INPUT_ERROR, type OnboardingResult, type OnboardingSnapshot, type OnboardingStep, OpenAddLiquidityFormTool, type OpenAddLiquidityFormToolConfig, OpenSupplyFormTool, type OpenSupplyFormToolConfig, type OrderBookSnapshot, type OrderBookWatch, type OrderInputError, PERPS_DEPOSIT_CONTRACT, POLYGON_CHAIN_ID, POLYGON_HEX_CHAIN_ID, POLYGON_NATIVE_PRECOMPILE, POLYMARKET_API, POLYMARKET_LIVE_DATA_WS, POLYMARKET_WEB_URL, POOL_UNISWAP_AGENT_TOOL_NAMES, POSITION_DUST_SHARES, PREDICTION_ACTIVITY_TYPES, PREDICTION_AGENT_TOOL_NAMES, PREDICTION_CATEGORIES, PREDICTION_SORTS, PUSD_ADDRESS, PUSD_DECIMALS, PantographService, type PantographServiceConfig, type PantographYieldIdentity, type PaymentToken, type PlaceOrderOptions, type PlacedOrder, type PolymarketAccount, PolymarketApiError, type PolymarketBuilderAuth, type PolymarketBuilderCredentials, PolymarketOnboardingError, PolymarketRedeemError, type PolymarketSdkSigner, PolymarketService, type PolymarketServiceConfig, type PolymarketSignerBridge, PolymarketTradeError, type PolymarketTypedData, PolymarketWithdrawError, PoolByAddressTool, type PoolByAddressToolConfig, PoolDetailTool, type PoolDetailToolConfig, type PoolDisplayInfo, PoolFallbackAiTool, type PoolFallbackAiToolConfig, type PoolOnchainInfo, PoolPriceRangesTool, type PoolPriceRangesToolConfig, PoolSearchTool, type PoolSearchToolConfig, PoolService, type PoolServiceConfig, PoolSwapRouter, type PredictionActivityItem, type PredictionActivityItemProps, type PredictionActivityProps, PredictionActivityTool, type PredictionCategoryKey, type PredictionDepositAssetProps, type PredictionDepositNetworkProps, type PredictionDepositOptionProps, type PredictionDepositProps, PredictionDepositTool, type PredictionEvent, type PredictionEventCardProps, type PredictionHeadline, type PredictionMarket, type PredictionMarketDetailProps, PredictionMarketDetailTool, type PredictionMarketListProps, type PredictionMarketRowProps, PredictionMarketsTool, type PredictionOutcome, type PredictionOutcomeProps, type PredictionPortfolioProps, PredictionPortfolioTool, type PredictionPosition, type PredictionPositionProps, type PredictionSetupProps, PredictionSetupTool, type PredictionSortKey, type PredictionTradeMarketProps, type PredictionTradeProps, PredictionTradeTool, type PredictionWithdrawDestinationProps, type PredictionWithdrawProps, PredictionWithdrawTool, type PreparedOrder, type PresetInputs, PreviewAddLiquidityTool, type PreviewAddLiquidityToolConfig, type PriceBounds, type PriceRangePrefill, type ProtocolVersion, type ProviderName, PublicClient, type PublicClientConfig, type QuickRate, type QuoteGas, REDEEM, RELAYER_DEPLOY_POLL, RELAYER_SUBMIT_PATH, type RangePreset, type RawYieldIdentityRow, type ReActPhase, type ReActStep, type ReActTrace, type ReadContractParameters, type RedeemErrorCode, type RedeemOptions, type RedeemResult, RelayProvider, type RelayRequestDetail, type RelayRequestDetailParams, type RemoteBuilderSigningConfig, type ResolvedRange, Router, type RouterAssignment, type RouterDecision, type RunOnboardingOptions, SUPPLIABLE_TYPES, SUPPORTED_CHAINS, SUPPORTED_CHAINS_LABEL, SWAP_PROVIDER_CONFIG, SendNativeTool, SendNftTool, SendTokenTool, type SpendableBalance, type StateOverride, type StorageProvider, Subagent, type SubagentCard, type SubagentOptions, type SubagentParams, type SubagentResult, type SubagentTask, type SubagentToggles, SubgraphAddPoolTool, type SubgraphAddPoolToolConfig, SubgraphCoinPoolPairsTool, type SubgraphCoinPoolPairsToolConfig, SubgraphPoolByAddressTool, type SubgraphPoolByAddressToolConfig, SubgraphPoolByPositionIdTool, type SubgraphPoolByPositionIdToolConfig, SubgraphPoolSearchTool, type SubgraphPoolSearchToolConfig, SubgraphPositionDetailTool, type SubgraphPositionDetailToolConfig, SubgraphTrendingPoolsTool, type SubgraphTrendingPoolsToolConfig, type SuggestedAction, Summarizer, type SuppliableMarket, type SupplyProtocolType, type SupplyUsdcProps, type SupportedChainId, type SupportedChainName, type SwapProviderConfig, type SwapProviderConfigMap, SwapProviderFactory, type SwapQuoteParams, type SwapQuoteResult, type SwapRoute, type SwapRouteRequest, SwapRouter, SwapRouterRegistry, type SwapTokenFormProps, SwapTokenTool, type SwapTxData, Synthesizer, TOKEN_AGENT_TOOL_NAMES, TRADE_ERROR, TRADING_APPROVALS_METADATA, TRANSFER_TOPIC, TRENDING_DEFAULT_BY_HEX_CHAIN, type ThinkingLevel, 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 TradeErrorCode, type TradingApprovalsStatus, type TransactionByHashResponse, TransactionByHashTool, type TransactionByHashToolConfig, type TransactionLog, type TransactionReceipt, type TransactionReceiptLog, type TranslateInput, TranslateKeyringAgent, type TranslateKeyringAgentConfig, type TranslateResult, type Transport, type TransportConfig, type TrendingToken, type TrendingTokenTimeframeBuckets, TrendingTokensTool, type TrendingTokensToolConfig, type UIPayload, UNISWAP_CHAIN_SLUG, UNRESOLVED_ASSET, UP_OR_DOWN_TAG_ID, type UnsignedTx, type UpDownPrices, type UpDownWindow, type UpstashEmbedStrategy, type UpstashFusionAlgorithm, type UpstashKBUpsertEntry, UpstashKnowledgeBase, type UpstashKnowledgeBaseConfig, type UserContext, UserSwapRouter, type VectorKBConfig, WALLET_ACTION_AGENT_TOOL_NAMES, WALLET_AGENT_TOOL_NAMES, WALLET_DERIVATION, WITHDRAW, 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, type WalletDefiSummaryV1Response, type WalletDepositOption, type WalletHistoryCategory, type WalletHistoryContractInteraction, type WalletHistoryErc20Transfer, type WalletHistoryItem, type WalletHistoryNativeTransfer, type WalletHistoryNftTransfer, type WalletHistoryResponse, WalletHistoryTool, type WalletHistoryToolConfig, WalletLendingPositionsTool, type WalletLendingPositionsToolConfig, WalletNFTsTool, type WalletNFTsToolConfig, type WalletNftCardProps, type WalletNftListProps, 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, type WatchOrderBooksOptions, type WebsiteTrustExtraData, type WebsiteTrustInput, WebsiteTrustKeyringAgent, type WebsiteTrustKeyringAgentConfig, type WebsiteTrustResult, type WithdrawDestination, type WithdrawErrorCode, type WithdrawOptions, type WithdrawQuote, type WithdrawResult, type WithdrawTarget, type X402Authorization, type X402Challenge, type X402Display, type X402Outcome, type X402PaymentRequiredProps, type X402Receipt, type X402RequestSpec, type X402Requirements, type X402SignRequest, type X402Signer, type X402TypedData, type X402Version, type YieldAssetInfo, type YieldConversionCall, type YieldConversionPlan, type YieldPricingOptions, type YieldPricingToken, type YieldTokenInput, type YieldTokenValue, ZERO_ADDRESS, adjustBuyAmountForFees, allInBuyNotional, amazonDomainForLanguage, apiClient, applyMarketEvent, applyYieldConversions, bestPrice, bridgeMinUsd, buildApprovalCalls, buildApprovals, buildBuilderSignature, buildChallenge, buildRangePresets, buildUniswapPoolUrl, builderApiKey, buyFeePrice, buyNotional, buyNotionalAfterFee, buyNotionalForCash, call, canDeriveV3PoolAddress, ceil2, chains, checkNativeGasAffordable, checksumAddress, clampTick, classifyTradeError, classifyWithdrawError, clearPublicClientCache, coinpoolConfigApi, compareBridgeTokens, compareDecimal, completeX402, configureSupportedChains, configureSwapProvider, convertSusdsShares, createAiAgent, createDefaultSubagents, createNfcAgent, createNftAgent, createPolymarketSigner, createPoolUniswapAgent, createPredictionAgent, createPublicClient, createTokenAgent, createTransport, createWalletActionAgent, createWalletAgent, createX402SignatureProvider, decodeAbiParameters, decodeErrorResult, decodeFunctionData, decodeFunctionResult, defiLlamaPoolInfoScope, defiLlamaPoolSupportsLabel, deployDepositWallet, depositPriceImpact, deriveBeaconDepositWallet, deriveDepositWallet, deriveSafeWallet, deriveUupsDepositWallet, deriveV3PoolAddress, displayFromChallenge, effectivePriceUSD, encodeAbiParameters, encodeApprove, encodeErrorResult, encodeFunctionData, encodeSignedHeader, erc1155Abi, erc20Abi, erc20Abi_bytes32, erc721Abi, estimateGas, estimateNativeGasReserveWei, estimateTransactionFeeWei, ethCallAt, ethCallByChain, eventHeadline, eventUrl, evmDepositAssets, exactAmountString, extractOutRaw, extractQuoteError, fallback, feePerShare, feeWeiToNative, fetchOnboardingSnapshot, fetchTopMarketplaces, fetchTradingApprovalsStatus, fetchUnderlyingPricesUSD, findWalletDepositOptions, floor2, floorToDecimals, formatDefiLlamaPool, getAbiItem, getAddress, getBalance, getBlock, getBlockNumber, getCashBalance, getCashBalanceBaseUnits, getChain, getChainContractAddress, getChainId, getChainMeta, getCode, getDefaultRpcUrl, getGasPrice, getNativeTokenInfo, getPolymarketBuilderCode, getPublicClient, getRevertReason, getRpcOverrides, getShareBalances, getStorageAt, getTokenPriceUSD, getTransactionCount, http, humanToWei, ingestKnowledgeBase, isAbortError, isAddress, isAddressEqual, isBelowWithdrawMinimum, isEvmAddress, isMarketOpen, isPaymentRequired, isShareBasedProtocol, isShareBasedYieldToken, isSupplyChain, keyringSettingApi, listCandidateChains, listSupplyChains, mapEvent, mapMarket, marketFee, marketProtocol, moneylineMarket, mulDivFloor, multicall, multicall3Abi, multicallRaw, nativeGasShortfall, nfcAmazonSearchUrl, normaliseCountry, normalizeDecimal, normalizeLevels, normalizePriceRangeToPool, normalizeText, onboardingStep, openSecureClient, parseAbi, parseAbiItem, parseAbiParameters, parsePolymarketUrl, parsePredictionHint, pickLogo, placePredictionOrder, planYieldTokenConversions, predictionHint, prepareMarketOrder, priceToTick, protocolLabelFor, psm3For, pusdFromBaseUnits, pusdToBaseUnits, quoteBuyAsPolymarket, quoteBuyUsd, quoteDeposit, quoteMarketOrder, quoteSellShares, quoteWithdrawal, readContract, readPaymentError, readPaymentRequired, readProtocolFeeWei, readReceipt, readSpendableBalance, readTokenUsdPrice, redeemPredictionPositions, registerMaybeNoForm, remoteBuilderSigning, requestWithX402, resolveAccountWallet, resolveCategory, resolveGasLimit, resolveNfcShopLinks, resolveRawYieldAsset, resolveRawYieldIdentity, resolveRawYieldProtocol, resolveRpcUrl, resolveRpcUrls, resolveTokenPriceUSD, roundTickToSpacing, rpcCall, runPolymarketOnboarding, setPolymarketBuilderCode, setRpcOverrides, slippagePrice, spendableNative, swapProviderFactory, swapRouterRegistry, tickToPrice, ticketFee, toBuilderAuthorization, toEventSelector, toFunctionSelector, toPantographChain, toPlainDecimal, unitPriceUSD, upDownWindow, valueYieldTokens, walletDepositAssets, watchCryptoPrice, watchOrderBooks, weiToHuman, withdrawDestinations, withdrawFromPolymarket };