@continuumdao/ctm-mpc-defi 0.2.48 → 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.
Files changed (63) hide show
  1. package/dist/agent/catalog.cjs +1083 -4
  2. package/dist/agent/catalog.cjs.map +1 -1
  3. package/dist/agent/catalog.d.ts +1191 -7
  4. package/dist/agent/catalog.js +1047 -5
  5. package/dist/agent/catalog.js.map +1 -1
  6. package/dist/agent/skills/derive/SKILL.md +112 -0
  7. package/dist/agent/skills/hyperliquid/SKILL.md +22 -2
  8. package/dist/chains/evm/index.d.ts +118 -6
  9. package/dist/chains/near/index.d.ts +7 -1
  10. package/dist/chains/solana/index.d.ts +7 -1
  11. package/dist/core/index.cjs +2 -1
  12. package/dist/core/index.cjs.map +1 -1
  13. package/dist/core/index.d.ts +138 -7
  14. package/dist/core/index.js +2 -1
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/index.cjs +2 -1
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.ts +848 -16
  19. package/dist/index.js +2 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/protocols/evm/aave-v4/index.d.ts +600 -6
  22. package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
  23. package/dist/protocols/evm/aerodrome/index.d.ts +125 -5
  24. package/dist/protocols/evm/aerodrome/index.js.map +1 -1
  25. package/dist/protocols/evm/arcus/index.d.ts +66 -2
  26. package/dist/protocols/evm/circle-cctp/index.d.ts +71 -2
  27. package/dist/protocols/evm/compound-v3/index.d.ts +52 -1
  28. package/dist/protocols/evm/continuum-dao/index.d.ts +56 -1
  29. package/dist/protocols/evm/curve-dao/index.d.ts +66 -2
  30. package/dist/protocols/evm/derive/index.cjs +2655 -0
  31. package/dist/protocols/evm/derive/index.cjs.map +1 -0
  32. package/dist/protocols/evm/derive/index.d.ts +859 -0
  33. package/dist/protocols/evm/derive/index.js +2536 -0
  34. package/dist/protocols/evm/derive/index.js.map +1 -0
  35. package/dist/protocols/evm/ethena/index.d.ts +52 -1
  36. package/dist/protocols/evm/euler-v2/index.d.ts +115 -16
  37. package/dist/protocols/evm/gmx/index.d.ts +66 -2
  38. package/dist/protocols/evm/hyperliquid/index.cjs +545 -267
  39. package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
  40. package/dist/protocols/evm/hyperliquid/index.d.ts +152 -7
  41. package/dist/protocols/evm/hyperliquid/index.js +535 -269
  42. package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
  43. package/dist/protocols/evm/lido/index.d.ts +52 -1
  44. package/dist/protocols/evm/maple/index.d.ts +52 -1
  45. package/dist/protocols/evm/morpho/index.d.ts +115 -4
  46. package/dist/protocols/evm/pendle/index.cjs +2 -1
  47. package/dist/protocols/evm/pendle/index.cjs.map +1 -1
  48. package/dist/protocols/evm/pendle/index.d.ts +125 -5
  49. package/dist/protocols/evm/pendle/index.js +2 -1
  50. package/dist/protocols/evm/pendle/index.js.map +1 -1
  51. package/dist/protocols/evm/permit2/index.d.ts +14 -1
  52. package/dist/protocols/evm/sky/index.d.ts +52 -1
  53. package/dist/protocols/evm/uniswap-v4/index.d.ts +78 -4
  54. package/dist/protocols/evm/venice/index.d.ts +52 -1
  55. package/package.json +7 -2
  56. package/dist/buildBatch-tsEUVn_a.d.ts +0 -45
  57. package/dist/eip712Multisign-6oNIlObj.d.ts +0 -39
  58. package/dist/envelope-Cm-llShH.d.ts +0 -37
  59. package/dist/merklDistributor-CdqtZC9N.d.ts +0 -65
  60. package/dist/multisign-Dr0j9fHm.d.ts +0 -489
  61. package/dist/registry-BvsXh0-r.d.ts +0 -8
  62. package/dist/types-RJpoU4Pc.d.ts +0 -34
  63. package/dist/types-lIfv59N1.d.ts +0 -63
@@ -1,9 +1,67 @@
1
- import { b as KeyGenSubsetForPermit, e as ProtocolModule } from '../../../types-lIfv59N1.js';
2
- import { Address, Hex } from 'viem';
3
- import { E as EvmChainDetail, b as EvmTxStep } from '../../../types-RJpoU4Pc.js';
4
- import { b as buildEvmMultisignBatch } from '../../../buildBatch-tsEUVn_a.js';
1
+ import { Address, Hex, PublicClient } from 'viem';
5
2
  import * as abitype from 'abitype';
6
- import '../../../envelope-Cm-llShH.js';
3
+
4
+ /** Aligns with app NonEvmChainType + 'evm'. Extend as mpc-auth adds chains. */
5
+ type ChainCategory = 'evm' | 'solana' | 'near' | 'sui' | 'ton' | 'stellar';
6
+ type MultisignBuildResult = {
7
+ bodyForSign: Record<string, unknown>;
8
+ messageToSign: string;
9
+ };
10
+ type EvmTokenKind = 'native' | 'erc20' | 'erc721' | 'ctmerc20' | 'ctmrwa1';
11
+ type SolanaTokenKind = 'native' | 'spl' | 'spl2022';
12
+ type NearTokenKind = 'native' | 'nep141';
13
+ type TokenRef = {
14
+ category: 'evm';
15
+ kind: EvmTokenKind;
16
+ address: `0x${string}`;
17
+ } | {
18
+ category: 'solana';
19
+ kind: SolanaTokenKind;
20
+ mint: string;
21
+ } | {
22
+ category: 'near';
23
+ kind: NearTokenKind;
24
+ contractId: string;
25
+ };
26
+ type ParamDoc = {
27
+ type: string;
28
+ required: boolean;
29
+ description: string;
30
+ };
31
+ type ProtocolActionDescriptor = {
32
+ id: string;
33
+ protocolId: string;
34
+ chainCategory: ChainCategory;
35
+ description: string;
36
+ commonParams: Array<'keyGen' | 'purposeText' | 'useCustomGas' | 'useCustomFees'>;
37
+ params: Record<string, ParamDoc>;
38
+ };
39
+ type ChainSupportContext = {
40
+ chainCategory: ChainCategory;
41
+ chainId: string | number;
42
+ };
43
+ interface ProtocolModule {
44
+ id: string;
45
+ chainCategory: ChainCategory;
46
+ isChainSupported(ctx: ChainSupportContext): boolean | Promise<boolean>;
47
+ isTokenSupported(token: TokenRef): boolean | Promise<boolean>;
48
+ actions: ProtocolActionDescriptor[];
49
+ }
50
+ interface MultisignCommonArgs {
51
+ keyGen: KeyGenSubset;
52
+ purposeText: string;
53
+ /** Optional Unix seconds (UTC) for POST /multiSignRequest expiryDate. */
54
+ expiryDate?: number;
55
+ }
56
+ type KeyGenSubset = {
57
+ pubkeyhex?: string;
58
+ keylist?: string[];
59
+ ClientKeys?: Record<string, string>;
60
+ groupId?: string;
61
+ GroupId?: string;
62
+ };
63
+ /** App-compatible alias used by multisign builders and Permit2 helpers. */
64
+ type KeyGenSubsetForPermit = KeyGenSubset;
7
65
 
8
66
  declare const AERODROME_PROTOCOL_ID: "aerodrome";
9
67
  /** Aerodrome is Base-only. */
@@ -422,6 +480,68 @@ declare function computeAerodromePriceImpactPercent(args: {
422
480
  /** e.g. "0.12%" from a 0–100 quote field. */
423
481
  declare function formatAerodromePriceImpact(percent0to100: number | null | undefined): string;
424
482
 
483
+ type EvmChainDetail = {
484
+ legacy?: boolean;
485
+ gasLimit?: number;
486
+ gasMultiplier?: number;
487
+ gasPrice?: number;
488
+ baseFee?: number;
489
+ priorityFee?: number;
490
+ baseFeeMultiplier?: number;
491
+ };
492
+ interface EvmProtocolContext extends MultisignCommonArgs {
493
+ chainCategory: 'evm';
494
+ chainId: number;
495
+ rpcUrl: string;
496
+ executorAddress: Address;
497
+ chainDetail: EvmChainDetail;
498
+ useCustomGas: boolean;
499
+ customGasChainDetails?: Record<string, unknown> | null;
500
+ }
501
+ type EvmTxStep = {
502
+ to: Address;
503
+ data: `0x${string}`;
504
+ value: bigint;
505
+ /** Fallback when estimateGas reverts */
506
+ fallbackGas?: bigint;
507
+ /** When set, use routerSwapGasLimitFromEstimate instead of plain estimate */
508
+ routerSwap?: boolean;
509
+ };
510
+
511
+ type EvmBatchMetaBuilder = (args: {
512
+ step: EvmTxStep;
513
+ index: number;
514
+ gasLimit: bigint;
515
+ }) => Record<string, unknown>;
516
+ type EvmBuildBatchArgs = {
517
+ context: EvmProtocolContext;
518
+ steps: EvmTxStep[];
519
+ purposeSuffix?: string;
520
+ buildBatchMeta: EvmBatchMetaBuilder;
521
+ /** First leg msgRaw without 0x prefix; defaults to first step calldata */
522
+ firstMsgRawNo0x?: string;
523
+ destinationAddress?: Address;
524
+ /** Top-level `value` on bodyForSign when the payable amount is not on the first leg */
525
+ payableValueWei?: bigint;
526
+ resolveGasLimit?: (args: {
527
+ step: EvmTxStep;
528
+ index: number;
529
+ estimatedGas: bigint;
530
+ publicClient: PublicClient;
531
+ }) => Promise<bigint> | bigint;
532
+ /** Override default `estimateGas` (e.g. trade-API gas, skip post-approve deposit estimate). */
533
+ estimateGasForStep?: (args: {
534
+ step: EvmTxStep;
535
+ index: number;
536
+ publicClient: PublicClient;
537
+ executor: Address;
538
+ }) => Promise<bigint> | bigint;
539
+ };
540
+ /**
541
+ * Build unsigned EVM txs, estimate gas, serialize, hash — then assemble mpc-auth body via core envelope.
542
+ */
543
+ declare function buildEvmMultisignBatch(args: EvmBuildBatchArgs): Promise<MultisignBuildResult>;
544
+
425
545
  type AerodromeStep = EvmTxStep & {
426
546
  kind: string;
427
547
  };