@continuumdao/ctm-mpc-defi 0.2.0 → 0.2.2

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.
Files changed (100) hide show
  1. package/README.md +20 -78
  2. package/dist/agent/catalog.cjs +563 -5
  3. package/dist/agent/catalog.cjs.map +1 -1
  4. package/dist/agent/catalog.d.ts +166 -20
  5. package/dist/agent/catalog.js +551 -7
  6. package/dist/agent/catalog.js.map +1 -1
  7. package/dist/agent/skills/aave-v4/SKILL.md +43 -0
  8. package/dist/agent/skills/curve-dao/SKILL.md +13 -0
  9. package/dist/agent/skills/ethena/SKILL.md +10 -0
  10. package/dist/agent/skills/euler-v2/SKILL.md +10 -0
  11. package/dist/agent/skills/lido/SKILL.md +22 -0
  12. package/dist/agent/skills/maple-syrup/SKILL.md +10 -0
  13. package/dist/agent/skills/sky/SKILL.md +10 -0
  14. package/dist/agent/skills/uniswap-v4/SKILL.md +22 -0
  15. package/dist/chains/evm/index.cjs +79 -224
  16. package/dist/chains/evm/index.cjs.map +1 -1
  17. package/dist/chains/evm/index.d.ts +26 -26
  18. package/dist/chains/evm/index.js +69 -209
  19. package/dist/chains/evm/index.js.map +1 -1
  20. package/dist/chains/near/index.d.ts +1 -1
  21. package/dist/chains/solana/index.d.ts +1 -1
  22. package/dist/core/index.cjs +68 -106
  23. package/dist/core/index.cjs.map +1 -1
  24. package/dist/core/index.d.ts +21 -36
  25. package/dist/core/index.js +57 -96
  26. package/dist/core/index.js.map +1 -1
  27. package/dist/{envelope-CcE5Cz_q.d.ts → envelope-CpBUh9eP.d.ts} +1 -1
  28. package/dist/index.cjs +356 -1855
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.ts +7 -11
  31. package/dist/index.js +332 -1826
  32. package/dist/index.js.map +1 -1
  33. package/dist/protocols/evm/aave-v4/index.cjs +1152 -669
  34. package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
  35. package/dist/protocols/evm/aave-v4/index.d.ts +418 -3
  36. package/dist/protocols/evm/aave-v4/index.js +1126 -670
  37. package/dist/protocols/evm/aave-v4/index.js.map +1 -1
  38. package/dist/protocols/evm/curve-dao/index.cjs +257 -131
  39. package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
  40. package/dist/protocols/evm/curve-dao/index.d.ts +69 -5
  41. package/dist/protocols/evm/curve-dao/index.js +242 -124
  42. package/dist/protocols/evm/curve-dao/index.js.map +1 -1
  43. package/dist/protocols/evm/ethena/index.cjs +394 -402
  44. package/dist/protocols/evm/ethena/index.cjs.map +1 -1
  45. package/dist/protocols/evm/ethena/index.d.ts +47 -3
  46. package/dist/protocols/evm/ethena/index.js +390 -404
  47. package/dist/protocols/evm/ethena/index.js.map +1 -1
  48. package/dist/protocols/evm/euler-v2/index.cjs +2810 -1191
  49. package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
  50. package/dist/protocols/evm/euler-v2/index.d.ts +465 -3
  51. package/dist/protocols/evm/euler-v2/index.js +2761 -1192
  52. package/dist/protocols/evm/euler-v2/index.js.map +1 -1
  53. package/dist/protocols/evm/lido/index.cjs +351 -236
  54. package/dist/protocols/evm/lido/index.cjs.map +1 -1
  55. package/dist/protocols/evm/lido/index.d.ts +34 -4
  56. package/dist/protocols/evm/lido/index.js +348 -238
  57. package/dist/protocols/evm/lido/index.js.map +1 -1
  58. package/dist/protocols/evm/maple/index.cjs +390 -395
  59. package/dist/protocols/evm/maple/index.cjs.map +1 -1
  60. package/dist/protocols/evm/maple/index.d.ts +23 -3
  61. package/dist/protocols/evm/maple/index.js +390 -397
  62. package/dist/protocols/evm/maple/index.js.map +1 -1
  63. package/dist/protocols/evm/sky/index.cjs +454 -232
  64. package/dist/protocols/evm/sky/index.cjs.map +1 -1
  65. package/dist/protocols/evm/sky/index.d.ts +57 -3
  66. package/dist/protocols/evm/sky/index.js +444 -231
  67. package/dist/protocols/evm/sky/index.js.map +1 -1
  68. package/dist/protocols/evm/uniswap-v4/index.cjs +423 -658
  69. package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
  70. package/dist/protocols/evm/uniswap-v4/index.d.ts +3 -4
  71. package/dist/protocols/evm/uniswap-v4/index.js +422 -657
  72. package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
  73. package/dist/{registry-oMKlO_5z.d.ts → registry-Bv5o37_w.d.ts} +1 -1
  74. package/dist/{types-Ce2qNHai.d.cts → types-BfjWdw1j.d.ts} +3 -1
  75. package/dist/{types-5u863Fd9.d.ts → types-DUeNJLr9.d.ts} +1 -1
  76. package/package.json +7 -6
  77. package/dist/agent/catalog.d.cts +0 -939
  78. package/dist/chains/evm/index.d.cts +0 -64
  79. package/dist/chains/near/index.d.cts +0 -37
  80. package/dist/chains/solana/index.d.cts +0 -40
  81. package/dist/core/index.d.cts +0 -43
  82. package/dist/envelope-DYDPnrHZ.d.cts +0 -35
  83. package/dist/index.d.cts +0 -16
  84. package/dist/keygen-CfNp8yKJ.d.cts +0 -9
  85. package/dist/keygen-DsINazx8.d.ts +0 -9
  86. package/dist/nodeRead-BnmSaMGO.d.cts +0 -8
  87. package/dist/nodeRead-BnmSaMGO.d.ts +0 -8
  88. package/dist/protocols/evm/aave-v4/index.d.cts +0 -500
  89. package/dist/protocols/evm/curve-dao/index.d.cts +0 -147
  90. package/dist/protocols/evm/ethena/index.d.cts +0 -161
  91. package/dist/protocols/evm/euler-v2/index.d.cts +0 -317
  92. package/dist/protocols/evm/lido/index.d.cts +0 -120
  93. package/dist/protocols/evm/maple/index.d.cts +0 -109
  94. package/dist/protocols/evm/sky/index.d.cts +0 -218
  95. package/dist/protocols/evm/uniswap-v4/index.d.cts +0 -324
  96. package/dist/registry-BwZoE668.d.cts +0 -8
  97. package/dist/txParams-BC7ogvdR.d.cts +0 -19
  98. package/dist/txParams-BC7ogvdR.d.ts +0 -19
  99. package/dist/types-B8idm_gu.d.cts +0 -34
  100. package/dist/types-Ce2qNHai.d.ts +0 -57
@@ -1,500 +0,0 @@
1
- import { d as ProtocolModule } from '../../../types-Ce2qNHai.cjs';
2
- import { Address } from 'viem';
3
- import { K as KeyGenSubsetForPermit } from '../../../keygen-CfNp8yKJ.cjs';
4
-
5
- declare const AAVE_V4_GRAPHQL_URL = "https://api.v4.aave.com/graphql";
6
- declare function aaveV4Gql<T>(query: string, variables?: Record<string, unknown>): Promise<T>;
7
- type ChainRowV4 = {
8
- chainId: number;
9
- name?: string | null;
10
- nativeWrappedToken?: string | null;
11
- };
12
- declare function fetchAaveV4Chains(): Promise<readonly ChainRowV4[]>;
13
- /**
14
- * Aave v4: supported EVM chain IDs (from {@link fetchAaveV4Chains}).
15
- */
16
- declare function loadAaveV4SupportedChainIdsFromV4Api(): Promise<ReadonlySet<number>>;
17
- type V4ReservesListRow = {
18
- id: string;
19
- onChainId?: string | null;
20
- spoke?: {
21
- address: string;
22
- name?: string | null;
23
- liquidationConfig?: {
24
- targetHealthFactor: string;
25
- healthFactorForMaxBonus: string;
26
- } | null;
27
- } | null;
28
- summary: {
29
- supplied: {
30
- amount: {
31
- value: string;
32
- decimals: number;
33
- };
34
- };
35
- borrowed: {
36
- amount: {
37
- value: string;
38
- decimals: number;
39
- };
40
- };
41
- suppliable: {
42
- amount: {
43
- value: string;
44
- decimals: number;
45
- };
46
- };
47
- supplyApy: {
48
- normalized: string;
49
- value: string;
50
- };
51
- };
52
- userState: {
53
- balance: {
54
- amount: {
55
- value: string;
56
- decimals: number;
57
- };
58
- } | null;
59
- borrowable?: {
60
- amount: {
61
- value: string;
62
- decimals: number;
63
- };
64
- } | null;
65
- } | null;
66
- };
67
- declare function aggregateV4SupplyDisplay(symbolForDisplay: string, rows: readonly V4ReservesListRow[]): {
68
- depositedAmount: string;
69
- apy: string;
70
- totalDeposits: string;
71
- availableLiquidity: string;
72
- };
73
- /**
74
- * Formats a token notional for display: uses k (≥1k) and M (≥1M) with a few decimal places, otherwise limited decimals.
75
- * Safe to reuse outside the Aave V4 dialog (e.g. tables, tooltips).
76
- */
77
- declare function formatAaveV4TokenAmount(n: number): string;
78
- /**
79
- * Human-readable notional for Aave v4 API decimal strings (reserve amounts, user debt, etc.).
80
- * Use this for all “display from GraphQL `value`” paths so formatting stays consistent.
81
- */
82
- declare function formatAaveV4AmountHumanFromApiString(raw: string | null | undefined): string;
83
- /**
84
- * Unnamed reserve liquidity: supplied − borrowed (both API decimal strings, same unit).
85
- */
86
- declare function formatAaveV4ReserveLiquidityFromSummary(args: {
87
- suppliedValue: string | null | undefined;
88
- borrowedValue: string | null | undefined;
89
- }): string;
90
- declare function fetchAaveV4NativeWrappedToken(chainId: number): Promise<string | null>;
91
- /**
92
- * All underlying token addresses (lowercased checksummed form for lookup: store lowercase) listed as reserves on the chain.
93
- */
94
- declare function fetchAaveV4SupportedUnderlyingAddressSet(chainId: number): Promise<ReadonlySet<string>>;
95
- declare function fetchAaveV4ReservesForUnderlying(args: {
96
- chainId: number;
97
- underlying: `0x${string}`;
98
- user?: `0x${string}` | null;
99
- }): Promise<readonly V4ReservesListRow[]>;
100
- /**
101
- * Reserve row for a hub asset on the same Aave v4 **Spoke** as the user’s collateral (same as {@link useAaveV4DepositCollateralInfo}’s `collateralForAsset`).
102
- * Needed so borrow/repay multi-sign uses the same spoke as the user’s position.
103
- */
104
- declare function pickAaveV4ReserveRowForSpoke(rows: readonly V4ReservesListRow[], spokeAddress: `0x${string}`): V4ReservesListRow | null;
105
- declare function aaveV4KeyForNodeAssetRow(args: {
106
- contractAddress: string;
107
- nativeWrapped: string | null;
108
- }): string | null;
109
- type AaveV4ChainTokenCache = {
110
- supportedUnderlying: ReadonlySet<string>;
111
- nativeWrapped: string | null;
112
- };
113
- /**
114
- * Fetches and caches (per process) the list of Aave v4 underlying addresses on a chain and the wrapped native token.
115
- */
116
- declare function ensureAaveV4ChainTokenCache(chainId: number): Promise<AaveV4ChainTokenCache>;
117
- /** UI market segment; maps to Aave v4 `Hub` by name (e.g. Plus ≈ “Main”, Core, Prime ≈ “Bluechip”). */
118
- type AaveV4UiMarketId = 'main' | 'core' | 'bluechip';
119
- type AaveV4Hub = {
120
- name: string;
121
- address: `0x${string}`;
122
- chain: {
123
- chainId: number;
124
- name?: string | null;
125
- };
126
- };
127
- /** `summary` is included for hub `reserves` (market borrow/supply TVL, APYs). */
128
- type AaveV4HubReserveSummary = {
129
- supplied: {
130
- amount: {
131
- value: string;
132
- decimals: number;
133
- };
134
- };
135
- borrowed: {
136
- amount: {
137
- value: string;
138
- decimals: number;
139
- };
140
- };
141
- suppliable: {
142
- amount: {
143
- value: string;
144
- decimals: number;
145
- };
146
- };
147
- supplyApy: {
148
- normalized: string;
149
- value: string;
150
- };
151
- borrowApy: {
152
- normalized: string;
153
- value: string;
154
- };
155
- };
156
- type AaveV4HubReserve = {
157
- canBorrow: boolean;
158
- canUseAsCollateral: boolean;
159
- canSupply: boolean;
160
- /** Spoke contract to call for `supply` on this reserve. */
161
- spoke: {
162
- address: string;
163
- } | null;
164
- settings: {
165
- borrowable: boolean;
166
- collateral: boolean;
167
- collateralFactor: {
168
- normalized: string;
169
- value: string;
170
- };
171
- collateralRisk: {
172
- normalized: string;
173
- value: string;
174
- };
175
- };
176
- asset: {
177
- underlying: {
178
- address: string;
179
- info: {
180
- name: string;
181
- symbol: string;
182
- icon: string | null;
183
- } | null;
184
- };
185
- };
186
- /** Present when using the extended hub reserves query (borrow tab, market TVL). */
187
- summary?: AaveV4HubReserveSummary | null;
188
- };
189
- declare function fetchAaveV4HubsForChain(chainId: number): Promise<readonly AaveV4Hub[]>;
190
- /**
191
- * Resolves which Aave v4 hub (Core / Plus / Prime, etc.) a UI “market” refers to.
192
- * Main → Plus, Core → Core, Bluechip → Prime.
193
- */
194
- declare function resolveAaveV4HubForUiMarket(hubs: readonly AaveV4Hub[], market: AaveV4UiMarketId, chainId: number): AaveV4Hub | null;
195
- /**
196
- * Inverse of {@link resolveAaveV4HubForUiMarket} label mapping, for switching UI market when a hub is chosen by
197
- * “first hub on chain that lists this underlying”.
198
- */
199
- declare function aaveV4UiMarketIdForHubName(hubName: string): AaveV4UiMarketId;
200
- /**
201
- * The selected UI market maps to a single hub, but a token may only be listed in another hub (e.g. WETH in Core, not
202
- * Plus on Ethereum). Returns a hub on this chain where this underlying appears in hub reserves, so Spoke and
203
- * collateral can be resolved.
204
- *
205
- * **When no debt hint:** `preferHub` is tried first, then other hubs in {@link aaveV4HubAutoPickTiebreakOrder} order.
206
- *
207
- * **When `debtUnderlying` is set (user chose a debt asset on the borrow flow):** among hubs that list **both** the
208
- * **collateral** and that **debt** as borrowable, the hub with the **lowest debt borrow APY** is chosen. If
209
- * `debtBorrowAmountHumanForLiquidity` is a positive number string, we **prefer** hubs where `suppliable` on the debt
210
- * reserve is at least that amount; if none satisfy that, the lowest-APY hub among all debt-backed candidates is
211
- * used anyway.
212
- */
213
- declare function findAaveV4HubReserveForChainUnderlying(args: {
214
- chainId: number;
215
- hubs: readonly AaveV4Hub[];
216
- underlying: `0x${string}`;
217
- /** Tried first; if the asset is not listed here, other hubs on the same chain are scanned. */
218
- preferHub: AaveV4Hub;
219
- /** If set, disambiguate using this debt asset’s `borrowAPY` (and optional liquidity) per hub. */
220
- debtUnderlying?: `0x${string}` | null;
221
- /**
222
- * When set, used with `debtUnderlying` to prefer hubs with enough `suppliable` on the debt line for a borrow
223
- * of that size (human amount; commas may be included).
224
- */
225
- debtBorrowAmountHumanForLiquidity?: string | null;
226
- }): Promise<{
227
- hub: AaveV4Hub;
228
- hubReserves: readonly AaveV4HubReserve[];
229
- reserve: AaveV4HubReserve;
230
- } | null>;
231
- declare function fetchAaveV4HubReserves(args: {
232
- chainId: number;
233
- hubAddress: `0x${string}`;
234
- }): Promise<readonly AaveV4HubReserve[]>;
235
- /**
236
- * LTV you can borrow against a unit of this asset, e.g. "90%".
237
- */
238
- declare function formatAaveV4PercentDisplay(normalized: string | undefined, value: string | undefined): string;
239
- /**
240
- * Collateral / protocol risk on the same 0–100 style scale as the API, or a plain label if zero/empty.
241
- */
242
- declare function formatAaveV4RiskDisplay(normalized: string | undefined, value: string | undefined): string;
243
- declare function findHubReserveForUnderlying(list: readonly AaveV4HubReserve[], underlying: `0x${string}`): AaveV4HubReserve | null;
244
- type AaveV4BorrowableDisplay = {
245
- address: string;
246
- symbol: string;
247
- name: string;
248
- icon: string | null;
249
- };
250
- /**
251
- * De-duplicated borrowable debt assets in a hub (what users can borrow there).
252
- */
253
- declare function borrowableAssetsFromHubReserves(rows: readonly AaveV4HubReserve[]): AaveV4BorrowableDisplay[];
254
- /**
255
- * Current variable-debt balance per underlying token for this user in the given hub (one entry per asset).
256
- * Values are API decimal strings; format with {@link formatAaveV4AmountHumanFromApiString}.
257
- */
258
- declare function fetchAaveV4UserBorrowsDebtByUnderlyingForHub(args: {
259
- user: `0x${string}`;
260
- chainId: number;
261
- hubAddress: `0x${string}`;
262
- }): Promise<ReadonlyMap<string, string>>;
263
- type AaveV4BorrowTableRow = {
264
- address: string;
265
- symbol: string;
266
- name: string;
267
- icon: string | null;
268
- yourBorrowedDisplay: string;
269
- baseBorrowApyDisplay: string;
270
- totalBorrowsDisplay: string;
271
- liquidityDisplay: string;
272
- };
273
- /**
274
- * One row per borrowable asset in the hub, using shared human-readable formatters.
275
- */
276
- declare function buildAaveV4BorrowTableRowsFromHub(borrowable: readonly AaveV4BorrowableDisplay[], hubReserves: readonly AaveV4HubReserve[] | null,
277
- /** `undefined` = not loaded or no wallet (show em dash for “your” column). */
278
- debtByUnderlying: ReadonlyMap<string, string> | undefined): AaveV4BorrowTableRow[];
279
-
280
- type AaveV4SpokeOnChainReserveStatus = {
281
- reserveId: bigint;
282
- /** From `getReserveConfig` — not a global Spoke `paused()`. */
283
- paused: boolean;
284
- frozen: boolean;
285
- borrowable: boolean;
286
- receiveSharesEnabled: boolean;
287
- collateralRisk: number;
288
- };
289
- type SpokeReadArgs = {
290
- rpcUrl: string;
291
- chainId: number;
292
- spoke: Address;
293
- underlying: Address;
294
- };
295
- /**
296
- * On-chain `reserveId` for an underlying on the Spoke (`getReserve` scan). Used for
297
- * `supply(uint256 reserveId, uint256 amount, address onBehalfOf)` calldata.
298
- */
299
- declare function fetchAaveV4SpokeReserveIdForUnderlying(args: SpokeReadArgs): Promise<bigint | null>;
300
- /**
301
- * Per-reserve pause/freeze from the Spoke (`getReserveConfig`), after resolving
302
- * `reserveId` for `underlying` via `getReserve` / `getReserveCount`.
303
- * Aave v4 does not expose a single contract-wide `paused()` on the Spoke for this.
304
- */
305
- declare function fetchAaveV4SpokeReserveStatusForUnderlying(args: SpokeReadArgs): Promise<AaveV4SpokeOnChainReserveStatus | null>;
306
-
307
- /**
308
- * `eth_estimateGas` can revert for complex Aave v4 `supply` calldata; same order of magnitude as Curve router.
309
- * Exported for Get Sig / Execute fallbacks.
310
- */
311
- declare const AAVE_V4_SPOKE_SUPPLY_DEFAULT_GAS_UNITS = 1200000n;
312
- declare const AAVE_V4_SPOKE_WITHDRAW_DEFAULT_GAS_UNITS = 800000n;
313
- declare const AAVE_V4_SPOKE_BORROW_DEFAULT_GAS_UNITS = 900000n;
314
- declare const AAVE_V4_SPOKE_REPAY_DEFAULT_GAS_UNITS = 1000000n;
315
- type ChainRow = {
316
- legacy?: boolean;
317
- gasLimit?: number;
318
- gasMultiplier?: number;
319
- gasPrice?: number;
320
- baseFee?: number;
321
- priorityFee?: number;
322
- baseFeeMultiplier?: number;
323
- };
324
- /**
325
- * Aave v4: optional WETH `deposit` (native path), exact ERC-20 `approve` to the spoke when needed, then
326
- * `spoke.supply(reserveId, amount, onBehalfOf)`.
327
- * Optionally appends `spoke.setUsingAsCollateral(reserveId, true, onBehalfOf)` in the same batch
328
- * (same pattern as the Aave app’s “use as collateral” toggle after supply).
329
- */
330
- declare function buildEvmMultisignBodyAaveV4DepositBatch(args: {
331
- keyGen: KeyGenSubsetForPermit;
332
- chainId: number;
333
- rpcUrl: string;
334
- chainDetail: ChainRow;
335
- useCustomGas: boolean;
336
- customGasChainDetails?: Record<string, unknown> | null;
337
- market: AaveV4UiMarketId;
338
- /** Underlying to supply (e.g. WETH when user chose native, or the ERC-20). */
339
- asset: Address;
340
- isNativeIn: boolean;
341
- /** Wrapped native; required when `isNativeIn`. */
342
- nativeWrapped: Address;
343
- amountHuman: string;
344
- spoke: Address;
345
- onBehalfOf: Address;
346
- executorAddress: Address;
347
- purposeText: string;
348
- /**
349
- * When true, add a final tx `setUsingAsCollateral(reserveId, true, onBehalfOf)` after `supply`
350
- * so the new supply is enabled as borrow collateral (Aave v4 `ISpoke.setUsingAsCollateral`).
351
- */
352
- enableAsCollateralAfterSupply?: boolean;
353
- }): Promise<{
354
- bodyForSign: Record<string, unknown>;
355
- messageToSign: string;
356
- }>;
357
- /**
358
- * `Spoke.withdraw` — one transaction (same sign-request shape as a single step of a deposit batch).
359
- * Prefer passing {@link fetchAaveV4SpokeReserveIdForUnderlying} result via `reserveIdOnChain` when known.
360
- */
361
- declare function buildEvmMultisignBodyAaveV4SpokeWithdraw(args: {
362
- keyGen: KeyGenSubsetForPermit;
363
- chainId: number;
364
- rpcUrl: string;
365
- chainDetail: ChainRow;
366
- useCustomGas: boolean;
367
- customGasChainDetails?: Record<string, unknown> | null;
368
- marketLabel: string;
369
- spoke: Address;
370
- underlying: Address;
371
- amountHuman: string;
372
- onBehalfOf: Address;
373
- executorAddress: Address;
374
- purposeText: string;
375
- /** When set, avoids an extra on-chain getReserve for the id. */
376
- reserveIdOnChain?: bigint | null;
377
- }): Promise<{
378
- bodyForSign: Record<string, unknown>;
379
- messageToSign: string;
380
- }>;
381
- /**
382
- * `Spoke.borrow` — one transaction, same shape as {@link buildEvmMultisignBodyAaveV4SpokeWithdraw}.
383
- */
384
- declare function buildEvmMultisignBodyAaveV4SpokeBorrow(args: {
385
- keyGen: KeyGenSubsetForPermit;
386
- chainId: number;
387
- rpcUrl: string;
388
- chainDetail: ChainRow;
389
- useCustomGas: boolean;
390
- customGasChainDetails?: Record<string, unknown> | null;
391
- marketLabel: string;
392
- spoke: Address;
393
- underlying: Address;
394
- amountHuman: string;
395
- onBehalfOf: Address;
396
- executorAddress: Address;
397
- purposeText: string;
398
- reserveIdOnChain?: bigint | null;
399
- }): Promise<{
400
- bodyForSign: Record<string, unknown>;
401
- messageToSign: string;
402
- }>;
403
- /**
404
- * `approve` (if required) and `Spoke.repay` — one or two transactions (same pattern as a deposit batch).
405
- */
406
- declare function buildEvmMultisignBodyAaveV4SpokeRepay(args: {
407
- keyGen: KeyGenSubsetForPermit;
408
- chainId: number;
409
- rpcUrl: string;
410
- chainDetail: ChainRow;
411
- useCustomGas: boolean;
412
- customGasChainDetails?: Record<string, unknown> | null;
413
- market: AaveV4UiMarketId;
414
- spoke: Address;
415
- underlying: Address;
416
- amountHuman: string;
417
- onBehalfOf: Address;
418
- executorAddress: Address;
419
- purposeText: string;
420
- reserveIdOnChain?: bigint | null;
421
- }): Promise<{
422
- bodyForSign: Record<string, unknown>;
423
- messageToSign: string;
424
- }>;
425
- /**
426
- * Merkl claim-rewards call from the Aave API (`claimRewards`) — one transaction to `to` with `data` / `value`.
427
- */
428
- declare function buildEvmMultisignBodyAaveV4MerklClaimRewards(args: {
429
- keyGen: KeyGenSubsetForPermit;
430
- chainId: number;
431
- rpcUrl: string;
432
- chainDetail: ChainRow;
433
- useCustomGas: boolean;
434
- customGasChainDetails?: Record<string, unknown> | null;
435
- to: Address;
436
- data: `0x${string}`;
437
- valueWei: bigint;
438
- rewardIdCount: number;
439
- executorAddress: Address;
440
- purposeText: string;
441
- }): Promise<{
442
- bodyForSign: Record<string, unknown>;
443
- messageToSign: string;
444
- }>;
445
- /**
446
- * Merkl `Distributor.claim` using calldata from {@link encodeMerklDistributorClaimData} / Merkl API proofs.
447
- */
448
- declare function buildEvmMultisignBodyEulerV2MerklDistributorClaim(args: {
449
- keyGen: KeyGenSubsetForPermit;
450
- chainId: number;
451
- rpcUrl: string;
452
- chainDetail: ChainRow;
453
- useCustomGas: boolean;
454
- customGasChainDetails?: Record<string, unknown> | null;
455
- to: Address;
456
- data: `0x${string}`;
457
- valueWei: bigint;
458
- claimLeafCount: number;
459
- executorAddress: Address;
460
- purposeText: string;
461
- }): Promise<{
462
- bodyForSign: Record<string, unknown>;
463
- messageToSign: string;
464
- }>;
465
- /**
466
- * rEUL (`RewardToken`) batched `withdrawToByLockTimestamps` → unwrap vested underlying (EUL) to `executorAddress`.
467
- */
468
- declare function buildEvmMultisignBodyEulerV2ReulUnlock(args: {
469
- keyGen: KeyGenSubsetForPermit;
470
- chainId: number;
471
- rpcUrl: string;
472
- chainDetail: ChainRow;
473
- useCustomGas: boolean;
474
- customGasChainDetails?: Record<string, unknown> | null;
475
- to: Address;
476
- data: `0x${string}`;
477
- valueWei: bigint;
478
- lockTimestampCount: number;
479
- allowRemainderLoss: boolean;
480
- executorAddress: Address;
481
- purposeText: string;
482
- }): Promise<{
483
- bodyForSign: Record<string, unknown>;
484
- messageToSign: string;
485
- }>;
486
- /** Minimum gas floor for Execute preflight (same style as `MIN_CURVE_ROUTER_GAS_EXEC`). */
487
- declare const MIN_AAVE_V4_DEPOSIT_GAS_EXEC = 400000n;
488
- /**
489
- * True when this sign request (or `batchMeta[batchIndex]`) is an Aave v4 deposit batch step.
490
- */
491
- declare function isAaveV4DepositEvmSignRequest(detail: Record<string, unknown> | null | undefined, batchIndex?: number): boolean;
492
- /**
493
- * Prefer `proposalTxParams[i]` / `batchMeta[i].aaveV4.gasBuildSupply` when `eth_estimateGas` reverts.
494
- */
495
- declare function resolveAaveV4DepositGasUnitsFromSignRequest(detail: Record<string, unknown> | null | undefined, batchIndex?: number): bigint | null;
496
-
497
- declare const AAVE_V4_PROTOCOL_ID = "aave-v4";
498
- declare const aaveV4ProtocolModule: ProtocolModule;
499
-
500
- export { AAVE_V4_GRAPHQL_URL, AAVE_V4_PROTOCOL_ID, AAVE_V4_SPOKE_BORROW_DEFAULT_GAS_UNITS, AAVE_V4_SPOKE_REPAY_DEFAULT_GAS_UNITS, AAVE_V4_SPOKE_SUPPLY_DEFAULT_GAS_UNITS, AAVE_V4_SPOKE_WITHDRAW_DEFAULT_GAS_UNITS, type AaveV4BorrowTableRow, type AaveV4BorrowableDisplay, type AaveV4Hub, type AaveV4HubReserve, type AaveV4HubReserveSummary, type AaveV4SpokeOnChainReserveStatus, type AaveV4UiMarketId, MIN_AAVE_V4_DEPOSIT_GAS_EXEC, type V4ReservesListRow, aaveV4Gql, aaveV4KeyForNodeAssetRow, aaveV4ProtocolModule, aaveV4UiMarketIdForHubName, aggregateV4SupplyDisplay, borrowableAssetsFromHubReserves, buildAaveV4BorrowTableRowsFromHub, buildEvmMultisignBodyAaveV4DepositBatch, buildEvmMultisignBodyAaveV4MerklClaimRewards, buildEvmMultisignBodyAaveV4SpokeBorrow, buildEvmMultisignBodyAaveV4SpokeRepay, buildEvmMultisignBodyAaveV4SpokeWithdraw, buildEvmMultisignBodyEulerV2MerklDistributorClaim, buildEvmMultisignBodyEulerV2ReulUnlock, ensureAaveV4ChainTokenCache, fetchAaveV4Chains, fetchAaveV4HubReserves, fetchAaveV4HubsForChain, fetchAaveV4NativeWrappedToken, fetchAaveV4ReservesForUnderlying, fetchAaveV4SpokeReserveIdForUnderlying, fetchAaveV4SpokeReserveStatusForUnderlying, fetchAaveV4SupportedUnderlyingAddressSet, fetchAaveV4UserBorrowsDebtByUnderlyingForHub, findAaveV4HubReserveForChainUnderlying, findHubReserveForUnderlying, formatAaveV4AmountHumanFromApiString, formatAaveV4PercentDisplay, formatAaveV4ReserveLiquidityFromSummary, formatAaveV4RiskDisplay, formatAaveV4TokenAmount, isAaveV4DepositEvmSignRequest, loadAaveV4SupportedChainIdsFromV4Api, pickAaveV4ReserveRowForSpoke, resolveAaveV4DepositGasUnitsFromSignRequest, resolveAaveV4HubForUiMarket };
@@ -1,147 +0,0 @@
1
- import { M as MultisignBuildResult, d as ProtocolModule } from '../../../types-Ce2qNHai.cjs';
2
- import { K as KeyGenSubsetForPermit } from '../../../keygen-CfNp8yKJ.cjs';
3
- import { E as EvmChainDetail } from '../../../types-B8idm_gu.cjs';
4
- import { Address } from 'viem';
5
- export { P as ProposalTxParams } from '../../../txParams-BC7ogvdR.cjs';
6
-
7
- declare function isCurveApiChainSupported(chainId: string | number | bigint | null | undefined): boolean;
8
-
9
- declare const CURVE_NATIVE_PLACEHOLDER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
10
- /** Map token in list to the address shape Curve uses in pool graphs (native → 0xeeee…). */
11
- declare function toCurveTokenKey(tokenInAddress: string, wrappedNative: string | undefined): string;
12
- /**
13
- * Router / `getBestRouteAndOutput` expect the same coin id as the pool graph: wrapped native
14
- * is represented as `0xeeee…`, not the WETH (etc.) contract. Without this, route discovery can
15
- * return an empty route while BFS (which uses `toCurveTokenKey`) still finds a path.
16
- */
17
- declare function toCurveRouterTokenId(tokenAddress: string, wrappedNative: string | undefined): string;
18
- /**
19
- * Turn the user’s decimal string into a canonical form using **this chain’s** token-in decimals
20
- * (from the asset row). `@curvefi/api` uses the same for `parseUnits` when building routes; an
21
- * over-long fraction (e.g. 1e-8 on USDC) can make internal calls fail and yield an empty route / 0.0.
22
- */
23
- declare function normalizeCurveRouterAmountString(raw: string, tokenInDecimals: number): string;
24
- /**
25
- * Build graph from the same pool list the Curve router uses (`getPool` / `getPoolList` on the
26
- * public `@curvefi/api` instance; `getPoolsData` is internal).
27
- */
28
- declare function buildCurveLiquidityGraphFromApi(curve: {
29
- getPoolList: () => string[];
30
- getPool: (id: string) => {
31
- underlyingCoinAddresses: string[] | undefined;
32
- wrappedCoinAddresses: string[] | undefined;
33
- };
34
- }): Map<string, Set<string>>;
35
- /**
36
- * Add bidirectional edge between the SDK's native placeholder coin and WETH, when the chain uses
37
- * wrapped native in pools (mirrors the Curve dialog graph).
38
- */
39
- declare function addNativeWethBridge(adj: Map<string, Set<string>>, wrappedNative: string | undefined): void;
40
- /** True when the token key appears in the graph with at least one swap neighbor. */
41
- declare function isCurveTokenKeySwappable(swappableNodeKeys: ReadonlySet<string>, graphTokenKey: string): boolean;
42
- /**
43
- * All token keys in `adj` that have at least one pool neighbor (candidates to start a path from).
44
- */
45
- declare function swappableCurveGraphNodeKeys(adj: Map<string, Set<string>>): Set<string>;
46
- /**
47
- * All tokens in the same connected component as `start` (excluding `start`), for router discovery.
48
- */
49
- declare function bfsCurveSwapDestinations(adj: Map<string, Set<string>>, start: string): Set<string>;
50
- type CurveDestToken = {
51
- address: string;
52
- symbol: string;
53
- name: string;
54
- /** From Curve `getCoinsData` (on-chain), when available. */
55
- decimals: number | null;
56
- };
57
-
58
- /** Live `@curvefi/api` instance with pools already fetched, plus the routing graph. */
59
- type CurveFullSession = {
60
- /** Same reference used for getCoinsData / router; pools already loaded. */
61
- curve: any;
62
- adj: Map<string, Set<string>>;
63
- swappableNodeKeys: ReadonlySet<string>;
64
- wrappedNative: string | undefined;
65
- };
66
- /**
67
- * Fetches all factory pools in parallel (best-effort; failures are ignored per factory,
68
- * same as the Curve dialog).
69
- */
70
- declare function fetchAllCurvePools(curve: {
71
- factory: {
72
- fetchPools: () => Promise<unknown>;
73
- };
74
- crvUSDFactory: {
75
- fetchPools: () => Promise<unknown>;
76
- };
77
- EYWAFactory: {
78
- fetchPools: () => Promise<unknown>;
79
- };
80
- cryptoFactory: {
81
- fetchPools: () => Promise<unknown>;
82
- };
83
- twocryptoFactory: {
84
- fetchPools: () => Promise<unknown>;
85
- };
86
- tricryptoFactory: {
87
- fetchPools: () => Promise<unknown>;
88
- };
89
- stableNgFactory: {
90
- fetchPools: () => Promise<unknown>;
91
- };
92
- }): Promise<void>;
93
- /**
94
- * One init + `fetchAllCurvePools` + graph build. Reuse this session for the asset list and the
95
- * Curve dialog to avoid duplicating the Curve API work.
96
- */
97
- declare function loadFullCurveSessionForRpc(rpcUrl: string): Promise<CurveFullSession | null>;
98
-
99
- /**
100
- * One-line prefill for multi-sign "Purpose" on Curve (DAO) swap (user may add detail below).
101
- * Matches the spirit of `buildUniswapV4PurposePrefill` for Uniswap.
102
- */
103
- declare function buildCurveDaoPurposePrefill(args: {
104
- tokenInSymbol: string;
105
- tokenOutSymbol: string;
106
- amountIn: string;
107
- /** Quoted output from `getBestRouteAndOutput` (decimal string, no symbol). */
108
- quoteOutAmount: string | null;
109
- slippageInput: string;
110
- chainName: string;
111
- chainId: number;
112
- }): string;
113
-
114
- declare const CURVE_ROUTER_EXCHANGE_DEFAULT_GAS_UNITS = 1200000n;
115
- declare function isCurveDaoSwapEvmSignRequest(detail: Record<string, unknown> | null | undefined, batchIndex?: number): boolean;
116
- declare function isCurveDaoErc20ApproveEvmSignRequest(detail: Record<string, unknown> | null | undefined, batchIndex?: number): boolean;
117
- declare function resolveCurveDaoRouterGasUnitsFromSignRequest(detail: Record<string, unknown> | null | undefined, batchIndex?: number): bigint | null;
118
-
119
- /**
120
- * Build `POST /multiSignRequest` body: optional ERC-20 approve(s) to the Curve router, then
121
- * `CurveRouterNG.exchange` via `@curvefi/api` `router.populateSwap`.
122
- */
123
- declare function buildEvmMultisignBodyCurveDaoBatch(args: {
124
- keyGen: KeyGenSubsetForPermit;
125
- chainId: number;
126
- rpcUrl: string;
127
- chainDetail: EvmChainDetail;
128
- useCustomGas: boolean;
129
- customGasChainDetails?: Record<string, unknown> | null;
130
- tokenIn: Address;
131
- tokenOut: string;
132
- amountHuman: string;
133
- slippagePercent: number;
134
- executorAddress: Address;
135
- purposeText: string;
136
- }): Promise<MultisignBuildResult>;
137
-
138
- declare const CURVE_DAO_PROTOCOL_ID = "curve-dao";
139
- declare const curveDaoProtocolModule: ProtocolModule;
140
-
141
- declare const curveDao: {
142
- buildSwapMultisignBody: typeof buildEvmMultisignBodyCurveDaoBatch;
143
- isChainSupported: typeof isCurveApiChainSupported;
144
- loadSession: typeof loadFullCurveSessionForRpc;
145
- };
146
-
147
- export { CURVE_DAO_PROTOCOL_ID, CURVE_NATIVE_PLACEHOLDER, CURVE_ROUTER_EXCHANGE_DEFAULT_GAS_UNITS, type CurveDestToken, type CurveFullSession, addNativeWethBridge, bfsCurveSwapDestinations, buildCurveDaoPurposePrefill, buildCurveLiquidityGraphFromApi, buildEvmMultisignBodyCurveDaoBatch, curveDao, curveDaoProtocolModule, fetchAllCurvePools, isCurveApiChainSupported, isCurveApiChainSupported as isCurveDaoChainSupported, isCurveDaoErc20ApproveEvmSignRequest, isCurveDaoSwapEvmSignRequest, isCurveTokenKeySwappable, loadFullCurveSessionForRpc, normalizeCurveRouterAmountString, resolveCurveDaoRouterGasUnitsFromSignRequest, swappableCurveGraphNodeKeys, toCurveRouterTokenId, toCurveTokenKey };