@continuumdao/ctm-mpc-defi 0.2.30 → 0.2.32

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 (40) hide show
  1. package/dist/agent/catalog.cjs +1933 -56
  2. package/dist/agent/catalog.cjs.map +1 -1
  3. package/dist/agent/catalog.d.ts +3671 -661
  4. package/dist/agent/catalog.js +1896 -58
  5. package/dist/agent/catalog.js.map +1 -1
  6. package/dist/agent/skills/aerodrome/SKILL.md +93 -0
  7. package/dist/agent/skills/compound-v3/SKILL.md +132 -0
  8. package/dist/agent/skills/euler-v2/SKILL.md +1 -1
  9. package/dist/agent/skills/morpho/SKILL.md +16 -8
  10. package/dist/buildBatch-CngvebiD.d.ts +45 -0
  11. package/dist/chains/evm/index.d.ts +6 -44
  12. package/dist/core/index.cjs +2 -1
  13. package/dist/core/index.cjs.map +1 -1
  14. package/dist/core/index.js +2 -1
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/index.cjs +119 -1
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.ts +4 -1
  19. package/dist/index.js +119 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/protocols/evm/aerodrome/index.cjs +3922 -0
  22. package/dist/protocols/evm/aerodrome/index.cjs.map +1 -0
  23. package/dist/protocols/evm/aerodrome/index.d.ts +792 -0
  24. package/dist/protocols/evm/aerodrome/index.js +3843 -0
  25. package/dist/protocols/evm/aerodrome/index.js.map +1 -0
  26. package/dist/protocols/evm/compound-v3/index.cjs +1542 -0
  27. package/dist/protocols/evm/compound-v3/index.cjs.map +1 -0
  28. package/dist/protocols/evm/compound-v3/index.d.ts +683 -0
  29. package/dist/protocols/evm/compound-v3/index.js +1488 -0
  30. package/dist/protocols/evm/compound-v3/index.js.map +1 -0
  31. package/dist/protocols/evm/euler-v2/index.cjs +17 -10
  32. package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
  33. package/dist/protocols/evm/euler-v2/index.js +17 -10
  34. package/dist/protocols/evm/euler-v2/index.js.map +1 -1
  35. package/dist/protocols/evm/morpho/index.cjs +746 -39
  36. package/dist/protocols/evm/morpho/index.cjs.map +1 -1
  37. package/dist/protocols/evm/morpho/index.d.ts +161 -14
  38. package/dist/protocols/evm/morpho/index.js +736 -42
  39. package/dist/protocols/evm/morpho/index.js.map +1 -1
  40. package/package.json +15 -1
@@ -0,0 +1,683 @@
1
+ import { b as KeyGenSubsetForPermit, e as ProtocolModule } from '../../../types-PZrvtjv8.js';
2
+ import { Address, PublicClient } from 'viem';
3
+
4
+ declare const COMPOUND_V3_PROTOCOL_ID = "compound-v3";
5
+ /** Live Comet deployments. Scroll and Ronin omitted (effectively dead). Testnets omitted. */
6
+ declare const COMPOUND_V3_CHAIN_IDS: readonly [1, 8453, 42161, 10, 137, 5000, 130, 59144];
7
+ type CompoundV3ChainId = (typeof COMPOUND_V3_CHAIN_IDS)[number];
8
+ declare const COMPOUND_V3_WRAPPED_NATIVE: Readonly<Record<number, Address>>;
9
+ declare function isCompoundV3ChainSupported(chainId: number): boolean;
10
+ declare function compoundV3WrappedNative(chainId: number): Address | null;
11
+ declare function isNativeAssetAddress(address: string): boolean;
12
+ declare function resolveCompoundV3ActionAsset(args: {
13
+ chainId: number;
14
+ asset: string;
15
+ isNative?: boolean;
16
+ }): {
17
+ asset: Address;
18
+ isNative: boolean;
19
+ nativeWrapped: Address | null;
20
+ };
21
+
22
+ type CompoundV3MarketRecord = {
23
+ chainId: number;
24
+ slug: string;
25
+ symbol: string;
26
+ comet: Address;
27
+ rewards: Address;
28
+ bulker: Address | null;
29
+ /** Known base token when documented; on-chain `baseToken()` wins. */
30
+ baseToken?: Address;
31
+ source: 'comet-deployments';
32
+ };
33
+ /**
34
+ * Official Comet proxy + Rewards + Bulker from
35
+ * https://github.com/compound-finance/comet/tree/main/deployments
36
+ * (`roots.json`). Always use `comet` (proxy) with CometInterface — never the implementation.
37
+ */
38
+ declare const COMPOUND_V3_MARKETS: readonly CompoundV3MarketRecord[];
39
+ declare function listCompoundV3SupportedChainIds(): number[];
40
+ declare function listCompoundV3MarketsForChain(chainId: number): CompoundV3MarketRecord[];
41
+ declare function getCompoundV3MarketByComet(chainId: number, comet: string): CompoundV3MarketRecord | null;
42
+ declare function requireCompoundV3Market(chainId: number, comet: string): CompoundV3MarketRecord;
43
+ declare function listCompoundV3KnownTokenAddresses(chainId: number): Address[];
44
+
45
+ /** CometInterface — call on the proxy only. Sourced from compound-js Comet ABI + Comet docs. */
46
+ declare const cometInterfaceAbi: readonly [{
47
+ readonly name: "supply";
48
+ readonly type: "function";
49
+ readonly stateMutability: "nonpayable";
50
+ readonly inputs: readonly [{
51
+ readonly type: "address";
52
+ readonly name: "asset";
53
+ }, {
54
+ readonly type: "uint256";
55
+ readonly name: "amount";
56
+ }];
57
+ readonly outputs: readonly [];
58
+ }, {
59
+ readonly name: "supplyTo";
60
+ readonly type: "function";
61
+ readonly stateMutability: "nonpayable";
62
+ readonly inputs: readonly [{
63
+ readonly type: "address";
64
+ readonly name: "dst";
65
+ }, {
66
+ readonly type: "address";
67
+ readonly name: "asset";
68
+ }, {
69
+ readonly type: "uint256";
70
+ readonly name: "amount";
71
+ }];
72
+ readonly outputs: readonly [];
73
+ }, {
74
+ readonly name: "withdraw";
75
+ readonly type: "function";
76
+ readonly stateMutability: "nonpayable";
77
+ readonly inputs: readonly [{
78
+ readonly type: "address";
79
+ readonly name: "asset";
80
+ }, {
81
+ readonly type: "uint256";
82
+ readonly name: "amount";
83
+ }];
84
+ readonly outputs: readonly [];
85
+ }, {
86
+ readonly name: "withdrawTo";
87
+ readonly type: "function";
88
+ readonly stateMutability: "nonpayable";
89
+ readonly inputs: readonly [{
90
+ readonly type: "address";
91
+ readonly name: "to";
92
+ }, {
93
+ readonly type: "address";
94
+ readonly name: "asset";
95
+ }, {
96
+ readonly type: "uint256";
97
+ readonly name: "amount";
98
+ }];
99
+ readonly outputs: readonly [];
100
+ }, {
101
+ readonly name: "allow";
102
+ readonly type: "function";
103
+ readonly stateMutability: "nonpayable";
104
+ readonly inputs: readonly [{
105
+ readonly type: "address";
106
+ readonly name: "manager";
107
+ }, {
108
+ readonly type: "bool";
109
+ readonly name: "isAllowed";
110
+ }];
111
+ readonly outputs: readonly [];
112
+ }, {
113
+ readonly name: "hasPermission";
114
+ readonly type: "function";
115
+ readonly stateMutability: "view";
116
+ readonly inputs: readonly [{
117
+ readonly type: "address";
118
+ readonly name: "owner";
119
+ }, {
120
+ readonly type: "address";
121
+ readonly name: "manager";
122
+ }];
123
+ readonly outputs: readonly [{
124
+ readonly type: "bool";
125
+ }];
126
+ }, {
127
+ readonly name: "balanceOf";
128
+ readonly type: "function";
129
+ readonly stateMutability: "view";
130
+ readonly inputs: readonly [{
131
+ readonly type: "address";
132
+ readonly name: "account";
133
+ }];
134
+ readonly outputs: readonly [{
135
+ readonly type: "uint256";
136
+ }];
137
+ }, {
138
+ readonly name: "borrowBalanceOf";
139
+ readonly type: "function";
140
+ readonly stateMutability: "view";
141
+ readonly inputs: readonly [{
142
+ readonly type: "address";
143
+ readonly name: "account";
144
+ }];
145
+ readonly outputs: readonly [{
146
+ readonly type: "uint256";
147
+ }];
148
+ }, {
149
+ readonly name: "collateralBalanceOf";
150
+ readonly type: "function";
151
+ readonly stateMutability: "view";
152
+ readonly inputs: readonly [{
153
+ readonly type: "address";
154
+ readonly name: "account";
155
+ }, {
156
+ readonly type: "address";
157
+ readonly name: "asset";
158
+ }];
159
+ readonly outputs: readonly [{
160
+ readonly type: "uint128";
161
+ }];
162
+ }, {
163
+ readonly name: "baseToken";
164
+ readonly type: "function";
165
+ readonly stateMutability: "view";
166
+ readonly inputs: readonly [];
167
+ readonly outputs: readonly [{
168
+ readonly type: "address";
169
+ }];
170
+ }, {
171
+ readonly name: "baseTokenPriceFeed";
172
+ readonly type: "function";
173
+ readonly stateMutability: "view";
174
+ readonly inputs: readonly [];
175
+ readonly outputs: readonly [{
176
+ readonly type: "address";
177
+ }];
178
+ }, {
179
+ readonly name: "decimals";
180
+ readonly type: "function";
181
+ readonly stateMutability: "view";
182
+ readonly inputs: readonly [];
183
+ readonly outputs: readonly [{
184
+ readonly type: "uint8";
185
+ }];
186
+ }, {
187
+ readonly name: "numAssets";
188
+ readonly type: "function";
189
+ readonly stateMutability: "view";
190
+ readonly inputs: readonly [];
191
+ readonly outputs: readonly [{
192
+ readonly type: "uint8";
193
+ }];
194
+ }, {
195
+ readonly name: "getUtilization";
196
+ readonly type: "function";
197
+ readonly stateMutability: "view";
198
+ readonly inputs: readonly [];
199
+ readonly outputs: readonly [{
200
+ readonly type: "uint256";
201
+ }];
202
+ }, {
203
+ readonly name: "getSupplyRate";
204
+ readonly type: "function";
205
+ readonly stateMutability: "view";
206
+ readonly inputs: readonly [{
207
+ readonly type: "uint256";
208
+ readonly name: "utilization";
209
+ }];
210
+ readonly outputs: readonly [{
211
+ readonly type: "uint64";
212
+ }];
213
+ }, {
214
+ readonly name: "getBorrowRate";
215
+ readonly type: "function";
216
+ readonly stateMutability: "view";
217
+ readonly inputs: readonly [{
218
+ readonly type: "uint256";
219
+ readonly name: "utilization";
220
+ }];
221
+ readonly outputs: readonly [{
222
+ readonly type: "uint64";
223
+ }];
224
+ }, {
225
+ readonly name: "getPrice";
226
+ readonly type: "function";
227
+ readonly stateMutability: "view";
228
+ readonly inputs: readonly [{
229
+ readonly type: "address";
230
+ readonly name: "priceFeed";
231
+ }];
232
+ readonly outputs: readonly [{
233
+ readonly type: "uint256";
234
+ }];
235
+ }, {
236
+ readonly name: "isBorrowCollateralized";
237
+ readonly type: "function";
238
+ readonly stateMutability: "view";
239
+ readonly inputs: readonly [{
240
+ readonly type: "address";
241
+ readonly name: "account";
242
+ }];
243
+ readonly outputs: readonly [{
244
+ readonly type: "bool";
245
+ }];
246
+ }, {
247
+ readonly name: "isLiquidatable";
248
+ readonly type: "function";
249
+ readonly stateMutability: "view";
250
+ readonly inputs: readonly [{
251
+ readonly type: "address";
252
+ readonly name: "account";
253
+ }];
254
+ readonly outputs: readonly [{
255
+ readonly type: "bool";
256
+ }];
257
+ }, {
258
+ readonly name: "getAssetInfo";
259
+ readonly type: "function";
260
+ readonly stateMutability: "view";
261
+ readonly inputs: readonly [{
262
+ readonly type: "uint8";
263
+ readonly name: "i";
264
+ }];
265
+ readonly outputs: readonly [{
266
+ readonly type: "tuple";
267
+ readonly components: readonly [{
268
+ readonly type: "uint8";
269
+ readonly name: "offset";
270
+ }, {
271
+ readonly type: "address";
272
+ readonly name: "asset";
273
+ }, {
274
+ readonly type: "address";
275
+ readonly name: "priceFeed";
276
+ }, {
277
+ readonly type: "uint64";
278
+ readonly name: "scale";
279
+ }, {
280
+ readonly type: "uint64";
281
+ readonly name: "borrowCollateralFactor";
282
+ }, {
283
+ readonly type: "uint64";
284
+ readonly name: "liquidateCollateralFactor";
285
+ }, {
286
+ readonly type: "uint64";
287
+ readonly name: "liquidationFactor";
288
+ }, {
289
+ readonly type: "uint128";
290
+ readonly name: "supplyCap";
291
+ }];
292
+ }];
293
+ }, {
294
+ readonly name: "getAssetInfoByAddress";
295
+ readonly type: "function";
296
+ readonly stateMutability: "view";
297
+ readonly inputs: readonly [{
298
+ readonly type: "address";
299
+ readonly name: "asset";
300
+ }];
301
+ readonly outputs: readonly [{
302
+ readonly type: "tuple";
303
+ readonly components: readonly [{
304
+ readonly type: "uint8";
305
+ readonly name: "offset";
306
+ }, {
307
+ readonly type: "address";
308
+ readonly name: "asset";
309
+ }, {
310
+ readonly type: "address";
311
+ readonly name: "priceFeed";
312
+ }, {
313
+ readonly type: "uint64";
314
+ readonly name: "scale";
315
+ }, {
316
+ readonly type: "uint64";
317
+ readonly name: "borrowCollateralFactor";
318
+ }, {
319
+ readonly type: "uint64";
320
+ readonly name: "liquidateCollateralFactor";
321
+ }, {
322
+ readonly type: "uint64";
323
+ readonly name: "liquidationFactor";
324
+ }, {
325
+ readonly type: "uint128";
326
+ readonly name: "supplyCap";
327
+ }];
328
+ }];
329
+ }];
330
+ declare const cometRewardsAbi: readonly [{
331
+ readonly name: "getRewardOwed";
332
+ readonly type: "function";
333
+ readonly stateMutability: "view";
334
+ readonly inputs: readonly [{
335
+ readonly type: "address";
336
+ readonly name: "comet";
337
+ }, {
338
+ readonly type: "address";
339
+ readonly name: "account";
340
+ }];
341
+ readonly outputs: readonly [{
342
+ readonly type: "tuple";
343
+ readonly components: readonly [{
344
+ readonly type: "address";
345
+ readonly name: "token";
346
+ }, {
347
+ readonly type: "uint256";
348
+ readonly name: "owed";
349
+ }];
350
+ }];
351
+ }, {
352
+ readonly name: "claim";
353
+ readonly type: "function";
354
+ readonly stateMutability: "nonpayable";
355
+ readonly inputs: readonly [{
356
+ readonly type: "address";
357
+ readonly name: "comet";
358
+ }, {
359
+ readonly type: "address";
360
+ readonly name: "src";
361
+ }, {
362
+ readonly type: "bool";
363
+ readonly name: "shouldAccrue";
364
+ }];
365
+ readonly outputs: readonly [];
366
+ }];
367
+ declare const cometBulkerAbi: readonly [{
368
+ readonly name: "invoke";
369
+ readonly type: "function";
370
+ readonly stateMutability: "payable";
371
+ readonly inputs: readonly [{
372
+ readonly type: "bytes32[]";
373
+ readonly name: "actions";
374
+ }, {
375
+ readonly type: "bytes[]";
376
+ readonly name: "data";
377
+ }];
378
+ readonly outputs: readonly [];
379
+ }];
380
+ declare const erc20ReadAbi: readonly [{
381
+ readonly name: "allowance";
382
+ readonly type: "function";
383
+ readonly stateMutability: "view";
384
+ readonly inputs: readonly [{
385
+ readonly type: "address";
386
+ readonly name: "owner";
387
+ }, {
388
+ readonly type: "address";
389
+ readonly name: "spender";
390
+ }];
391
+ readonly outputs: readonly [{
392
+ readonly type: "uint256";
393
+ }];
394
+ }, {
395
+ readonly name: "decimals";
396
+ readonly type: "function";
397
+ readonly stateMutability: "view";
398
+ readonly inputs: readonly [];
399
+ readonly outputs: readonly [{
400
+ readonly type: "uint8";
401
+ }];
402
+ }, {
403
+ readonly name: "symbol";
404
+ readonly type: "function";
405
+ readonly stateMutability: "view";
406
+ readonly inputs: readonly [];
407
+ readonly outputs: readonly [{
408
+ readonly type: "string";
409
+ }];
410
+ }, {
411
+ readonly name: "name";
412
+ readonly type: "function";
413
+ readonly stateMutability: "view";
414
+ readonly inputs: readonly [];
415
+ readonly outputs: readonly [{
416
+ readonly type: "string";
417
+ }];
418
+ }];
419
+ declare const erc20ApproveAbi: readonly [{
420
+ readonly name: "approve";
421
+ readonly type: "function";
422
+ readonly stateMutability: "nonpayable";
423
+ readonly inputs: readonly [{
424
+ readonly type: "address";
425
+ readonly name: "spender";
426
+ }, {
427
+ readonly type: "uint256";
428
+ readonly name: "amount";
429
+ }];
430
+ readonly outputs: readonly [{
431
+ readonly type: "bool";
432
+ }];
433
+ }];
434
+ declare const wethAbi: readonly [{
435
+ readonly name: "deposit";
436
+ readonly type: "function";
437
+ readonly stateMutability: "payable";
438
+ readonly inputs: readonly [];
439
+ readonly outputs: readonly [];
440
+ }, {
441
+ readonly name: "withdraw";
442
+ readonly type: "function";
443
+ readonly stateMutability: "nonpayable";
444
+ readonly inputs: readonly [{
445
+ readonly type: "uint256";
446
+ readonly name: "wad";
447
+ }];
448
+ readonly outputs: readonly [];
449
+ }];
450
+ /** Solidity `bytes32 constant ACTION_* = "ACTION_*"` (short string). */
451
+ declare function bulkerActionId(name: string): `0x${string}`;
452
+ declare const BULKER_ACTION_SUPPLY_ASSET: `0x${string}`;
453
+ declare const BULKER_ACTION_SUPPLY_NATIVE_TOKEN: `0x${string}`;
454
+ declare const BULKER_ACTION_WITHDRAW_ASSET: `0x${string}`;
455
+ declare const BULKER_ACTION_WITHDRAW_NATIVE_TOKEN: `0x${string}`;
456
+ declare const BULKER_ACTION_CLAIM_REWARD: `0x${string}`;
457
+ declare const BULKER_ACTION_TRANSFER_ASSET: `0x${string}`;
458
+
459
+ /**
460
+ * Isolated adapter over official Compound.js artifacts
461
+ * (https://github.com/compound-finance/compound-js).
462
+ *
463
+ * The npm package peers ethers@5 and cannot be a hard runtime dependency next to
464
+ * ethers@6 / viem. We vendor `comet-constants.json` from that repo and treat
465
+ * official comet `deployments/` as the address source of truth.
466
+ */
467
+
468
+ type CompoundJsInstanceId = string;
469
+ type CompoundJsKnownComet = {
470
+ instanceId: string;
471
+ chainId: number;
472
+ comet: Address;
473
+ baseSymbol: string;
474
+ collateralSymbols: string[];
475
+ };
476
+ declare function listCompoundJsCometInstances(): CompoundJsKnownComet[];
477
+ declare function compoundJsCometAddress(instanceId: string): Address | null;
478
+ declare function compoundJsCollateralAddresses(instanceId: string): Address[];
479
+ /** Cross-check: official deployment proxy should match Compound.js when both list the market. */
480
+ declare function compoundJsAgreesWithOfficial(instanceId: string, officialComet: string): boolean;
481
+
482
+ /** Compound III rates are per-second, scaled by 1e18. */
483
+ declare const COMPOUND_V3_SECONDS_PER_YEAR: number;
484
+ declare const COMPOUND_V3_FACTOR_SCALE: bigint;
485
+ declare function compoundV3RatePerSecondToAprDecimal(ratePerSecond: bigint): number;
486
+ declare function compoundV3AprToPercentLabel(aprDecimal: number): string;
487
+ declare function compoundV3UtilizationToDecimal(utilization: bigint): number;
488
+ declare function compoundV3FactorToPercent(factor: bigint): number;
489
+
490
+ type CompoundV3SubgraphMarketHint = {
491
+ id: string;
492
+ comet: string;
493
+ };
494
+ declare function compoundV3SubgraphIdForChain(chainId: number): string | null;
495
+ declare function fetchCompoundV3SubgraphMarkets(args: {
496
+ chainId: number;
497
+ apiKey?: string;
498
+ }): Promise<CompoundV3SubgraphMarketHint[] | null>;
499
+
500
+ type CompoundV3AssetInfoRow = {
501
+ asset: string;
502
+ symbol: string;
503
+ decimals: number;
504
+ borrowCollateralFactorPercent: number;
505
+ liquidateCollateralFactorPercent: number;
506
+ priceRaw: string;
507
+ role: 'base' | 'collateral';
508
+ };
509
+ type CompoundV3MarketSummary = {
510
+ chainId: number;
511
+ slug: string;
512
+ symbol: string;
513
+ comet: string;
514
+ rewards: string;
515
+ bulker: string | null;
516
+ baseToken: string | null;
517
+ utilization: number | null;
518
+ supplyAprPercent: string | null;
519
+ borrowAprPercent: string | null;
520
+ assets: CompoundV3AssetInfoRow[];
521
+ };
522
+ type CompoundV3AccountSummary = {
523
+ comet: string;
524
+ symbol: string;
525
+ baseSupplied: string;
526
+ baseBorrowed: string;
527
+ collaterals: Array<{
528
+ asset: string;
529
+ symbol: string;
530
+ balance: string;
531
+ }>;
532
+ isBorrowCollateralized: boolean;
533
+ isLiquidatable: boolean;
534
+ rewardToken: string | null;
535
+ rewardOwed: string | null;
536
+ };
537
+ declare function compoundV3FetchMarketsSummary(args: {
538
+ chainId: number;
539
+ rpcUrl?: string;
540
+ }): Promise<{
541
+ markets: CompoundV3MarketSummary[];
542
+ notes: string;
543
+ }>;
544
+ declare function compoundV3FetchMarketSummary(args: {
545
+ chainId: number;
546
+ comet: string;
547
+ rpcUrl?: string;
548
+ }): Promise<CompoundV3MarketSummary>;
549
+ declare function compoundV3FetchAccountSummary(args: {
550
+ chainId: number;
551
+ comet: string;
552
+ account: string;
553
+ rpcUrl?: string;
554
+ }): Promise<CompoundV3AccountSummary>;
555
+ type CompoundV3AssetModes = {
556
+ base: boolean;
557
+ collateral: boolean;
558
+ };
559
+ declare function compoundV3KeyForNodeAssetRow(args: {
560
+ contractAddress: string;
561
+ chainId: number;
562
+ }): string;
563
+ declare function ensureCompoundV3ChainAssetCache(args: {
564
+ chainId: number;
565
+ rpcUrl?: string;
566
+ }): Promise<Map<string, CompoundV3AssetModes>>;
567
+ declare function getCompoundV3AssetModesFromCache(chainId: number, contractAddress: string): CompoundV3AssetModes | null;
568
+ declare function listCompoundV3MarketsForAsset(args: {
569
+ chainId: number;
570
+ contractAddress: string;
571
+ }): CompoundV3MarketRecord[];
572
+
573
+ type CompoundV3BuildStepKind = 'weth_deposit' | 'weth_withdraw' | 'approve' | 'supply' | 'withdraw' | 'claim' | 'allow' | 'bulker_invoke';
574
+ type CompoundV3BuildStep = {
575
+ kind: CompoundV3BuildStepKind;
576
+ to: Address;
577
+ data: `0x${string}`;
578
+ value: bigint;
579
+ };
580
+ declare function createCompoundV3PublicClient(rpcUrl: string, chainId: number): PublicClient;
581
+ declare function pushApproveIfNeeded(args: {
582
+ client: PublicClient;
583
+ steps: CompoundV3BuildStep[];
584
+ token: Address;
585
+ owner: Address;
586
+ spender: Address;
587
+ amountWei: bigint;
588
+ }): Promise<void>;
589
+
590
+ type ChainRow$1 = {
591
+ legacy?: boolean;
592
+ gasLimit?: number;
593
+ gasMultiplier?: number;
594
+ gasPrice?: number;
595
+ baseFee?: number;
596
+ priorityFee?: number;
597
+ baseFeeMultiplier?: number;
598
+ };
599
+
600
+ type CommonBuildArgs = {
601
+ keyGen: KeyGenSubsetForPermit;
602
+ chainId: number;
603
+ rpcUrl: string;
604
+ chainDetail: ChainRow$1;
605
+ useCustomGas: boolean;
606
+ customGasChainDetails?: Record<string, unknown> | null;
607
+ comet: Address;
608
+ executorAddress: Address;
609
+ purposeText: string;
610
+ };
611
+ /**
612
+ * Supply base (earn / repay) or collateral. Native ETH always wraps via WETH.deposit
613
+ * when `isNative` / zero address — Bulker is not required.
614
+ */
615
+ declare function buildEvmMultisignBodyCompoundV3Supply(args: CommonBuildArgs & {
616
+ asset: string;
617
+ amountHuman: string;
618
+ isNative?: boolean;
619
+ isNativeIn?: boolean;
620
+ }): Promise<{
621
+ bodyForSign: Record<string, unknown>;
622
+ messageToSign: string;
623
+ }>;
624
+ declare function buildEvmMultisignBodyCompoundV3Repay(args: Parameters<typeof buildEvmMultisignBodyCompoundV3Supply>[0]): Promise<{
625
+ bodyForSign: Record<string, unknown>;
626
+ messageToSign: string;
627
+ }>;
628
+ /**
629
+ * Withdraw collateral or base. Withdrawing base while undercollateralized is borrow.
630
+ * Native path always unwraps via WETH.withdraw after Comet.withdraw — Bulker is not required.
631
+ */
632
+ declare function buildEvmMultisignBodyCompoundV3Withdraw(args: CommonBuildArgs & {
633
+ asset: string;
634
+ amountHuman: string;
635
+ isNative?: boolean;
636
+ isNativeIn?: boolean;
637
+ }): Promise<{
638
+ bodyForSign: Record<string, unknown>;
639
+ messageToSign: string;
640
+ }>;
641
+ declare function buildEvmMultisignBodyCompoundV3ClaimRewards(args: CommonBuildArgs): Promise<{
642
+ bodyForSign: Record<string, unknown>;
643
+ messageToSign: string;
644
+ }>;
645
+
646
+ type ChainRow = {
647
+ legacy?: boolean;
648
+ gasLimit?: number;
649
+ gasMultiplier?: number;
650
+ gasPrice?: number;
651
+ baseFee?: number;
652
+ priorityFee?: number;
653
+ baseFeeMultiplier?: number;
654
+ };
655
+ type CompoundV3BulkerStepInput = {
656
+ action: 'supply' | 'withdraw' | 'claim';
657
+ asset?: string;
658
+ amountHuman?: string;
659
+ isNative?: boolean;
660
+ };
661
+ /**
662
+ * Combined Bulker.invoke. Native supply/withdraw uses ACTION_*_NATIVE_TOKEN.
663
+ * Requires ERC-20 approve(bulker) and Comet.allow(bulker) when not already set.
664
+ */
665
+ declare function buildEvmMultisignBodyCompoundV3Bulker(args: {
666
+ keyGen: KeyGenSubsetForPermit;
667
+ chainId: number;
668
+ rpcUrl: string;
669
+ chainDetail: ChainRow;
670
+ useCustomGas: boolean;
671
+ customGasChainDetails?: Record<string, unknown> | null;
672
+ comet: Address;
673
+ executorAddress: Address;
674
+ purposeText: string;
675
+ steps: CompoundV3BulkerStepInput[];
676
+ }): Promise<{
677
+ bodyForSign: Record<string, unknown>;
678
+ messageToSign: string;
679
+ }>;
680
+
681
+ declare const compoundV3ProtocolModule: ProtocolModule;
682
+
683
+ export { BULKER_ACTION_CLAIM_REWARD, BULKER_ACTION_SUPPLY_ASSET, BULKER_ACTION_SUPPLY_NATIVE_TOKEN, BULKER_ACTION_TRANSFER_ASSET, BULKER_ACTION_WITHDRAW_ASSET, BULKER_ACTION_WITHDRAW_NATIVE_TOKEN, COMPOUND_V3_CHAIN_IDS, COMPOUND_V3_FACTOR_SCALE, COMPOUND_V3_MARKETS, COMPOUND_V3_PROTOCOL_ID, COMPOUND_V3_SECONDS_PER_YEAR, COMPOUND_V3_WRAPPED_NATIVE, type CompoundJsInstanceId, type CompoundJsKnownComet, type CompoundV3AccountSummary, type CompoundV3AssetInfoRow, type CompoundV3AssetModes, type CompoundV3BuildStep, type CompoundV3BuildStepKind, type CompoundV3BulkerStepInput, type CompoundV3ChainId, type CompoundV3MarketRecord, type CompoundV3MarketSummary, type CompoundV3SubgraphMarketHint, buildEvmMultisignBodyCompoundV3Bulker, buildEvmMultisignBodyCompoundV3ClaimRewards, buildEvmMultisignBodyCompoundV3Repay, buildEvmMultisignBodyCompoundV3Supply, buildEvmMultisignBodyCompoundV3Withdraw, bulkerActionId, cometBulkerAbi, cometInterfaceAbi, cometRewardsAbi, compoundJsAgreesWithOfficial, compoundJsCollateralAddresses, compoundJsCometAddress, compoundV3AprToPercentLabel, compoundV3FactorToPercent, compoundV3FetchAccountSummary, compoundV3FetchMarketSummary, compoundV3FetchMarketsSummary, compoundV3KeyForNodeAssetRow, compoundV3ProtocolModule, compoundV3RatePerSecondToAprDecimal, compoundV3SubgraphIdForChain, compoundV3UtilizationToDecimal, compoundV3WrappedNative, createCompoundV3PublicClient, ensureCompoundV3ChainAssetCache, erc20ApproveAbi, erc20ReadAbi, fetchCompoundV3SubgraphMarkets, getCompoundV3AssetModesFromCache, getCompoundV3MarketByComet, isCompoundV3ChainSupported, isNativeAssetAddress, listCompoundJsCometInstances, listCompoundV3KnownTokenAddresses, listCompoundV3MarketsForAsset, listCompoundV3MarketsForChain, listCompoundV3SupportedChainIds, pushApproveIfNeeded, requireCompoundV3Market, resolveCompoundV3ActionAsset, wethAbi };