keyring-agent-core 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +777 -25
- package/dist/index.js +124 -124
- package/dist/index.native.js +252 -252
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1547,6 +1547,21 @@ interface BuyTokenSide {
|
|
|
1547
1547
|
* depends on it being set.
|
|
1548
1548
|
*/
|
|
1549
1549
|
logo?: string;
|
|
1550
|
+
/**
|
|
1551
|
+
* USD price of ONE whole token, when the index reported one. Display only:
|
|
1552
|
+
* the FE multiplies it by the amount on screen to caption each side of the
|
|
1553
|
+
* swap with what it is worth, the same fiat line the app's own Exchange
|
|
1554
|
+
* screen puts under its fields.
|
|
1555
|
+
*
|
|
1556
|
+
* Resolved HERE rather than by the app so the price travels with the token it
|
|
1557
|
+
* belongs to — one source for the balance, the symbol, the decimals and the
|
|
1558
|
+
* valuation, all read in the same pass. It is a SNAPSHOT, taken when the form
|
|
1559
|
+
* was built, and it goes stale exactly as the balance beside it does: the
|
|
1560
|
+
* form re-reads both together when the user taps Refresh, and never on its
|
|
1561
|
+
* own. Absent for a token the index has no price for, which the FE must
|
|
1562
|
+
* render as NO fiat line — an unpriced token is not a worthless one.
|
|
1563
|
+
*/
|
|
1564
|
+
usdPrice?: number;
|
|
1550
1565
|
}
|
|
1551
1566
|
/**
|
|
1552
1567
|
* Props for the FE `SwapTokenForm` component — the ONE payload SwapTokenTool and
|
|
@@ -2028,13 +2043,35 @@ interface AgentConfig {
|
|
|
2028
2043
|
* for buying one. Opt-in — defaults to false.
|
|
2029
2044
|
*/
|
|
2030
2045
|
nfc?: boolean;
|
|
2031
|
-
|
|
2046
|
+
/**
|
|
2047
|
+
* Uniswap Explore-backed pool agent (V2/V3/V4 + add-liquidity). Default on.
|
|
2048
|
+
* Mutually exclusive with `pool-subgraph` and `pool-defillama`.
|
|
2049
|
+
*/
|
|
2050
|
+
'pool-uniswap'?: boolean;
|
|
2032
2051
|
/**
|
|
2033
2052
|
* Subgraph-backed pool agent (Uniswap V3 via The Graph + DefiLlama APR + CoinPool ranges).
|
|
2034
|
-
* Mutually exclusive with `pool`. Enabling this
|
|
2035
|
-
*
|
|
2053
|
+
* Mutually exclusive with `pool-uniswap` and `pool-defillama`. Enabling this
|
|
2054
|
+
* (true) automatically disables `pool-uniswap` unless that key is also
|
|
2055
|
+
* explicitly set to true. Defaults to false.
|
|
2036
2056
|
*/
|
|
2037
2057
|
'pool-subgraph'?: boolean;
|
|
2058
|
+
/**
|
|
2059
|
+
* DefiLlama-backed pool agent (Uniswap V2/V3/V4 market data from DefiLlama
|
|
2060
|
+
* Yields + CoinPool ranges + on-chain add-liquidity).
|
|
2061
|
+
*
|
|
2062
|
+
* Serves the SAME capabilities as `pool-uniswap` — same questions, same
|
|
2063
|
+
* add-liquidity flow — through a different upstream API, so a deployment can
|
|
2064
|
+
* switch data sources without any user-visible behaviour change. Its data
|
|
2065
|
+
* tools are named `defillama-*` where the Uniswap stack's are `uniswap-*`;
|
|
2066
|
+
* the add-liquidity / price-range / manage tools are literally shared
|
|
2067
|
+
* (`pool-*`). Covers 7 chains rather than 8: DefiLlama tracks no Uniswap
|
|
2068
|
+
* pools on Linea.
|
|
2069
|
+
*
|
|
2070
|
+
* Mutually exclusive with `pool-uniswap` and `pool-subgraph`. Enabling this
|
|
2071
|
+
* (true) automatically disables `pool-uniswap` unless that key is also
|
|
2072
|
+
* explicitly set to true. Defaults to false. Configure via `defiLlama`.
|
|
2073
|
+
*/
|
|
2074
|
+
'pool-defillama'?: boolean;
|
|
2038
2075
|
ai?: boolean;
|
|
2039
2076
|
};
|
|
2040
2077
|
/**
|
|
@@ -2077,6 +2114,28 @@ interface AgentConfig {
|
|
|
2077
2114
|
/** Minimum USD value the user must supply to add liquidity. Default 10. */
|
|
2078
2115
|
minProvideUsd?: number;
|
|
2079
2116
|
} | false;
|
|
2117
|
+
/**
|
|
2118
|
+
* DefiLlama Yields config for the `pool-defillama` subagent. Set to `false` to
|
|
2119
|
+
* skip registering those tools.
|
|
2120
|
+
*
|
|
2121
|
+
* Independent of `uniswap` — the DefiLlama stack needs no Uniswap gateway. It
|
|
2122
|
+
* DOES still use the shared RPC endpoints (for the on-chain add-liquidity
|
|
2123
|
+
* flow) and the CoinPool API (for price-range suggestions), exactly as the
|
|
2124
|
+
* Uniswap stack does. To actually route queries here, also set
|
|
2125
|
+
* `subagents['pool-defillama']: true`.
|
|
2126
|
+
*/
|
|
2127
|
+
defiLlama?: {
|
|
2128
|
+
/** Base URL of the DefiLlama Yields API (default: https://yields.llama.fi). */
|
|
2129
|
+
baseUrl?: string;
|
|
2130
|
+
/**
|
|
2131
|
+
* How long the pool snapshot is cached, in ms. Default 5 minutes.
|
|
2132
|
+
* DefiLlama serves one un-filterable ~12MB payload, so this is fetched
|
|
2133
|
+
* whole and cached; upstream itself only refreshes hourly.
|
|
2134
|
+
*/
|
|
2135
|
+
cacheTtlMs?: number;
|
|
2136
|
+
/** Minimum USD value the user must supply to add liquidity. Default 10. */
|
|
2137
|
+
minProvideUsd?: number;
|
|
2138
|
+
} | false;
|
|
2080
2139
|
/**
|
|
2081
2140
|
* Tools that must NOT open a form in this deployment, mapped to the message
|
|
2082
2141
|
* the user gets instead (e.g. "you can swap in the app: <link>").
|
|
@@ -3130,33 +3189,38 @@ declare function createNfcAgent(llm: LLMProvider, registry: ToolRegistry, option
|
|
|
3130
3189
|
declare const AI_AGENT_TOOL_NAMES: readonly ["gemini-search-ai"];
|
|
3131
3190
|
declare function createAiAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
3132
3191
|
|
|
3133
|
-
declare const
|
|
3134
|
-
declare function
|
|
3192
|
+
declare const POOL_UNISWAP_AGENT_TOOL_NAMES: readonly ["uniswap-top-pools", "uniswap-pool-detail", "uniswap-search-pools", "uniswap-pool-by-address", "pool-open-add-liquidity-form", "pool-preview-add-liquidity", "uniswap-estimate-pool-yield", "pool-price-ranges", "pool-manage-liquidity-redirect", "pool-fallback-ai"];
|
|
3193
|
+
declare function createPoolUniswapAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
3135
3194
|
|
|
3136
3195
|
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"];
|
|
3137
3196
|
declare function createWalletActionAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
3138
3197
|
|
|
3139
3198
|
/** Built-in subagent ids. */
|
|
3140
|
-
type DefaultSubagentName = 'wallet' | 'wallet-action' | 'lending' | 'token' | 'nft' | 'nfc' | 'pool' | 'pool-subgraph' | 'ai';
|
|
3199
|
+
type DefaultSubagentName = 'wallet' | 'wallet-action' | 'lending' | 'token' | 'nft' | 'nfc' | 'pool-uniswap' | 'pool-subgraph' | 'pool-defillama' | 'ai';
|
|
3141
3200
|
/**
|
|
3142
3201
|
* Per-subagent enable flags. Default for every key is `true` EXCEPT
|
|
3143
|
-
* `pool-subgraph`, which
|
|
3144
|
-
*
|
|
3202
|
+
* `pool-subgraph` and `pool-defillama`, which default to `false` because all
|
|
3203
|
+
* three pool agents are mutually exclusive. Enable exactly ONE per deployment:
|
|
3204
|
+
*
|
|
3205
|
+
* - `pool-uniswap` (default on) → Uniswap Explore gateway (V2/V3/V4) + add-liquidity
|
|
3206
|
+
* - `pool-subgraph` → The Graph subgraphs (V3) + DefiLlama APR + CoinPool ranges
|
|
3207
|
+
* - `pool-defillama` → DefiLlama Yields (V2/V3/V4 data, V3 add-liquidity) + CoinPool ranges
|
|
3145
3208
|
*
|
|
3146
|
-
* - `pool`
|
|
3147
|
-
*
|
|
3209
|
+
* Turning `pool-subgraph` OR `pool-defillama` on automatically turns
|
|
3210
|
+
* `pool-uniswap` off unless the caller has explicitly enabled it. This prevents
|
|
3211
|
+
* two pool agents from competing for the same user query.
|
|
3148
3212
|
*
|
|
3149
|
-
*
|
|
3150
|
-
*
|
|
3151
|
-
*
|
|
3213
|
+
* `pool-defillama` serves the same capabilities as `pool-uniswap` through a
|
|
3214
|
+
* different API: same flows, source-prefixed tool names, 7 chains instead of 8
|
|
3215
|
+
* (no Linea).
|
|
3152
3216
|
*/
|
|
3153
3217
|
type SubagentToggles = Partial<Record<DefaultSubagentName, boolean>>;
|
|
3154
3218
|
/**
|
|
3155
3219
|
* Create the default set of domain subagents. Returned in routing-priority order.
|
|
3156
3220
|
*
|
|
3157
|
-
* `toggles` lets callers disable individual subagents. `pool-subgraph`
|
|
3158
|
-
* opt-in (default false); enabling
|
|
3159
|
-
* explicitly set
|
|
3221
|
+
* `toggles` lets callers disable individual subagents. `pool-subgraph` and
|
|
3222
|
+
* `pool-defillama` are opt-in (default false); enabling either disables
|
|
3223
|
+
* `pool-uniswap` unless the caller has explicitly set it back on.
|
|
3160
3224
|
*/
|
|
3161
3225
|
declare function createDefaultSubagents(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions, toggles?: SubagentToggles): Subagent[];
|
|
3162
3226
|
|
|
@@ -3283,6 +3347,24 @@ interface TokenMetadata {
|
|
|
3283
3347
|
usd_price?: number;
|
|
3284
3348
|
usd_price_24hr_percent_change?: number;
|
|
3285
3349
|
usd_price_24hr_usd_change?: number;
|
|
3350
|
+
/**
|
|
3351
|
+
* The token's `symbol()` as READ FROM THE CONTRACT, when the upstream index
|
|
3352
|
+
* has it. Distinct from `symbol`, which is the index's own editorial label and
|
|
3353
|
+
* is frequently lower-cased ("usdc") or otherwise diverges from the chain.
|
|
3354
|
+
*
|
|
3355
|
+
* `null` when the index never resolved it — a token whose symbol therefore
|
|
3356
|
+
* still has to be read on-chain by the caller. Absent on endpoints that don't
|
|
3357
|
+
* report it at all (e.g. top-gainers), which is the same situation.
|
|
3358
|
+
*
|
|
3359
|
+
* Consumers should not have to reach for this: `normalizePantographToken`
|
|
3360
|
+
* already promotes it over `symbol`, so the canonical field is on-chain-true
|
|
3361
|
+
* wherever Pantograph knew the answer. It stays exposed for callers that need
|
|
3362
|
+
* to know WHICH source a symbol came from — see `confirmTokenIdentities`,
|
|
3363
|
+
* which skips its RPC round-trip when the symbol is already on-chain-sourced.
|
|
3364
|
+
*/
|
|
3365
|
+
symbolOnchain?: string | null;
|
|
3366
|
+
/** The token's on-chain `name()`, same contract as {@link symbolOnchain}. */
|
|
3367
|
+
nameOnchain?: string | null;
|
|
3286
3368
|
auditGoplus?: Record<string, unknown>;
|
|
3287
3369
|
holder_count?: string;
|
|
3288
3370
|
holders?: unknown[];
|
|
@@ -8202,12 +8284,89 @@ declare class PoolByAddressTool extends BaseTool {
|
|
|
8202
8284
|
private formatPoolCandidate;
|
|
8203
8285
|
}
|
|
8204
8286
|
|
|
8287
|
+
/**
|
|
8288
|
+
* Pluggable pool LOOKUP for the add-liquidity flow.
|
|
8289
|
+
*
|
|
8290
|
+
* `OpenAddLiquidityFormTool` needs exactly one thing from a pool data source:
|
|
8291
|
+
* turn a token pair (plus an optional fee tier, plus an optionally pinned pool
|
|
8292
|
+
* address) into candidate pools it can pick from. Everything the tool does after
|
|
8293
|
+
* that — reading `slot0` / `tickSpacing` on-chain, the balance and gas-reserve
|
|
8294
|
+
* maths, tick alignment, building the gateway call — is chain state, identical
|
|
8295
|
+
* no matter which API named the pool.
|
|
8296
|
+
*
|
|
8297
|
+
* Isolating just the lookup behind this interface is what lets the Uniswap
|
|
8298
|
+
* Explore stack and the DefiLlama stack share ONE add-liquidity implementation
|
|
8299
|
+
* instead of maintaining two ~1000-line copies that would inevitably drift.
|
|
8300
|
+
*
|
|
8301
|
+
* {@link PoolCandidate} is structurally a subset of `SearchPoolResult`, so the
|
|
8302
|
+
* Uniswap resolver is a pass-through and the tool's existing matching helpers
|
|
8303
|
+
* work unchanged against either source.
|
|
8304
|
+
*/
|
|
8305
|
+
|
|
8306
|
+
/**
|
|
8307
|
+
* A token as a candidate reports it. `name` and `logo` are display-only — they
|
|
8308
|
+
* flow straight into the add-liquidity form's props — and are optional because
|
|
8309
|
+
* not every source carries them (DefiLlama reports symbols and addresses only,
|
|
8310
|
+
* so the form simply renders without them).
|
|
8311
|
+
*/
|
|
8312
|
+
interface PoolCandidateToken {
|
|
8313
|
+
symbol?: string;
|
|
8314
|
+
address?: string;
|
|
8315
|
+
name?: string;
|
|
8316
|
+
logo?: string;
|
|
8317
|
+
}
|
|
8318
|
+
/**
|
|
8319
|
+
* One candidate pool. `id` is the pool address (V2/V3) or pool id (V4) — the
|
|
8320
|
+
* identifier the add-liquidity flow reads on-chain.
|
|
8321
|
+
*/
|
|
8322
|
+
interface PoolCandidate {
|
|
8323
|
+
id?: string;
|
|
8324
|
+
protocolVersion?: 'V2' | 'V3' | 'V4';
|
|
8325
|
+
feeTier?: number;
|
|
8326
|
+
token0?: PoolCandidateToken;
|
|
8327
|
+
token1?: PoolCandidateToken;
|
|
8328
|
+
tvlUsd?: number;
|
|
8329
|
+
volume1DayUsd?: number;
|
|
8330
|
+
volumeUsd24hr?: number;
|
|
8331
|
+
apr?: number;
|
|
8332
|
+
isDynamicFee?: boolean;
|
|
8333
|
+
}
|
|
8334
|
+
interface ResolvePoolCandidatesParams {
|
|
8335
|
+
chain: string;
|
|
8336
|
+
token0Symbol: string;
|
|
8337
|
+
token1Symbol: string;
|
|
8338
|
+
/** Narrow to one fee tier (bps). Ignored when a pool address is pinned. */
|
|
8339
|
+
feeTier?: number;
|
|
8340
|
+
/**
|
|
8341
|
+
* `'V3'` for the mintable set (the default the flow works with), `'ALL'` when
|
|
8342
|
+
* the caller is diagnosing whether the pool exists as V2/V4 instead.
|
|
8343
|
+
*/
|
|
8344
|
+
protocolVersion: 'V3' | 'ALL';
|
|
8345
|
+
}
|
|
8346
|
+
/** A pool data source the add-liquidity flow can resolve candidates from. */
|
|
8347
|
+
interface PoolCandidateResolver {
|
|
8348
|
+
/**
|
|
8349
|
+
* Return every pool matching the pair on the chain. Returns `null` — distinct
|
|
8350
|
+
* from `[]` — when the LOOKUP ITSELF failed, so the caller reports an error
|
|
8351
|
+
* rather than the misleading "no pool found".
|
|
8352
|
+
*/
|
|
8353
|
+
resolveCandidates(params: ResolvePoolCandidatesParams): Promise<PoolCandidate[] | null>;
|
|
8354
|
+
}
|
|
8355
|
+
|
|
8205
8356
|
interface OpenAddLiquidityFormToolConfig extends UniswapServiceConfig {
|
|
8206
8357
|
pool?: PoolServiceConfig;
|
|
8207
8358
|
/** Min USD value the user must supply. Default 10. */
|
|
8208
8359
|
minProvideUsd?: number;
|
|
8209
8360
|
/** CoinPool API config for the reference price-range suggestions. */
|
|
8210
8361
|
coinPool?: CoinPoolServiceConfig;
|
|
8362
|
+
/**
|
|
8363
|
+
* Where candidate pools are looked up from. Defaults to Uniswap's own pool
|
|
8364
|
+
* search; the DefiLlama-backed pool agent injects its own resolver so both
|
|
8365
|
+
* agents share this single add-liquidity implementation. See
|
|
8366
|
+
* {@link PoolCandidateResolver} — only the LOOKUP varies, never the on-chain
|
|
8367
|
+
* work that follows it.
|
|
8368
|
+
*/
|
|
8369
|
+
resolver?: PoolCandidateResolver;
|
|
8211
8370
|
}
|
|
8212
8371
|
/**
|
|
8213
8372
|
* Tool: open-add-liquidity-form
|
|
@@ -8230,7 +8389,7 @@ declare class OpenAddLiquidityFormTool extends BaseTool {
|
|
|
8230
8389
|
category: string;
|
|
8231
8390
|
description: string;
|
|
8232
8391
|
parameters: ToolParameter[];
|
|
8233
|
-
private
|
|
8392
|
+
private resolver;
|
|
8234
8393
|
private pool;
|
|
8235
8394
|
private coinPool;
|
|
8236
8395
|
private minProvideUsd;
|
|
@@ -8360,7 +8519,39 @@ declare class EstimatePoolYieldTool extends BaseTool {
|
|
|
8360
8519
|
private describeQuery;
|
|
8361
8520
|
}
|
|
8362
8521
|
|
|
8363
|
-
|
|
8522
|
+
/**
|
|
8523
|
+
* A pool operation's supported-chain tier. Pools cover fewer chains than the
|
|
8524
|
+
* 12-chain global catalog, and ADD-LIQUIDITY covers fewer still:
|
|
8525
|
+
* - `info` → the 8 Uniswap-Explore chains ({@link POOL_INFO_CHAIN_HEXES}).
|
|
8526
|
+
* - `add-liquidity` → only chains with a gateway contract configured (a smaller,
|
|
8527
|
+
* dynamic subset resolved from the addresses API at call time).
|
|
8528
|
+
*
|
|
8529
|
+
* Tools never reason about these sets directly — they hand a scope to
|
|
8530
|
+
* {@link gatePoolChain}, which resolves + validates the chain and, when it isn't
|
|
8531
|
+
* served, returns the right "not available on this chain, available on: …" result.
|
|
8532
|
+
*/
|
|
8533
|
+
interface PoolChainScope {
|
|
8534
|
+
/** Selects the not-supported wording ({@link poolChainNotSupportedResult}). */
|
|
8535
|
+
readonly kind: 'info' | 'add-liquidity';
|
|
8536
|
+
/** Canonical hex ids this scope serves, intersected with the active set. */
|
|
8537
|
+
listSupported(): Promise<string[]>;
|
|
8538
|
+
/** True when this scope's data/flow is available for `chain`. */
|
|
8539
|
+
isSupported(chain: string): Promise<boolean>;
|
|
8540
|
+
}
|
|
8541
|
+
|
|
8542
|
+
interface PoolPriceRangesToolConfig extends CoinPoolServiceConfig {
|
|
8543
|
+
/**
|
|
8544
|
+
* Chain scope to gate on. Defaults to the Uniswap pool-INFO set; the
|
|
8545
|
+
* DefiLlama-backed pool agent passes its own (narrower) scope so the tool
|
|
8546
|
+
* advertises and gates the same chains as the rest of that agent's tools.
|
|
8547
|
+
* CoinPool itself is shared — only the SUPPORTED-CHAIN set differs.
|
|
8548
|
+
*/
|
|
8549
|
+
scope?: PoolChainScope;
|
|
8550
|
+
/** Human-readable supported-chain list for the tool description. */
|
|
8551
|
+
supportsLabel?: string;
|
|
8552
|
+
/** `chain` parameter description matching {@link scope}. */
|
|
8553
|
+
chainParamDescription?: string;
|
|
8554
|
+
}
|
|
8364
8555
|
/**
|
|
8365
8556
|
* Tool: get-pool-price-ranges
|
|
8366
8557
|
*
|
|
@@ -8379,6 +8570,7 @@ declare class PoolPriceRangesTool extends BaseTool {
|
|
|
8379
8570
|
category: string;
|
|
8380
8571
|
parameters: ToolParameter[];
|
|
8381
8572
|
private service;
|
|
8573
|
+
private scope;
|
|
8382
8574
|
constructor(config?: PoolPriceRangesToolConfig);
|
|
8383
8575
|
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<Record<string, unknown>>;
|
|
8384
8576
|
}
|
|
@@ -8988,6 +9180,464 @@ declare class SubgraphAddPoolTool extends BaseTool {
|
|
|
8988
9180
|
private formatPool;
|
|
8989
9181
|
}
|
|
8990
9182
|
|
|
9183
|
+
/**
|
|
9184
|
+
* DefiLlamaPoolService — pool data from the DefiLlama Yields API.
|
|
9185
|
+
*
|
|
9186
|
+
* The data source behind the `pool-defillama` subagent, mirroring what
|
|
9187
|
+
* {@link UniswapService} (Uniswap Explore) does for the `pool-uniswap`
|
|
9188
|
+
* subagent: same questions, different upstream. A deployment enables exactly
|
|
9189
|
+
* one of them.
|
|
9190
|
+
*
|
|
9191
|
+
* Three properties of the upstream shape everything here:
|
|
9192
|
+
*
|
|
9193
|
+
* 1. ONE endpoint, NO filters. `https://yields.llama.fi/pools` ignores every
|
|
9194
|
+
* query parameter and always returns the full ~12MB / 17k-pool snapshot, so
|
|
9195
|
+
* the service fetches once, caches, and does all filtering/sorting locally.
|
|
9196
|
+
* The in-flight promise is shared so a burst of tool calls triggers a single
|
|
9197
|
+
* download.
|
|
9198
|
+
* 2. NO pool addresses. A pool is identified by an opaque UUID plus
|
|
9199
|
+
* `underlyingTokens` + `poolMeta` (the fee tier). The address every on-chain
|
|
9200
|
+
* flow needs is recomputed with {@link deriveV3PoolAddress} — see
|
|
9201
|
+
* `uniswapV3PoolAddress.ts`. V2/V4 have no such derivation here, so only V3
|
|
9202
|
+
* pools carry an address.
|
|
9203
|
+
* 3. NO address index. Nothing maps an address back to a pool, so a pasted 0x
|
|
9204
|
+
* address is resolved by deriving candidate addresses for the pools we
|
|
9205
|
+
* already hold and matching (see {@link findByPoolAddress}); the caller falls
|
|
9206
|
+
* back to an on-chain read when that misses.
|
|
9207
|
+
*/
|
|
9208
|
+
interface DefiLlamaPoolServiceConfig {
|
|
9209
|
+
/** Base URL of the DefiLlama Yields API. Defaults to `https://yields.llama.fi`. */
|
|
9210
|
+
baseUrl?: string;
|
|
9211
|
+
/** Snapshot cache TTL in ms. Defaults to 5 minutes (upstream refreshes hourly). */
|
|
9212
|
+
cacheTtlMs?: number;
|
|
9213
|
+
}
|
|
9214
|
+
/** Uniswap protocol versions DefiLlama exposes as separate `project` values. */
|
|
9215
|
+
type DefiLlamaProtocolVersion = 'V2' | 'V3' | 'V4';
|
|
9216
|
+
/** A pool, normalized to the shape the pool tools render. */
|
|
9217
|
+
interface DefiLlamaPool {
|
|
9218
|
+
/** DefiLlama's opaque pool UUID — stable, and the key for the history chart. */
|
|
9219
|
+
id: string;
|
|
9220
|
+
/** `"USDC/WETH"`. Derived from the upstream `symbol` (`"USDC-WETH"`). */
|
|
9221
|
+
pair: string;
|
|
9222
|
+
chain: string;
|
|
9223
|
+
protocolVersion: DefiLlamaProtocolVersion;
|
|
9224
|
+
/**
|
|
9225
|
+
* The pool's on-chain address, recomputed via CREATE2. Present only for V3
|
|
9226
|
+
* pools on a chain with a known factory AND a parseable fee tier; `undefined`
|
|
9227
|
+
* otherwise, which callers must treat as "cannot act on-chain".
|
|
9228
|
+
*/
|
|
9229
|
+
address?: string;
|
|
9230
|
+
/** Fee tier in hundredths of a bip (500 = 0.05%), parsed from `poolMeta`. */
|
|
9231
|
+
feeTierBps?: number;
|
|
9232
|
+
/** Fee tier as a percentage (0.05 = 0.05%). */
|
|
9233
|
+
feeTierPercent?: number;
|
|
9234
|
+
tvlUsd: number;
|
|
9235
|
+
/** Fee APR as a PERCENT (5 = 5%) — same unit as the Uniswap/subgraph paths. */
|
|
9236
|
+
apr?: number;
|
|
9237
|
+
/** {@link apr} plus any reward/incentive APR upstream attributes to the pool. */
|
|
9238
|
+
totalApr?: number;
|
|
9239
|
+
volume1DayUsd?: number;
|
|
9240
|
+
volume7DayUsd?: number;
|
|
9241
|
+
/** 24h volume ÷ TVL — the capital-efficiency signal the shared rubric reads. */
|
|
9242
|
+
volumeToTvlRatio?: number;
|
|
9243
|
+
/** LP fee revenue over 24h, in USD: volume × fee tier. */
|
|
9244
|
+
fee24hUsd?: number;
|
|
9245
|
+
token0?: {
|
|
9246
|
+
symbol?: string;
|
|
9247
|
+
address?: string;
|
|
9248
|
+
};
|
|
9249
|
+
token1?: {
|
|
9250
|
+
symbol?: string;
|
|
9251
|
+
address?: string;
|
|
9252
|
+
};
|
|
9253
|
+
/** True when DefiLlama classifies the pool as a stablecoin pair. */
|
|
9254
|
+
isStablecoin?: boolean;
|
|
9255
|
+
/** Upstream impermanent-loss risk label ("no" / "yes"). */
|
|
9256
|
+
ilRisk?: string;
|
|
9257
|
+
/** APR change over 1d / 7d / 30d, in percentage points. */
|
|
9258
|
+
aprChange1D?: number;
|
|
9259
|
+
aprChange7D?: number;
|
|
9260
|
+
aprChange30D?: number;
|
|
9261
|
+
/** 30-day mean APR — a steadiness signal against the spot `apr`. */
|
|
9262
|
+
aprMean30d?: number;
|
|
9263
|
+
}
|
|
9264
|
+
interface DefiLlamaServiceResponse<T> {
|
|
9265
|
+
success: boolean;
|
|
9266
|
+
data?: T;
|
|
9267
|
+
error?: string;
|
|
9268
|
+
}
|
|
9269
|
+
type DefiLlamaSortBy = 'tvl' | 'volume1Day' | 'volume7Day' | 'apr';
|
|
9270
|
+
/** Hex chain ids this service serves, in the order tools should advertise them. */
|
|
9271
|
+
declare const DEFILLAMA_POOL_CHAIN_HEXES: string[];
|
|
9272
|
+
declare class DefiLlamaPoolService {
|
|
9273
|
+
private readonly baseUrl;
|
|
9274
|
+
private readonly cacheTtlMs;
|
|
9275
|
+
constructor(config?: DefiLlamaPoolServiceConfig);
|
|
9276
|
+
/** The cache entry for this instance's endpoint, created on first use. */
|
|
9277
|
+
private get store();
|
|
9278
|
+
isSupported(chain?: string | null): boolean;
|
|
9279
|
+
listSupportedChains(): string[];
|
|
9280
|
+
/**
|
|
9281
|
+
* The full normalized pool snapshot, cached for {@link cacheTtlMs}.
|
|
9282
|
+
*
|
|
9283
|
+
* On a refresh failure a STALE cache is returned rather than throwing: pool
|
|
9284
|
+
* data minutes out of date is far better than an error, and DefiLlama's own
|
|
9285
|
+
* numbers only refresh hourly.
|
|
9286
|
+
*/
|
|
9287
|
+
private snapshot;
|
|
9288
|
+
/**
|
|
9289
|
+
* Force the next read to re-download. Exposed for tests/diagnostics.
|
|
9290
|
+
*
|
|
9291
|
+
* Clears the cache for THIS instance's endpoint, which every service on that
|
|
9292
|
+
* endpoint shares — that is the point of the shared cache, and what makes a
|
|
9293
|
+
* test's reset actually take effect on the tools under test.
|
|
9294
|
+
*/
|
|
9295
|
+
clearCache(): void;
|
|
9296
|
+
/**
|
|
9297
|
+
* Parse `poolMeta` into a fee tier in hundredths of a bip.
|
|
9298
|
+
*
|
|
9299
|
+
* Upstream writes the tier as a percentage string ("0.05%", "0.3%"). Values
|
|
9300
|
+
* that do not correspond to a real Uniswap tier are rejected rather than
|
|
9301
|
+
* rounded: a wrong tier would derive a wrong pool address, and a wrong address
|
|
9302
|
+
* is far more damaging than a missing one.
|
|
9303
|
+
*/
|
|
9304
|
+
private parseFeeTierBps;
|
|
9305
|
+
private normalize;
|
|
9306
|
+
private sortValue;
|
|
9307
|
+
private sorted;
|
|
9308
|
+
/**
|
|
9309
|
+
* The chain-wide leaderboard — the `get-top-pools` counterpart.
|
|
9310
|
+
*
|
|
9311
|
+
* `forAddLiquidity` keeps only pools that can actually be minted into: V3
|
|
9312
|
+
* pools whose address was derivable. Without it a user could pick a V2/V4 pool
|
|
9313
|
+
* from the list and hit a dead end at the add-liquidity step.
|
|
9314
|
+
*/
|
|
9315
|
+
getTopPools(params: {
|
|
9316
|
+
chain: string;
|
|
9317
|
+
limit?: number;
|
|
9318
|
+
sortBy?: DefiLlamaSortBy;
|
|
9319
|
+
protocolVersion?: DefiLlamaProtocolVersion | 'ALL';
|
|
9320
|
+
forAddLiquidity?: boolean;
|
|
9321
|
+
}): Promise<DefiLlamaServiceResponse<DefiLlamaPool[]>>;
|
|
9322
|
+
/**
|
|
9323
|
+
* Free-text pool search — the `search-pools` counterpart.
|
|
9324
|
+
*
|
|
9325
|
+
* Matches on token SYMBOLS (and token addresses when the query looks like
|
|
9326
|
+
* one). Every named symbol must appear in the pair, so "ETH USDC" returns only
|
|
9327
|
+
* ETH/USDC pools rather than the union of both tokens' pools.
|
|
9328
|
+
*/
|
|
9329
|
+
searchPools(params: {
|
|
9330
|
+
chain: string;
|
|
9331
|
+
query: string;
|
|
9332
|
+
limit?: number;
|
|
9333
|
+
sortBy?: DefiLlamaSortBy;
|
|
9334
|
+
protocolVersion?: DefiLlamaProtocolVersion | 'ALL';
|
|
9335
|
+
forAddLiquidity?: boolean;
|
|
9336
|
+
}): Promise<DefiLlamaServiceResponse<DefiLlamaPool[]>>;
|
|
9337
|
+
/**
|
|
9338
|
+
* Symbol comparison that tolerates the wrapped/native spelling difference:
|
|
9339
|
+
* a user asking for "ETH" means the WETH pools, and "BTC" means WBTC. Exact
|
|
9340
|
+
* match first so "ETH" never matches an unrelated token that merely contains
|
|
9341
|
+
* those letters.
|
|
9342
|
+
*/
|
|
9343
|
+
private symbolMatches;
|
|
9344
|
+
/**
|
|
9345
|
+
* Resolve the pools for a token pair (and optional fee tier) — the
|
|
9346
|
+
* `get-pool-detail` counterpart. Returns EVERY matching pool, sorted, so the
|
|
9347
|
+
* caller can render fee-tier candidates when more than one comes back.
|
|
9348
|
+
*/
|
|
9349
|
+
getPoolsByPair(params: {
|
|
9350
|
+
chain: string;
|
|
9351
|
+
token0Symbol: string;
|
|
9352
|
+
token1Symbol?: string;
|
|
9353
|
+
feeTierBps?: number;
|
|
9354
|
+
protocolVersion?: DefiLlamaProtocolVersion | 'ALL';
|
|
9355
|
+
}): Promise<DefiLlamaServiceResponse<DefiLlamaPool[]>>;
|
|
9356
|
+
/**
|
|
9357
|
+
* Reverse-resolve a pool ADDRESS to its DefiLlama entry.
|
|
9358
|
+
*
|
|
9359
|
+
* DefiLlama has no address index, so this matches against the addresses the
|
|
9360
|
+
* snapshot already derived. A hit therefore means "a V3 pool DefiLlama tracks
|
|
9361
|
+
* on this chain"; a miss means only that DefiLlama does not track it — the
|
|
9362
|
+
* pool may still exist, which is why callers fall back to an on-chain read
|
|
9363
|
+
* rather than reporting "not found".
|
|
9364
|
+
*/
|
|
9365
|
+
findByPoolAddress(params: {
|
|
9366
|
+
chain: string;
|
|
9367
|
+
address: string;
|
|
9368
|
+
}): Promise<DefiLlamaServiceResponse<DefiLlamaPool | null>>;
|
|
9369
|
+
/**
|
|
9370
|
+
* Find the pools that contain a given TOKEN address — what a pasted address
|
|
9371
|
+
* resolves to when it turns out to be a token rather than a pool.
|
|
9372
|
+
*/
|
|
9373
|
+
findPoolsByTokenAddress(params: {
|
|
9374
|
+
chain: string;
|
|
9375
|
+
address: string;
|
|
9376
|
+
limit?: number;
|
|
9377
|
+
}): Promise<DefiLlamaServiceResponse<DefiLlamaPool[]>>;
|
|
9378
|
+
}
|
|
9379
|
+
|
|
9380
|
+
type DefiLlamaTopPoolsToolConfig = DefiLlamaPoolServiceConfig;
|
|
9381
|
+
/**
|
|
9382
|
+
* Tool: get-top-pools (DefiLlama-backed)
|
|
9383
|
+
*
|
|
9384
|
+
* The chain-wide pool leaderboard — the DefiLlama counterpart of the Uniswap
|
|
9385
|
+
* stack's `uniswap-top-pools`. The `llama-` prefix names the data source, so a
|
|
9386
|
+
* log line or trace says unambiguously which stack answered.
|
|
9387
|
+
*
|
|
9388
|
+
* Note the sort keys differ slightly from the Uniswap stack: DefiLlama reports a
|
|
9389
|
+
* 7-day volume bucket where Uniswap reports a 30-day one, so `volume7Day`
|
|
9390
|
+
* replaces `volume30Day` rather than being faked from data we do not have.
|
|
9391
|
+
*/
|
|
9392
|
+
declare class DefiLlamaTopPoolsTool extends BaseTool {
|
|
9393
|
+
name: string;
|
|
9394
|
+
description: string;
|
|
9395
|
+
category: string;
|
|
9396
|
+
parameters: ToolParameter[];
|
|
9397
|
+
private service;
|
|
9398
|
+
private pool;
|
|
9399
|
+
constructor(config?: DefiLlamaTopPoolsToolConfig);
|
|
9400
|
+
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<Record<string, unknown>>;
|
|
9401
|
+
}
|
|
9402
|
+
|
|
9403
|
+
type DefiLlamaPoolSearchToolConfig = DefiLlamaPoolServiceConfig;
|
|
9404
|
+
/**
|
|
9405
|
+
* Tool: search-pools (DefiLlama-backed)
|
|
9406
|
+
*
|
|
9407
|
+
* Finds pools related to a token the user named — the DefiLlama counterpart of
|
|
9408
|
+
* the Uniswap stack's `uniswap-search-pools`.
|
|
9409
|
+
*
|
|
9410
|
+
* The match is AND-across-terms (see `DefiLlamaPoolService.searchPools`), so a
|
|
9411
|
+
* two-symbol query returns that pair's pools rather than the union of each
|
|
9412
|
+
* token's pools, and "ETH" resolves to the WETH pools a user actually means.
|
|
9413
|
+
*/
|
|
9414
|
+
declare class DefiLlamaPoolSearchTool extends BaseTool {
|
|
9415
|
+
name: string;
|
|
9416
|
+
description: string;
|
|
9417
|
+
category: string;
|
|
9418
|
+
parameters: ToolParameter[];
|
|
9419
|
+
private service;
|
|
9420
|
+
private pool;
|
|
9421
|
+
constructor(config?: DefiLlamaPoolSearchToolConfig);
|
|
9422
|
+
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<Record<string, unknown>>;
|
|
9423
|
+
}
|
|
9424
|
+
|
|
9425
|
+
type DefiLlamaPoolDetailToolConfig = DefiLlamaPoolServiceConfig;
|
|
9426
|
+
/**
|
|
9427
|
+
* Tool: get-pool-detail (DefiLlama-backed)
|
|
9428
|
+
*
|
|
9429
|
+
* Full stats for ONE pool identified BY TOKEN PAIR (never by address — that is
|
|
9430
|
+
* `lookup-pool-by-address`). Mirrors the Uniswap stack's two-outcome contract
|
|
9431
|
+
* exactly, because the subagent prompt is shared:
|
|
9432
|
+
*
|
|
9433
|
+
* - the filter resolves to one pool → `{ pool: … }`
|
|
9434
|
+
* - it resolves to several → `{ candidates: [ … ] }` and NO `pool`
|
|
9435
|
+
* key, so the model asks which fee tier rather than inventing one.
|
|
9436
|
+
*/
|
|
9437
|
+
declare class DefiLlamaPoolDetailTool extends BaseTool {
|
|
9438
|
+
name: string;
|
|
9439
|
+
description: string;
|
|
9440
|
+
category: string;
|
|
9441
|
+
parameters: ToolParameter[];
|
|
9442
|
+
private service;
|
|
9443
|
+
private pool;
|
|
9444
|
+
constructor(config?: DefiLlamaPoolDetailToolConfig);
|
|
9445
|
+
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<Record<string, unknown>>;
|
|
9446
|
+
}
|
|
9447
|
+
|
|
9448
|
+
type DefiLlamaPoolByAddressToolConfig = DefiLlamaPoolServiceConfig;
|
|
9449
|
+
/**
|
|
9450
|
+
* Tool: lookup-pool-by-address (DefiLlama-backed)
|
|
9451
|
+
*
|
|
9452
|
+
* Resolves a bare 0x address the user pasted without saying what it is.
|
|
9453
|
+
*
|
|
9454
|
+
* This is the one capability DefiLlama cannot serve on its own: its Yields feed
|
|
9455
|
+
* has no address index at all — a pool is an opaque UUID — so an address can
|
|
9456
|
+
* never be looked up directly. The tool therefore resolves in three stages,
|
|
9457
|
+
* cheapest first, and only reports "not found" when all three miss:
|
|
9458
|
+
*
|
|
9459
|
+
* 1. POOL, from the snapshot. `DefiLlamaPoolService` recomputes each V3 pool's
|
|
9460
|
+
* CREATE2 address, so a pasted address can be matched against those. A hit
|
|
9461
|
+
* carries the full market stats (TVL / volume / APR).
|
|
9462
|
+
* 2. TOKEN, from the snapshot — the address is one of a tracked pool's tokens,
|
|
9463
|
+
* so we can list the pools containing it.
|
|
9464
|
+
* 3. POOL, ON-CHAIN. A miss above means only that DefiLlama does not TRACK the
|
|
9465
|
+
* pool, not that it does not exist (new pools, thin pools, and every pool on
|
|
9466
|
+
* a chain DefiLlama covers sparsely). Reading `slot0`/`token0`/`token1`
|
|
9467
|
+
* settles it definitively. Such a pool has no market stats — it is reported
|
|
9468
|
+
* as a real pool with its on-chain facts and an explicit note that TVL /
|
|
9469
|
+
* volume / APR are unavailable, never with invented numbers.
|
|
9470
|
+
*
|
|
9471
|
+
* The `resolvedAs` contract ("pool" | "token") matches the Uniswap stack's tool
|
|
9472
|
+
* exactly, so the shared subagent prompt drives either implementation.
|
|
9473
|
+
*/
|
|
9474
|
+
declare class DefiLlamaPoolByAddressTool extends BaseTool {
|
|
9475
|
+
name: string;
|
|
9476
|
+
description: string;
|
|
9477
|
+
category: string;
|
|
9478
|
+
parameters: ToolParameter[];
|
|
9479
|
+
private service;
|
|
9480
|
+
private pool;
|
|
9481
|
+
constructor(config?: DefiLlamaPoolByAddressToolConfig);
|
|
9482
|
+
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<Record<string, unknown>>;
|
|
9483
|
+
/**
|
|
9484
|
+
* Read the address as a Uniswap V3 pool directly from the chain.
|
|
9485
|
+
*
|
|
9486
|
+
* Returns `null` when the address is not a V3 pool — `readPoolOnchain`
|
|
9487
|
+
* multicalls `slot0`/`tickSpacing`/`token0`/`token1`, all of which revert on a
|
|
9488
|
+
* non-pool contract, so a throw here IS the "not a pool" signal. Token symbols
|
|
9489
|
+
* are then filled in with one batched metadata read so the pair can be named.
|
|
9490
|
+
*/
|
|
9491
|
+
private readPoolOnchain;
|
|
9492
|
+
}
|
|
9493
|
+
|
|
9494
|
+
type DefiLlamaEstimatePoolYieldToolConfig = DefiLlamaPoolServiceConfig;
|
|
9495
|
+
/**
|
|
9496
|
+
* Tool: estimate-pool-yield (DefiLlama-backed)
|
|
9497
|
+
*
|
|
9498
|
+
* Projects fee income for a USD deposit. Mirrors the Uniswap stack's tool
|
|
9499
|
+
* contract field-for-field — `candidates` / `depositMode` / `autoPickedReason` —
|
|
9500
|
+
* so the shared subagent prompt's YIELD ESTIMATION FLOW drives either one.
|
|
9501
|
+
*
|
|
9502
|
+
* The tool resolves missing inputs itself rather than bouncing questions back:
|
|
9503
|
+
* one token auto-picks that token's highest-volume pool, a missing deposit falls
|
|
9504
|
+
* back to a clearly-labelled $1000 example, and only a genuinely ambiguous fee
|
|
9505
|
+
* tier produces a candidates list.
|
|
9506
|
+
*/
|
|
9507
|
+
declare class DefiLlamaEstimatePoolYieldTool extends BaseTool {
|
|
9508
|
+
name: string;
|
|
9509
|
+
description: string;
|
|
9510
|
+
category: string;
|
|
9511
|
+
parameters: ToolParameter[];
|
|
9512
|
+
private service;
|
|
9513
|
+
constructor(config?: DefiLlamaEstimatePoolYieldToolConfig);
|
|
9514
|
+
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<Record<string, unknown>>;
|
|
9515
|
+
/** One representative pool (the deepest) per fee tier, ordered by TVL. */
|
|
9516
|
+
private dedupeByFeeTier;
|
|
9517
|
+
}
|
|
9518
|
+
|
|
9519
|
+
/**
|
|
9520
|
+
* The DefiLlama implementation of {@link PoolCandidateResolver}.
|
|
9521
|
+
*
|
|
9522
|
+
* Lets the DefiLlama-backed pool agent reuse the SHARED add-liquidity flow
|
|
9523
|
+
* (`OpenAddLiquidityFormTool` / `PreviewAddLiquidityTool`) rather than forking
|
|
9524
|
+
* it: only the pool LOOKUP changes, and everything downstream — the on-chain
|
|
9525
|
+
* reads, balance and gas maths, tick alignment, the gateway call — is identical
|
|
9526
|
+
* because it operates on a pool address, not on an API response.
|
|
9527
|
+
*
|
|
9528
|
+
* The addresses come from `DefiLlamaPoolService`, which recomputes each V3
|
|
9529
|
+
* pool's CREATE2 address (DefiLlama itself never reports one). Pools whose
|
|
9530
|
+
* address could not be derived are dropped: the flow's very next step reads the
|
|
9531
|
+
* pool on-chain by address, so an entry without one could only fail there, with
|
|
9532
|
+
* a far less clear error than "no pool found".
|
|
9533
|
+
*/
|
|
9534
|
+
|
|
9535
|
+
declare class DefiLlamaPoolCandidateResolver implements PoolCandidateResolver {
|
|
9536
|
+
private service;
|
|
9537
|
+
constructor(config?: DefiLlamaPoolServiceConfig);
|
|
9538
|
+
resolveCandidates(params: ResolvePoolCandidatesParams): Promise<PoolCandidate[] | null>;
|
|
9539
|
+
}
|
|
9540
|
+
|
|
9541
|
+
/**
|
|
9542
|
+
* Chain scope + shared parameter text for the DefiLlama-backed pool tools.
|
|
9543
|
+
*
|
|
9544
|
+
* The `pool` (Uniswap Explore) agent serves 8 chains; this stack serves 7 —
|
|
9545
|
+
* Linea is deliberately absent because DefiLlama tracks zero Uniswap pools
|
|
9546
|
+
* there, and a chain that always answers with an empty list is worse than one
|
|
9547
|
+
* that says plainly it is not supported. Everything here derives from
|
|
9548
|
+
* {@link DEFILLAMA_POOL_CHAIN_HEXES}, so the advertised set, the gate, and the
|
|
9549
|
+
* "not available on this chain" list can never drift apart.
|
|
9550
|
+
*
|
|
9551
|
+
* Only the SCOPE differs from the Uniswap stack — the gating machinery itself
|
|
9552
|
+
* ({@link gatePoolChain}, {@link poolChainNotSupportedResult}) is shared, so both
|
|
9553
|
+
* pool agents phrase an unsupported chain identically.
|
|
9554
|
+
*/
|
|
9555
|
+
|
|
9556
|
+
/**
|
|
9557
|
+
* The pool-INFO scope for the DefiLlama stack — the 7 chains with real pool
|
|
9558
|
+
* data. Constant-backed (no network call), like `poolInfoScope()`.
|
|
9559
|
+
*/
|
|
9560
|
+
declare function defiLlamaPoolInfoScope(): PoolChainScope;
|
|
9561
|
+
/**
|
|
9562
|
+
* Human-readable, comma-joined list of the DefiLlama pool chains — names ONLY,
|
|
9563
|
+
* never hex. Used in each tool's `description` "Supports:" line so the
|
|
9564
|
+
* advertised set always matches the gated one.
|
|
9565
|
+
*/
|
|
9566
|
+
declare function defiLlamaPoolSupportsLabel(): string;
|
|
9567
|
+
/**
|
|
9568
|
+
* Canonical `chain` PARAMETER description for the DefiLlama pool tools.
|
|
9569
|
+
*
|
|
9570
|
+
* Spells out an EXHAUSTIVE name→hex map rather than an "e.g." list, for the same
|
|
9571
|
+
* reason the Uniswap stack does: given a partial list the model would sometimes
|
|
9572
|
+
* emit the wrong hex, or none, for a chain the list did not name. Linea is
|
|
9573
|
+
* absent on purpose — passing it is still safe (the gate answers "not available
|
|
9574
|
+
* on Linea, available on: …"), it is simply never advertised.
|
|
9575
|
+
*/
|
|
9576
|
+
declare const DEFILLAMA_POOL_CHAIN_PARAM_DESCRIPTION: string;
|
|
9577
|
+
|
|
9578
|
+
/**
|
|
9579
|
+
* Shared rendering shape for the DefiLlama pool tools.
|
|
9580
|
+
*
|
|
9581
|
+
* Every tool in this folder returns pools through {@link formatDefiLlamaPool} so a
|
|
9582
|
+
* pool reads identically whether it arrived from a ranking, a search, a pair
|
|
9583
|
+
* lookup, or a pasted address — the same guarantee `poolDetailShape.ts` gives
|
|
9584
|
+
* the Uniswap stack. The field NAMES deliberately match the Uniswap stack's
|
|
9585
|
+
* (`tvlUsd`, `volume1DayUsd`, `apr`, `feeTierPercent`, `volumeToTvlRatio`) so
|
|
9586
|
+
* the shared analyst rubric in `poolAnalysis.ts` reads the same keys from both
|
|
9587
|
+
* sources and neither agent needs its own divergent prompt.
|
|
9588
|
+
*/
|
|
9589
|
+
|
|
9590
|
+
/** A pool as the LLM sees it. Nulls are omitted rather than sent as `null`. */
|
|
9591
|
+
interface FormattedDefiLlamaPool {
|
|
9592
|
+
pair: string;
|
|
9593
|
+
address?: string;
|
|
9594
|
+
chain: string;
|
|
9595
|
+
protocolVersion: string;
|
|
9596
|
+
feeTierBps?: number;
|
|
9597
|
+
feeTierPercent?: number;
|
|
9598
|
+
tvlUsd: number;
|
|
9599
|
+
volume1DayUsd?: number;
|
|
9600
|
+
volume7DayUsd?: number;
|
|
9601
|
+
fee24hUsd?: number;
|
|
9602
|
+
apr?: number;
|
|
9603
|
+
totalApr?: number;
|
|
9604
|
+
volumeToTvlRatio?: number;
|
|
9605
|
+
aprChange1D?: number;
|
|
9606
|
+
aprChange7D?: number;
|
|
9607
|
+
aprMean30d?: number;
|
|
9608
|
+
isStablecoin?: boolean;
|
|
9609
|
+
ilRisk?: string;
|
|
9610
|
+
token0?: {
|
|
9611
|
+
symbol?: string;
|
|
9612
|
+
address?: string;
|
|
9613
|
+
};
|
|
9614
|
+
token1?: {
|
|
9615
|
+
symbol?: string;
|
|
9616
|
+
address?: string;
|
|
9617
|
+
};
|
|
9618
|
+
uniswapUrl?: string;
|
|
9619
|
+
/**
|
|
9620
|
+
* True when this pool cannot be added to through the in-app flow — a V2/V4
|
|
9621
|
+
* pool, or a V3 pool whose address could not be derived. Surfaced so the
|
|
9622
|
+
* analyst never promises an add-liquidity step that would dead-end.
|
|
9623
|
+
*/
|
|
9624
|
+
addLiquidityUnavailable?: boolean;
|
|
9625
|
+
}
|
|
9626
|
+
/**
|
|
9627
|
+
* Shape one {@link DefiLlamaPool} for a tool response.
|
|
9628
|
+
*
|
|
9629
|
+
* The Uniswap explore URL is attached whenever the address was derivable, giving
|
|
9630
|
+
* the user the same clickable pool page the Uniswap-backed agent links to — the
|
|
9631
|
+
* pool is the same on-chain contract regardless of which API described it.
|
|
9632
|
+
*/
|
|
9633
|
+
declare function formatDefiLlamaPool(p: DefiLlamaPool): FormattedDefiLlamaPool;
|
|
9634
|
+
/**
|
|
9635
|
+
* Extra grounding signals the DefiLlama feed carries that the Uniswap Explore
|
|
9636
|
+
* feed does not. Appended to the shared rubric so the analyst actually uses the
|
|
9637
|
+
* APR-trend and IL-risk fields instead of ignoring unfamiliar keys.
|
|
9638
|
+
*/
|
|
9639
|
+
declare const DEFILLAMA_EXTRA_SIGNALS: string;
|
|
9640
|
+
|
|
8991
9641
|
/**
|
|
8992
9642
|
* The transaction-fee model for wallet-action tools — the exchange screen's
|
|
8993
9643
|
* `feeGas`, ported so the agent sizes a spend exactly like the app does.
|
|
@@ -9167,6 +9817,12 @@ interface ResolvedToken {
|
|
|
9167
9817
|
symbol?: string;
|
|
9168
9818
|
name?: string;
|
|
9169
9819
|
decimals?: number;
|
|
9820
|
+
/**
|
|
9821
|
+
* True when `symbol` is the token's own `symbol()`, promoted from Pantograph's
|
|
9822
|
+
* `symbolOnchain`. It marks the symbol as safe to display as-is, in preference
|
|
9823
|
+
* to whatever the user or the model called the token.
|
|
9824
|
+
*/
|
|
9825
|
+
symbolIsOnchain?: boolean;
|
|
9170
9826
|
}
|
|
9171
9827
|
/**
|
|
9172
9828
|
* Shared base for wallet-action tools.
|
|
@@ -9601,6 +10257,9 @@ declare class BuyTokenTool extends BaseTool {
|
|
|
9601
10257
|
parameters: ToolParameter[];
|
|
9602
10258
|
execute(args: Record<string, unknown>, userContext?: UserContext): Promise<ToolResult>;
|
|
9603
10259
|
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
10260
|
+
error: string;
|
|
10261
|
+
_instructions: string;
|
|
10262
|
+
} | {
|
|
9604
10263
|
actionButtons: {
|
|
9605
10264
|
label: string;
|
|
9606
10265
|
prompt: string;
|
|
@@ -9609,9 +10268,6 @@ declare class BuyTokenTool extends BaseTool {
|
|
|
9609
10268
|
} | {
|
|
9610
10269
|
ui: UIPayload;
|
|
9611
10270
|
_instructions: string;
|
|
9612
|
-
} | {
|
|
9613
|
-
error: string;
|
|
9614
|
-
_instructions: string;
|
|
9615
10271
|
}>;
|
|
9616
10272
|
private buildResult;
|
|
9617
10273
|
private normaliseAddress;
|
|
@@ -9908,6 +10564,9 @@ declare class SwapTokenTool extends BaseTool {
|
|
|
9908
10564
|
parameters: ToolParameter[];
|
|
9909
10565
|
execute(args: Record<string, unknown>, userContext?: UserContext): Promise<ToolResult>;
|
|
9910
10566
|
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
10567
|
+
error: string;
|
|
10568
|
+
_instructions: string;
|
|
10569
|
+
} | {
|
|
9911
10570
|
actionButtons: {
|
|
9912
10571
|
label: string;
|
|
9913
10572
|
prompt: string;
|
|
@@ -9916,9 +10575,6 @@ declare class SwapTokenTool extends BaseTool {
|
|
|
9916
10575
|
} | {
|
|
9917
10576
|
ui: UIPayload;
|
|
9918
10577
|
_instructions: string;
|
|
9919
|
-
} | {
|
|
9920
|
-
error: string;
|
|
9921
|
-
_instructions: string;
|
|
9922
10578
|
}>;
|
|
9923
10579
|
private buildResult;
|
|
9924
10580
|
private normaliseAddress;
|
|
@@ -10286,7 +10942,44 @@ interface SpendableBalance {
|
|
|
10286
10942
|
symbol?: string;
|
|
10287
10943
|
decimals?: number;
|
|
10288
10944
|
logo?: string;
|
|
10945
|
+
/**
|
|
10946
|
+
* USD price of ONE whole token, as the balance source reported it alongside
|
|
10947
|
+
* the balance. `undefined` when it reported none.
|
|
10948
|
+
*
|
|
10949
|
+
* It comes free with the read — the wallet-balance row already carries
|
|
10950
|
+
* `usd_price` — so surfacing it costs no extra request, and it is the price
|
|
10951
|
+
* of the very token this balance is of. Callers pass it to the form as
|
|
10952
|
+
* `usdPrice`, where it captions the amount with what it is worth; the form
|
|
10953
|
+
* re-reads it with the balance on Refresh, so the two never disagree about
|
|
10954
|
+
* which moment they describe.
|
|
10955
|
+
*/
|
|
10956
|
+
usdPrice?: number;
|
|
10289
10957
|
}
|
|
10958
|
+
/**
|
|
10959
|
+
* The USD price of ONE whole token, for a token the wallet may not hold.
|
|
10960
|
+
*
|
|
10961
|
+
* The balance reader above already yields a price for the token it read, free,
|
|
10962
|
+
* because the wallet-balance row carries one. This is for the OTHER side of a
|
|
10963
|
+
* trade — the destination token, which is not held and so has no balance row —
|
|
10964
|
+
* and costs one metadata lookup.
|
|
10965
|
+
*
|
|
10966
|
+
* `'native'` is looked up as the zero address, which is the row the token
|
|
10967
|
+
* endpoint returns the chain's coin under.
|
|
10968
|
+
*
|
|
10969
|
+
* Exported for the same reason `readSpendableBalance` is: the tool that SEEDS a
|
|
10970
|
+
* swap form and the form that later RE-READS its prices on Refresh must agree,
|
|
10971
|
+
* and the alternative — the app calling its own price API — is exactly the
|
|
10972
|
+
* second implementation this module exists to prevent. It also replaced the two
|
|
10973
|
+
* identical private copies that sat in `SwapTokenTool` and `BuyTokenTool`.
|
|
10974
|
+
*
|
|
10975
|
+
* `null` on every failure, and for a price of zero: see {@link usablePrice} for
|
|
10976
|
+
* why an unpriced token must not be reported as a worthless one.
|
|
10977
|
+
*/
|
|
10978
|
+
declare function readTokenUsdPrice(input: {
|
|
10979
|
+
moralis?: MoralisService;
|
|
10980
|
+
tokenAddress: string;
|
|
10981
|
+
chain?: string;
|
|
10982
|
+
}): Promise<number | null>;
|
|
10290
10983
|
/**
|
|
10291
10984
|
* Read the spendable balance of `tokenAddress` for `walletAddress` on `chain`.
|
|
10292
10985
|
*
|
|
@@ -12331,6 +13024,11 @@ interface PantographRawToken {
|
|
|
12331
13024
|
decimals?: number;
|
|
12332
13025
|
fixedPrice?: number | string | null;
|
|
12333
13026
|
} | null;
|
|
13027
|
+
/**
|
|
13028
|
+
* The contract's own `symbol()`, as the index read it. `null` (or absent) when
|
|
13029
|
+
* the index never resolved one — see {@link TokenMetadata.symbolOnchain}.
|
|
13030
|
+
*/
|
|
13031
|
+
symbolOnchain?: string | null;
|
|
12334
13032
|
}
|
|
12335
13033
|
/**
|
|
12336
13034
|
* The yield half of a token API row — what decides whether a quoted price
|
|
@@ -12358,6 +13056,20 @@ declare class PantographService {
|
|
|
12358
13056
|
* slug — so token lookups work the same on Ethereum, Gnosis, or any other EVM.
|
|
12359
13057
|
*/
|
|
12360
13058
|
private tokensUrl;
|
|
13059
|
+
/**
|
|
13060
|
+
* Fetch token metadata + price rows for any number of contracts on one chain,
|
|
13061
|
+
* split across as many `/keyrings/tokens/all/{chainId}` requests as needed.
|
|
13062
|
+
*
|
|
13063
|
+
* Batches run in parallel and their rows are concatenated, so the caller sees
|
|
13064
|
+
* one flat list and cannot tell how many requests produced it. A batch that
|
|
13065
|
+
* fails contributes nothing rather than failing the whole call: every caller
|
|
13066
|
+
* here degrades per token (a missing row means no price, not an error), so
|
|
13067
|
+
* losing one chunk of a large wallet is strictly better than losing all of it.
|
|
13068
|
+
*
|
|
13069
|
+
* `chainId` is the DECIMAL id this route is keyed by; callers holding a hex
|
|
13070
|
+
* chain convert before calling.
|
|
13071
|
+
*/
|
|
13072
|
+
private fetchTokensAll;
|
|
12361
13073
|
/**
|
|
12362
13074
|
* Enrich token balances with price and logo data from Pantograph.
|
|
12363
13075
|
* Mutates the array in-place. Non-fatal: silently skips on failure.
|
|
@@ -12463,6 +13175,46 @@ declare class PantographService {
|
|
|
12463
13175
|
}): Promise<MoralisApiResponse<TrendingToken[]>>;
|
|
12464
13176
|
}
|
|
12465
13177
|
|
|
13178
|
+
/**
|
|
13179
|
+
* Deterministic Uniswap V3 pool-address derivation (CREATE2).
|
|
13180
|
+
*
|
|
13181
|
+
* DefiLlama Yields identifies a pool by an opaque UUID and never reports the
|
|
13182
|
+
* pool's contract address — it only gives `underlyingTokens` (the two token
|
|
13183
|
+
* addresses) and `poolMeta` (the fee tier). That is a problem for every flow
|
|
13184
|
+
* that must touch the chain: `PoolService.readPoolOnchain` needs a real address
|
|
13185
|
+
* to read `slot0` / `tickSpacing`, and the add-liquidity mint is built from it.
|
|
13186
|
+
*
|
|
13187
|
+
* Uniswap V3 deploys every pool through the factory with CREATE2, so the address
|
|
13188
|
+
* is a pure function of (factory, token0, token1, fee) and can be recomputed
|
|
13189
|
+
* locally — no RPC call, no extra API. This module is that function, and it is
|
|
13190
|
+
* what lets the DefiLlama-backed pool agent reach full parity with the Uniswap
|
|
13191
|
+
* Explore agent on the add-liquidity flow.
|
|
13192
|
+
*
|
|
13193
|
+
* The derived address is a CLAIM, not a fact: it is where the pool WOULD live if
|
|
13194
|
+
* it exists with that exact fee tier. Callers that go on to build a transaction
|
|
13195
|
+
* must confirm it on-chain (`readPoolOnchain` reverts on a non-pool), which the
|
|
13196
|
+
* add-liquidity flow already does as its first step.
|
|
13197
|
+
*/
|
|
13198
|
+
/** True when Uniswap V3 pool addresses can be derived on this chain. */
|
|
13199
|
+
declare function canDeriveV3PoolAddress(chain: string): boolean;
|
|
13200
|
+
/**
|
|
13201
|
+
* Derive the Uniswap V3 pool address for a token pair + fee tier on `chain`.
|
|
13202
|
+
*
|
|
13203
|
+
* Token order does NOT matter: the pair is sorted the way the factory sorts it
|
|
13204
|
+
* (ascending by address), so passing (WETH, USDC) and (USDC, WETH) yield the
|
|
13205
|
+
* same pool — which matters because DefiLlama's `underlyingTokens` order does
|
|
13206
|
+
* not follow the pool's own token0/token1 order.
|
|
13207
|
+
*
|
|
13208
|
+
* @param chain Hex chain id.
|
|
13209
|
+
* @param tokenA Either token's address (order irrelevant).
|
|
13210
|
+
* @param tokenB The other token's address.
|
|
13211
|
+
* @param feeTierBps Fee tier in hundredths of a bip, as the factory stores it
|
|
13212
|
+
* (100 = 0.01%, 500 = 0.05%, 3000 = 0.3%, 10000 = 1%).
|
|
13213
|
+
* @returns The lowercase pool address, or `null` when the chain has no known
|
|
13214
|
+
* factory or either input is not a valid address.
|
|
13215
|
+
*/
|
|
13216
|
+
declare function deriveV3PoolAddress(chain: string, tokenA: string, tokenB: string, feeTierBps: number): string | null;
|
|
13217
|
+
|
|
12466
13218
|
/**
|
|
12467
13219
|
* Manages conversation history for a single session.
|
|
12468
13220
|
*
|
|
@@ -12757,4 +13509,4 @@ declare class AbortError extends Error {
|
|
|
12757
13509
|
*/
|
|
12758
13510
|
declare function isAbortError(err: unknown): boolean;
|
|
12759
13511
|
|
|
12760
|
-
export { AI_AGENT_TOOL_NAMES, type Abi, type AbiItem, type AbiParameter, AbortError, type AddLiquidityFormProps, type AddLiquiditySummary, type Address, type AffiliateFee, type AgentConfig, AgentCore, type AgentResponse, type ApprovalTx, ApproveTokenTool, type ApyPoint, BaseNftAiTool, BaseSwapProvider, BaseTool, BaseWalletActionTool, type BlockParameters, type BlockTag, type BuildApprovalsParams, type BuyTokenSide, BuyTokenTool, 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, CoinpoolConfigApi, type ConfirmAddLiquidityTxProps, type ContractFunctionParameters, type CortexResponse, DEFAULT_CHAIN, DEFAULT_PROVIDER, DEFAULT_RPC_BY_CHAIN, DebridgeProvider, type DecodedCall, type DecodedEvent, type DecodedParam, type DefaultSubagentName, type DefiPosition, type DefiPositionDetails, type DefiPositionToken, type DefiProtocolSummary, type EIP1193RequestFn, EstimatePoolYieldTool, type EstimatePoolYieldToolConfig, type FeeContext, GeminiProvider, GeminiSearchAiTool, type GeminiSearchAiToolConfig, HEX_TO_PANTOGRAPH, 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, MULTICALL3_ADDRESS, ManageLiquidityRedirectTool, type MarketplaceLink, type MoralisApiResponse, MoralisService, type MoralisServiceConfig, type MulticallParameters, type MulticallRawParameters, type MulticallResult, NATIVE_GAS_LIMIT, 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, OpenAddLiquidityFormTool, type OpenAddLiquidityFormToolConfig, OpenSupplyFormTool, type OpenSupplyFormToolConfig, POOL_AGENT_TOOL_NAMES, PantographService, type PantographServiceConfig, type PantographYieldIdentity, type PaymentToken, PoolByAddressTool, type PoolByAddressToolConfig, PoolDetailTool, type PoolDetailToolConfig, type PoolDisplayInfo, PoolFallbackAiTool, type PoolFallbackAiToolConfig, type PoolOnchainInfo, PoolPriceRangesTool, type PoolPriceRangesToolConfig, PoolSearchTool, type PoolSearchToolConfig, PoolService, type PoolServiceConfig, PoolSwapRouter, type PresetInputs, PreviewAddLiquidityTool, type PreviewAddLiquidityToolConfig, type PriceBounds, type PriceRangePrefill, type ProviderName, PublicClient, type PublicClientConfig, type QuickRate, type QuoteGas, type RangePreset, type ReActPhase, type ReActStep, type ReActTrace, type ReadContractParameters, RelayProvider, type ResolvedRange, Router, type RouterAssignment, type RouterDecision, 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, 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 Transport, type TransportConfig, type TrendingToken, type TrendingTokenTimeframeBuckets, TrendingTokensTool, type TrendingTokensToolConfig, type UIPayload, UNISWAP_CHAIN_SLUG, UNRESOLVED_ASSET, type UnsignedTx, type UpstashEmbedStrategy, type UpstashFusionAlgorithm, type UpstashKBUpsertEntry, UpstashKnowledgeBase, type UpstashKnowledgeBaseConfig, type UserContext, UserSwapRouter, type VectorKBConfig, WALLET_ACTION_AGENT_TOOL_NAMES, WALLET_AGENT_TOOL_NAMES, type WalletActionProps, type WalletActionType, type WalletApprovalsResponse, WalletApprovalsTool, type WalletApprovalsToolConfig, type WalletDefiPositionSummary, WalletDefiPositionsTool, type WalletDefiPositionsToolConfig, type WalletDefiPositionsV1Response, type WalletDefiProtocolPositionsResponse, WalletDefiProtocolPositionsTool, type WalletDefiProtocolPositionsToolConfig, type WalletDefiProtocolPositionsV1Response, type WalletDefiSummaryResponse, type WalletDefiSummaryV1Response, 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 WebsiteTrustExtraData, type WebsiteTrustInput, WebsiteTrustKeyringAgent, type WebsiteTrustKeyringAgentConfig, type WebsiteTrustResult, 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 YieldConversionCall, type YieldConversionPlan, type YieldPricingOptions, type YieldPricingToken, type YieldTokenInput, type YieldTokenValue, ZERO_ADDRESS, amazonDomainForLanguage, apiClient, applyYieldConversions, buildApprovals, buildChallenge, buildRangePresets, buildUniswapPoolUrl, call, chains, checkNativeGasAffordable, checksumAddress, clampTick, clearPublicClientCache, coinpoolConfigApi, compareDecimal, completeX402, configureSupportedChains, configureSwapProvider, convertSusdsShares, createAiAgent, createDefaultSubagents, createNfcAgent, createNftAgent, createPoolAgent, createPublicClient, createTokenAgent, createTransport, createWalletActionAgent, createWalletAgent, createX402SignatureProvider, decodeAbiParameters, decodeErrorResult, decodeFunctionData, decodeFunctionResult, displayFromChallenge, effectivePriceUSD, encodeAbiParameters, encodeApprove, encodeErrorResult, encodeFunctionData, encodeSignedHeader, erc1155Abi, erc20Abi, erc20Abi_bytes32, erc721Abi, estimateGas, estimateNativeGasReserveWei, estimateTransactionFeeWei, ethCallAt, ethCallByChain, exactAmountString, extractOutRaw, extractQuoteError, fallback, feeWeiToNative, fetchTopMarketplaces, floorToDecimals, getAbiItem, getAddress, getBalance, getBlock, getBlockNumber, getChain, getChainContractAddress, getChainId, getChainMeta, getCode, getDefaultRpcUrl, getGasPrice, getNativeTokenInfo, getPublicClient, getRevertReason, getRpcOverrides, getStorageAt, getTokenPriceUSD, getTransactionCount, http, humanToWei, ingestKnowledgeBase, isAbortError, isAddress, isAddressEqual, isPaymentRequired, isShareBasedProtocol, isShareBasedYieldToken, isSupplyChain, keyringSettingApi, listCandidateChains, listSupplyChains, mulDivFloor, multicall, multicall3Abi, multicallRaw, nativeGasShortfall, nfcAmazonSearchUrl, normaliseCountry, normalizeDecimal, normalizePriceRangeToPool, parseAbi, parseAbiItem, parseAbiParameters, pickLogo, planYieldTokenConversions, priceToTick, protocolLabelFor, psm3For, readContract, readPaymentError, readPaymentRequired, readProtocolFeeWei, readReceipt, readSpendableBalance, registerMaybeNoForm, requestWithX402, resolveGasLimit, resolveNfcShopLinks, resolveRpcUrl, resolveRpcUrls, resolveTokenPriceUSD, roundTickToSpacing, rpcCall, setRpcOverrides, spendableNative, swapProviderFactory, swapRouterRegistry, tickToPrice, toEventSelector, toFunctionSelector, toPantographChain, toPlainDecimal, valueYieldTokens, weiToHuman };
|
|
13512
|
+
export { AI_AGENT_TOOL_NAMES, type Abi, type AbiItem, type AbiParameter, AbortError, type AddLiquidityFormProps, type AddLiquiditySummary, type Address, type AffiliateFee, type AgentConfig, AgentCore, type AgentResponse, type ApprovalTx, ApproveTokenTool, type ApyPoint, BaseNftAiTool, BaseSwapProvider, BaseTool, BaseWalletActionTool, type BlockParameters, type BlockTag, type BuildApprovalsParams, type BuyTokenSide, BuyTokenTool, 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, CoinpoolConfigApi, type ConfirmAddLiquidityTxProps, type ContractFunctionParameters, type CortexResponse, DEFAULT_CHAIN, DEFAULT_PROVIDER, DEFAULT_RPC_BY_CHAIN, DEFILLAMA_EXTRA_SIGNALS, DEFILLAMA_POOL_CHAIN_HEXES, DEFILLAMA_POOL_CHAIN_PARAM_DESCRIPTION, 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 EIP1193RequestFn, EstimatePoolYieldTool, type EstimatePoolYieldToolConfig, type FeeContext, type FormattedDefiLlamaPool, GeminiProvider, GeminiSearchAiTool, type GeminiSearchAiToolConfig, HEX_TO_PANTOGRAPH, 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, MULTICALL3_ADDRESS, ManageLiquidityRedirectTool, type MarketplaceLink, type MoralisApiResponse, MoralisService, type MoralisServiceConfig, type MulticallParameters, type MulticallRawParameters, type MulticallResult, NATIVE_GAS_LIMIT, 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, OpenAddLiquidityFormTool, type OpenAddLiquidityFormToolConfig, OpenSupplyFormTool, type OpenSupplyFormToolConfig, POOL_UNISWAP_AGENT_TOOL_NAMES, PantographService, type PantographServiceConfig, type PantographYieldIdentity, type PaymentToken, PoolByAddressTool, type PoolByAddressToolConfig, PoolDetailTool, type PoolDetailToolConfig, type PoolDisplayInfo, PoolFallbackAiTool, type PoolFallbackAiToolConfig, type PoolOnchainInfo, PoolPriceRangesTool, type PoolPriceRangesToolConfig, PoolSearchTool, type PoolSearchToolConfig, PoolService, type PoolServiceConfig, PoolSwapRouter, type PresetInputs, PreviewAddLiquidityTool, type PreviewAddLiquidityToolConfig, type PriceBounds, type PriceRangePrefill, type ProviderName, PublicClient, type PublicClientConfig, type QuickRate, type QuoteGas, type RangePreset, type ReActPhase, type ReActStep, type ReActTrace, type ReadContractParameters, RelayProvider, type ResolvedRange, Router, type RouterAssignment, type RouterDecision, 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, 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 Transport, type TransportConfig, type TrendingToken, type TrendingTokenTimeframeBuckets, TrendingTokensTool, type TrendingTokensToolConfig, type UIPayload, UNISWAP_CHAIN_SLUG, UNRESOLVED_ASSET, type UnsignedTx, type UpstashEmbedStrategy, type UpstashFusionAlgorithm, type UpstashKBUpsertEntry, UpstashKnowledgeBase, type UpstashKnowledgeBaseConfig, type UserContext, UserSwapRouter, type VectorKBConfig, WALLET_ACTION_AGENT_TOOL_NAMES, WALLET_AGENT_TOOL_NAMES, type WalletActionProps, type WalletActionType, type WalletApprovalsResponse, WalletApprovalsTool, type WalletApprovalsToolConfig, type WalletDefiPositionSummary, WalletDefiPositionsTool, type WalletDefiPositionsToolConfig, type WalletDefiPositionsV1Response, type WalletDefiProtocolPositionsResponse, WalletDefiProtocolPositionsTool, type WalletDefiProtocolPositionsToolConfig, type WalletDefiProtocolPositionsV1Response, type WalletDefiSummaryResponse, type WalletDefiSummaryV1Response, 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 WebsiteTrustExtraData, type WebsiteTrustInput, WebsiteTrustKeyringAgent, type WebsiteTrustKeyringAgentConfig, type WebsiteTrustResult, 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 YieldConversionCall, type YieldConversionPlan, type YieldPricingOptions, type YieldPricingToken, type YieldTokenInput, type YieldTokenValue, ZERO_ADDRESS, amazonDomainForLanguage, apiClient, applyYieldConversions, buildApprovals, buildChallenge, buildRangePresets, buildUniswapPoolUrl, call, canDeriveV3PoolAddress, chains, checkNativeGasAffordable, checksumAddress, clampTick, clearPublicClientCache, coinpoolConfigApi, compareDecimal, completeX402, configureSupportedChains, configureSwapProvider, convertSusdsShares, createAiAgent, createDefaultSubagents, createNfcAgent, createNftAgent, createPoolUniswapAgent, createPublicClient, createTokenAgent, createTransport, createWalletActionAgent, createWalletAgent, createX402SignatureProvider, decodeAbiParameters, decodeErrorResult, decodeFunctionData, decodeFunctionResult, defiLlamaPoolInfoScope, defiLlamaPoolSupportsLabel, deriveV3PoolAddress, displayFromChallenge, effectivePriceUSD, encodeAbiParameters, encodeApprove, encodeErrorResult, encodeFunctionData, encodeSignedHeader, erc1155Abi, erc20Abi, erc20Abi_bytes32, erc721Abi, estimateGas, estimateNativeGasReserveWei, estimateTransactionFeeWei, ethCallAt, ethCallByChain, exactAmountString, extractOutRaw, extractQuoteError, fallback, feeWeiToNative, fetchTopMarketplaces, floorToDecimals, formatDefiLlamaPool, getAbiItem, getAddress, getBalance, getBlock, getBlockNumber, getChain, getChainContractAddress, getChainId, getChainMeta, getCode, getDefaultRpcUrl, getGasPrice, getNativeTokenInfo, getPublicClient, getRevertReason, getRpcOverrides, getStorageAt, getTokenPriceUSD, getTransactionCount, http, humanToWei, ingestKnowledgeBase, isAbortError, isAddress, isAddressEqual, isPaymentRequired, isShareBasedProtocol, isShareBasedYieldToken, isSupplyChain, keyringSettingApi, listCandidateChains, listSupplyChains, mulDivFloor, multicall, multicall3Abi, multicallRaw, nativeGasShortfall, nfcAmazonSearchUrl, normaliseCountry, normalizeDecimal, normalizePriceRangeToPool, parseAbi, parseAbiItem, parseAbiParameters, pickLogo, planYieldTokenConversions, priceToTick, protocolLabelFor, psm3For, readContract, readPaymentError, readPaymentRequired, readProtocolFeeWei, readReceipt, readSpendableBalance, readTokenUsdPrice, registerMaybeNoForm, requestWithX402, resolveGasLimit, resolveNfcShopLinks, resolveRpcUrl, resolveRpcUrls, resolveTokenPriceUSD, roundTickToSpacing, rpcCall, setRpcOverrides, spendableNative, swapProviderFactory, swapRouterRegistry, tickToPrice, toEventSelector, toFunctionSelector, toPantographChain, toPlainDecimal, valueYieldTokens, weiToHuman };
|