@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.
- package/dist/agent/catalog.cjs +1083 -4
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +1191 -7
- package/dist/agent/catalog.js +1047 -5
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/derive/SKILL.md +112 -0
- package/dist/agent/skills/hyperliquid/SKILL.md +22 -2
- package/dist/chains/evm/index.d.ts +118 -6
- package/dist/chains/near/index.d.ts +7 -1
- package/dist/chains/solana/index.d.ts +7 -1
- package/dist/core/index.cjs +2 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +138 -7
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +848 -16
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.d.ts +600 -6
- package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
- package/dist/protocols/evm/aerodrome/index.d.ts +125 -5
- package/dist/protocols/evm/aerodrome/index.js.map +1 -1
- package/dist/protocols/evm/arcus/index.d.ts +66 -2
- package/dist/protocols/evm/circle-cctp/index.d.ts +71 -2
- package/dist/protocols/evm/compound-v3/index.d.ts +52 -1
- package/dist/protocols/evm/continuum-dao/index.d.ts +56 -1
- package/dist/protocols/evm/curve-dao/index.d.ts +66 -2
- package/dist/protocols/evm/derive/index.cjs +2655 -0
- package/dist/protocols/evm/derive/index.cjs.map +1 -0
- package/dist/protocols/evm/derive/index.d.ts +859 -0
- package/dist/protocols/evm/derive/index.js +2536 -0
- package/dist/protocols/evm/derive/index.js.map +1 -0
- package/dist/protocols/evm/ethena/index.d.ts +52 -1
- package/dist/protocols/evm/euler-v2/index.d.ts +115 -16
- package/dist/protocols/evm/gmx/index.d.ts +66 -2
- package/dist/protocols/evm/hyperliquid/index.cjs +545 -267
- package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.d.ts +152 -7
- package/dist/protocols/evm/hyperliquid/index.js +535 -269
- package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.d.ts +52 -1
- package/dist/protocols/evm/maple/index.d.ts +52 -1
- package/dist/protocols/evm/morpho/index.d.ts +115 -4
- package/dist/protocols/evm/pendle/index.cjs +2 -1
- package/dist/protocols/evm/pendle/index.cjs.map +1 -1
- package/dist/protocols/evm/pendle/index.d.ts +125 -5
- package/dist/protocols/evm/pendle/index.js +2 -1
- package/dist/protocols/evm/pendle/index.js.map +1 -1
- package/dist/protocols/evm/permit2/index.d.ts +14 -1
- package/dist/protocols/evm/sky/index.d.ts +52 -1
- package/dist/protocols/evm/uniswap-v4/index.d.ts +78 -4
- package/dist/protocols/evm/venice/index.d.ts +52 -1
- package/package.json +7 -2
- package/dist/buildBatch-tsEUVn_a.d.ts +0 -45
- package/dist/eip712Multisign-6oNIlObj.d.ts +0 -39
- package/dist/envelope-Cm-llShH.d.ts +0 -37
- package/dist/merklDistributor-CdqtZC9N.d.ts +0 -65
- package/dist/multisign-Dr0j9fHm.d.ts +0 -489
- package/dist/registry-BvsXh0-r.d.ts +0 -8
- package/dist/types-RJpoU4Pc.d.ts +0 -34
- package/dist/types-lIfv59N1.d.ts +0 -63
|
@@ -1,8 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Address, PublicClient } from 'viem';
|
|
2
|
+
|
|
3
|
+
/** Aligns with app NonEvmChainType + 'evm'. Extend as mpc-auth adds chains. */
|
|
4
|
+
type ChainCategory = 'evm' | 'solana' | 'near' | 'sui' | 'ton' | 'stellar';
|
|
5
|
+
type MultisignBuildResult = {
|
|
6
|
+
bodyForSign: Record<string, unknown>;
|
|
7
|
+
messageToSign: string;
|
|
8
|
+
};
|
|
9
|
+
type EvmTokenKind = 'native' | 'erc20' | 'erc721' | 'ctmerc20' | 'ctmrwa1';
|
|
10
|
+
type SolanaTokenKind = 'native' | 'spl' | 'spl2022';
|
|
11
|
+
type NearTokenKind = 'native' | 'nep141';
|
|
12
|
+
type TokenRef = {
|
|
13
|
+
category: 'evm';
|
|
14
|
+
kind: EvmTokenKind;
|
|
15
|
+
address: `0x${string}`;
|
|
16
|
+
} | {
|
|
17
|
+
category: 'solana';
|
|
18
|
+
kind: SolanaTokenKind;
|
|
19
|
+
mint: string;
|
|
20
|
+
} | {
|
|
21
|
+
category: 'near';
|
|
22
|
+
kind: NearTokenKind;
|
|
23
|
+
contractId: string;
|
|
24
|
+
};
|
|
25
|
+
type ParamDoc = {
|
|
26
|
+
type: string;
|
|
27
|
+
required: boolean;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
type ProtocolActionDescriptor = {
|
|
31
|
+
id: string;
|
|
32
|
+
protocolId: string;
|
|
33
|
+
chainCategory: ChainCategory;
|
|
34
|
+
description: string;
|
|
35
|
+
commonParams: Array<'keyGen' | 'purposeText' | 'useCustomGas' | 'useCustomFees'>;
|
|
36
|
+
params: Record<string, ParamDoc>;
|
|
37
|
+
};
|
|
38
|
+
type ChainSupportContext = {
|
|
39
|
+
chainCategory: ChainCategory;
|
|
40
|
+
chainId: string | number;
|
|
41
|
+
};
|
|
42
|
+
interface ProtocolModule {
|
|
43
|
+
id: string;
|
|
44
|
+
chainCategory: ChainCategory;
|
|
45
|
+
isChainSupported(ctx: ChainSupportContext): boolean | Promise<boolean>;
|
|
46
|
+
isTokenSupported(token: TokenRef): boolean | Promise<boolean>;
|
|
47
|
+
actions: ProtocolActionDescriptor[];
|
|
48
|
+
}
|
|
49
|
+
interface MultisignCommonArgs {
|
|
50
|
+
keyGen: KeyGenSubset;
|
|
51
|
+
purposeText: string;
|
|
52
|
+
/** Optional Unix seconds (UTC) for POST /multiSignRequest expiryDate. */
|
|
53
|
+
expiryDate?: number;
|
|
54
|
+
}
|
|
55
|
+
type KeyGenSubset = {
|
|
56
|
+
pubkeyhex?: string;
|
|
57
|
+
keylist?: string[];
|
|
58
|
+
ClientKeys?: Record<string, string>;
|
|
59
|
+
groupId?: string;
|
|
60
|
+
GroupId?: string;
|
|
61
|
+
};
|
|
62
|
+
/** App-compatible alias used by multisign builders and Permit2 helpers. */
|
|
63
|
+
type KeyGenSubsetForPermit = KeyGenSubset;
|
|
6
64
|
|
|
7
65
|
declare const PENDLE_PROTOCOL_ID = "pendle";
|
|
8
66
|
declare const PENDLE_CORE_API_BASE = "https://api-v2.pendle.finance/core";
|
|
@@ -276,6 +334,68 @@ declare function buildPendlePurposePrefill(args: {
|
|
|
276
334
|
slippagePercent?: number;
|
|
277
335
|
}): string;
|
|
278
336
|
|
|
337
|
+
type EvmChainDetail = {
|
|
338
|
+
legacy?: boolean;
|
|
339
|
+
gasLimit?: number;
|
|
340
|
+
gasMultiplier?: number;
|
|
341
|
+
gasPrice?: number;
|
|
342
|
+
baseFee?: number;
|
|
343
|
+
priorityFee?: number;
|
|
344
|
+
baseFeeMultiplier?: number;
|
|
345
|
+
};
|
|
346
|
+
interface EvmProtocolContext extends MultisignCommonArgs {
|
|
347
|
+
chainCategory: 'evm';
|
|
348
|
+
chainId: number;
|
|
349
|
+
rpcUrl: string;
|
|
350
|
+
executorAddress: Address;
|
|
351
|
+
chainDetail: EvmChainDetail;
|
|
352
|
+
useCustomGas: boolean;
|
|
353
|
+
customGasChainDetails?: Record<string, unknown> | null;
|
|
354
|
+
}
|
|
355
|
+
type EvmTxStep = {
|
|
356
|
+
to: Address;
|
|
357
|
+
data: `0x${string}`;
|
|
358
|
+
value: bigint;
|
|
359
|
+
/** Fallback when estimateGas reverts */
|
|
360
|
+
fallbackGas?: bigint;
|
|
361
|
+
/** When set, use routerSwapGasLimitFromEstimate instead of plain estimate */
|
|
362
|
+
routerSwap?: boolean;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
type EvmBatchMetaBuilder = (args: {
|
|
366
|
+
step: EvmTxStep;
|
|
367
|
+
index: number;
|
|
368
|
+
gasLimit: bigint;
|
|
369
|
+
}) => Record<string, unknown>;
|
|
370
|
+
type EvmBuildBatchArgs = {
|
|
371
|
+
context: EvmProtocolContext;
|
|
372
|
+
steps: EvmTxStep[];
|
|
373
|
+
purposeSuffix?: string;
|
|
374
|
+
buildBatchMeta: EvmBatchMetaBuilder;
|
|
375
|
+
/** First leg msgRaw without 0x prefix; defaults to first step calldata */
|
|
376
|
+
firstMsgRawNo0x?: string;
|
|
377
|
+
destinationAddress?: Address;
|
|
378
|
+
/** Top-level `value` on bodyForSign when the payable amount is not on the first leg */
|
|
379
|
+
payableValueWei?: bigint;
|
|
380
|
+
resolveGasLimit?: (args: {
|
|
381
|
+
step: EvmTxStep;
|
|
382
|
+
index: number;
|
|
383
|
+
estimatedGas: bigint;
|
|
384
|
+
publicClient: PublicClient;
|
|
385
|
+
}) => Promise<bigint> | bigint;
|
|
386
|
+
/** Override default `estimateGas` (e.g. trade-API gas, skip post-approve deposit estimate). */
|
|
387
|
+
estimateGasForStep?: (args: {
|
|
388
|
+
step: EvmTxStep;
|
|
389
|
+
index: number;
|
|
390
|
+
publicClient: PublicClient;
|
|
391
|
+
executor: Address;
|
|
392
|
+
}) => Promise<bigint> | bigint;
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* Build unsigned EVM txs, estimate gas, serialize, hash — then assemble mpc-auth body via core envelope.
|
|
396
|
+
*/
|
|
397
|
+
declare function buildEvmMultisignBatch(args: EvmBuildBatchArgs): Promise<MultisignBuildResult>;
|
|
398
|
+
|
|
279
399
|
declare function isPendleConvertEvmSignRequest(extra: Record<string, unknown> | null | undefined): boolean;
|
|
280
400
|
declare function buildEvmMultisignBodyPendleFromConvert(args: {
|
|
281
401
|
keyGen: KeyGenSubsetForPermit;
|
|
@@ -994,7 +994,8 @@ var DEFI_PROTOCOLS_WITH_30MIN_EXPIRY = /* @__PURE__ */ new Set([
|
|
|
994
994
|
"arcus",
|
|
995
995
|
"curve-dao",
|
|
996
996
|
"aerodrome",
|
|
997
|
-
"pendle"
|
|
997
|
+
"pendle",
|
|
998
|
+
"derive"
|
|
998
999
|
]);
|
|
999
1000
|
function defiMultisignExpiryUnixSeconds(protocolId, explicitExpiryDate) {
|
|
1000
1001
|
if (typeof explicitExpiryDate === "number" && Number.isFinite(explicitExpiryDate) && explicitExpiryDate > 0) {
|