keyring-agent-core 0.2.25 → 0.2.27
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 +730 -43
- package/dist/index.js +196 -104
- package/dist/index.native.js +346 -254
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
declare function tickToPrice(tick: number, token0Decimals: number, token1Decimals: number): number;
|
|
3
3
|
/** price (token1 per token0, decimal-adjusted) → tick */
|
|
4
4
|
declare function priceToTick(price: number, token0Decimals: number, token1Decimals: number): number;
|
|
5
|
+
/**
|
|
6
|
+
* Normalize a user-supplied price range to the pool's token1-per-token0 unit.
|
|
7
|
+
*
|
|
8
|
+
* A human (or the LLM transcribing them) may express a range in EITHER
|
|
9
|
+
* orientation — the pool's internal token1/token0 unit (e.g. ~0.0006 WETH per
|
|
10
|
+
* USDC) or its reciprocal (~1700 USDC per WETH) — and which one is "natural"
|
|
11
|
+
* depends on token ordering the user can't see. Since an add-liquidity range is
|
|
12
|
+
* meant to bracket the live price, we resolve the orientation generically: pick
|
|
13
|
+
* whichever reading — as-given or reciprocal — actually brackets `currentPrice`
|
|
14
|
+
* (and, when that's ambiguous, whichever sits closest to it in log-space).
|
|
15
|
+
*
|
|
16
|
+
* This is orientation-only: it never rescales by powers of ten or otherwise
|
|
17
|
+
* invents numbers. A range that brackets the price in neither orientation is
|
|
18
|
+
* returned untouched (the caller then reports a genuine out-of-range).
|
|
19
|
+
*
|
|
20
|
+
* `minPrice <= 0` (a full-range lower bound) or a non-positive/!finite current
|
|
21
|
+
* price can't be reasoned about, so the input is returned as-is.
|
|
22
|
+
*/
|
|
23
|
+
declare function normalizePriceRangeToPool(minPrice: number, maxPrice: number, currentPrice: number): {
|
|
24
|
+
minPrice: number;
|
|
25
|
+
maxPrice: number;
|
|
26
|
+
inverted: boolean;
|
|
27
|
+
};
|
|
5
28
|
/** Round a tick to the nearest valid tick respecting tickSpacing */
|
|
6
29
|
declare function roundTickToSpacing(tick: number, tickSpacing: number, direction?: 'down' | 'up' | 'nearest'): number;
|
|
7
30
|
declare function clampTick(tick: number): number;
|
|
@@ -840,6 +863,8 @@ interface SwapTokenConfirmTxProps {
|
|
|
840
863
|
/** Human-readable summary of an add-liquidity tx, shown above the Confirm button. */
|
|
841
864
|
interface AddLiquiditySummary {
|
|
842
865
|
nativeIn: number;
|
|
866
|
+
/** Native coin symbol for the pool's chain (ETH / BNB / POL / AVAX …) — for display. */
|
|
867
|
+
nativeSymbol: string;
|
|
843
868
|
nativeInUsd: number | null;
|
|
844
869
|
ratio: {
|
|
845
870
|
token0Percent: number;
|
|
@@ -1198,6 +1223,14 @@ interface AgentConfig {
|
|
|
1198
1223
|
subagents?: {
|
|
1199
1224
|
wallet?: boolean;
|
|
1200
1225
|
'wallet-action'?: boolean;
|
|
1226
|
+
/**
|
|
1227
|
+
* Redirect-only variant of `wallet-action`. Instead of emitting in-chat
|
|
1228
|
+
* forms, every tool just tells the user they can perform the action
|
|
1229
|
+
* directly in the app (using `walletActionAppLink` when set). Mutually
|
|
1230
|
+
* exclusive with `wallet-action`: enabling this (true) turns
|
|
1231
|
+
* `wallet-action` off. Defaults to false.
|
|
1232
|
+
*/
|
|
1233
|
+
'wallet-action-app'?: boolean;
|
|
1201
1234
|
token?: boolean;
|
|
1202
1235
|
nft?: boolean;
|
|
1203
1236
|
pool?: boolean;
|
|
@@ -1257,6 +1290,13 @@ interface AgentConfig {
|
|
|
1257
1290
|
* omitted, it stays as plain text. A single link is shared by all NFT tools.
|
|
1258
1291
|
*/
|
|
1259
1292
|
nftLink?: string;
|
|
1293
|
+
/**
|
|
1294
|
+
* Link to the app where wallet actions are performed, used ONLY by the
|
|
1295
|
+
* redirect-only `wallet-action-app` subagent. When set, its tools surface
|
|
1296
|
+
* this URL as plain text so the user can open the app; when omitted, they
|
|
1297
|
+
* just tell the user the action is done in the app.
|
|
1298
|
+
*/
|
|
1299
|
+
walletActionAppLink?: string;
|
|
1260
1300
|
}
|
|
1261
1301
|
interface LLMToolCall {
|
|
1262
1302
|
toolName: string;
|
|
@@ -1289,10 +1329,23 @@ interface ChatOptions {
|
|
|
1289
1329
|
* Ignored when no tools are passed.
|
|
1290
1330
|
*/
|
|
1291
1331
|
forceToolUse?: boolean;
|
|
1332
|
+
/**
|
|
1333
|
+
* Cancels this request when aborted. Takes precedence over any per-turn signal
|
|
1334
|
+
* set on the provider via {@link LLMProvider.setRequestSignal}. The in-flight
|
|
1335
|
+
* HTTP request is aborted and no further retries are attempted.
|
|
1336
|
+
*/
|
|
1337
|
+
signal?: AbortSignal;
|
|
1292
1338
|
}
|
|
1293
1339
|
interface LLMProvider {
|
|
1294
1340
|
/** Send messages to the LLM and get a response */
|
|
1295
1341
|
chat(messages: ChatMessage[], tools?: ToolDefinition[], options?: ChatOptions): Promise<LLMResponse>;
|
|
1342
|
+
/**
|
|
1343
|
+
* Set (or clear, with `undefined`) the signal applied to every subsequent
|
|
1344
|
+
* request until changed. AgentCore sets this for the duration of a `chat()`
|
|
1345
|
+
* turn so cancellation reaches each LLM round-trip without threading a signal
|
|
1346
|
+
* through every call site. Optional — providers that cannot cancel may omit it.
|
|
1347
|
+
*/
|
|
1348
|
+
setRequestSignal?(signal?: AbortSignal): void;
|
|
1296
1349
|
}
|
|
1297
1350
|
|
|
1298
1351
|
/**
|
|
@@ -1558,6 +1611,12 @@ declare class AgentCore {
|
|
|
1558
1611
|
* the clear. Null when no turn is in flight.
|
|
1559
1612
|
*/
|
|
1560
1613
|
private inFlightTurn;
|
|
1614
|
+
/**
|
|
1615
|
+
* Aborts the in-flight chat() turn when the caller invokes {@link stop} (or the
|
|
1616
|
+
* caller-supplied signal aborts). Null when no turn is running. Each turn owns
|
|
1617
|
+
* its own controller so a late stop() from a previous turn can't cancel the next.
|
|
1618
|
+
*/
|
|
1619
|
+
private currentAbortController;
|
|
1561
1620
|
/**
|
|
1562
1621
|
* Resolves once the initial persisted-history load attempt has finished
|
|
1563
1622
|
* (success or failure). Only meaningful when `persistHistory: true` and a
|
|
@@ -1639,7 +1698,19 @@ declare class AgentCore {
|
|
|
1639
1698
|
chat(userMessage: string, options?: {
|
|
1640
1699
|
generateSuggestions?: boolean;
|
|
1641
1700
|
language?: string;
|
|
1701
|
+
signal?: AbortSignal;
|
|
1642
1702
|
}): Promise<AgentResponse>;
|
|
1703
|
+
/**
|
|
1704
|
+
* Cancel the in-flight {@link chat} turn, if any. The pending `chat()` promise
|
|
1705
|
+
* rejects with an `AbortError` (`err.name === 'AbortError'`) — the in-flight LLM
|
|
1706
|
+
* request is aborted and no further nodes/tools run. No-op when idle.
|
|
1707
|
+
*
|
|
1708
|
+
* History is rolled back to its pre-turn state, so a stopped turn leaves no
|
|
1709
|
+
* orphan messages behind. Safe to call repeatedly.
|
|
1710
|
+
*/
|
|
1711
|
+
stop(): void;
|
|
1712
|
+
/** True while a {@link chat} turn is running (and can be {@link stop}ped). */
|
|
1713
|
+
isBusy(): boolean;
|
|
1643
1714
|
/**
|
|
1644
1715
|
* Build the host object the chat graph's nodes call into. Each method is a
|
|
1645
1716
|
* thin closure over an existing (private) helper, so the graph stays pure
|
|
@@ -1777,6 +1848,209 @@ declare class AgentCore {
|
|
|
1777
1848
|
getToolRegistry(): ToolRegistry;
|
|
1778
1849
|
}
|
|
1779
1850
|
|
|
1851
|
+
/**
|
|
1852
|
+
* Configuration for {@link WebsiteTrustAgent}.
|
|
1853
|
+
*
|
|
1854
|
+
* The agent is self-contained — it does NOT need the full {@link AgentCore}
|
|
1855
|
+
* pipeline. A consuming app just constructs it once (optionally with its own
|
|
1856
|
+
* Gemini proxy / model) and calls {@link WebsiteTrustAgent.chat}.
|
|
1857
|
+
*/
|
|
1858
|
+
interface WebsiteTrustAgentConfig {
|
|
1859
|
+
/**
|
|
1860
|
+
* Gemini LLM config (model / baseUrl / temperature). Omit to use the default
|
|
1861
|
+
* proxy. Ignored when an explicit `provider` is supplied.
|
|
1862
|
+
*/
|
|
1863
|
+
llm?: LLMProviderConfig;
|
|
1864
|
+
/** Bring your own LLM provider (e.g. a shared instance). Overrides `llm`. */
|
|
1865
|
+
provider?: LLMProvider;
|
|
1866
|
+
/** Enable debug logging. */
|
|
1867
|
+
debug?: boolean;
|
|
1868
|
+
}
|
|
1869
|
+
/** Input for a single website-trust analysis ({@link WebsiteTrustAgent.chat}). */
|
|
1870
|
+
interface WebsiteTrustInput {
|
|
1871
|
+
/** The website URL to analyze (e.g. "https://example.com"). */
|
|
1872
|
+
url: string;
|
|
1873
|
+
/**
|
|
1874
|
+
* When true the site is PRE-MARKED official/trusted by the caller: the agent
|
|
1875
|
+
* skips the phishing/impersonation checks and just describes what the site is.
|
|
1876
|
+
* When false the agent runs the full multi-step phishing assessment.
|
|
1877
|
+
*/
|
|
1878
|
+
isMarkOfficial: boolean;
|
|
1879
|
+
/**
|
|
1880
|
+
* Language for the user-facing strings (`answer`, `reasons`) — a BCP-47 tag
|
|
1881
|
+
* ("vi", "en") or a language name. Defaults to English.
|
|
1882
|
+
*/
|
|
1883
|
+
language?: string;
|
|
1884
|
+
/** Cancels the underlying LLM requests when aborted. */
|
|
1885
|
+
signal?: AbortSignal;
|
|
1886
|
+
}
|
|
1887
|
+
/** Structured trust signals returned alongside the natural-language answer. */
|
|
1888
|
+
interface WebsiteTrustExtraData {
|
|
1889
|
+
/** The site that was analyzed (hostname when parseable, else the raw input). */
|
|
1890
|
+
currentSite: string;
|
|
1891
|
+
/**
|
|
1892
|
+
* True under either criterion: (1) it impersonates a WELL-KNOWN brand
|
|
1893
|
+
* (prominent in crypto / blockchain / NFT / DeFi / Web3, or otherwise major)
|
|
1894
|
+
* without being one of that brand's official domains; or (2) it does not
|
|
1895
|
+
* impersonate anyone but a real source (article / scanner / blocklist) reports
|
|
1896
|
+
* it as phishing/scam. An obscure or brand-free site with no such report is
|
|
1897
|
+
* NOT flagged.
|
|
1898
|
+
*/
|
|
1899
|
+
isPhishing: boolean;
|
|
1900
|
+
/**
|
|
1901
|
+
* The reputable site this one is judged to copy / impersonate (domain or
|
|
1902
|
+
* brand name, e.g. "relay.link"). Present ONLY when the verdict is that it
|
|
1903
|
+
* imitates another site.
|
|
1904
|
+
*/
|
|
1905
|
+
copiedSite?: string;
|
|
1906
|
+
/**
|
|
1907
|
+
* At least 3 (up to 5) concise, expert, evidence-grounded reasons the site is
|
|
1908
|
+
* flagged as phishing — the look-alike trick used and any scam-report /
|
|
1909
|
+
* article findings, written in the requested language. Report-based reasons
|
|
1910
|
+
* cite their source as a markdown link; unsourced accusations are omitted so a
|
|
1911
|
+
* legitimate-but-obscure site is never defamed. Present ONLY when `isPhishing`.
|
|
1912
|
+
*/
|
|
1913
|
+
reasons?: string[];
|
|
1914
|
+
}
|
|
1915
|
+
/** Result of {@link WebsiteTrustAgent.chat}. */
|
|
1916
|
+
interface WebsiteTrustResult {
|
|
1917
|
+
/**
|
|
1918
|
+
* Natural-language information ABOUT the site under test — what it is, what it
|
|
1919
|
+
* does and who runs it — ending with the safety verdict, in the requested
|
|
1920
|
+
* language. The purpose is to tell the user what the provided site actually is.
|
|
1921
|
+
*/
|
|
1922
|
+
answer: string;
|
|
1923
|
+
/** Structured trust signals. */
|
|
1924
|
+
extraData: WebsiteTrustExtraData;
|
|
1925
|
+
}
|
|
1926
|
+
/**
|
|
1927
|
+
* Self-contained website phishing-detection agent backed by a search-grounded
|
|
1928
|
+
* Gemini model.
|
|
1929
|
+
*
|
|
1930
|
+
* Two clean phases, so accuracy and output-language never fight each other:
|
|
1931
|
+
* 1. GATHER — one web-search call investigates the EXACT domain and returns
|
|
1932
|
+
* structured signals + English evidence (is it a brand's official site, is
|
|
1933
|
+
* it impersonating another site, any scam reports). Anti-impersonation
|
|
1934
|
+
* rigor (no autocorrect, exact name+TLD match) lives here.
|
|
1935
|
+
* 2. The phishing verdict is derived from those signals in code, so it is
|
|
1936
|
+
* stable and not at the mercy of one free-form answer.
|
|
1937
|
+
* 3. PRESENT — one non-search call rewrites the evidence into the user-facing
|
|
1938
|
+
* `answer` + `reasons`, with the output language mandated at the system
|
|
1939
|
+
* level. Both come from the SAME call, so they are always one language.
|
|
1940
|
+
*
|
|
1941
|
+
* `isMarkOfficial: true` skips the phishing checks: it just describes the site
|
|
1942
|
+
* (trusted by the caller, `isPhishing: false`).
|
|
1943
|
+
*
|
|
1944
|
+
* Returns `{ answer, extraData: { currentSite, isPhishing, copiedSite?,
|
|
1945
|
+
* reasons? } }`. Designed to be exported and used standalone.
|
|
1946
|
+
*/
|
|
1947
|
+
declare class WebsiteTrustAgent {
|
|
1948
|
+
private readonly llm;
|
|
1949
|
+
private readonly debug;
|
|
1950
|
+
constructor(config?: WebsiteTrustAgentConfig);
|
|
1951
|
+
chat(input: WebsiteTrustInput): Promise<WebsiteTrustResult>;
|
|
1952
|
+
/**
|
|
1953
|
+
* Derive the phishing verdict + raw (English) evidence reasons from the
|
|
1954
|
+
* investigation — pure logic, no AI, so the verdict is stable across runs.
|
|
1955
|
+
*/
|
|
1956
|
+
private buildVerdict;
|
|
1957
|
+
/**
|
|
1958
|
+
* ONE search-grounded investigation of the EXACT domain. Returns every signal
|
|
1959
|
+
* the verdict needs plus English evidence. Folding the old brand / existence /
|
|
1960
|
+
* describe steps into a single call removes the multi-call fragility (any one
|
|
1961
|
+
* step returning an empty/unparseable turn used to blank out the analysis).
|
|
1962
|
+
*/
|
|
1963
|
+
private investigate;
|
|
1964
|
+
/** Gather a plain description for a caller-trusted (official) site. */
|
|
1965
|
+
private describeOfficial;
|
|
1966
|
+
/**
|
|
1967
|
+
* ONE non-search call that turns the finished assessment into the user-facing
|
|
1968
|
+
* `answer` + `reasons`, in the requested language. Because both come from the
|
|
1969
|
+
* SAME call — with the language mandated at the system level — they are always
|
|
1970
|
+
* the same language and never leak the English evidence. Falls back to the raw
|
|
1971
|
+
* facts (English) only if the model reply is unusable, so we never return empty.
|
|
1972
|
+
*/
|
|
1973
|
+
private present;
|
|
1974
|
+
/**
|
|
1975
|
+
* Resolve a caller-supplied language (a BCP-47 tag like "vi" or a name) to an
|
|
1976
|
+
* explicit English language NAME the model cannot misread. Bare tags like "vi"
|
|
1977
|
+
* are sometimes ignored; "Vietnamese" is unambiguous. Unknown values pass
|
|
1978
|
+
* through unchanged (a full name like "Tiếng Việt" already works).
|
|
1979
|
+
*/
|
|
1980
|
+
private languageLabel;
|
|
1981
|
+
/**
|
|
1982
|
+
* System instruction for user-facing presentation calls. Reinforces — at the
|
|
1983
|
+
* system level — the inline language directive in the prompt. Pass an explicit
|
|
1984
|
+
* language NAME (via {@link languageLabel}), not a bare tag.
|
|
1985
|
+
*/
|
|
1986
|
+
private presentationSystem;
|
|
1987
|
+
/**
|
|
1988
|
+
* One focused LLM call returning the parsed JSON object.
|
|
1989
|
+
*
|
|
1990
|
+
* - `system` swaps the system instruction. The gather call uses the default
|
|
1991
|
+
* {@link GATHER_SYSTEM_PROMPT}; the user-facing presentation call passes
|
|
1992
|
+
* {@link presentationSystem} so the output language is mandated at the
|
|
1993
|
+
* strongest level (system instructions dominate inline ones).
|
|
1994
|
+
* - `googleSearch` defaults to true; pass false for pure rewrite/formatting
|
|
1995
|
+
* calls where grounding only drags the reply toward the source language.
|
|
1996
|
+
* - `maxRetries` lets search-grounded calls survive the occasional empty turn
|
|
1997
|
+
* (a single attempt used to blank out the whole analysis).
|
|
1998
|
+
*/
|
|
1999
|
+
private askJson;
|
|
2000
|
+
/** Hostname when the URL parses, else the raw (trimmed) input. */
|
|
2001
|
+
private normalizeSite;
|
|
2002
|
+
/** Lowercased hostname with any scheme/path and a leading "www." stripped. */
|
|
2003
|
+
private toHost;
|
|
2004
|
+
/**
|
|
2005
|
+
* True when `test` is the SAME registrable domain as `official` (or a real
|
|
2006
|
+
* subdomain of it) — a deterministic, byte-exact comparison. This is what
|
|
2007
|
+
* defeats look-alikes: `binance.co`, `binаnce.com` (homoglyph) and
|
|
2008
|
+
* `secure-binance.com` are NOT equal to `binance.com`, while `www.binance.com`
|
|
2009
|
+
* and `accounts.binance.com` ARE. Used to override the model's exact-match flag.
|
|
2010
|
+
*/
|
|
2011
|
+
private isSameRegistrableDomain;
|
|
2012
|
+
/** Lowercased, letters-and-digits-only form (drops dots, hyphens, etc.). */
|
|
2013
|
+
private alnum;
|
|
2014
|
+
/** The registrable name label (the one just before the TLD), letters+digits only. */
|
|
2015
|
+
private registrableName;
|
|
2016
|
+
/** Levenshtein edit distance between two strings. */
|
|
2017
|
+
private editDistance;
|
|
2018
|
+
/**
|
|
2019
|
+
* True when `name` is a typosquat near-miss of `core` — close but not equal,
|
|
2020
|
+
* e.g. "opensee" vs "opensea" (a missing/swapped/doubled letter). The allowed
|
|
2021
|
+
* distance scales with length so short names don't false-match.
|
|
2022
|
+
*/
|
|
2023
|
+
private isNearMiss;
|
|
2024
|
+
/**
|
|
2025
|
+
* True when the host trades on a brand's core name — the generic squatting
|
|
2026
|
+
* signal the model under-reports. Covers BOTH combosquats by EMBEDDING
|
|
2027
|
+
* (`infurarpc` contains "infura", `binance-pro` contains "binance") AND
|
|
2028
|
+
* typosquats by NEAR-MISS (`opensee` ≈ "opensea"). The brand core comes from
|
|
2029
|
+
* the official domain's first label (preferred) and/or the model's brand name;
|
|
2030
|
+
* a ≥4-char guard avoids trivial coincidences. Brand-agnostic — it works for
|
|
2031
|
+
* any brand the model can name, so it covers the class, not one domain.
|
|
2032
|
+
*/
|
|
2033
|
+
private carriesBrandName;
|
|
2034
|
+
/**
|
|
2035
|
+
* Name the specific look-alike trick a domain uses against the official one,
|
|
2036
|
+
* when it is one of the high-confidence, deterministically detectable cases.
|
|
2037
|
+
* Returns English evidence (later localized by {@link present}); `undefined`
|
|
2038
|
+
* when the difference is not one we can state with certainty.
|
|
2039
|
+
*/
|
|
2040
|
+
private describeLookAlike;
|
|
2041
|
+
/** Parse the first balanced JSON object out of the model's reply. */
|
|
2042
|
+
private parseJson;
|
|
2043
|
+
/** Trim a value to a non-empty string, treating null-ish words as absent. */
|
|
2044
|
+
private cleanStr;
|
|
2045
|
+
/**
|
|
2046
|
+
* Normalize a model `string[]` into a clean array. Accepts an array of
|
|
2047
|
+
* strings, or a single string (split on lines / bullets) as a fallback.
|
|
2048
|
+
*/
|
|
2049
|
+
private cleanStrArray;
|
|
2050
|
+
/** Drop case-insensitive duplicate strings, preserving order. */
|
|
2051
|
+
private dedupe;
|
|
2052
|
+
}
|
|
2053
|
+
|
|
1780
2054
|
/**
|
|
1781
2055
|
* Router — top-level orchestrator in the Router → Subagent → Tool architecture.
|
|
1782
2056
|
*
|
|
@@ -1824,20 +2098,20 @@ declare function createWalletAgent(llm: LLMProvider, registry: ToolRegistry, opt
|
|
|
1824
2098
|
declare const TOKEN_AGENT_TOOL_NAMES: readonly ["get-token-info", "get-token-holders", "get-token-analytics", "get-token-score", "get-trending-tokens", "get-top-gainers", "gemini-search-ai"];
|
|
1825
2099
|
declare function createTokenAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
1826
2100
|
|
|
1827
|
-
declare const NFT_AGENT_TOOL_NAMES: readonly ["get-wallet-nfts", "get-nft-metadata", "get-nft-contract-info", "
|
|
2101
|
+
declare const NFT_AGENT_TOOL_NAMES: readonly ["get-wallet-nfts", "get-nft-metadata", "get-nft-contract-info", "gemini-search-ai"];
|
|
1828
2102
|
declare function createNftAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
1829
2103
|
|
|
1830
2104
|
declare const AI_AGENT_TOOL_NAMES: readonly ["gemini-search-ai"];
|
|
1831
2105
|
declare function createAiAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
1832
2106
|
|
|
1833
|
-
declare const POOL_AGENT_TOOL_NAMES: readonly ["get-top-pools", "get-pool-detail", "search-pools", "lookup-pool-by-address", "open-add-liquidity-form", "preview-add-liquidity", "
|
|
2107
|
+
declare const POOL_AGENT_TOOL_NAMES: readonly ["get-top-pools", "get-pool-detail", "search-pools", "lookup-pool-by-address", "open-add-liquidity-form", "preview-add-liquidity", "estimate-pool-yield", "get-pool-price-ranges", "manage-liquidity-redirect", "pool-fallback-ai"];
|
|
1834
2108
|
declare function createPoolAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
1835
2109
|
|
|
1836
|
-
declare const WALLET_ACTION_AGENT_TOOL_NAMES: readonly ["open-send-native-form", "open-send-token-form", "open-buy-token-form", "open-swap-token-form", "open-approve-token-form"];
|
|
2110
|
+
declare const WALLET_ACTION_AGENT_TOOL_NAMES: readonly ["open-send-native-form", "open-send-token-form", "open-send-nft-form", "open-buy-token-form", "open-swap-token-form", "open-approve-token-form"];
|
|
1837
2111
|
declare function createWalletActionAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
1838
2112
|
|
|
1839
2113
|
/** Built-in subagent ids. */
|
|
1840
|
-
type DefaultSubagentName = 'wallet' | 'wallet-action' | 'token' | 'nft' | 'pool' | 'pool-subgraph' | 'ai';
|
|
2114
|
+
type DefaultSubagentName = 'wallet' | 'wallet-action' | 'wallet-action-app' | 'token' | 'nft' | 'pool' | 'pool-subgraph' | 'ai';
|
|
1841
2115
|
/**
|
|
1842
2116
|
* Per-subagent enable flags. Default for every key is `true` EXCEPT
|
|
1843
2117
|
* `pool-subgraph`, which defaults to `false` because it is mutually exclusive
|
|
@@ -1849,6 +2123,10 @@ type DefaultSubagentName = 'wallet' | 'wallet-action' | 'token' | 'nft' | 'pool'
|
|
|
1849
2123
|
* Turning `pool-subgraph` on automatically turns `pool` off unless the caller
|
|
1850
2124
|
* has explicitly enabled `pool: true`. This prevents two pool agents from
|
|
1851
2125
|
* competing for the same user query.
|
|
2126
|
+
*
|
|
2127
|
+
* Similarly, `wallet-action-app` (default off) is the redirect-only variant of
|
|
2128
|
+
* `wallet-action`: enabling it turns `wallet-action` off. The two are mutually
|
|
2129
|
+
* exclusive — only one wallet-action agent ever exists.
|
|
1852
2130
|
*/
|
|
1853
2131
|
type SubagentToggles = Partial<Record<DefaultSubagentName, boolean>>;
|
|
1854
2132
|
/**
|
|
@@ -1869,7 +2147,11 @@ declare class GeminiProvider implements LLMProvider {
|
|
|
1869
2147
|
private maxTokens;
|
|
1870
2148
|
private temperature;
|
|
1871
2149
|
private baseUrl;
|
|
2150
|
+
/** Per-turn signal applied to every request until cleared. See setRequestSignal. */
|
|
2151
|
+
private requestSignal?;
|
|
1872
2152
|
constructor(config: LLMProviderConfig);
|
|
2153
|
+
/** @see LLMProvider.setRequestSignal */
|
|
2154
|
+
setRequestSignal(signal?: AbortSignal): void;
|
|
1873
2155
|
chat(messages: ChatMessage[], tools?: ToolDefinition[], options?: ChatOptions): Promise<LLMResponse>;
|
|
1874
2156
|
private toContents;
|
|
1875
2157
|
private toFunctionDeclarations;
|
|
@@ -4582,6 +4864,34 @@ interface UniswapServiceConfig {
|
|
|
4582
4864
|
}
|
|
4583
4865
|
type UniswapProtocolVersion = 'V2' | 'V3' | 'V4';
|
|
4584
4866
|
|
|
4867
|
+
interface SubgraphServiceConfig {
|
|
4868
|
+
/** The Graph API key. Falls back to a public demo key. */
|
|
4869
|
+
theGraphApiKey?: string;
|
|
4870
|
+
/** CoinPool pair API base url (`/pair/v2`). */
|
|
4871
|
+
coinPoolBaseUrl?: string;
|
|
4872
|
+
/** @deprecated No longer used — CoinPool `/pair/v2` returns APR + ranges directly. */
|
|
4873
|
+
keyringPoolBaseUrl?: string;
|
|
4874
|
+
/** Override a subgraph URL by chain hex id. */
|
|
4875
|
+
subgraphUrls?: Record<string, string>;
|
|
4876
|
+
}
|
|
4877
|
+
interface CoinPoolPairSummary$1 {
|
|
4878
|
+
poolId: string;
|
|
4879
|
+
pair: string;
|
|
4880
|
+
fee: string;
|
|
4881
|
+
apr: number | null;
|
|
4882
|
+
aprAvg: number | null;
|
|
4883
|
+
token0Price: number;
|
|
4884
|
+
token1Price: number;
|
|
4885
|
+
priceRange: {
|
|
4886
|
+
minPrice: number;
|
|
4887
|
+
maxPrice: number;
|
|
4888
|
+
currentPrice: number;
|
|
4889
|
+
baseToken: string;
|
|
4890
|
+
quoteToken: string;
|
|
4891
|
+
};
|
|
4892
|
+
}
|
|
4893
|
+
type SubgraphSort = 'tvl' | 'volume' | 'apr' | 'fee' | 'liquidity';
|
|
4894
|
+
|
|
4585
4895
|
type TopPoolsToolConfig = UniswapServiceConfig;
|
|
4586
4896
|
/**
|
|
4587
4897
|
* Tool: get-top-pools
|
|
@@ -4597,13 +4907,22 @@ declare class TopPoolsTool extends BaseTool {
|
|
|
4597
4907
|
category: string;
|
|
4598
4908
|
parameters: ToolParameter[];
|
|
4599
4909
|
private service;
|
|
4600
|
-
|
|
4910
|
+
/**
|
|
4911
|
+
* The Graph subgraph client, used ONLY as a data fallback when Uniswap's
|
|
4912
|
+
* ExploreStats has no V3 pools for a chain (e.g. Optimism / Polygon, which are
|
|
4913
|
+
* V4-populated in Explore but still have rich V3 pools on the subgraph). This
|
|
4914
|
+
* is a tool-layer data fallback — the pool agent's tool surface stays
|
|
4915
|
+
* Uniswap-only; it never sees a subgraph tool.
|
|
4916
|
+
*/
|
|
4917
|
+
private subgraphFallback;
|
|
4918
|
+
constructor(config?: TopPoolsToolConfig, subgraphConfig?: SubgraphServiceConfig);
|
|
4601
4919
|
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
4602
4920
|
error: string;
|
|
4603
4921
|
_instructions?: undefined;
|
|
4604
4922
|
chain?: undefined;
|
|
4605
4923
|
protocolVersion?: undefined;
|
|
4606
4924
|
sortBy?: undefined;
|
|
4925
|
+
source?: undefined;
|
|
4607
4926
|
count?: undefined;
|
|
4608
4927
|
pools?: undefined;
|
|
4609
4928
|
} | {
|
|
@@ -4611,8 +4930,10 @@ declare class TopPoolsTool extends BaseTool {
|
|
|
4611
4930
|
chain: string;
|
|
4612
4931
|
protocolVersion: UniswapProtocolVersion;
|
|
4613
4932
|
sortBy: "tvl" | "volume1Day" | "volume1Week" | "volume30Day" | "txCount" | "apr";
|
|
4933
|
+
source: "uniswap" | "subgraph";
|
|
4614
4934
|
count: number;
|
|
4615
4935
|
pools: {
|
|
4936
|
+
uniswapUrl?: string;
|
|
4616
4937
|
apr: number | undefined;
|
|
4617
4938
|
address: string;
|
|
4618
4939
|
chain: string | undefined;
|
|
@@ -4620,6 +4941,7 @@ declare class TopPoolsTool extends BaseTool {
|
|
|
4620
4941
|
feeTierBps: number | undefined;
|
|
4621
4942
|
feeTierPercent: number | undefined;
|
|
4622
4943
|
tvlUsd: number | undefined;
|
|
4944
|
+
fee24hUsd: number | undefined;
|
|
4623
4945
|
volume1DayUsd: number | undefined;
|
|
4624
4946
|
volume1WeekUsd: number | undefined;
|
|
4625
4947
|
volume30DayUsd: number | undefined;
|
|
@@ -4630,6 +4952,8 @@ declare class TopPoolsTool extends BaseTool {
|
|
|
4630
4952
|
name: string | undefined;
|
|
4631
4953
|
decimals: number | undefined;
|
|
4632
4954
|
priceUsd: number | undefined;
|
|
4955
|
+
isSpam: boolean | undefined;
|
|
4956
|
+
safetyLevel: string | undefined;
|
|
4633
4957
|
} | undefined;
|
|
4634
4958
|
token1: {
|
|
4635
4959
|
address: string | undefined;
|
|
@@ -4637,16 +4961,68 @@ declare class TopPoolsTool extends BaseTool {
|
|
|
4637
4961
|
name: string | undefined;
|
|
4638
4962
|
decimals: number | undefined;
|
|
4639
4963
|
priceUsd: number | undefined;
|
|
4964
|
+
isSpam: boolean | undefined;
|
|
4965
|
+
safetyLevel: string | undefined;
|
|
4640
4966
|
} | undefined;
|
|
4967
|
+
volumeToTvlRatio?: number;
|
|
4641
4968
|
}[];
|
|
4642
4969
|
error?: undefined;
|
|
4643
4970
|
}>;
|
|
4971
|
+
/**
|
|
4972
|
+
* Attach deterministic expert signals so the analysis is grounded in real
|
|
4973
|
+
* numbers rather than the LLM's arithmetic. `volumeToTvlRatio` (24h volume ÷
|
|
4974
|
+
* TVL) is the single most informative LP-quality signal — capital efficiency /
|
|
4975
|
+
* how hard each dollar of liquidity is working.
|
|
4976
|
+
*/
|
|
4977
|
+
private withExpertSignals;
|
|
4978
|
+
/**
|
|
4979
|
+
* Fetch the V3 pool leaderboard from The Graph subgraph and shape it to match
|
|
4980
|
+
* {@link formatPool}'s output, so a downstream LLM renders it identically to a
|
|
4981
|
+
* native Uniswap result. Returns `[]` on any error (the caller then surfaces an
|
|
4982
|
+
* empty list, same as before this fallback existed).
|
|
4983
|
+
*/
|
|
4984
|
+
private fetchV3Fallback;
|
|
4985
|
+
/** Sort key resolver for the subgraph fallback (only TVL / 24h volume / APR are available). */
|
|
4986
|
+
private fallbackSortValue;
|
|
4987
|
+
/** Map a subgraph V3 pool to the same shape {@link formatPool} produces. */
|
|
4988
|
+
private formatSubgraphPool;
|
|
4644
4989
|
private parseProtocolVersion;
|
|
4645
4990
|
private parseSortKey;
|
|
4646
4991
|
/** Trim the upstream payload to the fields a downstream LLM actually needs. */
|
|
4647
4992
|
private formatPool;
|
|
4648
4993
|
}
|
|
4649
4994
|
|
|
4995
|
+
/**
|
|
4996
|
+
* Standalone client for the CoinPool platform's concentrated-liquidity
|
|
4997
|
+
* price-range API (`/pair/v2`). This is the CoinPool product — NOT The Graph
|
|
4998
|
+
* subgraph and NOT the Uniswap interface gateway. It is intentionally
|
|
4999
|
+
* independent of {@link UniswapSubgraphService} so the Uniswap-backed
|
|
5000
|
+
* `pool-agent` can surface CoinPool range suggestions without pulling in any
|
|
5001
|
+
* subgraph code (the two pool stacks are mutually exclusive and kept separate).
|
|
5002
|
+
*/
|
|
5003
|
+
interface CoinPoolServiceConfig {
|
|
5004
|
+
/** Base URL of the CoinPool API. Defaults to `https://api.coinpool.app`. */
|
|
5005
|
+
coinPoolBaseUrl?: string;
|
|
5006
|
+
}
|
|
5007
|
+
/** A single concentrated-liquidity price-range candidate from CoinPool. */
|
|
5008
|
+
interface CoinPoolPairSummary {
|
|
5009
|
+
poolId: string;
|
|
5010
|
+
pair: string;
|
|
5011
|
+
fee: string;
|
|
5012
|
+
/** APR earned ONLY within this specific price range (not the overall pool APR). */
|
|
5013
|
+
apr: number | null;
|
|
5014
|
+
aprAvg: number | null;
|
|
5015
|
+
token0Price: number;
|
|
5016
|
+
token1Price: number;
|
|
5017
|
+
priceRange: {
|
|
5018
|
+
minPrice: number;
|
|
5019
|
+
maxPrice: number;
|
|
5020
|
+
currentPrice: number;
|
|
5021
|
+
baseToken: string;
|
|
5022
|
+
quoteToken: string;
|
|
5023
|
+
};
|
|
5024
|
+
}
|
|
5025
|
+
|
|
4650
5026
|
type PoolDetailToolConfig = UniswapServiceConfig;
|
|
4651
5027
|
/**
|
|
4652
5028
|
* Tool: get-pool-detail
|
|
@@ -4668,20 +5044,33 @@ declare class PoolDetailTool extends BaseTool {
|
|
|
4668
5044
|
category: string;
|
|
4669
5045
|
parameters: ToolParameter[];
|
|
4670
5046
|
private service;
|
|
4671
|
-
|
|
5047
|
+
/**
|
|
5048
|
+
* CoinPool client (separate platform — its own API, not the subgraph). When a
|
|
5049
|
+
* pool resolves to exactly one match we also pull its concentrated-liquidity
|
|
5050
|
+
* price-range candidates so the detail view shows ranges inline, without the
|
|
5051
|
+
* user having to ask separately.
|
|
5052
|
+
*/
|
|
5053
|
+
private coinPool;
|
|
5054
|
+
constructor(config?: PoolDetailToolConfig, coinPoolConfig?: CoinPoolServiceConfig);
|
|
4672
5055
|
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
4673
5056
|
error: string;
|
|
5057
|
+
priceRanges?: undefined;
|
|
4674
5058
|
_instructions?: undefined;
|
|
4675
5059
|
pairOrderMatched?: undefined;
|
|
4676
5060
|
pool?: undefined;
|
|
4677
5061
|
chain?: undefined;
|
|
5062
|
+
multiFeeTier?: undefined;
|
|
5063
|
+
count?: undefined;
|
|
5064
|
+
pools?: undefined;
|
|
4678
5065
|
reason?: undefined;
|
|
4679
5066
|
missing?: undefined;
|
|
4680
5067
|
candidates?: undefined;
|
|
4681
5068
|
} | {
|
|
5069
|
+
priceRanges: CoinPoolPairSummary[];
|
|
4682
5070
|
_instructions: string;
|
|
4683
5071
|
pairOrderMatched: string;
|
|
4684
5072
|
pool: {
|
|
5073
|
+
uniswapUrl?: string;
|
|
4685
5074
|
address: string | undefined;
|
|
4686
5075
|
protocolVersion: UniswapProtocolVersion | undefined;
|
|
4687
5076
|
feeTierBps: number | undefined;
|
|
@@ -4691,6 +5080,7 @@ declare class PoolDetailTool extends BaseTool {
|
|
|
4691
5080
|
volume24hUsd: number | undefined;
|
|
4692
5081
|
fees24hUsd: number | undefined;
|
|
4693
5082
|
aprPercent: number | undefined;
|
|
5083
|
+
volumeToTvlRatio: number | undefined;
|
|
4694
5084
|
txCount: number | undefined;
|
|
4695
5085
|
historicalVolumeWeek: {
|
|
4696
5086
|
timestamp: number | undefined;
|
|
@@ -4719,6 +5109,59 @@ declare class PoolDetailTool extends BaseTool {
|
|
|
4719
5109
|
};
|
|
4720
5110
|
error?: undefined;
|
|
4721
5111
|
chain?: undefined;
|
|
5112
|
+
multiFeeTier?: undefined;
|
|
5113
|
+
count?: undefined;
|
|
5114
|
+
pools?: undefined;
|
|
5115
|
+
reason?: undefined;
|
|
5116
|
+
missing?: undefined;
|
|
5117
|
+
candidates?: undefined;
|
|
5118
|
+
} | {
|
|
5119
|
+
_instructions: string;
|
|
5120
|
+
chain: string;
|
|
5121
|
+
pairOrderMatched: string;
|
|
5122
|
+
multiFeeTier: boolean;
|
|
5123
|
+
count: number;
|
|
5124
|
+
pools: {
|
|
5125
|
+
uniswapUrl?: string;
|
|
5126
|
+
address: string | undefined;
|
|
5127
|
+
protocolVersion: UniswapProtocolVersion | undefined;
|
|
5128
|
+
feeTierBps: number | undefined;
|
|
5129
|
+
feeTierPercent: number | undefined;
|
|
5130
|
+
tvlUsd: number | undefined;
|
|
5131
|
+
tvlChange24hPercent: number | undefined;
|
|
5132
|
+
volume24hUsd: number | undefined;
|
|
5133
|
+
fees24hUsd: number | undefined;
|
|
5134
|
+
aprPercent: number | undefined;
|
|
5135
|
+
volumeToTvlRatio: number | undefined;
|
|
5136
|
+
txCount: number | undefined;
|
|
5137
|
+
historicalVolumeWeek: {
|
|
5138
|
+
timestamp: number | undefined;
|
|
5139
|
+
volumeUsd: number | undefined;
|
|
5140
|
+
}[] | undefined;
|
|
5141
|
+
token0: {
|
|
5142
|
+
address: string | undefined;
|
|
5143
|
+
symbol: string | undefined;
|
|
5144
|
+
name: string | undefined;
|
|
5145
|
+
decimals: number | undefined;
|
|
5146
|
+
priceUsd: number | undefined;
|
|
5147
|
+
reserve: number | undefined;
|
|
5148
|
+
isSpam: boolean | undefined;
|
|
5149
|
+
safetyLevel: string | undefined;
|
|
5150
|
+
} | undefined;
|
|
5151
|
+
token1: {
|
|
5152
|
+
address: string | undefined;
|
|
5153
|
+
symbol: string | undefined;
|
|
5154
|
+
name: string | undefined;
|
|
5155
|
+
decimals: number | undefined;
|
|
5156
|
+
priceUsd: number | undefined;
|
|
5157
|
+
reserve: number | undefined;
|
|
5158
|
+
isSpam: boolean | undefined;
|
|
5159
|
+
safetyLevel: string | undefined;
|
|
5160
|
+
} | undefined;
|
|
5161
|
+
}[];
|
|
5162
|
+
error?: undefined;
|
|
5163
|
+
priceRanges?: undefined;
|
|
5164
|
+
pool?: undefined;
|
|
4722
5165
|
reason?: undefined;
|
|
4723
5166
|
missing?: undefined;
|
|
4724
5167
|
candidates?: undefined;
|
|
@@ -4729,6 +5172,7 @@ declare class PoolDetailTool extends BaseTool {
|
|
|
4729
5172
|
reason: string;
|
|
4730
5173
|
missing: string[];
|
|
4731
5174
|
candidates: {
|
|
5175
|
+
uniswapUrl?: string;
|
|
4732
5176
|
address: string | undefined;
|
|
4733
5177
|
protocolVersion: UniswapProtocolVersion | undefined;
|
|
4734
5178
|
feeTierBps: number | undefined;
|
|
@@ -4747,7 +5191,11 @@ declare class PoolDetailTool extends BaseTool {
|
|
|
4747
5191
|
} | undefined;
|
|
4748
5192
|
}[];
|
|
4749
5193
|
error?: undefined;
|
|
5194
|
+
priceRanges?: undefined;
|
|
4750
5195
|
pool?: undefined;
|
|
5196
|
+
multiFeeTier?: undefined;
|
|
5197
|
+
count?: undefined;
|
|
5198
|
+
pools?: undefined;
|
|
4751
5199
|
}>;
|
|
4752
5200
|
/**
|
|
4753
5201
|
* Filter predicate. `mode` controls pair-order matching when both symbols
|
|
@@ -4766,6 +5214,13 @@ declare class PoolDetailTool extends BaseTool {
|
|
|
4766
5214
|
private rankCandidates;
|
|
4767
5215
|
/** Compact view of a search candidate for the LLM to render as a picker. */
|
|
4768
5216
|
private formatCandidate;
|
|
5217
|
+
/**
|
|
5218
|
+
* Best-effort CoinPool price-range candidates for the resolved pool. Tries the
|
|
5219
|
+
* exact pool address first (most precise); if CoinPool has no entry for that
|
|
5220
|
+
* pool, falls back to the token pair so the user still sees relevant ranges.
|
|
5221
|
+
* Never throws — returns `[]` on any miss so the detail view is unaffected.
|
|
5222
|
+
*/
|
|
5223
|
+
private fetchPriceRanges;
|
|
4769
5224
|
/** Trim and enrich the GraphQL payload with derived metrics. */
|
|
4770
5225
|
private formatPool;
|
|
4771
5226
|
private formatHistorical;
|
|
@@ -4810,7 +5265,9 @@ declare class PoolSearchTool extends BaseTool {
|
|
|
4810
5265
|
page: number;
|
|
4811
5266
|
size: number;
|
|
4812
5267
|
count: number;
|
|
4813
|
-
pools:
|
|
5268
|
+
pools: {
|
|
5269
|
+
uniswapUrl?: string;
|
|
5270
|
+
}[];
|
|
4814
5271
|
error?: undefined;
|
|
4815
5272
|
}>;
|
|
4816
5273
|
private parseProtocolFilter;
|
|
@@ -4851,6 +5308,7 @@ declare class PoolByAddressTool extends BaseTool {
|
|
|
4851
5308
|
chain: string;
|
|
4852
5309
|
protocolVersion: UniswapProtocolVersion;
|
|
4853
5310
|
pool: {
|
|
5311
|
+
uniswapUrl?: string;
|
|
4854
5312
|
address: string | undefined;
|
|
4855
5313
|
protocolVersion: UniswapProtocolVersion | undefined;
|
|
4856
5314
|
poolId: string | undefined;
|
|
@@ -4864,6 +5322,7 @@ declare class PoolByAddressTool extends BaseTool {
|
|
|
4864
5322
|
volume24hUsd: number | undefined;
|
|
4865
5323
|
fees24hUsd: number | undefined;
|
|
4866
5324
|
aprPercent: number | undefined;
|
|
5325
|
+
volumeToTvlRatio: number | undefined;
|
|
4867
5326
|
txCount: number | undefined;
|
|
4868
5327
|
historicalVolumeWeek: {
|
|
4869
5328
|
timestamp: number | undefined;
|
|
@@ -4876,6 +5335,8 @@ declare class PoolByAddressTool extends BaseTool {
|
|
|
4876
5335
|
decimals: number | undefined;
|
|
4877
5336
|
priceUsd: number | undefined;
|
|
4878
5337
|
reserve: number | undefined;
|
|
5338
|
+
isSpam: boolean | undefined;
|
|
5339
|
+
safetyLevel: string | undefined;
|
|
4879
5340
|
} | undefined;
|
|
4880
5341
|
token1: {
|
|
4881
5342
|
address: string | undefined;
|
|
@@ -4884,6 +5345,8 @@ declare class PoolByAddressTool extends BaseTool {
|
|
|
4884
5345
|
decimals: number | undefined;
|
|
4885
5346
|
priceUsd: number | undefined;
|
|
4886
5347
|
reserve: number | undefined;
|
|
5348
|
+
isSpam: boolean | undefined;
|
|
5349
|
+
safetyLevel: string | undefined;
|
|
4887
5350
|
} | undefined;
|
|
4888
5351
|
};
|
|
4889
5352
|
error?: undefined;
|
|
@@ -4912,6 +5375,7 @@ declare class PoolByAddressTool extends BaseTool {
|
|
|
4912
5375
|
};
|
|
4913
5376
|
poolCount: number;
|
|
4914
5377
|
pools: {
|
|
5378
|
+
uniswapUrl?: string;
|
|
4915
5379
|
address: string | undefined;
|
|
4916
5380
|
protocolVersion: UniswapProtocolVersion | undefined;
|
|
4917
5381
|
feeTierBps: number | undefined;
|
|
@@ -4945,6 +5409,8 @@ interface OpenAddLiquidityFormToolConfig extends UniswapServiceConfig {
|
|
|
4945
5409
|
pool?: PoolServiceConfig;
|
|
4946
5410
|
/** Min USD value the user must supply. Default 10. */
|
|
4947
5411
|
minProvideUsd?: number;
|
|
5412
|
+
/** CoinPool API config for the reference price-range suggestions. */
|
|
5413
|
+
coinPool?: CoinPoolServiceConfig;
|
|
4948
5414
|
}
|
|
4949
5415
|
/**
|
|
4950
5416
|
* Tool: open-add-liquidity-form
|
|
@@ -4970,6 +5436,7 @@ declare class OpenAddLiquidityFormTool extends BaseTool {
|
|
|
4970
5436
|
parameters: ToolParameter[];
|
|
4971
5437
|
private uniswap;
|
|
4972
5438
|
private pool;
|
|
5439
|
+
private coinPool;
|
|
4973
5440
|
private minProvideUsd;
|
|
4974
5441
|
constructor(config?: OpenAddLiquidityFormToolConfig);
|
|
4975
5442
|
/**
|
|
@@ -4984,8 +5451,10 @@ declare class OpenAddLiquidityFormTool extends BaseTool {
|
|
|
4984
5451
|
requestedToken?: undefined;
|
|
4985
5452
|
nativeSymbol?: undefined;
|
|
4986
5453
|
chainName?: undefined;
|
|
4987
|
-
|
|
5454
|
+
relatedPools?: undefined;
|
|
5455
|
+
count?: undefined;
|
|
4988
5456
|
ui?: undefined;
|
|
5457
|
+
suggestedRanges?: undefined;
|
|
4989
5458
|
summary?: undefined;
|
|
4990
5459
|
} | {
|
|
4991
5460
|
error: string;
|
|
@@ -4994,8 +5463,10 @@ declare class OpenAddLiquidityFormTool extends BaseTool {
|
|
|
4994
5463
|
requestedToken?: undefined;
|
|
4995
5464
|
nativeSymbol?: undefined;
|
|
4996
5465
|
chainName?: undefined;
|
|
4997
|
-
|
|
5466
|
+
relatedPools?: undefined;
|
|
5467
|
+
count?: undefined;
|
|
4998
5468
|
ui?: undefined;
|
|
5469
|
+
suggestedRanges?: undefined;
|
|
4999
5470
|
summary?: undefined;
|
|
5000
5471
|
} | {
|
|
5001
5472
|
error: string;
|
|
@@ -5004,8 +5475,10 @@ declare class OpenAddLiquidityFormTool extends BaseTool {
|
|
|
5004
5475
|
chainName: string;
|
|
5005
5476
|
_instructions: string;
|
|
5006
5477
|
chain?: undefined;
|
|
5007
|
-
|
|
5478
|
+
relatedPools?: undefined;
|
|
5479
|
+
count?: undefined;
|
|
5008
5480
|
ui?: undefined;
|
|
5481
|
+
suggestedRanges?: undefined;
|
|
5009
5482
|
summary?: undefined;
|
|
5010
5483
|
} | {
|
|
5011
5484
|
error: string;
|
|
@@ -5014,12 +5487,15 @@ declare class OpenAddLiquidityFormTool extends BaseTool {
|
|
|
5014
5487
|
requestedToken?: undefined;
|
|
5015
5488
|
nativeSymbol?: undefined;
|
|
5016
5489
|
chainName?: undefined;
|
|
5017
|
-
|
|
5490
|
+
relatedPools?: undefined;
|
|
5491
|
+
count?: undefined;
|
|
5018
5492
|
ui?: undefined;
|
|
5493
|
+
suggestedRanges?: undefined;
|
|
5019
5494
|
summary?: undefined;
|
|
5020
5495
|
} | {
|
|
5021
|
-
|
|
5496
|
+
relatedPools: {
|
|
5022
5497
|
apr?: number | undefined;
|
|
5498
|
+
volumeToTvlRatio?: number | undefined;
|
|
5023
5499
|
address: string | undefined;
|
|
5024
5500
|
token0Symbol: string | undefined;
|
|
5025
5501
|
token1Symbol: string | undefined;
|
|
@@ -5028,6 +5504,7 @@ declare class OpenAddLiquidityFormTool extends BaseTool {
|
|
|
5028
5504
|
volume24hUsd: number | undefined;
|
|
5029
5505
|
tvlUsd: number | undefined;
|
|
5030
5506
|
}[];
|
|
5507
|
+
count: number;
|
|
5031
5508
|
_instructions: string;
|
|
5032
5509
|
error?: undefined;
|
|
5033
5510
|
chain?: undefined;
|
|
@@ -5035,9 +5512,19 @@ declare class OpenAddLiquidityFormTool extends BaseTool {
|
|
|
5035
5512
|
nativeSymbol?: undefined;
|
|
5036
5513
|
chainName?: undefined;
|
|
5037
5514
|
ui?: undefined;
|
|
5515
|
+
suggestedRanges?: undefined;
|
|
5038
5516
|
summary?: undefined;
|
|
5039
5517
|
} | {
|
|
5040
5518
|
ui: UIPayload<AddLiquidityFormProps>;
|
|
5519
|
+
suggestedRanges: {
|
|
5520
|
+
fee: string;
|
|
5521
|
+
apr: number | null;
|
|
5522
|
+
minPrice: number;
|
|
5523
|
+
maxPrice: number;
|
|
5524
|
+
currentPrice: number;
|
|
5525
|
+
baseSymbol?: string;
|
|
5526
|
+
quoteSymbol?: string;
|
|
5527
|
+
}[];
|
|
5041
5528
|
summary: string;
|
|
5042
5529
|
_instructions: string;
|
|
5043
5530
|
error?: undefined;
|
|
@@ -5045,8 +5532,32 @@ declare class OpenAddLiquidityFormTool extends BaseTool {
|
|
|
5045
5532
|
requestedToken?: undefined;
|
|
5046
5533
|
nativeSymbol?: undefined;
|
|
5047
5534
|
chainName?: undefined;
|
|
5048
|
-
|
|
5535
|
+
relatedPools?: undefined;
|
|
5536
|
+
count?: undefined;
|
|
5049
5537
|
}>;
|
|
5538
|
+
/**
|
|
5539
|
+
* Best-effort CoinPool in-range price-range candidates for the resolved pool,
|
|
5540
|
+
* offered to the user as a reference when filling the form's range inputs.
|
|
5541
|
+
* Tries the exact pool address first (most precise); falls back to the token
|
|
5542
|
+
* pair when CoinPool has no entry for that pool. Never throws — returns `[]`
|
|
5543
|
+
* on any miss so the add-liquidity form is unaffected. The CoinPool service
|
|
5544
|
+
* already drops out-of-range entries, so every candidate here is in-range.
|
|
5545
|
+
*/
|
|
5546
|
+
private fetchPriceRanges;
|
|
5547
|
+
/**
|
|
5548
|
+
* Re-express CoinPool range candidates in the form's price unit (token1 per
|
|
5549
|
+
* token0, decimal-adjusted — the same unit as `pool.currentPrice` and the
|
|
5550
|
+
* min/max inputs). CoinPool orients each entry by its own `selectorAddress`,
|
|
5551
|
+
* which may pick EITHER token as the base, so a USDC/WETH pool can come back
|
|
5552
|
+
* as ~1600 (USDC per WETH) while the form shows ~0.0006 (WETH per USDC).
|
|
5553
|
+
*
|
|
5554
|
+
* For each candidate we pick the reading — as-is or reciprocal — whose current
|
|
5555
|
+
* price is closer (in log space) to the pool's actual on-chain current price,
|
|
5556
|
+
* then label base = token0, quote = token1 to match the form. When the pool
|
|
5557
|
+
* price is unknown we cannot orient safely, so we drop the suggestions rather
|
|
5558
|
+
* than risk showing an inverted (misleading) range.
|
|
5559
|
+
*/
|
|
5560
|
+
private orientRangesToForm;
|
|
5050
5561
|
private matchesPairExact;
|
|
5051
5562
|
private matchesPair;
|
|
5052
5563
|
private symMatch;
|
|
@@ -5113,6 +5624,9 @@ declare class PreviewAddLiquidityTool extends BaseTool {
|
|
|
5113
5624
|
rawTickUpper?: undefined;
|
|
5114
5625
|
tickLower?: undefined;
|
|
5115
5626
|
tickUpper?: undefined;
|
|
5627
|
+
currentPrice?: undefined;
|
|
5628
|
+
requestedRange?: undefined;
|
|
5629
|
+
side?: undefined;
|
|
5116
5630
|
balanceWei?: undefined;
|
|
5117
5631
|
requiredWei?: undefined;
|
|
5118
5632
|
gasReserveWei?: undefined;
|
|
@@ -5126,6 +5640,9 @@ declare class PreviewAddLiquidityTool extends BaseTool {
|
|
|
5126
5640
|
rawTickUpper?: undefined;
|
|
5127
5641
|
tickLower?: undefined;
|
|
5128
5642
|
tickUpper?: undefined;
|
|
5643
|
+
currentPrice?: undefined;
|
|
5644
|
+
requestedRange?: undefined;
|
|
5645
|
+
side?: undefined;
|
|
5129
5646
|
balanceWei?: undefined;
|
|
5130
5647
|
requiredWei?: undefined;
|
|
5131
5648
|
gasReserveWei?: undefined;
|
|
@@ -5139,6 +5656,9 @@ declare class PreviewAddLiquidityTool extends BaseTool {
|
|
|
5139
5656
|
rawTickUpper?: undefined;
|
|
5140
5657
|
tickLower?: undefined;
|
|
5141
5658
|
tickUpper?: undefined;
|
|
5659
|
+
currentPrice?: undefined;
|
|
5660
|
+
requestedRange?: undefined;
|
|
5661
|
+
side?: undefined;
|
|
5142
5662
|
balanceWei?: undefined;
|
|
5143
5663
|
requiredWei?: undefined;
|
|
5144
5664
|
gasReserveWei?: undefined;
|
|
@@ -5152,6 +5672,28 @@ declare class PreviewAddLiquidityTool extends BaseTool {
|
|
|
5152
5672
|
tickLower: number;
|
|
5153
5673
|
tickUpper: number;
|
|
5154
5674
|
chain?: undefined;
|
|
5675
|
+
currentPrice?: undefined;
|
|
5676
|
+
requestedRange?: undefined;
|
|
5677
|
+
side?: undefined;
|
|
5678
|
+
balanceWei?: undefined;
|
|
5679
|
+
requiredWei?: undefined;
|
|
5680
|
+
gasReserveWei?: undefined;
|
|
5681
|
+
ui?: undefined;
|
|
5682
|
+
summary?: undefined;
|
|
5683
|
+
} | {
|
|
5684
|
+
error: string;
|
|
5685
|
+
_instructions: string;
|
|
5686
|
+
currentPrice: number;
|
|
5687
|
+
requestedRange: {
|
|
5688
|
+
minPrice: number;
|
|
5689
|
+
maxPrice: number;
|
|
5690
|
+
};
|
|
5691
|
+
side: string;
|
|
5692
|
+
chain?: undefined;
|
|
5693
|
+
rawTickLower?: undefined;
|
|
5694
|
+
rawTickUpper?: undefined;
|
|
5695
|
+
tickLower?: undefined;
|
|
5696
|
+
tickUpper?: undefined;
|
|
5155
5697
|
balanceWei?: undefined;
|
|
5156
5698
|
requiredWei?: undefined;
|
|
5157
5699
|
gasReserveWei?: undefined;
|
|
@@ -5168,6 +5710,9 @@ declare class PreviewAddLiquidityTool extends BaseTool {
|
|
|
5168
5710
|
rawTickUpper?: undefined;
|
|
5169
5711
|
tickLower?: undefined;
|
|
5170
5712
|
tickUpper?: undefined;
|
|
5713
|
+
currentPrice?: undefined;
|
|
5714
|
+
requestedRange?: undefined;
|
|
5715
|
+
side?: undefined;
|
|
5171
5716
|
ui?: undefined;
|
|
5172
5717
|
summary?: undefined;
|
|
5173
5718
|
} | {
|
|
@@ -5180,6 +5725,9 @@ declare class PreviewAddLiquidityTool extends BaseTool {
|
|
|
5180
5725
|
rawTickUpper?: undefined;
|
|
5181
5726
|
tickLower?: undefined;
|
|
5182
5727
|
tickUpper?: undefined;
|
|
5728
|
+
currentPrice?: undefined;
|
|
5729
|
+
requestedRange?: undefined;
|
|
5730
|
+
side?: undefined;
|
|
5183
5731
|
balanceWei?: undefined;
|
|
5184
5732
|
requiredWei?: undefined;
|
|
5185
5733
|
gasReserveWei?: undefined;
|
|
@@ -5251,6 +5799,7 @@ declare class EstimatePoolYieldTool extends BaseTool {
|
|
|
5251
5799
|
tvlUsd: number | undefined;
|
|
5252
5800
|
volume24hUsd: number | undefined;
|
|
5253
5801
|
fees24hUsd: number | undefined;
|
|
5802
|
+
volumeToTvlRatio: number | undefined;
|
|
5254
5803
|
aprPercent: number | undefined;
|
|
5255
5804
|
chain: string;
|
|
5256
5805
|
token0: {
|
|
@@ -5279,6 +5828,7 @@ declare class EstimatePoolYieldTool extends BaseTool {
|
|
|
5279
5828
|
tvlUsd: number | undefined;
|
|
5280
5829
|
volume24hUsd: number | undefined;
|
|
5281
5830
|
fees24hUsd: number | undefined;
|
|
5831
|
+
volumeToTvlRatio: number | undefined;
|
|
5282
5832
|
aprPercent: number | undefined;
|
|
5283
5833
|
chain: string;
|
|
5284
5834
|
token0: {
|
|
@@ -5306,33 +5856,80 @@ declare class EstimatePoolYieldTool extends BaseTool {
|
|
|
5306
5856
|
private describeQuery;
|
|
5307
5857
|
}
|
|
5308
5858
|
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5859
|
+
type PoolPriceRangesToolConfig = CoinPoolServiceConfig;
|
|
5860
|
+
/**
|
|
5861
|
+
* Tool: get-pool-price-ranges
|
|
5862
|
+
*
|
|
5863
|
+
* Returns concentrated-liquidity price-range candidates from the CoinPool
|
|
5864
|
+
* platform for a token pair on a chain. Each entry is a SPECIFIC price range
|
|
5865
|
+
* with its own APR (NOT the overall pool APR). Used by the Uniswap-backed
|
|
5866
|
+
* `pool-agent` to suggest which range to provide liquidity in.
|
|
5867
|
+
*
|
|
5868
|
+
* Backed by the CoinPool `/pair/v2` API — independent of The Graph subgraph and
|
|
5869
|
+
* of the Uniswap interface gateway. Returns an empty list when the chain is not
|
|
5870
|
+
* served by CoinPool.
|
|
5871
|
+
*/
|
|
5872
|
+
declare class PoolPriceRangesTool extends BaseTool {
|
|
5873
|
+
name: string;
|
|
5874
|
+
description: string;
|
|
5875
|
+
category: string;
|
|
5876
|
+
noSuggestions: boolean;
|
|
5877
|
+
parameters: ToolParameter[];
|
|
5878
|
+
private service;
|
|
5879
|
+
constructor(config?: PoolPriceRangesToolConfig);
|
|
5880
|
+
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
5881
|
+
error: string;
|
|
5882
|
+
_instructions?: undefined;
|
|
5883
|
+
unsupportedChains?: undefined;
|
|
5884
|
+
supportedChains?: undefined;
|
|
5885
|
+
tokens?: undefined;
|
|
5886
|
+
chain?: undefined;
|
|
5887
|
+
count?: undefined;
|
|
5888
|
+
pairs?: undefined;
|
|
5889
|
+
} | {
|
|
5890
|
+
_instructions: string;
|
|
5891
|
+
unsupportedChains: string[];
|
|
5892
|
+
supportedChains: string[];
|
|
5893
|
+
error?: undefined;
|
|
5894
|
+
tokens?: undefined;
|
|
5895
|
+
chain?: undefined;
|
|
5896
|
+
count?: undefined;
|
|
5897
|
+
pairs?: undefined;
|
|
5898
|
+
} | {
|
|
5899
|
+
_instructions: string;
|
|
5900
|
+
tokens: string[];
|
|
5901
|
+
chain: string;
|
|
5902
|
+
count: number;
|
|
5903
|
+
pairs: CoinPoolPairSummary[];
|
|
5904
|
+
error?: undefined;
|
|
5905
|
+
unsupportedChains?: undefined;
|
|
5906
|
+
supportedChains?: undefined;
|
|
5907
|
+
}>;
|
|
5318
5908
|
}
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5909
|
+
|
|
5910
|
+
/**
|
|
5911
|
+
* Tool: manage-liquidity-redirect
|
|
5912
|
+
*
|
|
5913
|
+
* The agent can OPEN an add-liquidity flow in-app, but managing an EXISTING
|
|
5914
|
+
* position — collecting earned fees or closing/removing the pair — is not
|
|
5915
|
+
* supported in-app yet. For those actions we point the user to the CoinPool
|
|
5916
|
+
* web app (https://coinpool.app/my-liquidity), which lists their positions and
|
|
5917
|
+
* exposes the collect / close controls.
|
|
5918
|
+
*
|
|
5919
|
+
* Returns a static instruction only — no API calls, no chain reads.
|
|
5920
|
+
*/
|
|
5921
|
+
declare class ManageLiquidityRedirectTool extends BaseTool {
|
|
5922
|
+
name: string;
|
|
5923
|
+
description: string;
|
|
5924
|
+
category: string;
|
|
5925
|
+
noSuggestions: boolean;
|
|
5926
|
+
parameters: ToolParameter[];
|
|
5927
|
+
protected run(args: Record<string, unknown>): Promise<{
|
|
5928
|
+
_instructions: string;
|
|
5929
|
+
url: string;
|
|
5930
|
+
action: string | undefined;
|
|
5931
|
+
}>;
|
|
5334
5932
|
}
|
|
5335
|
-
type SubgraphSort = 'tvl' | 'volume' | 'apr' | 'fee' | 'liquidity';
|
|
5336
5933
|
|
|
5337
5934
|
type SubgraphPoolSearchToolConfig = SubgraphServiceConfig;
|
|
5338
5935
|
/**
|
|
@@ -5399,7 +5996,7 @@ declare class SubgraphPoolSearchTool extends BaseTool {
|
|
|
5399
5996
|
};
|
|
5400
5997
|
uniswapUrl: string;
|
|
5401
5998
|
}[];
|
|
5402
|
-
coinPoolPairs: (CoinPoolPairSummary & {
|
|
5999
|
+
coinPoolPairs: (CoinPoolPairSummary$1 & {
|
|
5403
6000
|
chain: string;
|
|
5404
6001
|
})[];
|
|
5405
6002
|
supportedChains?: undefined;
|
|
@@ -5499,7 +6096,7 @@ declare class SubgraphPoolByAddressTool extends BaseTool {
|
|
|
5499
6096
|
} | {
|
|
5500
6097
|
_instructions: string;
|
|
5501
6098
|
chain: string;
|
|
5502
|
-
coinPoolPairs: never[] | CoinPoolPairSummary[];
|
|
6099
|
+
coinPoolPairs: never[] | CoinPoolPairSummary$1[];
|
|
5503
6100
|
pool: {
|
|
5504
6101
|
pair: string;
|
|
5505
6102
|
poolAddress: string;
|
|
@@ -5752,7 +6349,7 @@ declare class SubgraphCoinPoolPairsTool extends BaseTool {
|
|
|
5752
6349
|
tokens: string[];
|
|
5753
6350
|
chain: string;
|
|
5754
6351
|
count: number;
|
|
5755
|
-
pairs: CoinPoolPairSummary[];
|
|
6352
|
+
pairs: CoinPoolPairSummary$1[];
|
|
5756
6353
|
error?: undefined;
|
|
5757
6354
|
unsupportedChains?: undefined;
|
|
5758
6355
|
supportedChains?: undefined;
|
|
@@ -5822,7 +6419,7 @@ declare class SubgraphAddPoolTool extends BaseTool {
|
|
|
5822
6419
|
};
|
|
5823
6420
|
uniswapUrl: string;
|
|
5824
6421
|
}[];
|
|
5825
|
-
coinPoolPairs: CoinPoolPairSummary[];
|
|
6422
|
+
coinPoolPairs: CoinPoolPairSummary$1[];
|
|
5826
6423
|
} | {
|
|
5827
6424
|
_instructions: string;
|
|
5828
6425
|
howTo: boolean;
|
|
@@ -6878,6 +7475,77 @@ declare class SendNftTool extends BaseWalletActionTool {
|
|
|
6878
7475
|
private paramsFromNft;
|
|
6879
7476
|
}
|
|
6880
7477
|
|
|
7478
|
+
/**
|
|
7479
|
+
* Config for the redirect-only wallet-action tools used by the
|
|
7480
|
+
* `wallet-action-app` subagent.
|
|
7481
|
+
*/
|
|
7482
|
+
interface WalletActionAppToolConfig {
|
|
7483
|
+
/**
|
|
7484
|
+
* Optional link to the app where the user performs the action. When set, the
|
|
7485
|
+
* tool surfaces it as plain text so the user can open the app directly. When
|
|
7486
|
+
* omitted, the tool just tells the user the action is done in the app.
|
|
7487
|
+
*/
|
|
7488
|
+
appLink?: string;
|
|
7489
|
+
/**
|
|
7490
|
+
* Optional NFT website link, used ONLY by the send-NFT tool. Mirrors the
|
|
7491
|
+
* `wallet-action` SendNftTool: when set, the notice carries a clickable
|
|
7492
|
+
* Markdown link to this URL; when omitted, the website phrase stays plain
|
|
7493
|
+
* text. Separate from `appLink` because sending an NFT is done on the NFT
|
|
7494
|
+
* website, not the wallet-action app.
|
|
7495
|
+
*/
|
|
7496
|
+
nftLink?: string;
|
|
7497
|
+
}
|
|
7498
|
+
interface ActionSpec {
|
|
7499
|
+
/** Tool name — mirrors the matching `wallet-action` form tool it replaces. */
|
|
7500
|
+
name: string;
|
|
7501
|
+
/** Routing description so the agent picks this tool for the matching intent. */
|
|
7502
|
+
description: string;
|
|
7503
|
+
/** Human phrase used in the redirect message, e.g. "send a token". */
|
|
7504
|
+
what: string;
|
|
7505
|
+
/**
|
|
7506
|
+
* Which link the redirect points to. `'app'` (default) → the wallet-action
|
|
7507
|
+
* app (`appLink`); `'nft'` → the NFT website (`nftLink`), matching how the
|
|
7508
|
+
* `wallet-action` SendNftTool points NFT sends to the NFT site.
|
|
7509
|
+
*/
|
|
7510
|
+
linkKind?: 'app' | 'nft';
|
|
7511
|
+
}
|
|
7512
|
+
/**
|
|
7513
|
+
* Redirect-only wallet-action tool.
|
|
7514
|
+
*
|
|
7515
|
+
* The `wallet-action-app` subagent is a variant of `wallet-action` for
|
|
7516
|
+
* deployments where the action is NOT performed in chat. Instead of emitting a
|
|
7517
|
+
* pre-filled form, every tool returns a static instruction telling the user
|
|
7518
|
+
* they can perform the action directly in the app. No API calls, no chain
|
|
7519
|
+
* reads, no parameters.
|
|
7520
|
+
*/
|
|
7521
|
+
declare class WalletActionAppTool extends BaseTool {
|
|
7522
|
+
name: string;
|
|
7523
|
+
description: string;
|
|
7524
|
+
category: string;
|
|
7525
|
+
noSuggestions: boolean;
|
|
7526
|
+
parameters: ToolParameter[];
|
|
7527
|
+
private readonly what;
|
|
7528
|
+
private readonly linkKind;
|
|
7529
|
+
private readonly appLink?;
|
|
7530
|
+
private readonly nftLink?;
|
|
7531
|
+
constructor(spec: ActionSpec, config?: WalletActionAppToolConfig);
|
|
7532
|
+
protected run(): Promise<{
|
|
7533
|
+
message: string;
|
|
7534
|
+
_instructions: string;
|
|
7535
|
+
} | {
|
|
7536
|
+
url?: string | undefined;
|
|
7537
|
+
_instructions: string;
|
|
7538
|
+
}>;
|
|
7539
|
+
/**
|
|
7540
|
+
* Fixed "go to the NFT website" notice — byte-for-byte the same pattern as
|
|
7541
|
+
* the `wallet-action` SendNftTool: the website phrase becomes a clickable
|
|
7542
|
+
* Markdown link when `nftLink` is configured, plain text otherwise.
|
|
7543
|
+
*/
|
|
7544
|
+
private nftWebsiteNotice;
|
|
7545
|
+
}
|
|
7546
|
+
/** Create the full set of redirect-only wallet-action tools. */
|
|
7547
|
+
declare function createWalletActionAppTools(config?: WalletActionAppToolConfig): WalletActionAppTool[];
|
|
7548
|
+
|
|
6881
7549
|
/**
|
|
6882
7550
|
* Shared JSON-RPC client + default public RPC endpoints.
|
|
6883
7551
|
*
|
|
@@ -7286,4 +7954,23 @@ declare class Summarizer {
|
|
|
7286
7954
|
summarize(messages: ChatMessage[]): Promise<string>;
|
|
7287
7955
|
}
|
|
7288
7956
|
|
|
7289
|
-
|
|
7957
|
+
/**
|
|
7958
|
+
* Cancellation helpers shared by AgentCore and the LLM provider.
|
|
7959
|
+
*
|
|
7960
|
+
* A turn is cancelled by aborting an `AbortSignal`. We surface every cancellation
|
|
7961
|
+
* as an {@link AbortError} (`name === 'AbortError'`) so consumers can branch on it
|
|
7962
|
+
* uniformly, regardless of whether the abort originated from our own check or from
|
|
7963
|
+
* the underlying HTTP client (axios throws a `CanceledError` with `code` of
|
|
7964
|
+
* `'ERR_CANCELED'`).
|
|
7965
|
+
*/
|
|
7966
|
+
/** Error thrown when a chat turn is cancelled via its AbortSignal. */
|
|
7967
|
+
declare class AbortError extends Error {
|
|
7968
|
+
constructor(message?: string);
|
|
7969
|
+
}
|
|
7970
|
+
/**
|
|
7971
|
+
* True when `err` represents a cancellation — either our own {@link AbortError},
|
|
7972
|
+
* a DOMException AbortError, or axios's `CanceledError` (`code: 'ERR_CANCELED'`).
|
|
7973
|
+
*/
|
|
7974
|
+
declare function isAbortError(err: unknown): boolean;
|
|
7975
|
+
|
|
7976
|
+
export { AI_AGENT_TOOL_NAMES, AbortError, type AddLiquidityFormProps, type AddLiquiditySummary, type AffiliateFee, type AgentConfig, AgentCore, type AgentResponse, ApproveTokenTool, BaseNftAiTool, 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, ManageLiquidityRedirectTool, type MoralisApiResponse, MoralisService, type MoralisServiceConfig, NFTContractInfoTool, type NFTContractMetadata, type NFTItem, type NFTLastSale, type NFTMetadata, NFTMetadataTool, 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, PoolFallbackAiTool, type PoolFallbackAiToolConfig, type PoolOnchainInfo, PoolPriceRangesTool, type PoolPriceRangesToolConfig, 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, 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 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, WalletActionAppTool, type WalletActionAppToolConfig, 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 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, WebsiteTrustAgent, type WebsiteTrustAgentConfig, type WebsiteTrustExtraData, type WebsiteTrustInput, type WebsiteTrustResult, ZERO_ADDRESS, buildRangePresets, buildUniswapPoolUrl, clampTick, configureSupportedChains, createAiAgent, createDefaultSubagents, createNftAgent, createPoolAgent, createTokenAgent, createWalletActionAgent, createWalletActionAppTools, createWalletAgent, ethCallAt, ethCallByChain, getAffiliateFee, getChainMeta, getDefaultRpcUrl, getGatewayAddress, getNativeTokenInfo, getPositionManagerAddress, getProviderByChain, ingestKnowledgeBase, isAbortError, normalizePriceRangeToPool, priceToTick, resolveRpcUrl, roundTickToSpacing, rpcCall, setRpcOverrides, swapServiceFactory, tickToPrice, toPantographChain };
|