@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.
- package/README.md +20 -78
- package/dist/agent/catalog.cjs +563 -5
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +166 -20
- package/dist/agent/catalog.js +551 -7
- 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 +13 -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 +79 -224
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.d.ts +26 -26
- package/dist/chains/evm/index.js +69 -209
- 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 +68 -106
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +21 -36
- package/dist/core/index.js +57 -96
- 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 +356 -1855
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -11
- package/dist/index.js +332 -1826
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +1152 -669
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.d.ts +418 -3
- package/dist/protocols/evm/aave-v4/index.js +1126 -670
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +257 -131
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.d.ts +69 -5
- package/dist/protocols/evm/curve-dao/index.js +242 -124
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +394 -402
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.d.ts +47 -3
- package/dist/protocols/evm/ethena/index.js +390 -404
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +2810 -1191
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.d.ts +465 -3
- package/dist/protocols/evm/euler-v2/index.js +2761 -1192
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +351 -236
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.d.ts +34 -4
- package/dist/protocols/evm/lido/index.js +348 -238
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +390 -395
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.d.ts +23 -3
- package/dist/protocols/evm/maple/index.js +390 -397
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs +454 -232
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.d.ts +57 -3
- package/dist/protocols/evm/sky/index.js +444 -231
- package/dist/protocols/evm/sky/index.js.map +1 -1
- 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 +7 -6
- package/dist/agent/catalog.d.cts +0 -939
- package/dist/chains/evm/index.d.cts +0 -64
- 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 -16
- 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/aave-v4/index.d.cts +0 -500
- package/dist/protocols/evm/curve-dao/index.d.cts +0 -147
- package/dist/protocols/evm/ethena/index.d.cts +0 -161
- package/dist/protocols/evm/euler-v2/index.d.cts +0 -317
- package/dist/protocols/evm/lido/index.d.cts +0 -120
- package/dist/protocols/evm/maple/index.d.cts +0 -109
- package/dist/protocols/evm/sky/index.d.cts +0 -218
- 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
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @continuumdao/ctm-mpc-defi
|
|
2
2
|
|
|
3
|
-
Continuum MPC DeFi protocol library — builds **multiSignRequest** payloads for EVM (and future chain categories).
|
|
3
|
+
Continuum MPC DeFi protocol library — builds **multiSignRequest** payloads for EVM (and future chain categories). Bundled into the **continuum-mcp-server** Docker image; linked locally via `file:../ctm-mpc-defi`.
|
|
4
4
|
|
|
5
5
|
**License:** [Business Source License 1.1](LICENSE) (ContinuumDAO). Converts to GPL-3.0-or-later on 2030-01-01.
|
|
6
6
|
|
|
@@ -8,92 +8,55 @@ Continuum MPC DeFi protocol library — builds **multiSignRequest** payloads for
|
|
|
8
8
|
|
|
9
9
|
| Layer | Path | Role |
|
|
10
10
|
|-------|------|------|
|
|
11
|
-
| Core | `src/core/` |
|
|
12
|
-
| Chain categories | `src/chains/<category>/` | EVM batch builder
|
|
11
|
+
| Core | `src/core/` | Purpose text, mpc-auth envelope, protocol registry |
|
|
12
|
+
| Chain categories | `src/chains/<category>/` | EVM batch builder; Solana/NEAR stubs |
|
|
13
13
|
| Protocols | `src/protocols/<category>/<name>/` | DeFi actions (Uniswap V4, Curve DAO, …) |
|
|
14
|
+
| Agent | `src/agent/` | MCP tool catalog, SKILL.md, support advisors |
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
Management reads, fee helpers, and client-sign utilities live in **`@continuumdao/continuum-node-sdk`** — import those from the SDK, not from this package.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
npm install @continuumdao/ctm-mpc-defi viem
|
|
19
|
-
```
|
|
18
|
+
## Install
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
This package is published to npm for production deploys (e.g. Railway). For local development against unreleased changes, use a `file:` link:
|
|
22
21
|
|
|
23
22
|
```json
|
|
24
23
|
"@continuumdao/ctm-mpc-defi": "file:../ctm-mpc-defi"
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
Run `npm run build` in this repo after changes so `dist/` is up to date.
|
|
26
|
+
Run `npm run build` in this repo after changes so `dist/` is up to date before linking.
|
|
28
27
|
|
|
29
28
|
## Package exports
|
|
30
29
|
|
|
31
|
-
- `@continuumdao/ctm-mpc-defi` —
|
|
32
|
-
- `@continuumdao/ctm-mpc-defi/core`
|
|
33
|
-
- `@continuumdao/ctm-mpc-defi/chains/evm`
|
|
34
|
-
- `@continuumdao/ctm-mpc-defi/protocols/evm
|
|
35
|
-
- `@continuumdao/ctm-mpc-defi/
|
|
36
|
-
- `@continuumdao/ctm-mpc-defi/agent` — action catalog for agents
|
|
30
|
+
- `@continuumdao/ctm-mpc-defi` — registry + protocol modules
|
|
31
|
+
- `@continuumdao/ctm-mpc-defi/core` — envelope, registry, `KeyGenSubset`, `firstClientIdFromKeyGen`
|
|
32
|
+
- `@continuumdao/ctm-mpc-defi/chains/evm` — `buildEvmMultisignBatch`, chain helpers
|
|
33
|
+
- `@continuumdao/ctm-mpc-defi/protocols/evm/<protocol>` — per-protocol builders
|
|
34
|
+
- `@continuumdao/ctm-mpc-defi/agent` — MCP tool catalog and SKILL.md paths
|
|
37
35
|
|
|
38
|
-
##
|
|
36
|
+
## Protocol example (Uniswap V4)
|
|
39
37
|
|
|
40
38
|
```typescript
|
|
41
39
|
import { uniswapV4 } from '@continuumdao/ctm-mpc-defi/protocols/evm/uniswap-v4'
|
|
42
40
|
|
|
43
|
-
const quote = await uniswapV4.quote({
|
|
44
|
-
type: 'EXACT_INPUT',
|
|
45
|
-
amount: '1000000',
|
|
46
|
-
tokenIn: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
|
|
47
|
-
tokenOut: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
48
|
-
chainId: 1,
|
|
49
|
-
uniswapApiKey: process.env.UNISWAP_API_KEY!,
|
|
50
|
-
swapper: '0xYourMpcExecutor',
|
|
51
|
-
})
|
|
52
|
-
|
|
41
|
+
const quote = await uniswapV4.quote({ /* … */ })
|
|
53
42
|
const { bodyForSign, messageToSign } = await uniswapV4.buildSwapMultisignBody({ /* … */ })
|
|
54
43
|
// Sign messageToSign, POST { ...bodyForSign, clientSig, signedMessage }
|
|
55
|
-
|
|
56
|
-
// Management POST routes (Get Sig, shelve, keyGen, …) use NodeMgtKeySig:
|
|
57
|
-
import {
|
|
58
|
-
buildManagementPostBody,
|
|
59
|
-
fetchManagementNonce,
|
|
60
|
-
fetchNodeKey,
|
|
61
|
-
messageToSignManagementBody,
|
|
62
|
-
withManagementClientSig,
|
|
63
|
-
} from '@continuumdao/ctm-mpc-defi/core'
|
|
64
|
-
|
|
65
|
-
const { nodeKey } = await fetchNodeKey(managementNodeUrl)
|
|
66
|
-
const { nonce } = await fetchManagementNonce(managementNodeUrl, true, ed25519PublicKey)
|
|
67
|
-
const body = buildManagementPostBody(nonce, nodeKey, { requestId: '…' })
|
|
68
|
-
const messageToSign = messageToSignManagementBody(body)
|
|
69
|
-
// sign messageToSign → POST with withManagementClientSig(body, sig)
|
|
70
44
|
```
|
|
71
45
|
|
|
72
|
-
##
|
|
46
|
+
## MCP servers
|
|
73
47
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
```typescript
|
|
77
|
-
import { getAgentCatalog } from '@continuumdao/ctm-mpc-defi/agent'
|
|
78
|
-
console.log(getAgentCatalog().byCategory.evm)
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
**MCP servers** should use the richer tool definitions (descriptions, input/output schema, handler mapping, prerequisites):
|
|
48
|
+
Use the agent export for tool registration and discovery:
|
|
82
49
|
|
|
83
50
|
```typescript
|
|
84
51
|
import { getMcpToolDefinitions, getAgentCatalogForMcp } from '@continuumdao/ctm-mpc-defi/agent'
|
|
85
52
|
|
|
86
53
|
for (const tool of getMcpToolDefinitions()) {
|
|
87
|
-
// Register
|
|
88
|
-
//
|
|
54
|
+
// Register tool.name, tool.description, tool.inputSchema, tool.outputSchema
|
|
55
|
+
// Invoke via tool.handler.importPath + exportName
|
|
89
56
|
}
|
|
90
57
|
```
|
|
91
58
|
|
|
92
|
-
Each MCP tool includes
|
|
93
|
-
- Long `description` (what it does and does not do)
|
|
94
|
-
- `inputSchema` / `outputSchema` (including `MultisignBuildResult` for sign builders)
|
|
95
|
-
- `prerequisites` / `followUp` (typical quote → swap → multisign → sign → POST flow)
|
|
96
|
-
- `handler`: `{ importPath, exportName }` pointing at the library export to call
|
|
59
|
+
Each MCP tool includes descriptions, Zod-derived JSON schemas, prerequisites/followUp hints, and a handler pointing at the library export. The continuum-node-sdk MCP server enriches slim inputs (`keyGenId`, `chainId`) before calling builders.
|
|
97
60
|
|
|
98
61
|
## Development
|
|
99
62
|
|
|
@@ -103,24 +66,3 @@ npm run build
|
|
|
103
66
|
npm test
|
|
104
67
|
npm run typecheck
|
|
105
68
|
```
|
|
106
|
-
|
|
107
|
-
## Publish (npm)
|
|
108
|
-
|
|
109
|
-
Scoped package for the [ContinuumDAO npm org](https://www.npmjs.com/org/continuumdao):
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
npm login
|
|
113
|
-
npm publish
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Install in consumers:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
npm install @continuumdao/ctm-mpc-defi
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
For local development against the sibling repo:
|
|
123
|
-
|
|
124
|
-
```json
|
|
125
|
-
"@continuumdao/ctm-mpc-defi": "file:../ctm-mpc-defi"
|
|
126
|
-
```
|