@continuumdao/ctm-mpc-defi 0.1.4 → 0.2.1
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/README.md +20 -78
- package/dist/agent/catalog.cjs +1388 -144
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +881 -17
- package/dist/agent/catalog.js +1327 -145
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/aave-v4/SKILL.md +43 -0
- package/dist/agent/skills/curve-dao/SKILL.md +12 -0
- package/dist/agent/skills/ethena/SKILL.md +10 -0
- package/dist/agent/skills/euler-v2/SKILL.md +10 -0
- package/dist/agent/skills/lido/SKILL.md +22 -0
- package/dist/agent/skills/maple-syrup/SKILL.md +10 -0
- package/dist/agent/skills/sky/SKILL.md +10 -0
- package/dist/agent/skills/uniswap-v4/SKILL.md +22 -0
- package/dist/chains/evm/index.cjs +27 -213
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.d.ts +15 -25
- package/dist/chains/evm/index.js +21 -199
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/chains/near/index.d.ts +1 -1
- package/dist/chains/solana/index.d.ts +1 -1
- package/dist/core/index.cjs +8 -110
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +5 -39
- package/dist/core/index.js +6 -100
- package/dist/core/index.js.map +1 -1
- package/dist/{envelope-CcE5Cz_q.d.ts → envelope-CpBUh9eP.d.ts} +1 -1
- package/dist/index.cjs +238 -1184
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -10
- package/dist/index.js +227 -1156
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +1710 -0
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -0
- package/dist/protocols/evm/aave-v4/index.d.ts +499 -0
- package/dist/protocols/evm/aave-v4/index.js +1666 -0
- package/dist/protocols/evm/aave-v4/index.js.map +1 -0
- package/dist/protocols/evm/curve-dao/index.cjs +24 -124
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.d.ts +3 -4
- package/dist/protocols/evm/curve-dao/index.js +15 -115
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +853 -0
- package/dist/protocols/evm/ethena/index.cjs.map +1 -0
- package/dist/protocols/evm/ethena/index.d.ts +160 -0
- package/dist/protocols/evm/ethena/index.js +831 -0
- package/dist/protocols/evm/ethena/index.js.map +1 -0
- package/dist/protocols/evm/euler-v2/index.cjs +1585 -0
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -0
- package/dist/protocols/evm/euler-v2/index.d.ts +316 -0
- package/dist/protocols/evm/euler-v2/index.js +1560 -0
- package/dist/protocols/evm/euler-v2/index.js.map +1 -0
- package/dist/protocols/evm/lido/index.cjs +839 -0
- package/dist/protocols/evm/lido/index.cjs.map +1 -0
- package/dist/protocols/evm/lido/index.d.ts +119 -0
- package/dist/protocols/evm/lido/index.js +814 -0
- package/dist/protocols/evm/lido/index.js.map +1 -0
- package/dist/protocols/evm/maple/index.cjs +619 -0
- package/dist/protocols/evm/maple/index.cjs.map +1 -0
- package/dist/protocols/evm/maple/index.d.ts +108 -0
- package/dist/protocols/evm/maple/index.js +605 -0
- package/dist/protocols/evm/maple/index.js.map +1 -0
- package/dist/protocols/evm/sky/index.cjs +1259 -0
- package/dist/protocols/evm/sky/index.cjs.map +1 -0
- package/dist/protocols/evm/sky/index.d.ts +217 -0
- package/dist/protocols/evm/sky/index.js +1234 -0
- package/dist/protocols/evm/sky/index.js.map +1 -0
- package/dist/protocols/evm/uniswap-v4/index.cjs +423 -658
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.d.ts +3 -4
- package/dist/protocols/evm/uniswap-v4/index.js +422 -657
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/dist/{registry-oMKlO_5z.d.ts → registry-Bv5o37_w.d.ts} +1 -1
- package/dist/{types-Ce2qNHai.d.cts → types-BfjWdw1j.d.ts} +3 -1
- package/dist/{types-5u863Fd9.d.ts → types-DUeNJLr9.d.ts} +1 -1
- package/package.json +43 -8
- package/dist/agent/catalog.d.cts +0 -195
- package/dist/chains/evm/index.d.cts +0 -62
- package/dist/chains/near/index.d.cts +0 -37
- package/dist/chains/solana/index.d.cts +0 -40
- package/dist/core/index.d.cts +0 -43
- package/dist/envelope-DYDPnrHZ.d.cts +0 -35
- package/dist/index.d.cts +0 -15
- package/dist/keygen-CfNp8yKJ.d.cts +0 -9
- package/dist/keygen-DsINazx8.d.ts +0 -9
- package/dist/nodeRead-BnmSaMGO.d.cts +0 -8
- package/dist/nodeRead-BnmSaMGO.d.ts +0 -8
- package/dist/protocols/evm/curve-dao/index.d.cts +0 -147
- package/dist/protocols/evm/uniswap-v4/index.d.cts +0 -324
- package/dist/registry-BwZoE668.d.cts +0 -8
- package/dist/txParams-BC7ogvdR.d.cts +0 -19
- package/dist/txParams-BC7ogvdR.d.ts +0 -19
- package/dist/types-B8idm_gu.d.cts +0 -34
- package/dist/types-Ce2qNHai.d.ts +0 -57
|
@@ -53,5 +53,7 @@ type KeyGenSubset = {
|
|
|
53
53
|
keylist?: string[];
|
|
54
54
|
ClientKeys?: Record<string, string>;
|
|
55
55
|
};
|
|
56
|
+
/** App-compatible alias used by multisign builders and Permit2 helpers. */
|
|
57
|
+
type KeyGenSubsetForPermit = KeyGenSubset;
|
|
56
58
|
|
|
57
|
-
export type { ChainCategory as C, EvmTokenKind as E, KeyGenSubset as K, MultisignBuildResult as M, NearTokenKind as N, ParamDoc as P, SolanaTokenKind as S, TokenRef as T, ChainSupportContext as a,
|
|
59
|
+
export type { ChainCategory as C, EvmTokenKind as E, KeyGenSubset as K, MultisignBuildResult as M, NearTokenKind as N, ParamDoc as P, SolanaTokenKind as S, TokenRef as T, ChainSupportContext as a, KeyGenSubsetForPermit as b, MultisignCommonArgs as c, ProtocolActionDescriptor as d, ProtocolModule as e };
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@continuumdao/ctm-mpc-defi",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Continuum MPC DeFi protocol library — multiSignRequest builders for EVM and future chain categories",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ContinuumDAO/ctm-mpc-defi.git"
|
|
8
8
|
},
|
|
9
|
-
"publishConfig": {
|
|
10
|
-
"access": "public"
|
|
11
|
-
},
|
|
12
9
|
"type": "module",
|
|
13
10
|
"main": "./dist/index.js",
|
|
14
11
|
"types": "./dist/index.d.ts",
|
|
@@ -48,6 +45,36 @@
|
|
|
48
45
|
"import": "./dist/protocols/evm/curve-dao/index.js",
|
|
49
46
|
"require": "./dist/protocols/evm/curve-dao/index.cjs"
|
|
50
47
|
},
|
|
48
|
+
"./protocols/evm/lido": {
|
|
49
|
+
"types": "./dist/protocols/evm/lido/index.d.ts",
|
|
50
|
+
"import": "./dist/protocols/evm/lido/index.js",
|
|
51
|
+
"require": "./dist/protocols/evm/lido/index.cjs"
|
|
52
|
+
},
|
|
53
|
+
"./protocols/evm/ethena": {
|
|
54
|
+
"types": "./dist/protocols/evm/ethena/index.d.ts",
|
|
55
|
+
"import": "./dist/protocols/evm/ethena/index.js",
|
|
56
|
+
"require": "./dist/protocols/evm/ethena/index.cjs"
|
|
57
|
+
},
|
|
58
|
+
"./protocols/evm/maple": {
|
|
59
|
+
"types": "./dist/protocols/evm/maple/index.d.ts",
|
|
60
|
+
"import": "./dist/protocols/evm/maple/index.js",
|
|
61
|
+
"require": "./dist/protocols/evm/maple/index.cjs"
|
|
62
|
+
},
|
|
63
|
+
"./protocols/evm/sky": {
|
|
64
|
+
"types": "./dist/protocols/evm/sky/index.d.ts",
|
|
65
|
+
"import": "./dist/protocols/evm/sky/index.js",
|
|
66
|
+
"require": "./dist/protocols/evm/sky/index.cjs"
|
|
67
|
+
},
|
|
68
|
+
"./protocols/evm/aave-v4": {
|
|
69
|
+
"types": "./dist/protocols/evm/aave-v4/index.d.ts",
|
|
70
|
+
"import": "./dist/protocols/evm/aave-v4/index.js",
|
|
71
|
+
"require": "./dist/protocols/evm/aave-v4/index.cjs"
|
|
72
|
+
},
|
|
73
|
+
"./protocols/evm/euler-v2": {
|
|
74
|
+
"types": "./dist/protocols/evm/euler-v2/index.d.ts",
|
|
75
|
+
"import": "./dist/protocols/evm/euler-v2/index.js",
|
|
76
|
+
"require": "./dist/protocols/evm/euler-v2/index.cjs"
|
|
77
|
+
},
|
|
51
78
|
"./agent": {
|
|
52
79
|
"types": "./dist/agent/catalog.d.ts",
|
|
53
80
|
"import": "./dist/agent/catalog.js",
|
|
@@ -60,10 +87,13 @@
|
|
|
60
87
|
"LICENSE"
|
|
61
88
|
],
|
|
62
89
|
"sideEffects": false,
|
|
90
|
+
"publishConfig": {
|
|
91
|
+
"access": "public"
|
|
92
|
+
},
|
|
63
93
|
"scripts": {
|
|
64
|
-
"build": "tsup",
|
|
94
|
+
"build": "tsup && cp -r src/agent/skills dist/agent/",
|
|
65
95
|
"prepublishOnly": "npm run build",
|
|
66
|
-
"
|
|
96
|
+
"pretest": "node scripts/link-self-for-sdk.mjs",
|
|
67
97
|
"test": "vitest run",
|
|
68
98
|
"test:watch": "vitest",
|
|
69
99
|
"typecheck": "tsc --noEmit"
|
|
@@ -71,9 +101,14 @@
|
|
|
71
101
|
"engines": {
|
|
72
102
|
"node": ">=22.19.0"
|
|
73
103
|
},
|
|
104
|
+
"dependencies": {
|
|
105
|
+
"@continuumdao/continuum-node-sdk": "^1.2.6",
|
|
106
|
+
"zod": "^3.24.0",
|
|
107
|
+
"zod-to-json-schema": "^3.24.0"
|
|
108
|
+
},
|
|
74
109
|
"peerDependencies": {
|
|
75
|
-
"
|
|
76
|
-
"
|
|
110
|
+
"@curvefi/api": "^2.68.0",
|
|
111
|
+
"viem": "^2.46.0"
|
|
77
112
|
},
|
|
78
113
|
"peerDependenciesMeta": {
|
|
79
114
|
"@curvefi/api": {
|
package/dist/agent/catalog.d.cts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { C as ChainCategory, d as ProtocolModule, P as ParamDoc, c as ProtocolActionDescriptor } from '../types-Ce2qNHai.cjs';
|
|
2
|
-
export { g as getActionsByChainCategory, b as getProtocolModules } from '../registry-BwZoE668.cjs';
|
|
3
|
-
|
|
4
|
-
/** JSON-schema-like object for MCP tool `inputSchema` / `outputSchema`. */
|
|
5
|
-
type McpSchemaProperty = {
|
|
6
|
-
type: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
};
|
|
9
|
-
type McpJsonSchema = {
|
|
10
|
-
type: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
properties?: Record<string, McpSchemaProperty>;
|
|
13
|
-
required?: string[];
|
|
14
|
-
items?: McpJsonSchema;
|
|
15
|
-
enum?: string[];
|
|
16
|
-
};
|
|
17
|
-
type McpToolHandler = {
|
|
18
|
-
/** Import path subpath, e.g. protocols/evm/uniswap-v4 */
|
|
19
|
-
importPath: string;
|
|
20
|
-
/** Named export to invoke */
|
|
21
|
-
exportName: string;
|
|
22
|
-
};
|
|
23
|
-
type McpToolDefinition = {
|
|
24
|
-
/** Stable MCP tool name (snake_case). */
|
|
25
|
-
name: string;
|
|
26
|
-
/** Registry action id, e.g. uniswap-v4.quote */
|
|
27
|
-
actionId: string;
|
|
28
|
-
protocolId: string;
|
|
29
|
-
chainCategory: ChainCategory;
|
|
30
|
-
/** Long description for the LLM — what it does, when to use it, what it does NOT do. */
|
|
31
|
-
description: string;
|
|
32
|
-
/** Prerequisites (other tools or data that must exist first). */
|
|
33
|
-
prerequisites: string[];
|
|
34
|
-
/** Typical next tools after this one succeeds. */
|
|
35
|
-
followUp: string[];
|
|
36
|
-
inputSchema: McpJsonSchema;
|
|
37
|
-
outputSchema: McpJsonSchema;
|
|
38
|
-
handler: McpToolHandler;
|
|
39
|
-
};
|
|
40
|
-
/** Curated MCP tools with rich descriptions — use this to register MCP server tools. */
|
|
41
|
-
declare const MCP_TOOL_DEFINITIONS: McpToolDefinition[];
|
|
42
|
-
declare function getMcpToolDefinitions(): readonly McpToolDefinition[];
|
|
43
|
-
declare function getMcpToolByName(name: string): McpToolDefinition | undefined;
|
|
44
|
-
/** Summary from protocol registry (shorter) plus full MCP tool list. */
|
|
45
|
-
declare function getAgentCatalogForMcp(): {
|
|
46
|
-
tools: McpToolDefinition[];
|
|
47
|
-
protocols: readonly ProtocolModule[];
|
|
48
|
-
commonParams: Record<string, ParamDoc>;
|
|
49
|
-
multisignOutput: {
|
|
50
|
-
readonly description: "Unsigned mpc-auth multiSignRequest payload. The caller must sign messageToSign (MetaMask personal_sign or Ed25519) and POST { ...bodyForSign, clientSig, signedMessage: messageToSign } to /multiSignRequest.";
|
|
51
|
-
readonly fields: {
|
|
52
|
-
readonly bodyForSign: {
|
|
53
|
-
readonly type: "object";
|
|
54
|
-
readonly description: "POST body fields without clientSig: keyList, pubKey, msgHash, msgRaw, destinationChainID, purpose, extraJSON, proposalTxParams (batch), messageHashes/messageRawBatch when N>1 txs.";
|
|
55
|
-
};
|
|
56
|
-
readonly messageToSign: {
|
|
57
|
-
readonly type: "string";
|
|
58
|
-
readonly description: "JSON.stringify(bodyForSign) — exact string to sign before adding clientSig.";
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
managementSig: {
|
|
63
|
-
readonly description: "Management POST bodies embed NodeMgtKeySig: { nonce, clientSig, nodeKey }. Sign JSON with clientSig cleared; POST with clientSig set to the Ed25519 128-hex or EIP-191 signature. Legacy Nonce/Sig/sig field names are not accepted.";
|
|
64
|
-
readonly fields: {
|
|
65
|
-
readonly nonce: {
|
|
66
|
-
readonly type: "number";
|
|
67
|
-
readonly description: "From GET /getPublicMgtKeyNonce (Ed25519) or GET /getNodeMgtKeyNonce (Ethereum NodeMgtKey).";
|
|
68
|
-
};
|
|
69
|
-
readonly clientSig: {
|
|
70
|
-
readonly type: "string";
|
|
71
|
-
readonly description: "Management signature; empty string in the message to sign.";
|
|
72
|
-
};
|
|
73
|
-
readonly nodeKey: {
|
|
74
|
-
readonly type: "string";
|
|
75
|
-
readonly description: "Required. 128-hex MPC node id from GET /getNodeKey (no 0x prefix).";
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
readonly helpers: {
|
|
79
|
-
readonly managementSigFields: "Base envelope with clientSig cleared.";
|
|
80
|
-
readonly buildManagementPostBody: "Spread managementSigFields then endpoint fields.";
|
|
81
|
-
readonly messageToSignManagementBody: "Canonical JSON string to sign.";
|
|
82
|
-
readonly withManagementClientSig: "Attach signature to POST body.";
|
|
83
|
-
readonly fetchNodeKey: "GET /getNodeKey via nodeFetchWithReadAuth.";
|
|
84
|
-
readonly fetchManagementNonce: "GET nonce for Ed25519 or Ethereum management key.";
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
workflow: {
|
|
88
|
-
evmSwapTypical: string[];
|
|
89
|
-
managementPostTypical: string[];
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
/** Shared inputs documented once for all EVM multisign builders. */
|
|
94
|
-
declare const EVM_COMMON_PARAM_DOCS: Record<string, ParamDoc>;
|
|
95
|
-
declare const MULTISIGN_OUTPUT_DOC: {
|
|
96
|
-
readonly description: "Unsigned mpc-auth multiSignRequest payload. The caller must sign messageToSign (MetaMask personal_sign or Ed25519) and POST { ...bodyForSign, clientSig, signedMessage: messageToSign } to /multiSignRequest.";
|
|
97
|
-
readonly fields: {
|
|
98
|
-
readonly bodyForSign: {
|
|
99
|
-
readonly type: "object";
|
|
100
|
-
readonly description: "POST body fields without clientSig: keyList, pubKey, msgHash, msgRaw, destinationChainID, purpose, extraJSON, proposalTxParams (batch), messageHashes/messageRawBatch when N>1 txs.";
|
|
101
|
-
};
|
|
102
|
-
readonly messageToSign: {
|
|
103
|
-
readonly type: "string";
|
|
104
|
-
readonly description: "JSON.stringify(bodyForSign) — exact string to sign before adding clientSig.";
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
/** mpc-auth NodeMgtKeySig envelope for management POST routes (Get Sig, shelve, keyGen, groups, …). */
|
|
109
|
-
declare const MANAGEMENT_SIG_DOC: {
|
|
110
|
-
readonly description: "Management POST bodies embed NodeMgtKeySig: { nonce, clientSig, nodeKey }. Sign JSON with clientSig cleared; POST with clientSig set to the Ed25519 128-hex or EIP-191 signature. Legacy Nonce/Sig/sig field names are not accepted.";
|
|
111
|
-
readonly fields: {
|
|
112
|
-
readonly nonce: {
|
|
113
|
-
readonly type: "number";
|
|
114
|
-
readonly description: "From GET /getPublicMgtKeyNonce (Ed25519) or GET /getNodeMgtKeyNonce (Ethereum NodeMgtKey).";
|
|
115
|
-
};
|
|
116
|
-
readonly clientSig: {
|
|
117
|
-
readonly type: "string";
|
|
118
|
-
readonly description: "Management signature; empty string in the message to sign.";
|
|
119
|
-
};
|
|
120
|
-
readonly nodeKey: {
|
|
121
|
-
readonly type: "string";
|
|
122
|
-
readonly description: "Required. 128-hex MPC node id from GET /getNodeKey (no 0x prefix).";
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
readonly helpers: {
|
|
126
|
-
readonly managementSigFields: "Base envelope with clientSig cleared.";
|
|
127
|
-
readonly buildManagementPostBody: "Spread managementSigFields then endpoint fields.";
|
|
128
|
-
readonly messageToSignManagementBody: "Canonical JSON string to sign.";
|
|
129
|
-
readonly withManagementClientSig: "Attach signature to POST body.";
|
|
130
|
-
readonly fetchNodeKey: "GET /getNodeKey via nodeFetchWithReadAuth.";
|
|
131
|
-
readonly fetchManagementNonce: "GET nonce for Ed25519 or Ethereum management key.";
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
/** Machine-readable catalog of protocol actions grouped by chain category. */
|
|
136
|
-
declare function getAgentCatalog(): {
|
|
137
|
-
protocols: readonly ProtocolModule[];
|
|
138
|
-
byCategory: {
|
|
139
|
-
evm: ProtocolActionDescriptor[];
|
|
140
|
-
solana: ProtocolActionDescriptor[];
|
|
141
|
-
near: ProtocolActionDescriptor[];
|
|
142
|
-
};
|
|
143
|
-
uniswapV4: ProtocolModule;
|
|
144
|
-
curveDao: ProtocolModule;
|
|
145
|
-
/** Prefer getAgentCatalogForMcp() or getMcpToolDefinitions() for MCP servers. */
|
|
146
|
-
mcp: {
|
|
147
|
-
tools: McpToolDefinition[];
|
|
148
|
-
protocols: readonly ProtocolModule[];
|
|
149
|
-
commonParams: Record<string, ParamDoc>;
|
|
150
|
-
multisignOutput: {
|
|
151
|
-
readonly description: "Unsigned mpc-auth multiSignRequest payload. The caller must sign messageToSign (MetaMask personal_sign or Ed25519) and POST { ...bodyForSign, clientSig, signedMessage: messageToSign } to /multiSignRequest.";
|
|
152
|
-
readonly fields: {
|
|
153
|
-
readonly bodyForSign: {
|
|
154
|
-
readonly type: "object";
|
|
155
|
-
readonly description: "POST body fields without clientSig: keyList, pubKey, msgHash, msgRaw, destinationChainID, purpose, extraJSON, proposalTxParams (batch), messageHashes/messageRawBatch when N>1 txs.";
|
|
156
|
-
};
|
|
157
|
-
readonly messageToSign: {
|
|
158
|
-
readonly type: "string";
|
|
159
|
-
readonly description: "JSON.stringify(bodyForSign) — exact string to sign before adding clientSig.";
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
managementSig: {
|
|
164
|
-
readonly description: "Management POST bodies embed NodeMgtKeySig: { nonce, clientSig, nodeKey }. Sign JSON with clientSig cleared; POST with clientSig set to the Ed25519 128-hex or EIP-191 signature. Legacy Nonce/Sig/sig field names are not accepted.";
|
|
165
|
-
readonly fields: {
|
|
166
|
-
readonly nonce: {
|
|
167
|
-
readonly type: "number";
|
|
168
|
-
readonly description: "From GET /getPublicMgtKeyNonce (Ed25519) or GET /getNodeMgtKeyNonce (Ethereum NodeMgtKey).";
|
|
169
|
-
};
|
|
170
|
-
readonly clientSig: {
|
|
171
|
-
readonly type: "string";
|
|
172
|
-
readonly description: "Management signature; empty string in the message to sign.";
|
|
173
|
-
};
|
|
174
|
-
readonly nodeKey: {
|
|
175
|
-
readonly type: "string";
|
|
176
|
-
readonly description: "Required. 128-hex MPC node id from GET /getNodeKey (no 0x prefix).";
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
readonly helpers: {
|
|
180
|
-
readonly managementSigFields: "Base envelope with clientSig cleared.";
|
|
181
|
-
readonly buildManagementPostBody: "Spread managementSigFields then endpoint fields.";
|
|
182
|
-
readonly messageToSignManagementBody: "Canonical JSON string to sign.";
|
|
183
|
-
readonly withManagementClientSig: "Attach signature to POST body.";
|
|
184
|
-
readonly fetchNodeKey: "GET /getNodeKey via nodeFetchWithReadAuth.";
|
|
185
|
-
readonly fetchManagementNonce: "GET nonce for Ed25519 or Ethereum management key.";
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
workflow: {
|
|
189
|
-
evmSwapTypical: string[];
|
|
190
|
-
managementPostTypical: string[];
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
export { EVM_COMMON_PARAM_DOCS, MANAGEMENT_SIG_DOC, MCP_TOOL_DEFINITIONS, MULTISIGN_OUTPUT_DOC, getAgentCatalog, getAgentCatalogForMcp, getMcpToolByName, getMcpToolDefinitions };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { b as EvmTxStep, a as EvmProtocolContext, E as EvmChainDetail } from '../../types-B8idm_gu.cjs';
|
|
2
|
-
export { i as isEvmNativeToken, m as matchEvmTokenKind } from '../../types-B8idm_gu.cjs';
|
|
3
|
-
export { P as ProposalTxParams, c as composeFeePayloadToTxParams, g as gasLimitFromEstimateAndChainConfig, p as proposalTxParamsToFeeSnapshot, r as routerSwapGasLimitFromEstimate, t as triggerTxParamsFromComposeBody } from '../../txParams-BC7ogvdR.cjs';
|
|
4
|
-
import { Address, PublicClient } from 'viem';
|
|
5
|
-
import { M as MultisignBuildResult } from '../../types-Ce2qNHai.cjs';
|
|
6
|
-
import { f as finalizeMultisign } from '../../envelope-DYDPnrHZ.cjs';
|
|
7
|
-
|
|
8
|
-
type EvmBatchMetaBuilder = (args: {
|
|
9
|
-
step: EvmTxStep;
|
|
10
|
-
index: number;
|
|
11
|
-
gasLimit: bigint;
|
|
12
|
-
}) => Record<string, unknown>;
|
|
13
|
-
type EvmBuildBatchArgs = {
|
|
14
|
-
context: EvmProtocolContext;
|
|
15
|
-
steps: EvmTxStep[];
|
|
16
|
-
purposeSuffix?: string;
|
|
17
|
-
buildBatchMeta: EvmBatchMetaBuilder;
|
|
18
|
-
/** First leg msgRaw without 0x prefix; defaults to first step calldata */
|
|
19
|
-
firstMsgRawNo0x?: string;
|
|
20
|
-
destinationAddress?: Address;
|
|
21
|
-
/** Top-level `value` on bodyForSign when the payable amount is not on the first leg */
|
|
22
|
-
payableValueWei?: bigint;
|
|
23
|
-
resolveGasLimit?: (args: {
|
|
24
|
-
step: EvmTxStep;
|
|
25
|
-
index: number;
|
|
26
|
-
estimatedGas: bigint;
|
|
27
|
-
publicClient: PublicClient;
|
|
28
|
-
}) => Promise<bigint> | bigint;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Build unsigned EVM txs, estimate gas, serialize, hash — then assemble mpc-auth body via core envelope.
|
|
32
|
-
*/
|
|
33
|
-
declare function buildEvmMultisignBatch(args: EvmBuildBatchArgs): Promise<MultisignBuildResult>;
|
|
34
|
-
declare const evmChainCategoryModule: {
|
|
35
|
-
category: "evm";
|
|
36
|
-
finalizeMultisign: typeof finalizeMultisign;
|
|
37
|
-
buildEvmMultisignBatch: typeof buildEvmMultisignBatch;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
interface ChainFeeParams {
|
|
41
|
-
isEip1559: boolean;
|
|
42
|
-
baseFeeGwei?: number;
|
|
43
|
-
priorityFeeGwei?: number;
|
|
44
|
-
gasPriceGwei?: number;
|
|
45
|
-
}
|
|
46
|
-
declare function fetchChainFeeParams(rpcUrl: string, chainId: number | string): Promise<ChainFeeParams>;
|
|
47
|
-
|
|
48
|
-
type ResolvedEip1559Fees = {
|
|
49
|
-
maxFeePerGas: bigint;
|
|
50
|
-
maxPriorityFeePerGas: bigint;
|
|
51
|
-
};
|
|
52
|
-
/** Align EIP-1559 fees with the latest head base fee (same rules as Get Sig). */
|
|
53
|
-
declare function alignEip1559FeesWithLatestBase(maxFeePerGas: bigint, maxPriorityFeePerGas: bigint, latestBlockBaseFeeWei: bigint): ResolvedEip1559Fees;
|
|
54
|
-
declare function gweiToDecimalString(n: number): string;
|
|
55
|
-
|
|
56
|
-
/** Snapshot chain gas config for extraJSON when Use Custom Gas is on. */
|
|
57
|
-
declare function chainSnapshotForCustomGasExtraJSON(chainDetail: EvmChainDetail): Record<string, unknown>;
|
|
58
|
-
|
|
59
|
-
/** Parse chain id for comparisons (decimal, 0x hex, CAIP-2 eip155:N, bigint). */
|
|
60
|
-
declare function parseEvmChainIdToNumber(chainId: string | number | bigint | null | undefined): number;
|
|
61
|
-
|
|
62
|
-
export { type ChainFeeParams, type EvmBatchMetaBuilder, type EvmBuildBatchArgs, EvmChainDetail, EvmProtocolContext, EvmTxStep, type ResolvedEip1559Fees, alignEip1559FeesWithLatestBase, buildEvmMultisignBatch, chainSnapshotForCustomGasExtraJSON, evmChainCategoryModule, fetchChainFeeParams, gweiToDecimalString, parseEvmChainIdToNumber };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { K as KeyGenSubset } from '../../types-Ce2qNHai.cjs';
|
|
2
|
-
|
|
3
|
-
type NearSigningDefaults = {
|
|
4
|
-
gasPriceYocto?: string;
|
|
5
|
-
};
|
|
6
|
-
type NearChainDetail = {
|
|
7
|
-
chainType: 'near';
|
|
8
|
-
chainId: string;
|
|
9
|
-
chainName: string;
|
|
10
|
-
rpcGateway: string;
|
|
11
|
-
endpointKind: 'json-rpc';
|
|
12
|
-
testnet: boolean;
|
|
13
|
-
nativeSymbol: string;
|
|
14
|
-
nativeDecimals: number;
|
|
15
|
-
signingDefaults?: NearSigningDefaults;
|
|
16
|
-
};
|
|
17
|
-
interface NearProtocolContext {
|
|
18
|
-
chainCategory: 'near';
|
|
19
|
-
chainId: string;
|
|
20
|
-
rpcGateway: string;
|
|
21
|
-
executorAddress: string;
|
|
22
|
-
chainDetail: NearChainDetail;
|
|
23
|
-
useCustomFees: boolean;
|
|
24
|
-
keyGen: KeyGenSubset;
|
|
25
|
-
purposeText: string;
|
|
26
|
-
}
|
|
27
|
-
declare class NotImplementedError extends Error {
|
|
28
|
-
constructor(feature: string);
|
|
29
|
-
}
|
|
30
|
-
declare function buildNearMultisignBatch(): Promise<never>;
|
|
31
|
-
declare const nearChainCategoryModule: {
|
|
32
|
-
category: "near";
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
declare const NEAR_CHAIN_CATEGORY: "near";
|
|
36
|
-
|
|
37
|
-
export { NEAR_CHAIN_CATEGORY, type NearChainDetail, type NearProtocolContext, type NearSigningDefaults, NotImplementedError, buildNearMultisignBatch, nearChainCategoryModule };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { K as KeyGenSubset } from '../../types-Ce2qNHai.cjs';
|
|
2
|
-
|
|
3
|
-
/** Solana signing defaults — mirrors app NonEvmChainDetailRow.signingDefaults. */
|
|
4
|
-
type SolanaSigningDefaults = {
|
|
5
|
-
commitment?: 'confirmed' | 'finalized';
|
|
6
|
-
computeUnitLimit?: number;
|
|
7
|
-
priorityFeeMicroLamports?: number;
|
|
8
|
-
};
|
|
9
|
-
type SolanaChainDetail = {
|
|
10
|
-
chainType: 'solana';
|
|
11
|
-
chainId: string;
|
|
12
|
-
chainName: string;
|
|
13
|
-
rpcGateway: string;
|
|
14
|
-
endpointKind: 'json-rpc';
|
|
15
|
-
testnet: boolean;
|
|
16
|
-
nativeSymbol: string;
|
|
17
|
-
nativeDecimals: number;
|
|
18
|
-
signingDefaults?: SolanaSigningDefaults;
|
|
19
|
-
};
|
|
20
|
-
interface SolanaProtocolContext {
|
|
21
|
-
chainCategory: 'solana';
|
|
22
|
-
chainId: string;
|
|
23
|
-
rpcGateway: string;
|
|
24
|
-
executorAddress: string;
|
|
25
|
-
chainDetail: SolanaChainDetail;
|
|
26
|
-
useCustomFees: boolean;
|
|
27
|
-
keyGen: KeyGenSubset;
|
|
28
|
-
purposeText: string;
|
|
29
|
-
}
|
|
30
|
-
declare class NotImplementedError extends Error {
|
|
31
|
-
constructor(feature: string);
|
|
32
|
-
}
|
|
33
|
-
declare function buildSolanaMultisignBatch(): Promise<never>;
|
|
34
|
-
declare const solanaChainCategoryModule: {
|
|
35
|
-
category: "solana";
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
declare const SOLANA_CHAIN_CATEGORY: "solana";
|
|
39
|
-
|
|
40
|
-
export { NotImplementedError, SOLANA_CHAIN_CATEGORY, type SolanaChainDetail, type SolanaProtocolContext, type SolanaSigningDefaults, buildSolanaMultisignBatch, solanaChainCategoryModule };
|
package/dist/core/index.d.cts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export { C as ChainCategory, a as ChainSupportContext, E as EvmTokenKind, K as KeyGenSubset, M as MultisignBuildResult, b as MultisignCommonArgs, N as NearTokenKind, P as ParamDoc, c as ProtocolActionDescriptor, d as ProtocolModule, S as SolanaTokenKind, T as TokenRef } from '../types-Ce2qNHai.cjs';
|
|
2
|
-
export { K as KeyGenSubsetForPermit, f as firstClientIdFromKeyGen, k as keyListFromKeyGen, r as requirePubKeyHex } from '../keygen-CfNp8yKJ.cjs';
|
|
3
|
-
export { C as ChainCategoryBuildInput, a as ChainCategoryModule, M as MultisignLeg, c as coreChainCategoryModule, f as finalizeMultisign } from '../envelope-DYDPnrHZ.cjs';
|
|
4
|
-
export { g as getActionsByChainCategory, a as getProtocolModule, b as getProtocolModules, r as registerProtocolModule } from '../registry-BwZoE668.cjs';
|
|
5
|
-
import { N as NodeReadAuth } from '../nodeRead-BnmSaMGO.cjs';
|
|
6
|
-
export { n as nodeFetchWithReadAuth } from '../nodeRead-BnmSaMGO.cjs';
|
|
7
|
-
|
|
8
|
-
/** Merge user purpose text with an optional batch / protocol suffix. */
|
|
9
|
-
declare function mergePurposeText(purposeText: string, purposeSuffix?: string): string;
|
|
10
|
-
|
|
11
|
-
/** mpc-auth NodeMgtKeySig envelope: `{ nonce, clientSig, nodeKey }` (all lowercase). */
|
|
12
|
-
type ManagementSigFields = {
|
|
13
|
-
nonce: number;
|
|
14
|
-
clientSig: string;
|
|
15
|
-
nodeKey: string;
|
|
16
|
-
};
|
|
17
|
-
declare function normalizeManagementNodeKey(nodeKey: string | null | undefined): string;
|
|
18
|
-
/** Base fields for NodeMgtKeySig-style POST bodies (`clientSig` cleared for signing). */
|
|
19
|
-
declare function managementSigFields(nonce: number, nodeKey: string | null | undefined): ManagementSigFields;
|
|
20
|
-
/** Spread management fields first, then endpoint-specific fields (preserves key order when spreading). */
|
|
21
|
-
declare function buildManagementPostBody(nonce: number, nodeKey: string | null | undefined, fields?: Record<string, unknown>): Record<string, unknown>;
|
|
22
|
-
/** Exact UTF-8 string to sign: same JSON with `clientSig` cleared. */
|
|
23
|
-
declare function messageToSignManagementBody(body: Record<string, unknown>): string;
|
|
24
|
-
declare function withManagementClientSig(body: Record<string, unknown>, clientSig: string): Record<string, unknown>;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* GET /getNodeKey — 128-hex MPC node id required on all NodeMgtKeySig POST bodies.
|
|
28
|
-
*/
|
|
29
|
-
declare function fetchNodeKey(nodeUrl: string, readAuth?: NodeReadAuth): Promise<{
|
|
30
|
-
nodeKey: string;
|
|
31
|
-
ok: boolean;
|
|
32
|
-
}>;
|
|
33
|
-
/**
|
|
34
|
-
* Fetch management nonce: GET /getPublicMgtKeyNonce (Ed25519) or GET /getNodeMgtKeyNonce (Ethereum NodeMgtKey).
|
|
35
|
-
* For Ed25519 added keys, pass `?publicKey=<64-hex>`.
|
|
36
|
-
*/
|
|
37
|
-
declare function fetchManagementNonce(nodeUrl: string, useEd25519: boolean, ed25519PublicKey?: string, readAuth?: NodeReadAuth): Promise<{
|
|
38
|
-
nonce: number;
|
|
39
|
-
ok: boolean;
|
|
40
|
-
code: number;
|
|
41
|
-
}>;
|
|
42
|
-
|
|
43
|
-
export { type ManagementSigFields, NodeReadAuth, buildManagementPostBody, fetchManagementNonce, fetchNodeKey, managementSigFields, mergePurposeText, messageToSignManagementBody, normalizeManagementNodeKey, withManagementClientSig };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { K as KeyGenSubset, C as ChainCategory, M as MultisignBuildResult } from './types-Ce2qNHai.cjs';
|
|
2
|
-
|
|
3
|
-
interface MultisignLeg {
|
|
4
|
-
msgHash: string;
|
|
5
|
-
msgRaw: string;
|
|
6
|
-
destinationAddress: string;
|
|
7
|
-
signatureText: string;
|
|
8
|
-
audit: Record<string, unknown>;
|
|
9
|
-
feeSnapshot: Record<string, unknown>;
|
|
10
|
-
proposalTxParams?: Record<string, unknown>;
|
|
11
|
-
/** Payable value wei string for first leg only when relevant */
|
|
12
|
-
valueWei?: bigint;
|
|
13
|
-
}
|
|
14
|
-
interface ChainCategoryBuildInput {
|
|
15
|
-
keyGen: KeyGenSubset;
|
|
16
|
-
purposeText: string;
|
|
17
|
-
purposeSuffix?: string;
|
|
18
|
-
destinationChainID: string;
|
|
19
|
-
legs: MultisignLeg[];
|
|
20
|
-
extraJSON?: Record<string, unknown>;
|
|
21
|
-
/** Top-level destination address (first leg destination if omitted) */
|
|
22
|
-
destinationAddress?: string;
|
|
23
|
-
}
|
|
24
|
-
interface ChainCategoryModule {
|
|
25
|
-
category: ChainCategory;
|
|
26
|
-
finalizeMultisign(input: ChainCategoryBuildInput): MultisignBuildResult;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Assemble mpc-auth `bodyForSign` from category-built legs.
|
|
30
|
-
* Supports single-tx and batch (messageHashes / messageRawBatch / proposalTxParams).
|
|
31
|
-
*/
|
|
32
|
-
declare function finalizeMultisign(input: ChainCategoryBuildInput): MultisignBuildResult;
|
|
33
|
-
declare const coreChainCategoryModule: ChainCategoryModule;
|
|
34
|
-
|
|
35
|
-
export { type ChainCategoryBuildInput as C, type MultisignLeg as M, type ChainCategoryModule as a, coreChainCategoryModule as c, finalizeMultisign as f };
|
package/dist/index.d.cts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { C as ChainCategory, a as ChainSupportContext, E as EvmTokenKind, K as KeyGenSubset, M as MultisignBuildResult, b as MultisignCommonArgs, N as NearTokenKind, P as ParamDoc, c as ProtocolActionDescriptor, d as ProtocolModule, S as SolanaTokenKind, T as TokenRef } from './types-Ce2qNHai.cjs';
|
|
2
|
-
export { K as KeyGenSubsetForPermit, f as firstClientIdFromKeyGen, k as keyListFromKeyGen, r as requirePubKeyHex } from './keygen-CfNp8yKJ.cjs';
|
|
3
|
-
export { ManagementSigFields, buildManagementPostBody, fetchManagementNonce, fetchNodeKey, managementSigFields, mergePurposeText, messageToSignManagementBody, normalizeManagementNodeKey, withManagementClientSig } from './core/index.cjs';
|
|
4
|
-
export { C as ChainCategoryBuildInput, a as ChainCategoryModule, M as MultisignLeg, c as coreChainCategoryModule, f as finalizeMultisign } from './envelope-DYDPnrHZ.cjs';
|
|
5
|
-
export { g as getActionsByChainCategory, a as getProtocolModule, b as getProtocolModules, r as registerProtocolModule } from './registry-BwZoE668.cjs';
|
|
6
|
-
export { N as NodeReadAuth, n as nodeFetchWithReadAuth } from './nodeRead-BnmSaMGO.cjs';
|
|
7
|
-
export { E as EvmChainDetail, a as EvmProtocolContext, b as EvmTxStep, i as isEvmNativeToken, m as matchEvmTokenKind } from './types-B8idm_gu.cjs';
|
|
8
|
-
export { P as ProposalTxParams, c as composeFeePayloadToTxParams, g as gasLimitFromEstimateAndChainConfig, p as proposalTxParamsToFeeSnapshot, r as routerSwapGasLimitFromEstimate, t as triggerTxParamsFromComposeBody } from './txParams-BC7ogvdR.cjs';
|
|
9
|
-
export { ChainFeeParams, EvmBatchMetaBuilder, EvmBuildBatchArgs, ResolvedEip1559Fees, alignEip1559FeesWithLatestBase, buildEvmMultisignBatch, chainSnapshotForCustomGasExtraJSON, evmChainCategoryModule, fetchChainFeeParams, gweiToDecimalString, parseEvmChainIdToNumber } from './chains/evm/index.cjs';
|
|
10
|
-
export { SOLANA_CHAIN_CATEGORY, solanaChainCategoryModule } from './chains/solana/index.cjs';
|
|
11
|
-
export { NEAR_CHAIN_CATEGORY, nearChainCategoryModule } from './chains/near/index.cjs';
|
|
12
|
-
export { getAgentCatalog } from './agent/catalog.cjs';
|
|
13
|
-
export { uniswapV4, uniswapV4ProtocolModule } from './protocols/evm/uniswap-v4/index.cjs';
|
|
14
|
-
export { curveDao, curveDaoProtocolModule } from './protocols/evm/curve-dao/index.cjs';
|
|
15
|
-
import 'viem';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { K as KeyGenSubset } from './types-Ce2qNHai.cjs';
|
|
2
|
-
|
|
3
|
-
/** App-compatible alias used by existing multisign builders. */
|
|
4
|
-
type KeyGenSubsetForPermit = KeyGenSubset;
|
|
5
|
-
declare function firstClientIdFromKeyGen(data: KeyGenSubset | null | undefined): string | null;
|
|
6
|
-
declare function requirePubKeyHex(keyGen: KeyGenSubset): string;
|
|
7
|
-
declare function keyListFromKeyGen(keyGen: KeyGenSubset): string[];
|
|
8
|
-
|
|
9
|
-
export { type KeyGenSubsetForPermit as K, firstClientIdFromKeyGen as f, keyListFromKeyGen as k, requirePubKeyHex as r };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { K as KeyGenSubset } from './types-Ce2qNHai.js';
|
|
2
|
-
|
|
3
|
-
/** App-compatible alias used by existing multisign builders. */
|
|
4
|
-
type KeyGenSubsetForPermit = KeyGenSubset;
|
|
5
|
-
declare function firstClientIdFromKeyGen(data: KeyGenSubset | null | undefined): string | null;
|
|
6
|
-
declare function requirePubKeyHex(keyGen: KeyGenSubset): string;
|
|
7
|
-
declare function keyListFromKeyGen(keyGen: KeyGenSubset): string[];
|
|
8
|
-
|
|
9
|
-
export { type KeyGenSubsetForPermit as K, firstClientIdFromKeyGen as f, keyListFromKeyGen as k, requirePubKeyHex as r };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** GET requests to mpc-auth management node with optional Bearer JWT (Browser HTTPS). */
|
|
2
|
-
type NodeReadAuth = {
|
|
3
|
-
bearerOnGet: boolean;
|
|
4
|
-
jwt: string | null;
|
|
5
|
-
};
|
|
6
|
-
declare function nodeFetchWithReadAuth(url: string, init: RequestInit | undefined, auth: NodeReadAuth): Promise<Response>;
|
|
7
|
-
|
|
8
|
-
export { type NodeReadAuth as N, nodeFetchWithReadAuth as n };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** GET requests to mpc-auth management node with optional Bearer JWT (Browser HTTPS). */
|
|
2
|
-
type NodeReadAuth = {
|
|
3
|
-
bearerOnGet: boolean;
|
|
4
|
-
jwt: string | null;
|
|
5
|
-
};
|
|
6
|
-
declare function nodeFetchWithReadAuth(url: string, init: RequestInit | undefined, auth: NodeReadAuth): Promise<Response>;
|
|
7
|
-
|
|
8
|
-
export { type NodeReadAuth as N, nodeFetchWithReadAuth as n };
|