keyring-agent-core 0.2.47 → 0.2.49
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 +830 -84
- package/dist/index.js +172 -90
- package/dist/index.native.js +302 -220
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -673,6 +673,22 @@ interface WalletNftCardProps {
|
|
|
673
673
|
image: string | null;
|
|
674
674
|
/** Human-readable chain name, e.g. "Base". */
|
|
675
675
|
chain: string;
|
|
676
|
+
/**
|
|
677
|
+
* Set only in PICKER mode (see {@link WalletNftListProps.mode}): the message
|
|
678
|
+
* submitted as the next user turn when this card is tapped. It carries the
|
|
679
|
+
* exact contract + token id, so the follow-up turn resolves to this one NFT.
|
|
680
|
+
* Absent in the default browse gallery — those cards are not tappable.
|
|
681
|
+
*/
|
|
682
|
+
prompt?: string;
|
|
683
|
+
/**
|
|
684
|
+
* Collection name, shown under the token id ONLY when the cards in this picker
|
|
685
|
+
* span more than one collection. That happens when the user identified the NFT
|
|
686
|
+
* by token id alone ("send NFT id 5118938") and holds that id in several
|
|
687
|
+
* collections: the name and token id are then identical on every card, and the
|
|
688
|
+
* collection is the only thing that tells them apart. Omitted whenever the
|
|
689
|
+
* cards already read distinctly, to keep the gallery uncluttered.
|
|
690
|
+
*/
|
|
691
|
+
collectionName?: string;
|
|
676
692
|
}
|
|
677
693
|
/** Props for the `WalletNftList` component — one collection's NFTs to display. */
|
|
678
694
|
interface WalletNftListProps {
|
|
@@ -682,6 +698,13 @@ interface WalletNftListProps {
|
|
|
682
698
|
collectionName: string;
|
|
683
699
|
/** The NFTs to render, in display order. */
|
|
684
700
|
nfts: WalletNftCardProps[];
|
|
701
|
+
/**
|
|
702
|
+
* `'browse'` (default) — a read-only gallery of what the wallet holds.
|
|
703
|
+
* `'picker'` — the user must choose ONE: every card carries a `prompt` and
|
|
704
|
+
* tapping it submits that prompt as the next turn (used by open-send-nft-form
|
|
705
|
+
* when the name the user gave matches several owned NFTs).
|
|
706
|
+
*/
|
|
707
|
+
mode?: 'browse' | 'picker';
|
|
685
708
|
}
|
|
686
709
|
/** Identifies a chain in BE↔FE payloads. */
|
|
687
710
|
interface ChainRef {
|
|
@@ -836,6 +859,88 @@ interface WalletActionProps {
|
|
|
836
859
|
*/
|
|
837
860
|
parameters: Record<string, string>;
|
|
838
861
|
}
|
|
862
|
+
/**
|
|
863
|
+
* The lending protocols a USDC supply can be routed to. Mirrors
|
|
864
|
+
* `LendingProtocolType` in `services/lending/protocols.ts` — the FE switches its
|
|
865
|
+
* deposit encoding on this, so the two MUST stay in step.
|
|
866
|
+
*/
|
|
867
|
+
type SupplyProtocolType = 'aave-v3' | 'compound-v3' | 'spark' | 'spark-ethereum' | 'morpho-v2';
|
|
868
|
+
/**
|
|
869
|
+
* Props for the FE `SupplyUsdcForm` component — depositing USDC into one lending
|
|
870
|
+
* market to earn yield.
|
|
871
|
+
*
|
|
872
|
+
* Unlike the flat `WalletActionProps` forms, a supply needs the MARKET as a
|
|
873
|
+
* structured fact: which contract receives the deposit, and which protocol
|
|
874
|
+
* family it belongs to (the deposit calldata differs per protocol — Aave
|
|
875
|
+
* `supply(asset,amount,onBehalfOf,referralCode)`, Compound `supply(asset,amount)`,
|
|
876
|
+
* ERC-4626 `deposit(...)` for Spark and Morpho vaults). The core resolves and
|
|
877
|
+
* validates all of that; the FE owns the allowance check, the encoding and the
|
|
878
|
+
* signing, exactly as it does for every other in-chat action.
|
|
879
|
+
*/
|
|
880
|
+
interface SupplyUsdcProps {
|
|
881
|
+
action: 'supply_usdc';
|
|
882
|
+
/** Hex chain id, e.g. "0x1", "0x2105". */
|
|
883
|
+
chainId: string;
|
|
884
|
+
/** Human-readable chain name for display, e.g. "Ethereum", "Base". */
|
|
885
|
+
chainName: string;
|
|
886
|
+
/** Connected wallet that will sign, and that receives the receipt token. */
|
|
887
|
+
walletAddress: string;
|
|
888
|
+
market: {
|
|
889
|
+
/** Display name of the market, e.g. "Aave v3 USDC". */
|
|
890
|
+
name: string;
|
|
891
|
+
/** Protocol family — selects the deposit encoding on the FE. */
|
|
892
|
+
type: SupplyProtocolType;
|
|
893
|
+
/** Protocol brand name, e.g. "Aave v3". */
|
|
894
|
+
protocol: string;
|
|
895
|
+
/** The protocol's site, as a full URL. Null when unknown. */
|
|
896
|
+
protocolUrl: string | null;
|
|
897
|
+
/** Pool / vault contract the deposit is sent to AND approved as spender. */
|
|
898
|
+
contract: string;
|
|
899
|
+
/** Receipt token received (aToken, Comet, vault share). */
|
|
900
|
+
token: string;
|
|
901
|
+
/** Live supply APY as a PERCENT (4.82 = 4.82%). Null when unavailable. */
|
|
902
|
+
apyPercent: number | null;
|
|
903
|
+
/**
|
|
904
|
+
* ERC-20 identity of the receipt token above — what "Est. Received" is
|
|
905
|
+
* denominated in, resolved here so the form never reads chain to display it.
|
|
906
|
+
*/
|
|
907
|
+
receiptToken: {
|
|
908
|
+
/** e.g. "aBasUSDC", "cUSDCv3", "sUSDC". Null when the read failed. */
|
|
909
|
+
symbol: string | null;
|
|
910
|
+
/**
|
|
911
|
+
* The receipt's OWN decimals — 18 for Spark's `sUSDC` against USDC's 6, so
|
|
912
|
+
* the form must scale shares by this and not by `asset.decimals`. Null when
|
|
913
|
+
* the read failed; the form then falls back to the asset's.
|
|
914
|
+
*/
|
|
915
|
+
decimals: number | null;
|
|
916
|
+
/**
|
|
917
|
+
* True when the receipt is denominated 1:1 in the supplied USDC (aToken,
|
|
918
|
+
* Comet) — the amount typed IS the amount received. False for an ERC-4626
|
|
919
|
+
* vault, which mints shares at its current rate and needs a preview.
|
|
920
|
+
*/
|
|
921
|
+
isUnderlying: boolean;
|
|
922
|
+
};
|
|
923
|
+
};
|
|
924
|
+
/** The USDC being supplied on this chain. */
|
|
925
|
+
asset: {
|
|
926
|
+
address: string;
|
|
927
|
+
symbol: string;
|
|
928
|
+
decimals: number;
|
|
929
|
+
};
|
|
930
|
+
/** Amount to pre-fill, human-readable (e.g. "100.5"). Absent = user types it. */
|
|
931
|
+
prefillAmount?: string;
|
|
932
|
+
/**
|
|
933
|
+
* The wallet's USDC balance on this chain, human-readable — what the form's
|
|
934
|
+
* spendable line and its 25/50/75/100% chips are computed from. Unlike a
|
|
935
|
+
* native send there is no gas reserve to hold back: the fee is paid in the
|
|
936
|
+
* chain's native coin, not in the USDC being supplied, so the whole balance
|
|
937
|
+
* is spendable. Absent when balances could not be read; the form then hides
|
|
938
|
+
* the line and the chips rather than showing a wrong figure.
|
|
939
|
+
*/
|
|
940
|
+
spendable?: string;
|
|
941
|
+
/** USD value of `spendable`, for the "(~$X)" hint. Absent when unpriced. */
|
|
942
|
+
spendableUsd?: string;
|
|
943
|
+
}
|
|
839
944
|
/**
|
|
840
945
|
* Props for the FE `X402PaymentRequired` component — a GENERIC paywall card for
|
|
841
946
|
* any x402-gated API (HTTP 402 "pay-per-call"). The core already made the call,
|
|
@@ -1370,6 +1475,21 @@ interface AgentConfig {
|
|
|
1370
1475
|
/** Pantograph API base URL for price enrichment */
|
|
1371
1476
|
pantographUrl?: string;
|
|
1372
1477
|
} | false;
|
|
1478
|
+
/**
|
|
1479
|
+
* USDC lending / supply tool config (`get-lending-markets` and
|
|
1480
|
+
* `get-wallet-lending-positions`). Set to `false` to skip registering them —
|
|
1481
|
+
* to keep the tools but stop routing to them, use `subagents.lending: false`.
|
|
1482
|
+
* Independent of `moralis`: the curated market list comes from the CoinPool
|
|
1483
|
+
* platform API and balances are read on-chain via `rpcUrls`.
|
|
1484
|
+
*/
|
|
1485
|
+
lending?: {
|
|
1486
|
+
/** CoinPool API base url (`<base>/supply/v2`). Default https://api.coinpool.app. */
|
|
1487
|
+
coinPoolBaseUrl?: string;
|
|
1488
|
+
/** Aave v3 GraphQL endpoint used for supply-APY history. */
|
|
1489
|
+
aaveApiUrl?: string;
|
|
1490
|
+
/** Morpho GraphQL endpoint used for vault APY history. */
|
|
1491
|
+
morphoApiUrl?: string;
|
|
1492
|
+
} | false;
|
|
1373
1493
|
/**
|
|
1374
1494
|
* Enable/disable individual built-in subagents. Defaults to all-enabled.
|
|
1375
1495
|
* Set any key to `false` to skip that subagent — it won't be created or
|
|
@@ -1380,6 +1500,11 @@ interface AgentConfig {
|
|
|
1380
1500
|
subagents?: {
|
|
1381
1501
|
wallet?: boolean;
|
|
1382
1502
|
'wallet-action'?: boolean;
|
|
1503
|
+
/**
|
|
1504
|
+
* USDC lending expert: which markets to supply to and what the wallet
|
|
1505
|
+
* already supplies. Needs `lending` (its tools) to be enabled.
|
|
1506
|
+
*/
|
|
1507
|
+
lending?: boolean;
|
|
1383
1508
|
token?: boolean;
|
|
1384
1509
|
nft?: boolean;
|
|
1385
1510
|
/**
|
|
@@ -2090,6 +2215,16 @@ interface WebsiteTrustKeyringAgentConfig {
|
|
|
2090
2215
|
llm?: LLMProviderConfig;
|
|
2091
2216
|
/** Bring your own LLM provider (e.g. a shared instance). Overrides `llm`. */
|
|
2092
2217
|
provider?: LLMProvider;
|
|
2218
|
+
/**
|
|
2219
|
+
* License key gating use of the Keyring-hosted Gemini proxy, exactly as in
|
|
2220
|
+
* {@link AgentCore.secretKey}. Validated lazily on the first
|
|
2221
|
+
* {@link WebsiteTrustKeyringAgent.chat} call, never in the constructor.
|
|
2222
|
+
*
|
|
2223
|
+
* Optional ONLY in bring-your-own-key mode — when {@link LLMProviderConfig.apiKey}
|
|
2224
|
+
* is set, calls go straight to Google, consume none of our proxy, and the gate is
|
|
2225
|
+
* waived. Without an `llm.apiKey`, this is required.
|
|
2226
|
+
*/
|
|
2227
|
+
secretKey?: string;
|
|
2093
2228
|
/**
|
|
2094
2229
|
* The ecosystem the input URLs belong to. Every URL handed to this agent is a
|
|
2095
2230
|
* site that integrates WalletConnect — i.e. a blockchain / Web3 dApp — so the
|
|
@@ -2201,7 +2336,29 @@ declare class WebsiteTrustKeyringAgent {
|
|
|
2201
2336
|
private readonly debug;
|
|
2202
2337
|
/** Ecosystem prior scoping every search-grounded call (see {@link DEFAULT_ECOSYSTEM_CONTEXT}). */
|
|
2203
2338
|
private readonly ecosystem;
|
|
2339
|
+
/** Caller-supplied license key; validated lazily on first chat() via assertLicense(). */
|
|
2340
|
+
private readonly secretKey;
|
|
2341
|
+
/**
|
|
2342
|
+
* True when the caller supplied their own Gemini API key (`llm.apiKey`), so
|
|
2343
|
+
* every LLM call goes straight to Google and the licence gate does not apply.
|
|
2344
|
+
*/
|
|
2345
|
+
private readonly ownGeminiKey;
|
|
2346
|
+
/** True once the license has passed, so we only hash-check once. */
|
|
2347
|
+
private licenseChecked;
|
|
2204
2348
|
constructor(config?: WebsiteTrustKeyringAgentConfig);
|
|
2349
|
+
/**
|
|
2350
|
+
* Validate the license key against the hash baked into this bundle at build
|
|
2351
|
+
* time (`__AGENT_LICENSE_HASH__`, set by tsup from `SECRET_KEY_HASH`). The
|
|
2352
|
+
* app passes the raw key; we hash it here and compare hash-to-hash, so
|
|
2353
|
+
* neither the bundle nor the repo ever holds the key itself. When no hash was
|
|
2354
|
+
* baked in (local dev build with no `SECRET_KEY_HASH`) the gate is a no-op.
|
|
2355
|
+
* Cached after the first pass so we only hash once.
|
|
2356
|
+
*
|
|
2357
|
+
* The gate exists to protect the Keyring-hosted Gemini proxy. A caller that
|
|
2358
|
+
* brings their own Gemini API key (`llm.apiKey`) talks to Google directly and
|
|
2359
|
+
* consumes nothing of ours, so no secretKey is required in that mode.
|
|
2360
|
+
*/
|
|
2361
|
+
private assertLicense;
|
|
2205
2362
|
chat(input: WebsiteTrustInput): Promise<WebsiteTrustResult>;
|
|
2206
2363
|
/**
|
|
2207
2364
|
* Derive the phishing verdict + raw (English) evidence reasons from the
|
|
@@ -2425,7 +2582,7 @@ declare class Synthesizer {
|
|
|
2425
2582
|
synthesise(userQuery: string, trace: ReActTrace, conversationHistory: ChatMessage[], language?: string): Promise<string>;
|
|
2426
2583
|
}
|
|
2427
2584
|
|
|
2428
|
-
declare const WALLET_AGENT_TOOL_NAMES: readonly ["get-wallet-token-balances", "get-wallet-history", "get-wallet-token-transfers", "get-wallet-nft-transfers", "get-wallet-pnl-summary", "get-wallet-pnl", "get-wallet-approvals", "get-wallet-
|
|
2585
|
+
declare const WALLET_AGENT_TOOL_NAMES: readonly ["get-wallet-token-balances", "get-wallet-history", "get-wallet-token-transfers", "get-wallet-nft-transfers", "get-wallet-pnl-summary", "get-wallet-pnl", "get-wallet-approvals", "get-wallet-lending-positions", "get-wallet-defi-positions", "get-wallet-defi-protocol-positions", "get-transaction-by-hash", "gemini-search-ai"];
|
|
2429
2586
|
declare function createWalletAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
2430
2587
|
|
|
2431
2588
|
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"];
|
|
@@ -2447,7 +2604,7 @@ declare const WALLET_ACTION_AGENT_TOOL_NAMES: readonly ["open-send-native-form",
|
|
|
2447
2604
|
declare function createWalletActionAgent(llm: LLMProvider, registry: ToolRegistry, options?: SubagentOptions): Subagent;
|
|
2448
2605
|
|
|
2449
2606
|
/** Built-in subagent ids. */
|
|
2450
|
-
type DefaultSubagentName = 'wallet' | 'wallet-action' | 'token' | 'nft' | 'nfc' | 'pool' | 'pool-subgraph' | 'ai';
|
|
2607
|
+
type DefaultSubagentName = 'wallet' | 'wallet-action' | 'lending' | 'token' | 'nft' | 'nfc' | 'pool' | 'pool-subgraph' | 'ai';
|
|
2451
2608
|
/**
|
|
2452
2609
|
* Per-subagent enable flags. Default for every key is `true` EXCEPT
|
|
2453
2610
|
* `pool-subgraph`, which defaults to `false` because it is mutually exclusive
|
|
@@ -4804,80 +4961,6 @@ declare class WalletApprovalsTool extends BaseTool {
|
|
|
4804
4961
|
}>;
|
|
4805
4962
|
}
|
|
4806
4963
|
|
|
4807
|
-
type WalletDefiSummaryToolConfig = MoralisServiceConfig;
|
|
4808
|
-
/**
|
|
4809
|
-
* Tool: get-wallet-defi-summary
|
|
4810
|
-
*
|
|
4811
|
-
* Queries `GET /wallets/{address}/defi/summary` — a high-level DeFi overview
|
|
4812
|
-
* for a wallet: total USD value, total unclaimed rewards, number of active
|
|
4813
|
-
* protocols and positions, plus a per-protocol breakdown.
|
|
4814
|
-
*
|
|
4815
|
-
* Moralis docs: https://docs.moralis.com/data-api/evm/wallet/wallet-protocols
|
|
4816
|
-
*/
|
|
4817
|
-
declare class WalletDefiSummaryTool extends BaseTool {
|
|
4818
|
-
name: string;
|
|
4819
|
-
description: string;
|
|
4820
|
-
category: string;
|
|
4821
|
-
parameters: ToolParameter[];
|
|
4822
|
-
private service;
|
|
4823
|
-
constructor(config?: WalletDefiSummaryToolConfig);
|
|
4824
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
4825
|
-
error: string;
|
|
4826
|
-
_instructions?: undefined;
|
|
4827
|
-
walletAddress?: undefined;
|
|
4828
|
-
chain?: undefined;
|
|
4829
|
-
totalUsdValue?: undefined;
|
|
4830
|
-
totalUnclaimedUsdValue?: undefined;
|
|
4831
|
-
chains?: undefined;
|
|
4832
|
-
} | {
|
|
4833
|
-
activeProtocols: number;
|
|
4834
|
-
totalPositions: number;
|
|
4835
|
-
totalUsdValue: number;
|
|
4836
|
-
totalUnclaimedUsdValue: number;
|
|
4837
|
-
protocols: {
|
|
4838
|
-
protocolName: string | undefined;
|
|
4839
|
-
protocolId: string | undefined;
|
|
4840
|
-
protocolUrl: string | undefined;
|
|
4841
|
-
protocolLogo: string | undefined;
|
|
4842
|
-
positions: number;
|
|
4843
|
-
totalUsdValue: number;
|
|
4844
|
-
totalUnclaimedUsdValue: number;
|
|
4845
|
-
accountHealthFactor: number | null;
|
|
4846
|
-
}[];
|
|
4847
|
-
walletAddress: string;
|
|
4848
|
-
chain: string;
|
|
4849
|
-
error?: undefined;
|
|
4850
|
-
_instructions?: undefined;
|
|
4851
|
-
chains?: undefined;
|
|
4852
|
-
} | {
|
|
4853
|
-
_instructions: string;
|
|
4854
|
-
walletAddress: string;
|
|
4855
|
-
chain: string;
|
|
4856
|
-
totalUsdValue: number;
|
|
4857
|
-
totalUnclaimedUsdValue: number;
|
|
4858
|
-
chains: {
|
|
4859
|
-
activeProtocols: number;
|
|
4860
|
-
totalPositions: number;
|
|
4861
|
-
totalUsdValue: number;
|
|
4862
|
-
totalUnclaimedUsdValue: number;
|
|
4863
|
-
protocols: {
|
|
4864
|
-
protocolName: string | undefined;
|
|
4865
|
-
protocolId: string | undefined;
|
|
4866
|
-
protocolUrl: string | undefined;
|
|
4867
|
-
protocolLogo: string | undefined;
|
|
4868
|
-
positions: number;
|
|
4869
|
-
totalUsdValue: number;
|
|
4870
|
-
totalUnclaimedUsdValue: number;
|
|
4871
|
-
accountHealthFactor: number | null;
|
|
4872
|
-
}[];
|
|
4873
|
-
chain: string;
|
|
4874
|
-
}[];
|
|
4875
|
-
error?: undefined;
|
|
4876
|
-
}>;
|
|
4877
|
-
/** Map a single chain's raw summary into the tool's camelCase output fields. */
|
|
4878
|
-
private summaryFields;
|
|
4879
|
-
}
|
|
4880
|
-
|
|
4881
4964
|
type WalletDefiPositionsToolConfig = MoralisServiceConfig;
|
|
4882
4965
|
/**
|
|
4883
4966
|
* Tool: get-wallet-defi-positions
|
|
@@ -5148,6 +5231,609 @@ declare class TransactionByHashTool extends BaseTool {
|
|
|
5148
5231
|
}>;
|
|
5149
5232
|
}
|
|
5150
5233
|
|
|
5234
|
+
/**
|
|
5235
|
+
* One class per USDC lending protocol — everything that differs between Aave,
|
|
5236
|
+
* Compound, Spark and Morpho, and nothing that doesn't.
|
|
5237
|
+
*
|
|
5238
|
+
* ## Why these classes declare calls instead of making them
|
|
5239
|
+
*
|
|
5240
|
+
* The obvious shape for a protocol adapter is `async readState()` that goes to
|
|
5241
|
+
* chain itself, the way the CoinPool app's `useUsdcLendingData` hook does. This
|
|
5242
|
+
* service deliberately does NOT do that: listing Ethereum's 11 markets is a
|
|
5243
|
+
* single `aggregate3` round-trip, because every market's reads are batched into
|
|
5244
|
+
* one Multicall3 call. A protocol that fetched for itself would turn that one
|
|
5245
|
+
* round-trip into eleven.
|
|
5246
|
+
*
|
|
5247
|
+
* So the on-chain half of each protocol is split in two:
|
|
5248
|
+
*
|
|
5249
|
+
* 1. {@link LendingProtocol.sizeCall} / {@link LendingProtocol.liveRateCall} —
|
|
5250
|
+
* DECLARE the call, return a {@link MulticallRequest}, touch no network.
|
|
5251
|
+
* 2. {@link LendingProtocol.decodeSize} / {@link LendingProtocol.decodeLiveRate} —
|
|
5252
|
+
* turn that call's return data into a number.
|
|
5253
|
+
*
|
|
5254
|
+
* {@link file://../LendingService.ts} collects step 1 across every market on a
|
|
5255
|
+
* chain, fires ONE multicall, then hands each protocol its own slice back for
|
|
5256
|
+
* step 2. The protocols stay ignorant of batching; the batching stays ignorant
|
|
5257
|
+
* of protocols.
|
|
5258
|
+
*
|
|
5259
|
+
* The APY half ({@link LendingProtocol.fetchApy}) is a per-market HTTP call to a
|
|
5260
|
+
* different upstream per protocol, so there is nothing to batch and each class
|
|
5261
|
+
* simply does the fetch.
|
|
5262
|
+
*/
|
|
5263
|
+
/** Market kinds `/supply/v2` returns; see {@link PROTOCOLS}. */
|
|
5264
|
+
type LendingProtocolType = 'aave-v3' | 'compound-v3' | 'spark' | 'spark-ethereum' | 'morpho-v2';
|
|
5265
|
+
|
|
5266
|
+
/**
|
|
5267
|
+
* Client for the CoinPool USDC **lending / supply** markets — the data behind
|
|
5268
|
+
* the app's "Supply" product (Aave v3, Compound v3, Spark, Morpho v2 vaults).
|
|
5269
|
+
*
|
|
5270
|
+
* A wallet's supplied balance is NOT read from an indexer: the receipt token
|
|
5271
|
+
* (aToken / Comet / ERC-4626 vault share) is read straight from chain through
|
|
5272
|
+
* Multicall3, so the number always matches what the app shows. Everything else
|
|
5273
|
+
* comes from the same sources the CoinPool web app itself uses — its
|
|
5274
|
+
* `useUsdcLendingData` hook, in the SEPARATE `coinpool-v2` repository
|
|
5275
|
+
* (`src/hooks/useUsdcLendingData.ts`), is the reference this service was checked
|
|
5276
|
+
* against protocol by protocol:
|
|
5277
|
+
*
|
|
5278
|
+
* - market list ................. CoinPool `GET /supply/v2?chainId=…`
|
|
5279
|
+
* - supply-APY history ......... Aave v3 GraphQL (`aave-v3`),
|
|
5280
|
+
* Morpho GraphQL (`morpho-v2`),
|
|
5281
|
+
* CoinPool `GET /supply/rates/history` (rest)
|
|
5282
|
+
* - supplied amount / market size on-chain via Multicall3
|
|
5283
|
+
*
|
|
5284
|
+
* Reported APY is the AVERAGE of the daily supply-APY samples of the last
|
|
5285
|
+
* {@link APY_HISTORY_DAYS} days plus the live rate — a spot rate swings with
|
|
5286
|
+
* borrow demand, so an average is what a supplier actually earns.
|
|
5287
|
+
*
|
|
5288
|
+
* ## Protocols differ; the pipeline does not
|
|
5289
|
+
*
|
|
5290
|
+
* The market kinds disagree on every input: where the market size lives, whether
|
|
5291
|
+
* the receipt token is 1:1 with USDC or an ERC-4626 share, which API knows the
|
|
5292
|
+
* rate history, and whether a live rate has to come off-chain. Each kind is a
|
|
5293
|
+
* class in {@link file://./lending/protocols.ts}; this file is the pipeline that
|
|
5294
|
+
* drives them and knows about no protocol by name.
|
|
5295
|
+
*
|
|
5296
|
+
* | | market size | balance | APY history | live APY |
|
|
5297
|
+
* |--------------|----------------|-------------|-------------|------------|
|
|
5298
|
+
* | aave-v3 | aToken supply | underlying | Aave API | on-chain |
|
|
5299
|
+
* | compound-v3 | Comet supply | underlying | CoinPool | newest row |
|
|
5300
|
+
* | spark* | totalAssets() | ERC-4626 | CoinPool | newest row |
|
|
5301
|
+
* | morpho-v2 | totalAssets() | ERC-4626 | Morpho API | from API |
|
|
5302
|
+
*
|
|
5303
|
+
* Two entries in that last column are worth stating outright, because the app
|
|
5304
|
+
* looks like it disagrees. The app derives EVERY protocol's live rate on-chain,
|
|
5305
|
+
* each with its own formula; here only Aave does. That is not a shortcut taken
|
|
5306
|
+
* blindly — CoinPool's history endpoint refreshes intraday and its newest row
|
|
5307
|
+
* was checked against chain to six decimals for all three protocols that use it
|
|
5308
|
+
* (see `fetchCoinPoolApy`). Aave is the one case where the API and the on-chain
|
|
5309
|
+
* figure genuinely differ, so it is the one case that pays for the extra call.
|
|
5310
|
+
*
|
|
5311
|
+
* Protocols DECLARE their on-chain calls rather than making them, so every
|
|
5312
|
+
* market on a chain still resolves in ONE Multicall3 round-trip regardless of
|
|
5313
|
+
* how many protocols are involved — see the protocols module for why.
|
|
5314
|
+
*
|
|
5315
|
+
* Independent of {@link file://./MoralisService.ts}: these markets are curated by the
|
|
5316
|
+
* CoinPool platform and an indexer neither knows the curated set nor the vault
|
|
5317
|
+
* share → USDC conversion.
|
|
5318
|
+
*/
|
|
5319
|
+
interface LendingServiceConfig {
|
|
5320
|
+
/** Base URL of the CoinPool API. Defaults to `https://api.coinpool.app`. */
|
|
5321
|
+
coinPoolBaseUrl?: string;
|
|
5322
|
+
/** Aave v3 GraphQL endpoint (supply-APY history). */
|
|
5323
|
+
aaveApiUrl?: string;
|
|
5324
|
+
/** Morpho GraphQL endpoint (vault APY history + live net APY). */
|
|
5325
|
+
morphoApiUrl?: string;
|
|
5326
|
+
}
|
|
5327
|
+
/** One curated USDC lending market. */
|
|
5328
|
+
interface LendingMarket {
|
|
5329
|
+
/** Hex chain id the market lives on. */
|
|
5330
|
+
chain: string;
|
|
5331
|
+
/** Display name, e.g. "Aave v3 USDC" / "Spark USDC Savings Vault". */
|
|
5332
|
+
name: string;
|
|
5333
|
+
/** Protocol family, e.g. "AAVE" / "MORPHO". */
|
|
5334
|
+
protocol: string;
|
|
5335
|
+
/** Protocol app URL, when known. */
|
|
5336
|
+
protocolUrl: string | null;
|
|
5337
|
+
type: LendingProtocolType | string;
|
|
5338
|
+
/** Pool / vault contract — where a supply goes. */
|
|
5339
|
+
contract: string;
|
|
5340
|
+
/** Receipt token holding the user's balance (aToken, Comet, vault share). */
|
|
5341
|
+
token: string;
|
|
5342
|
+
/**
|
|
5343
|
+
* CoinPool's balanced score for the market, 0–10 (higher is better) — weighs
|
|
5344
|
+
* protocol safety, market size and yield. Null when the market is unscored.
|
|
5345
|
+
*/
|
|
5346
|
+
platformScore: number | null;
|
|
5347
|
+
}
|
|
5348
|
+
/** One daily supply-APY sample (percent, e.g. `4.21` for 4.21%). */
|
|
5349
|
+
interface ApyPoint {
|
|
5350
|
+
/** UTC day, `YYYY-MM-DD`. */
|
|
5351
|
+
date: string;
|
|
5352
|
+
apyPercent: number;
|
|
5353
|
+
}
|
|
5354
|
+
/** A lending market plus its live rate and size — what you'd compare before supplying. */
|
|
5355
|
+
interface LendingMarketOverview extends LendingMarket {
|
|
5356
|
+
/** Total USDC supplied to this market by everyone (market size). */
|
|
5357
|
+
totalSuppliedUsdc: number | null;
|
|
5358
|
+
/** Mean of {@link apyHistory} — the headline APY. Null when history is unavailable. */
|
|
5359
|
+
avgApyPercent: number | null;
|
|
5360
|
+
/** Live supply APY. */
|
|
5361
|
+
currentApyPercent: number | null;
|
|
5362
|
+
/** Live APY minus the previous day's, in percentage points. */
|
|
5363
|
+
apyChangePercent: number | null;
|
|
5364
|
+
/** Daily APY samples, oldest first, last entry = today's live rate. */
|
|
5365
|
+
apyHistory: ApyPoint[];
|
|
5366
|
+
}
|
|
5367
|
+
/** A wallet's live supply position in one lending market. */
|
|
5368
|
+
interface LendingSupplyPosition extends LendingMarketOverview {
|
|
5369
|
+
/** Supplied USDC, receipt-token balance converted to underlying. */
|
|
5370
|
+
suppliedUsdc: number;
|
|
5371
|
+
/** `suppliedUsdc × avgApyPercent` — projected yearly earnings at the average rate. */
|
|
5372
|
+
estimatedAnnualYieldUsdc: number | null;
|
|
5373
|
+
}
|
|
5374
|
+
declare class LendingService {
|
|
5375
|
+
private readonly coinPoolBaseUrl;
|
|
5376
|
+
/** Passed to each protocol's `fetchApy`, so endpoints stay configurable. */
|
|
5377
|
+
private readonly apiEndpoints;
|
|
5378
|
+
/** Shared across chains, so a whole-catalogue scan stays within the cap. */
|
|
5379
|
+
private readonly apyLimiter;
|
|
5380
|
+
constructor(config?: LendingServiceConfig);
|
|
5381
|
+
/** Hex chain ids with USDC lending markets (intersected with the active set). */
|
|
5382
|
+
listSupportedChains(): string[];
|
|
5383
|
+
/** True when the given chain (any alias / hex / decimal form) has lending markets. */
|
|
5384
|
+
isSupported(chain?: string | null): boolean;
|
|
5385
|
+
/**
|
|
5386
|
+
* Every curated USDC lending market on a chain. Empty when the chain has none
|
|
5387
|
+
* or the API is unreachable — never throws.
|
|
5388
|
+
*/
|
|
5389
|
+
getMarkets(chain: string): Promise<LendingMarket[]>;
|
|
5390
|
+
/** The USDC a supply on this chain moves. Null when the chain has no markets. */
|
|
5391
|
+
getUsdc(chain: string): {
|
|
5392
|
+
address: string;
|
|
5393
|
+
decimals: number;
|
|
5394
|
+
} | null;
|
|
5395
|
+
/**
|
|
5396
|
+
* The receipt token a supply into `market` credits — its own ERC-20 symbol and
|
|
5397
|
+
* decimals, read on chain in one multicall.
|
|
5398
|
+
*
|
|
5399
|
+
* This is what "Est. Received" is denominated in, and it is NOT the underlying:
|
|
5400
|
+
* Aave's is `aBasUSDC`, Compound's is `cUSDCv3`, and Spark's Base vault is
|
|
5401
|
+
* `sUSDC` with **18** decimals against USDC's 6. Scaling a share figure by the
|
|
5402
|
+
* asset's decimals overstates it by 10^12, so the form needs these to render a
|
|
5403
|
+
* correct number and an honest label.
|
|
5404
|
+
*
|
|
5405
|
+
* Resolved here, once, when the supply payload is built — the form is a pure
|
|
5406
|
+
* renderer and must never go to chain just to display what it was handed.
|
|
5407
|
+
*
|
|
5408
|
+
* Both fields are independently null when their call failed or decoded
|
|
5409
|
+
* implausibly; the caller then falls back to the underlying's metadata rather
|
|
5410
|
+
* than blocking a supply over a display detail.
|
|
5411
|
+
*/
|
|
5412
|
+
readReceiptToken(chain: string, market: Pick<LendingMarket, 'token' | 'type'>): Promise<{
|
|
5413
|
+
symbol: string | null;
|
|
5414
|
+
decimals: number | null;
|
|
5415
|
+
isUnderlying: boolean;
|
|
5416
|
+
}>;
|
|
5417
|
+
/**
|
|
5418
|
+
* Resolve ONE market on a chain from a free-text reference — the market name,
|
|
5419
|
+
* the protocol, or the contract address — for the supply flow, which needs a
|
|
5420
|
+
* single unambiguous target rather than a ranked list.
|
|
5421
|
+
*
|
|
5422
|
+
* Returns every close match rather than guessing when the reference is
|
|
5423
|
+
* ambiguous ("Morpho" on a chain with several Morpho vaults): depositing into
|
|
5424
|
+
* the wrong vault is not something the user can undo, so the caller asks
|
|
5425
|
+
* instead of picking. An exact name or contract match always wins outright.
|
|
5426
|
+
*/
|
|
5427
|
+
findMarket(chain: string, reference: string): Promise<LendingMarket[]>;
|
|
5428
|
+
/**
|
|
5429
|
+
* Size + APY for markets already resolved by {@link findMarket}, so the supply
|
|
5430
|
+
* flow can quote a rate without re-listing (and re-pricing) the whole chain.
|
|
5431
|
+
* Returns them in the order given; empty when the chain is unsupported.
|
|
5432
|
+
*/
|
|
5433
|
+
describeResolvedMarkets(chain: string, markets: LendingMarket[]): Promise<LendingMarketOverview[]>;
|
|
5434
|
+
/**
|
|
5435
|
+
* Every curated market on `chains`, each with its size and APY — the "where
|
|
5436
|
+
* can I supply USDC?" view. Highest average APY first, unrated markets last.
|
|
5437
|
+
*
|
|
5438
|
+
* Chains are queried in parallel and contribute independently: a chain whose
|
|
5439
|
+
* API or RPC fails yields nothing rather than failing the whole call.
|
|
5440
|
+
*/
|
|
5441
|
+
getMarketOverviews(params: {
|
|
5442
|
+
chains: readonly string[];
|
|
5443
|
+
}): Promise<LendingMarketOverview[]>;
|
|
5444
|
+
/**
|
|
5445
|
+
* Every lending market the wallet currently supplies to, across `chains`,
|
|
5446
|
+
* highest supplied amount first. Same parallelism and failure isolation as
|
|
5447
|
+
* {@link getMarketOverviews}; positions worth less than {@link DUST_USDC} are
|
|
5448
|
+
* dropped as withdrawal residue.
|
|
5449
|
+
*/
|
|
5450
|
+
getSupplyPositions(params: {
|
|
5451
|
+
address: string;
|
|
5452
|
+
chains: readonly string[];
|
|
5453
|
+
}): Promise<LendingSupplyPosition[]>;
|
|
5454
|
+
/** Supply positions on ONE chain: market list → balances → supplied amount + overview. */
|
|
5455
|
+
private positionsForChain;
|
|
5456
|
+
/**
|
|
5457
|
+
* Attach market size and the APY series to each market — one batched on-chain
|
|
5458
|
+
* read plus one API call per market, both at once. Order is preserved, so
|
|
5459
|
+
* callers can zip the result with their own per-market data. Never throws.
|
|
5460
|
+
*/
|
|
5461
|
+
private describeMarkets;
|
|
5462
|
+
/**
|
|
5463
|
+
* Every market's receipt-token balance + decimals in one batch, narrowed to the
|
|
5464
|
+
* markets the wallet actually holds something in — the step that decides how
|
|
5465
|
+
* much further work the rest of the flow has to do.
|
|
5466
|
+
*/
|
|
5467
|
+
private readBalances;
|
|
5468
|
+
/**
|
|
5469
|
+
* On-chain state of each market, in ONE batch, aligned with `markets`: its size
|
|
5470
|
+
* and — for Aave alone — its live supply rate.
|
|
5471
|
+
*
|
|
5472
|
+
* This is where the batching lives. Each market's protocol only DECLARES the
|
|
5473
|
+
* calls it wants ({@link LendingProtocol.sizeCall}, {@link LendingProtocol.liveRateCall});
|
|
5474
|
+
* they are pooled here into a single multicall, and each protocol then decodes
|
|
5475
|
+
* its own slice of the result. Twenty markets across four protocols still cost
|
|
5476
|
+
* one RPC round-trip.
|
|
5477
|
+
*
|
|
5478
|
+
* Either field is null when its call failed or decoded implausibly.
|
|
5479
|
+
*/
|
|
5480
|
+
private readMarketState;
|
|
5481
|
+
/**
|
|
5482
|
+
* Each held balance as USDC, aligned with `held`. A protocol whose receipt
|
|
5483
|
+
* token is an ERC-4626 share declares a `convertToAssets` call; one whose
|
|
5484
|
+
* balance is already underlying declares none. As with {@link readMarketState},
|
|
5485
|
+
* every conversion across every protocol shares ONE multicall.
|
|
5486
|
+
*
|
|
5487
|
+
* A vault whose conversion reverts falls back to the raw balance in the share
|
|
5488
|
+
* token's own decimals — an approximation that beats dropping the position
|
|
5489
|
+
* outright.
|
|
5490
|
+
*/
|
|
5491
|
+
private convertToUnderlying;
|
|
5492
|
+
/**
|
|
5493
|
+
* Historical supply-APY samples for one market, from whichever upstream its
|
|
5494
|
+
* protocol queries, plus that source's own live rate where it reports one.
|
|
5495
|
+
*
|
|
5496
|
+
* Unlike the on-chain reads there is nothing to batch here — each protocol
|
|
5497
|
+
* talks to a different API, one request per market — so the protocol performs
|
|
5498
|
+
* the fetch itself. Never throws: an unreachable source yields no samples, so
|
|
5499
|
+
* the market is still listed, just without APY.
|
|
5500
|
+
*/
|
|
5501
|
+
private fetchApySamples;
|
|
5502
|
+
}
|
|
5503
|
+
|
|
5504
|
+
type LendingMarketsToolConfig = LendingServiceConfig;
|
|
5505
|
+
/** How the list is ordered. Mirrors the `sort` parameter. */
|
|
5506
|
+
type SortKey = 'apy' | 'score' | 'size';
|
|
5507
|
+
/**
|
|
5508
|
+
* Tool: get-lending-markets
|
|
5509
|
+
*
|
|
5510
|
+
* The USDC lending markets a user CAN supply to — the catalogue side of the
|
|
5511
|
+
* lending domain, as opposed to `get-wallet-lending-positions` which reports
|
|
5512
|
+
* what a wallet already supplies. Each market carries its size, the protocol's
|
|
5513
|
+
* live supply APY — the rate the list is ranked on, and the one a depositor is
|
|
5514
|
+
* quoted today — and the average over the last week as a stability check on it.
|
|
5515
|
+
*
|
|
5516
|
+
* See {@link file://../../../services/LendingService.ts} for the data sources.
|
|
5517
|
+
*/
|
|
5518
|
+
declare class LendingMarketsTool extends BaseTool {
|
|
5519
|
+
name: string;
|
|
5520
|
+
description: string;
|
|
5521
|
+
category: string;
|
|
5522
|
+
parameters: ToolParameter[];
|
|
5523
|
+
private service;
|
|
5524
|
+
constructor(config?: LendingMarketsToolConfig);
|
|
5525
|
+
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
5526
|
+
_instructions: string;
|
|
5527
|
+
requestedProtocol: string;
|
|
5528
|
+
protocolSupported: boolean;
|
|
5529
|
+
supportedProtocols: string[];
|
|
5530
|
+
marketCount: number;
|
|
5531
|
+
markets: never[];
|
|
5532
|
+
} | {
|
|
5533
|
+
_instructions: string;
|
|
5534
|
+
chain: string;
|
|
5535
|
+
connectedChainHasNoMarkets: boolean;
|
|
5536
|
+
marketCount: number;
|
|
5537
|
+
markets: never[];
|
|
5538
|
+
chainsWithLendingMarkets: string[];
|
|
5539
|
+
requestedProtocol?: undefined;
|
|
5540
|
+
protocolsAvailable?: undefined;
|
|
5541
|
+
} | {
|
|
5542
|
+
_instructions: string;
|
|
5543
|
+
requestedProtocol: string;
|
|
5544
|
+
chain: string;
|
|
5545
|
+
marketCount: number;
|
|
5546
|
+
markets: never[];
|
|
5547
|
+
protocolsAvailable: string[];
|
|
5548
|
+
connectedChainHasNoMarkets?: undefined;
|
|
5549
|
+
chainsWithLendingMarkets?: undefined;
|
|
5550
|
+
} | {
|
|
5551
|
+
sortedBy: SortKey;
|
|
5552
|
+
marketCount: number;
|
|
5553
|
+
totalMarketsAvailable: number;
|
|
5554
|
+
markets: {
|
|
5555
|
+
marketName: string;
|
|
5556
|
+
protocol: string;
|
|
5557
|
+
protocolUrl: string | null;
|
|
5558
|
+
chain: string;
|
|
5559
|
+
avgApyPercent: number | null;
|
|
5560
|
+
avgApyDays: number;
|
|
5561
|
+
currentApyPercent: number | null;
|
|
5562
|
+
apyChangePercent: number | null;
|
|
5563
|
+
totalSuppliedUsdc: number | null;
|
|
5564
|
+
platformScore: number | null;
|
|
5565
|
+
}[];
|
|
5566
|
+
protocolFilter?: string | undefined;
|
|
5567
|
+
chain: string;
|
|
5568
|
+
chainsQueried: string[];
|
|
5569
|
+
actionButtons?: SuggestedAction[] | undefined;
|
|
5570
|
+
_instructions: string;
|
|
5571
|
+
connectedChainHasNoMarkets?: undefined;
|
|
5572
|
+
chainsWithLendingMarkets?: undefined;
|
|
5573
|
+
requestedProtocol?: undefined;
|
|
5574
|
+
protocolsAvailable?: undefined;
|
|
5575
|
+
}>;
|
|
5576
|
+
/**
|
|
5577
|
+
* The reply for a protocol we carry no markets for — whether it is a real one
|
|
5578
|
+
* we haven't integrated (Euler, Venus) or a name that resolved to nothing.
|
|
5579
|
+
*
|
|
5580
|
+
* Both land here because the user's next step is identical: hear that we don't
|
|
5581
|
+
* have it, and see what we do. They differ only in how the request is echoed —
|
|
5582
|
+
* a recognised protocol is named back properly ("Euler"), while an unrecognised
|
|
5583
|
+
* string is quoted as the user's own words and never called a protocol, since
|
|
5584
|
+
* calling it one would assert something we could not verify.
|
|
5585
|
+
*/
|
|
5586
|
+
private unsupportedProtocol;
|
|
5587
|
+
/** Presentation contract for the synthesizer, tailored to what we found. */
|
|
5588
|
+
private instructions;
|
|
5589
|
+
}
|
|
5590
|
+
|
|
5591
|
+
type WalletLendingPositionsToolConfig = LendingServiceConfig;
|
|
5592
|
+
/**
|
|
5593
|
+
* Tool: get-wallet-lending-positions
|
|
5594
|
+
*
|
|
5595
|
+
* A wallet's USDC lending ("supply") positions in the curated markets the app
|
|
5596
|
+
* itself lists — Aave v3, Compound v3, Spark and Morpho v2 vaults. Balances are
|
|
5597
|
+
* read from chain (receipt token → underlying), so they match the app exactly;
|
|
5598
|
+
* the reported APY is the AVERAGE of the last week's daily supply-APY samples
|
|
5599
|
+
* rather than the spot rate, which swings with borrow demand.
|
|
5600
|
+
*
|
|
5601
|
+
* See {@link file://../../../services/LendingService.ts} for the data sources.
|
|
5602
|
+
*/
|
|
5603
|
+
declare class WalletLendingPositionsTool extends BaseTool {
|
|
5604
|
+
name: string;
|
|
5605
|
+
description: string;
|
|
5606
|
+
category: string;
|
|
5607
|
+
parameters: ToolParameter[];
|
|
5608
|
+
private service;
|
|
5609
|
+
constructor(config?: WalletLendingPositionsToolConfig);
|
|
5610
|
+
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
5611
|
+
error: string;
|
|
5612
|
+
_instructions?: undefined;
|
|
5613
|
+
walletAddress?: undefined;
|
|
5614
|
+
chain?: undefined;
|
|
5615
|
+
positionCount?: undefined;
|
|
5616
|
+
positions?: undefined;
|
|
5617
|
+
chainsWithLendingMarkets?: undefined;
|
|
5618
|
+
chainsQueried?: undefined;
|
|
5619
|
+
totals?: undefined;
|
|
5620
|
+
} | {
|
|
5621
|
+
_instructions: string;
|
|
5622
|
+
walletAddress: string;
|
|
5623
|
+
chain: string;
|
|
5624
|
+
positionCount: number;
|
|
5625
|
+
positions: never[];
|
|
5626
|
+
chainsWithLendingMarkets: string[];
|
|
5627
|
+
error?: undefined;
|
|
5628
|
+
chainsQueried?: undefined;
|
|
5629
|
+
totals?: undefined;
|
|
5630
|
+
} | {
|
|
5631
|
+
_instructions: string;
|
|
5632
|
+
walletAddress: string;
|
|
5633
|
+
chain: string;
|
|
5634
|
+
chainsQueried: string[];
|
|
5635
|
+
positionCount: number;
|
|
5636
|
+
totals: {
|
|
5637
|
+
suppliedUsdc: number;
|
|
5638
|
+
estimatedAnnualYieldUsdc: number;
|
|
5639
|
+
weightedAvgApyPercent: number | null;
|
|
5640
|
+
};
|
|
5641
|
+
positions: {
|
|
5642
|
+
marketName: string;
|
|
5643
|
+
protocol: string;
|
|
5644
|
+
protocolUrl: string | null;
|
|
5645
|
+
chain: string;
|
|
5646
|
+
suppliedUsdc: number;
|
|
5647
|
+
avgApyPercent: number | null;
|
|
5648
|
+
currentApyPercent: number | null;
|
|
5649
|
+
apyChangePercent: number | null;
|
|
5650
|
+
estimatedAnnualYieldUsdc: number | null;
|
|
5651
|
+
marketTotalSuppliedUsdc: number | null;
|
|
5652
|
+
apyHistory: ApyPoint[];
|
|
5653
|
+
platformScore: number | null;
|
|
5654
|
+
}[];
|
|
5655
|
+
error?: undefined;
|
|
5656
|
+
chainsWithLendingMarkets?: undefined;
|
|
5657
|
+
}>;
|
|
5658
|
+
/** Presentation contract for the synthesizer, tailored to what we found. */
|
|
5659
|
+
private instructions;
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5662
|
+
interface OpenSupplyFormToolConfig extends LendingServiceConfig {
|
|
5663
|
+
/** Moralis config for the USDC balance shown on the form. */
|
|
5664
|
+
moralis?: MoralisServiceConfig;
|
|
5665
|
+
}
|
|
5666
|
+
/**
|
|
5667
|
+
* Tool: open-supply-usdc-form
|
|
5668
|
+
*
|
|
5669
|
+
* Opens the form that deposits USDC into ONE lending market. The counterpart to
|
|
5670
|
+
* `get-lending-markets`, which only lists what is available: this resolves the
|
|
5671
|
+
* market the user picked, checks their USDC balance, and hands the FE everything
|
|
5672
|
+
* it needs to run the approve → supply sequence itself.
|
|
5673
|
+
*
|
|
5674
|
+
* Like every wallet action in this core, the tool does NOT build or sign a
|
|
5675
|
+
* transaction — it resolves and validates, then emits a `SupplyUsdcForm` payload.
|
|
5676
|
+
* The FE owns the allowance check, the per-protocol encoding and the signing.
|
|
5677
|
+
*/
|
|
5678
|
+
declare class OpenSupplyFormTool extends BaseTool {
|
|
5679
|
+
name: string;
|
|
5680
|
+
kind: ToolKind;
|
|
5681
|
+
category: string;
|
|
5682
|
+
description: string;
|
|
5683
|
+
parameters: ToolParameter[];
|
|
5684
|
+
private service;
|
|
5685
|
+
private moralis;
|
|
5686
|
+
constructor(config?: OpenSupplyFormToolConfig);
|
|
5687
|
+
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
5688
|
+
error: string;
|
|
5689
|
+
_instructions: string;
|
|
5690
|
+
chain?: undefined;
|
|
5691
|
+
chainsWithLendingMarkets?: undefined;
|
|
5692
|
+
market?: undefined;
|
|
5693
|
+
candidates?: undefined;
|
|
5694
|
+
marketName?: undefined;
|
|
5695
|
+
protocol?: undefined;
|
|
5696
|
+
usdcBalance?: undefined;
|
|
5697
|
+
requestedAmount?: undefined;
|
|
5698
|
+
ui?: undefined;
|
|
5699
|
+
apyPercent?: undefined;
|
|
5700
|
+
} | {
|
|
5701
|
+
error: string;
|
|
5702
|
+
chain: string;
|
|
5703
|
+
chainsWithLendingMarkets: string[];
|
|
5704
|
+
_instructions: string;
|
|
5705
|
+
market?: undefined;
|
|
5706
|
+
candidates?: undefined;
|
|
5707
|
+
marketName?: undefined;
|
|
5708
|
+
protocol?: undefined;
|
|
5709
|
+
usdcBalance?: undefined;
|
|
5710
|
+
requestedAmount?: undefined;
|
|
5711
|
+
ui?: undefined;
|
|
5712
|
+
apyPercent?: undefined;
|
|
5713
|
+
} | {
|
|
5714
|
+
error: string;
|
|
5715
|
+
market: string;
|
|
5716
|
+
chain: string;
|
|
5717
|
+
_instructions: string;
|
|
5718
|
+
chainsWithLendingMarkets?: undefined;
|
|
5719
|
+
candidates?: undefined;
|
|
5720
|
+
marketName?: undefined;
|
|
5721
|
+
protocol?: undefined;
|
|
5722
|
+
usdcBalance?: undefined;
|
|
5723
|
+
requestedAmount?: undefined;
|
|
5724
|
+
ui?: undefined;
|
|
5725
|
+
apyPercent?: undefined;
|
|
5726
|
+
} | {
|
|
5727
|
+
error: string;
|
|
5728
|
+
market: string;
|
|
5729
|
+
chain: string;
|
|
5730
|
+
candidates: {
|
|
5731
|
+
marketName: string;
|
|
5732
|
+
protocol: string;
|
|
5733
|
+
}[];
|
|
5734
|
+
_instructions: string;
|
|
5735
|
+
chainsWithLendingMarkets?: undefined;
|
|
5736
|
+
marketName?: undefined;
|
|
5737
|
+
protocol?: undefined;
|
|
5738
|
+
usdcBalance?: undefined;
|
|
5739
|
+
requestedAmount?: undefined;
|
|
5740
|
+
ui?: undefined;
|
|
5741
|
+
apyPercent?: undefined;
|
|
5742
|
+
} | {
|
|
5743
|
+
error: string;
|
|
5744
|
+
marketName: string;
|
|
5745
|
+
protocol: string;
|
|
5746
|
+
_instructions: string;
|
|
5747
|
+
chain?: undefined;
|
|
5748
|
+
chainsWithLendingMarkets?: undefined;
|
|
5749
|
+
market?: undefined;
|
|
5750
|
+
candidates?: undefined;
|
|
5751
|
+
usdcBalance?: undefined;
|
|
5752
|
+
requestedAmount?: undefined;
|
|
5753
|
+
ui?: undefined;
|
|
5754
|
+
apyPercent?: undefined;
|
|
5755
|
+
} | {
|
|
5756
|
+
error: string;
|
|
5757
|
+
chain: string;
|
|
5758
|
+
_instructions: string;
|
|
5759
|
+
chainsWithLendingMarkets?: undefined;
|
|
5760
|
+
market?: undefined;
|
|
5761
|
+
candidates?: undefined;
|
|
5762
|
+
marketName?: undefined;
|
|
5763
|
+
protocol?: undefined;
|
|
5764
|
+
usdcBalance?: undefined;
|
|
5765
|
+
requestedAmount?: undefined;
|
|
5766
|
+
ui?: undefined;
|
|
5767
|
+
apyPercent?: undefined;
|
|
5768
|
+
} | {
|
|
5769
|
+
error: string;
|
|
5770
|
+
marketName: string;
|
|
5771
|
+
chain: string;
|
|
5772
|
+
usdcBalance: string;
|
|
5773
|
+
_instructions: string;
|
|
5774
|
+
chainsWithLendingMarkets?: undefined;
|
|
5775
|
+
market?: undefined;
|
|
5776
|
+
candidates?: undefined;
|
|
5777
|
+
protocol?: undefined;
|
|
5778
|
+
requestedAmount?: undefined;
|
|
5779
|
+
ui?: undefined;
|
|
5780
|
+
apyPercent?: undefined;
|
|
5781
|
+
} | {
|
|
5782
|
+
error: string;
|
|
5783
|
+
marketName: string;
|
|
5784
|
+
chain: string;
|
|
5785
|
+
requestedAmount: string | null;
|
|
5786
|
+
usdcBalance: string;
|
|
5787
|
+
_instructions: string;
|
|
5788
|
+
chainsWithLendingMarkets?: undefined;
|
|
5789
|
+
market?: undefined;
|
|
5790
|
+
candidates?: undefined;
|
|
5791
|
+
protocol?: undefined;
|
|
5792
|
+
ui?: undefined;
|
|
5793
|
+
apyPercent?: undefined;
|
|
5794
|
+
} | {
|
|
5795
|
+
ui: UIPayload<SupplyUsdcProps>;
|
|
5796
|
+
marketName: string;
|
|
5797
|
+
protocol: string;
|
|
5798
|
+
chain: string;
|
|
5799
|
+
apyPercent: number | null;
|
|
5800
|
+
usdcBalance: string | null;
|
|
5801
|
+
_instructions: string;
|
|
5802
|
+
error?: undefined;
|
|
5803
|
+
chainsWithLendingMarkets?: undefined;
|
|
5804
|
+
market?: undefined;
|
|
5805
|
+
candidates?: undefined;
|
|
5806
|
+
requestedAmount?: undefined;
|
|
5807
|
+
}>;
|
|
5808
|
+
/** Size + live APY for the one resolved market. Null when it can't be priced. */
|
|
5809
|
+
private describeOne;
|
|
5810
|
+
/**
|
|
5811
|
+
* The wallet's USDC on this chain, for the form's spendable line and the
|
|
5812
|
+
* balance checks above.
|
|
5813
|
+
*
|
|
5814
|
+
* The distinction that matters here is "the call FAILED" vs "the call
|
|
5815
|
+
* succeeded and reported nothing", which a bare null cannot express:
|
|
5816
|
+
*
|
|
5817
|
+
* - `null` — the balance is genuinely UNREADABLE (request failed or threw).
|
|
5818
|
+
* The form still opens: blocking a supply over a flaky call would be worse.
|
|
5819
|
+
* - `{ amount: '0' }` — the request SUCCEEDED and returned no USDC row.
|
|
5820
|
+
*
|
|
5821
|
+
* The second case is the one that was being missed. `getWalletTokenBalances`
|
|
5822
|
+
* serves portfolio LISTS, so it drops zero rows and anything worth under a
|
|
5823
|
+
* cent; we asked it for this one token, so a successful call with no row means
|
|
5824
|
+
* the wallet holds nothing spendable here — not that the read failed. Reporting
|
|
5825
|
+
* it as '0' is what lets the `no_usdc_balance` branch fire instead of opening a
|
|
5826
|
+
* form the user cannot submit.
|
|
5827
|
+
*/
|
|
5828
|
+
private usdcBalance;
|
|
5829
|
+
/**
|
|
5830
|
+
* Presentation contract for the synthesizer. Only reached once the supply is
|
|
5831
|
+
* actually possible — an empty or short balance returns earlier with its own
|
|
5832
|
+
* message, so nothing here needs to warn about funds.
|
|
5833
|
+
*/
|
|
5834
|
+
private instructions;
|
|
5835
|
+
}
|
|
5836
|
+
|
|
5151
5837
|
type WalletNFTsToolConfig = MoralisServiceConfig;
|
|
5152
5838
|
/**
|
|
5153
5839
|
* Tool: get-wallet-nfts
|
|
@@ -7459,15 +8145,19 @@ declare class SwapTokenTool extends BaseTool {
|
|
|
7459
8145
|
* - contract_address + token_id → confirm ownership; emit form (image + name +
|
|
7460
8146
|
* token_standard + maxAmount come from the wallet row). Not held → error.
|
|
7461
8147
|
* - contract_address only → list the user's holdings in that collection.
|
|
7462
|
-
* • 0 → error • 1 → form pre-filled • >1 →
|
|
8148
|
+
* • 0 → error • 1 → form pre-filled • >1 → picker gallery.
|
|
7463
8149
|
* - token_id only → list all owned NFTs whose token_id matches.
|
|
7464
|
-
* • 0 → error • 1 → form pre-filled • >1 →
|
|
8150
|
+
* • 0 → error • 1 → form pre-filled • >1 → picker gallery.
|
|
7465
8151
|
* - nft_name only → fuzzy-match against owned NFTs' names.
|
|
7466
|
-
* • 0 → error • 1 → form pre-filled • >1 →
|
|
8152
|
+
* • 0 → error • 1 → form pre-filled • >1 → picker gallery.
|
|
7467
8153
|
*
|
|
7468
|
-
* When more than one owned NFT matches
|
|
7469
|
-
*
|
|
7470
|
-
*
|
|
8154
|
+
* When more than one owned NFT matches — the common case for a name-only request
|
|
8155
|
+
* ("send my Bored Ape"), since a collection's NFTs usually share one name — we
|
|
8156
|
+
* cannot safely pick one for the user. Instead of opening a half-blank form we
|
|
8157
|
+
* show the matches as the same `WalletNftList` gallery `get-wallet-nfts` renders,
|
|
8158
|
+
* in PICKER mode: each card carries a prompt naming that NFT's exact contract +
|
|
8159
|
+
* token id, so tapping one comes straight back here and resolves to a single
|
|
8160
|
+
* match, which then opens the pre-filled form.
|
|
7471
8161
|
*/
|
|
7472
8162
|
declare class SendNftTool extends BaseWalletActionTool {
|
|
7473
8163
|
name: string;
|
|
@@ -7479,11 +8169,67 @@ declare class SendNftTool extends BaseWalletActionTool {
|
|
|
7479
8169
|
}];
|
|
7480
8170
|
description: string;
|
|
7481
8171
|
parameters: ToolParameter[];
|
|
7482
|
-
protected buildParameters(args: Record<string, unknown>, userContext?: UserContext): Promise<Record<string, string
|
|
8172
|
+
protected buildParameters(args: Record<string, unknown>, userContext?: UserContext): Promise<Record<string, string> | {
|
|
8173
|
+
ui: UIPayload;
|
|
8174
|
+
_instructions: string;
|
|
8175
|
+
matchCount: number;
|
|
8176
|
+
}>;
|
|
8177
|
+
/**
|
|
8178
|
+
* Render the ambiguous matches as a `WalletNftList` in picker mode — the same
|
|
8179
|
+
* component `get-wallet-nfts` uses, so a "which one?" gallery looks identical
|
|
8180
|
+
* to a browse gallery.
|
|
8181
|
+
*
|
|
8182
|
+
* Each card's prompt carries the NFT's exact token id and contract address
|
|
8183
|
+
* (see {@link buildPickPrompt}), which is what makes the follow-up turn
|
|
8184
|
+
* unambiguous: `matchNfts` then filters on contract + token_id (the strong
|
|
8185
|
+
* keys) and lands on exactly one row. The recipient and amount the user
|
|
8186
|
+
* ALREADY gave are carried through too, so picking an NFT doesn't lose them
|
|
8187
|
+
* and re-ask.
|
|
8188
|
+
*
|
|
8189
|
+
* Images come from the same on-chain `tokenURI` resolution as the browse
|
|
8190
|
+
* gallery, so the user recognises the artwork they are choosing between; they
|
|
8191
|
+
* travel inside `ui.props` and never enter the LLM prompt.
|
|
8192
|
+
*/
|
|
8193
|
+
private buildPicker;
|
|
8194
|
+
/**
|
|
8195
|
+
* The message submitted when a picker card is tapped, e.g.
|
|
8196
|
+
*
|
|
8197
|
+
* send my Uniswap - 0.3% - LINK/WETH - 176.22<>239.30 Token id: 5118938
|
|
8198
|
+
* (collection contract: 0x03a5…34f1)
|
|
8199
|
+
*
|
|
8200
|
+
* The action + name come from the LLM's already-localized template, so the
|
|
8201
|
+
* sentence stays in the user's language. Everything after it is a LABELLED
|
|
8202
|
+
* value: a send prompt can carry TWO addresses (the collection and the
|
|
8203
|
+
* recipient) and position alone is not a reliable cue for which is which —
|
|
8204
|
+
* mixing them up would send the NFT to the collection contract. The labels are
|
|
8205
|
+
* fixed English keywords rather than prose, so they survive any template
|
|
8206
|
+
* language.
|
|
8207
|
+
*
|
|
8208
|
+
* The token id trails the name unbracketed because it reads as part of how an
|
|
8209
|
+
* NFT is named; the addresses stay parenthesised so they are unmistakably
|
|
8210
|
+
* machine values and never get parsed as part of the name — which matters here,
|
|
8211
|
+
* since names like the Uniswap LP one above contain their own dashes, slashes
|
|
8212
|
+
* and numbers.
|
|
8213
|
+
*/
|
|
8214
|
+
private buildPickPrompt;
|
|
8215
|
+
/**
|
|
8216
|
+
* Each NFT's image from its on-chain `tokenURI` (one multicall for the chain).
|
|
8217
|
+
* Positionally aligned with `nfts`; `null` where nothing resolved, letting the
|
|
8218
|
+
* caller fall back to the Moralis-derived image. Best-effort — any failure
|
|
8219
|
+
* degrades to all-null rather than breaking the picker.
|
|
8220
|
+
*/
|
|
8221
|
+
private resolveImages;
|
|
7483
8222
|
private normaliseString;
|
|
7484
8223
|
private normaliseTokenId;
|
|
7485
8224
|
private normaliseAmountInt;
|
|
7486
8225
|
private nftDisplayName;
|
|
8226
|
+
/**
|
|
8227
|
+
* Label for the collection a picker card belongs to, used only when the picker
|
|
8228
|
+
* spans several collections. Falls back to a shortened contract address when
|
|
8229
|
+
* the collection is unnamed — the whole point of the label is to tell two
|
|
8230
|
+
* otherwise-identical cards apart, so it can never be blank.
|
|
8231
|
+
*/
|
|
8232
|
+
private collectionLabel;
|
|
7487
8233
|
private matchNfts;
|
|
7488
8234
|
private paramsFromInputs;
|
|
7489
8235
|
private paramsFromNft;
|
|
@@ -8246,4 +8992,4 @@ declare class AbortError extends Error {
|
|
|
8246
8992
|
*/
|
|
8247
8993
|
declare function isAbortError(err: unknown): boolean;
|
|
8248
8994
|
|
|
8249
|
-
export { AI_AGENT_TOOL_NAMES, AbortError, type AddLiquidityFormProps, type AddLiquiditySummary, type AffiliateFee, type AgentConfig, AgentCore, type AgentResponse, ApproveTokenTool, BaseNftAiTool, 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 HttpMethod, type IngestKnowledgeBaseInput, type IngestKnowledgeBaseResult, type InputTokenInfo, type KBSearchResult, KnowledgeBase, type KnowledgeBaseEntry, type KnowledgeBaseProvider, type LLMProvider, type LLMProviderConfig, type LLMResponse, type LLMToolCall, ManageLiquidityRedirectTool, type MarketplaceLink, type MoralisApiResponse, MoralisService, type MoralisServiceConfig, 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 NativeTokenInfo, NfcBuyTool, NfcInfoTool, type NftTransferLastSale, NoFormTool, type NoFormToolMessages, 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, 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,
|
|
8995
|
+
export { AI_AGENT_TOOL_NAMES, AbortError, type AddLiquidityFormProps, type AddLiquiditySummary, type AffiliateFee, type AgentConfig, AgentCore, type AgentResponse, ApproveTokenTool, type ApyPoint, BaseNftAiTool, 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 HttpMethod, type IngestKnowledgeBaseInput, type IngestKnowledgeBaseResult, type InputTokenInfo, type KBSearchResult, KnowledgeBase, type KnowledgeBaseEntry, type KnowledgeBaseProvider, type LLMProvider, type LLMProviderConfig, type LLMResponse, type LLMToolCall, type LendingMarket, type LendingMarketOverview, LendingMarketsTool, type LendingMarketsToolConfig, type LendingProtocolType, LendingService, type LendingServiceConfig, type LendingSupplyPosition, ManageLiquidityRedirectTool, type MarketplaceLink, type MoralisApiResponse, MoralisService, type MoralisServiceConfig, 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 NativeTokenInfo, NfcBuyTool, NfcInfoTool, type NftTransferLastSale, NoFormTool, type NoFormToolMessages, OpenAddLiquidityFormTool, type OpenAddLiquidityFormToolConfig, OpenSupplyFormTool, type OpenSupplyFormToolConfig, 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 SupplyProtocolType, type SupplyUsdcProps, 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, 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, ZERO_ADDRESS, amazonDomainForLanguage, apiClient, buildChallenge, buildRangePresets, buildUniswapPoolUrl, clampTick, completeX402, configureSupportedChains, createAiAgent, createDefaultSubagents, createNfcAgent, createNftAgent, createPoolAgent, createTokenAgent, createWalletActionAgent, createWalletAgent, createX402SignatureProvider, displayFromChallenge, encodeSignedHeader, ethCallAt, ethCallByChain, fetchTopMarketplaces, getAffiliateFee, getChainMeta, getDefaultRpcUrl, getGatewayAddress, getGatewayChains, getNativeTokenInfo, getPositionManagerAddress, getProviderByChain, ingestKnowledgeBase, isAbortError, isPaymentRequired, nfcAmazonSearchUrl, normaliseCountry, normalizePriceRangeToPool, priceToTick, readPaymentError, readPaymentRequired, readReceipt, registerMaybeNoForm, requestWithX402, resolveNfcShopLinks, resolveRpcUrl, roundTickToSpacing, rpcCall, setRpcOverrides, swapServiceFactory, tickToPrice, toPantographChain };
|