@continuumdao/ctm-mpc-defi 0.1.3 → 0.2.0

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 (68) hide show
  1. package/README.md +16 -1
  2. package/dist/agent/catalog.cjs +913 -142
  3. package/dist/agent/catalog.cjs.map +1 -1
  4. package/dist/agent/catalog.d.cts +834 -12
  5. package/dist/agent/catalog.d.ts +834 -12
  6. package/dist/agent/catalog.js +863 -143
  7. package/dist/agent/catalog.js.map +1 -1
  8. package/dist/chains/evm/index.cjs +13 -0
  9. package/dist/chains/evm/index.cjs.map +1 -1
  10. package/dist/chains/evm/index.d.cts +3 -1
  11. package/dist/chains/evm/index.d.ts +3 -1
  12. package/dist/chains/evm/index.js +13 -1
  13. package/dist/chains/evm/index.js.map +1 -1
  14. package/dist/core/index.cjs +76 -0
  15. package/dist/core/index.cjs.map +1 -1
  16. package/dist/core/index.d.cts +35 -2
  17. package/dist/core/index.d.ts +35 -2
  18. package/dist/core/index.js +70 -1
  19. package/dist/core/index.js.map +1 -1
  20. package/dist/index.cjs +934 -141
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +3 -2
  23. package/dist/index.d.ts +3 -2
  24. package/dist/index.js +927 -142
  25. package/dist/index.js.map +1 -1
  26. package/dist/protocols/evm/aave-v4/index.cjs +1987 -0
  27. package/dist/protocols/evm/aave-v4/index.cjs.map +1 -0
  28. package/dist/protocols/evm/aave-v4/index.d.cts +500 -0
  29. package/dist/protocols/evm/aave-v4/index.d.ts +500 -0
  30. package/dist/protocols/evm/aave-v4/index.js +1943 -0
  31. package/dist/protocols/evm/aave-v4/index.js.map +1 -0
  32. package/dist/protocols/evm/ethena/index.cjs +965 -0
  33. package/dist/protocols/evm/ethena/index.cjs.map +1 -0
  34. package/dist/protocols/evm/ethena/index.d.cts +161 -0
  35. package/dist/protocols/evm/ethena/index.d.ts +161 -0
  36. package/dist/protocols/evm/ethena/index.js +943 -0
  37. package/dist/protocols/evm/ethena/index.js.map +1 -0
  38. package/dist/protocols/evm/euler-v2/index.cjs +2263 -0
  39. package/dist/protocols/evm/euler-v2/index.cjs.map +1 -0
  40. package/dist/protocols/evm/euler-v2/index.d.cts +317 -0
  41. package/dist/protocols/evm/euler-v2/index.d.ts +317 -0
  42. package/dist/protocols/evm/euler-v2/index.js +2238 -0
  43. package/dist/protocols/evm/euler-v2/index.js.map +1 -0
  44. package/dist/protocols/evm/lido/index.cjs +834 -0
  45. package/dist/protocols/evm/lido/index.cjs.map +1 -0
  46. package/dist/protocols/evm/lido/index.d.cts +120 -0
  47. package/dist/protocols/evm/lido/index.d.ts +120 -0
  48. package/dist/protocols/evm/lido/index.js +809 -0
  49. package/dist/protocols/evm/lido/index.js.map +1 -0
  50. package/dist/protocols/evm/maple/index.cjs +707 -0
  51. package/dist/protocols/evm/maple/index.cjs.map +1 -0
  52. package/dist/protocols/evm/maple/index.d.cts +109 -0
  53. package/dist/protocols/evm/maple/index.d.ts +109 -0
  54. package/dist/protocols/evm/maple/index.js +693 -0
  55. package/dist/protocols/evm/maple/index.js.map +1 -0
  56. package/dist/protocols/evm/sky/index.cjs +1254 -0
  57. package/dist/protocols/evm/sky/index.cjs.map +1 -0
  58. package/dist/protocols/evm/sky/index.d.cts +218 -0
  59. package/dist/protocols/evm/sky/index.d.ts +218 -0
  60. package/dist/protocols/evm/sky/index.js +1229 -0
  61. package/dist/protocols/evm/sky/index.js.map +1 -0
  62. package/dist/protocols/evm/uniswap-v4/index.cjs +31 -11
  63. package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
  64. package/dist/protocols/evm/uniswap-v4/index.d.cts +2 -1
  65. package/dist/protocols/evm/uniswap-v4/index.d.ts +2 -1
  66. package/dist/protocols/evm/uniswap-v4/index.js +31 -11
  67. package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
  68. package/package.json +37 -3
package/dist/index.cjs CHANGED
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var viem = require('viem');
4
+ var zodToJsonSchema = require('zod-to-json-schema');
5
+ var zod = require('zod');
4
6
 
5
7
  // src/core/keygen.ts
6
8
  function firstClientIdFromKeyGen(data) {
@@ -114,6 +116,75 @@ function nodeFetchWithReadAuth(url, init, auth) {
114
116
  }
115
117
  return fetch(url, { ...init, headers });
116
118
  }
119
+
120
+ // src/core/managementPostSig.ts
121
+ function normalizeManagementNodeKey(nodeKey) {
122
+ const nk = nodeKey?.trim().replace(/^0x/i, "");
123
+ if (!nk || !/^[0-9a-fA-F]{128}$/.test(nk)) {
124
+ throw new Error("nodeKey is required (128 hex from GET /getNodeKey).");
125
+ }
126
+ return nk.toLowerCase();
127
+ }
128
+ function managementSigFields(nonce, nodeKey) {
129
+ return { nonce, clientSig: "", nodeKey: normalizeManagementNodeKey(nodeKey) };
130
+ }
131
+ function buildManagementPostBody(nonce, nodeKey, fields = {}) {
132
+ return { ...managementSigFields(nonce, nodeKey), ...fields };
133
+ }
134
+ function messageToSignManagementBody(body) {
135
+ return JSON.stringify({ ...body, clientSig: "" });
136
+ }
137
+ function withManagementClientSig(body, clientSig) {
138
+ return { ...body, clientSig: clientSig.trim().replace(/^0x/i, "") };
139
+ }
140
+
141
+ // src/core/managementNonce.ts
142
+ function mpcAuthData(raw) {
143
+ const code = raw.Code ?? raw.code;
144
+ if (code !== 0 && code !== void 0) return void 0;
145
+ return raw.Data ?? raw.data;
146
+ }
147
+ async function fetchNodeKey(nodeUrl, readAuth = { bearerOnGet: false, jwt: null }) {
148
+ const base = nodeUrl.trim().replace(/\/$/, "");
149
+ const res = await nodeFetchWithReadAuth(`${base}/getNodeKey`, { cache: "no-store" }, readAuth);
150
+ const text = await res.text();
151
+ let raw;
152
+ try {
153
+ raw = JSON.parse(text);
154
+ } catch {
155
+ return { nodeKey: "", ok: false };
156
+ }
157
+ const data = mpcAuthData(raw);
158
+ const nk = typeof data === "string" ? data : data != null && typeof data === "object" && !Array.isArray(data) ? String(data.nodeKey ?? data.NodeKey ?? "") : data != null ? String(data) : "";
159
+ const trimmed = nk.trim().replace(/^0x/i, "");
160
+ if (!/^[0-9a-fA-F]{128}$/.test(trimmed)) {
161
+ return { nodeKey: "", ok: false };
162
+ }
163
+ return { nodeKey: trimmed.toLowerCase(), ok: res.ok };
164
+ }
165
+ async function fetchManagementNonce(nodeUrl, useEd25519, ed25519PublicKey, readAuth = { bearerOnGet: false, jwt: null }) {
166
+ const base = nodeUrl.trim().replace(/\/$/, "");
167
+ const path = useEd25519 ? "/getPublicMgtKeyNonce" : "/getNodeMgtKeyNonce";
168
+ const url = useEd25519 && ed25519PublicKey && /^[0-9a-fA-F]{64}$/.test(ed25519PublicKey.trim()) ? `${base}${path}?publicKey=${encodeURIComponent(ed25519PublicKey.trim())}` : `${base}${path}`;
169
+ const res = await nodeFetchWithReadAuth(url, { cache: "no-store" }, readAuth);
170
+ const text = await res.text();
171
+ let raw;
172
+ try {
173
+ raw = JSON.parse(text);
174
+ } catch {
175
+ return { nonce: 0, ok: false, code: -1 };
176
+ }
177
+ const code = raw.Code ?? raw.code;
178
+ const payload = mpcAuthData(raw) ?? raw.Data ?? raw.data;
179
+ let nonce = 0;
180
+ if (typeof payload === "number" && !Number.isNaN(payload)) {
181
+ nonce = payload;
182
+ } else if (payload && typeof payload === "object") {
183
+ const n = payload.nonce ?? payload.Nonce;
184
+ nonce = typeof n === "number" && !Number.isNaN(n) ? n : Number(n) || 0;
185
+ }
186
+ return { nonce, ok: res.ok && (code === 0 || code === void 0), code: code ?? -1 };
187
+ }
117
188
  function isEvmNativeToken(address) {
118
189
  try {
119
190
  return viem.getAddress(address) === viem.zeroAddress;
@@ -496,6 +567,18 @@ function parseEvmChainIdToNumber(chainId) {
496
567
  return Number.parseInt(t, 10);
497
568
  }
498
569
 
570
+ // src/chains/evm/rpcUrl.ts
571
+ function isValidRpcUrl(url) {
572
+ const t = url.trim();
573
+ if (!t) return false;
574
+ try {
575
+ const u = new URL(t);
576
+ return u.protocol === "http:" || u.protocol === "https:";
577
+ } catch {
578
+ return false;
579
+ }
580
+ }
581
+
499
582
  // src/chains/solana/types.ts
500
583
  var solanaChainCategoryModule = {
501
584
  category: "solana"
@@ -2221,46 +2304,606 @@ var MULTISIGN_OUTPUT_DOC = {
2221
2304
  }
2222
2305
  }
2223
2306
  };
2224
-
2225
- // src/agent/mcpTools.ts
2226
- function paramProperties(params, includeCommon = []) {
2227
- const out = {};
2228
- for (const k of includeCommon) {
2229
- const d = EVM_COMMON_PARAM_DOCS[k];
2230
- if (d) out[k] = { type: d.type, description: d.description };
2231
- }
2232
- for (const [k, d] of Object.entries(params)) {
2233
- out[k] = { type: d.type, description: d.description };
2234
- }
2235
- return out;
2236
- }
2237
- function requiredKeys(params, includeCommon = []) {
2238
- const req = [];
2239
- for (const k of includeCommon) {
2240
- if (EVM_COMMON_PARAM_DOCS[k]?.required) req.push(k);
2241
- }
2242
- for (const [k, d] of Object.entries(params)) {
2243
- if (d.required) req.push(k);
2244
- }
2245
- return req;
2246
- }
2247
- var multisignOutputSchema = {
2248
- type: "object",
2249
- description: MULTISIGN_OUTPUT_DOC.description,
2250
- properties: {
2251
- bodyForSign: {
2252
- type: "object",
2253
- description: MULTISIGN_OUTPUT_DOC.fields.bodyForSign.description
2307
+ var MANAGEMENT_SIG_DOC = {
2308
+ 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.",
2309
+ fields: {
2310
+ nonce: {
2311
+ type: "number",
2312
+ description: "From GET /getPublicMgtKeyNonce (Ed25519) or GET /getNodeMgtKeyNonce (Ethereum NodeMgtKey)."
2254
2313
  },
2255
- messageToSign: {
2314
+ clientSig: {
2315
+ type: "string",
2316
+ description: "Management signature; empty string in the message to sign."
2317
+ },
2318
+ nodeKey: {
2256
2319
  type: "string",
2257
- description: MULTISIGN_OUTPUT_DOC.fields.messageToSign.description
2320
+ description: "Required. 128-hex MPC node id from GET /getNodeKey (no 0x prefix)."
2258
2321
  }
2259
2322
  },
2260
- required: ["bodyForSign", "messageToSign"]
2323
+ helpers: {
2324
+ managementSigFields: "Base envelope with clientSig cleared.",
2325
+ buildManagementPostBody: "Spread managementSigFields then endpoint fields.",
2326
+ messageToSignManagementBody: "Canonical JSON string to sign.",
2327
+ withManagementClientSig: "Attach signature to POST body.",
2328
+ fetchNodeKey: "GET /getNodeKey via nodeFetchWithReadAuth.",
2329
+ fetchManagementNonce: "GET nonce for Ed25519 or Ethereum management key."
2330
+ }
2261
2331
  };
2262
- var MCP_TOOL_DEFINITIONS = [
2263
- {
2332
+ function zodSchemaToMcpJsonSchema(schema) {
2333
+ const raw = zodToJsonSchema.zodToJsonSchema(schema, {
2334
+ target: "openApi3",
2335
+ $refStrategy: "none"
2336
+ });
2337
+ if (raw.type === "object" || raw.type === "array" || raw.type === "string") {
2338
+ const { $schema: _s, ...rest } = raw;
2339
+ return rest;
2340
+ }
2341
+ const defs = raw.definitions;
2342
+ if (defs) {
2343
+ const first = Object.values(defs)[0];
2344
+ if (first?.type) {
2345
+ const { $schema: _s, ...rest } = first;
2346
+ return rest;
2347
+ }
2348
+ }
2349
+ return raw;
2350
+ }
2351
+ var evmAddressSchema = zod.z.string().min(1).describe("EVM address (0x-prefixed, 40 hex nibbles)");
2352
+ var keyGenSchema = zod.z.object({
2353
+ pubkeyhex: zod.z.string().min(1).describe("MPC secp256k1 public key hex (required for multiSignRequest pubKey)"),
2354
+ keylist: zod.z.array(zod.z.string()).optional().describe("Key list on the sign request"),
2355
+ ClientKeys: zod.z.record(zod.z.string()).optional().describe("Optional client key map from keyGen")
2356
+ }).describe(
2357
+ "MPC key slice: { pubkeyhex, keylist?, ClientKeys? }. Used for pubKey/keyList on POST /multiSignRequest."
2358
+ );
2359
+ var chainDetailSchema = zod.z.object({
2360
+ legacy: zod.z.boolean().optional(),
2361
+ gasLimit: zod.z.number().optional(),
2362
+ gasMultiplier: zod.z.number().optional(),
2363
+ gasPrice: zod.z.number().optional(),
2364
+ baseFee: zod.z.number().optional(),
2365
+ priorityFee: zod.z.number().optional(),
2366
+ baseFeeMultiplier: zod.z.number().optional()
2367
+ }).passthrough().describe(
2368
+ "Optional gas config: { legacy?, gasLimit?, gasMultiplier?, gasPrice?, baseFee?, priorityFee?, baseFeeMultiplier? }."
2369
+ );
2370
+ var evmMultisignCommonInputSchema = zod.z.object({
2371
+ keyGen: keyGenSchema,
2372
+ purposeText: zod.z.string().min(1).describe(
2373
+ "Human-readable purpose for the sign request. Stored in bodyForSign.purpose (may be appended with an automatic batch suffix)."
2374
+ ),
2375
+ useCustomGas: zod.z.boolean().describe(
2376
+ "When true, apply chain gas settings from chainDetail / customGasChainDetails instead of raw RPC estimates only."
2377
+ ),
2378
+ chainId: zod.z.number().int().positive().describe("EVM chain id (decimal). Becomes destinationChainID on the sign request."),
2379
+ rpcUrl: zod.z.string().min(1).describe("HTTPS JSON-RPC URL for gas estimation, nonce, and allowance reads."),
2380
+ executorAddress: evmAddressSchema.describe(
2381
+ "MPC wallet address (from keyGen ethereumaddress) \u2014 tx sender for estimates and approvals."
2382
+ ),
2383
+ chainDetail: chainDetailSchema,
2384
+ customGasChainDetails: zod.z.record(zod.z.unknown()).optional().describe("Snapshot written to extraJSON.customGasChainDetails when useCustomGas is true.")
2385
+ });
2386
+ var multisignOutputSchema = zod.z.object({
2387
+ bodyForSign: zod.z.record(zod.z.unknown()).describe(
2388
+ "POST body fields without clientSig: keyList, pubKey, msgHash, msgRaw, destinationChainID, purpose, extraJSON, proposalTxParams (batch), messageHashes/messageRawBatch when N>1 txs."
2389
+ ),
2390
+ messageToSign: zod.z.string().describe("JSON.stringify(bodyForSign) \u2014 exact string to sign before adding clientSig.")
2391
+ }).describe(
2392
+ "Unsigned mpc-auth multiSignRequest payload. Sign messageToSign and POST { ...bodyForSign, clientSig, signedMessage } to /multiSignRequest."
2393
+ );
2394
+ var jsonObjectSchema = zod.z.record(zod.z.unknown());
2395
+ var uniswapQuoteTradeTypeSchema = zod.z.enum(["EXACT_INPUT", "EXACT_OUTPUT"]);
2396
+ var mcpUniswapV4QuoteInputSchema = zod.z.object({
2397
+ type: uniswapQuoteTradeTypeSchema.describe("EXACT_INPUT or EXACT_OUTPUT"),
2398
+ amount: zod.z.string().min(1).describe("Amount in token-in base units (wei string for ERC-20)"),
2399
+ tokenIn: zod.z.string().min(1).describe("Input token; 0x0 for native ETH"),
2400
+ tokenOut: zod.z.string().min(1).describe("Output token address"),
2401
+ chainId: zod.z.union([zod.z.number().int().positive(), zod.z.string().min(1)]).describe("tokenInChainId / same-chain default"),
2402
+ uniswapApiKey: zod.z.string().min(1).describe("Uniswap Trade API x-api-key"),
2403
+ swapper: evmAddressSchema.optional().describe("MPC executor; omit if keyGen + managementNodeUrl provided"),
2404
+ slippage: zod.z.union([zod.z.number(), zod.z.string()]).optional().describe("Slippage percent; omit for API auto slippage"),
2405
+ keyGen: zod.z.string().optional().describe("KeyGen id \u2014 resolves swapper via GET /getKeyGenResultById when swapper omitted"),
2406
+ managementNodeUrl: zod.z.string().min(1).optional().describe("MPC node base URL; required with keyGen when swapper is omitted"),
2407
+ tokenInChainId: zod.z.union([zod.z.number(), zod.z.string()]).optional(),
2408
+ tokenOutChainId: zod.z.union([zod.z.number(), zod.z.string()]).optional(),
2409
+ permit2Disabled: zod.z.boolean().optional(),
2410
+ baseUrl: zod.z.string().optional(),
2411
+ universalRouterVersion: zod.z.string().optional()
2412
+ });
2413
+ var mcpUniswapV4QuoteOutputSchema = jsonObjectSchema.describe(
2414
+ "Full Uniswap POST /quote JSON (includes nested quote object with input/output amounts)."
2415
+ );
2416
+ var mcpUniswapV4CreateSwapInputSchema = zod.z.object({
2417
+ uniswapApiKey: zod.z.string().min(1).describe("Uniswap Trade API key"),
2418
+ fullQuoteFromPermit: jsonObjectSchema.describe("Full quote JSON from ctm_uniswap_v4_quote"),
2419
+ swapTransactionDeadlineUnix: zod.z.number().int().positive().optional().describe("On-chain deadline unix seconds; default ~30 min from now"),
2420
+ useServerProxy: zod.z.boolean().optional().describe("Set false in Node/agents; true only in browser via Next API route"),
2421
+ baseUrl: zod.z.string().optional(),
2422
+ universalRouterVersion: zod.z.string().optional()
2423
+ });
2424
+ var mcpUniswapV4CreateSwapOutputSchema = zod.z.object({
2425
+ swap: jsonObjectSchema.describe("Universal Router tx: { to, data, value, gasLimit? }"),
2426
+ requestId: zod.z.string().optional(),
2427
+ gasFee: zod.z.string().optional()
2428
+ }).passthrough().describe("{ swap: TransactionRequest, requestId?, gasFee? }");
2429
+ var swapTxRequestSchema = jsonObjectSchema.describe("swap field from create_swap response (to, data, value)");
2430
+ var mcpUniswapV4BuildSwapMultisignInputSchema = evmMultisignCommonInputSchema.extend({
2431
+ tokenIn: evmAddressSchema.describe("Token in; 0x0 for native ETH"),
2432
+ swap: swapTxRequestSchema,
2433
+ createSwapResponse: zod.z.object({
2434
+ swap: swapTxRequestSchema,
2435
+ requestId: zod.z.string().optional(),
2436
+ gasFee: zod.z.string().optional()
2437
+ }).passthrough().describe("Full create_swap response"),
2438
+ fullQuoteSnapshot: jsonObjectSchema.describe("Quote JSON used for the swap"),
2439
+ swapDeadlineUnix: zod.z.number().describe("Same deadline passed to create_swap"),
2440
+ slippagePercent: zod.z.number().optional().describe("Extra approve headroom for EXACT_OUTPUT")
2441
+ });
2442
+ var mcpCurveDaoBuildSwapMultisignInputSchema = evmMultisignCommonInputSchema.extend({
2443
+ tokenIn: evmAddressSchema.describe("ERC-20 sold (native in uses WETH path in UI)"),
2444
+ tokenOut: zod.z.string().min(1).describe("Output token or 0xeeee\u2026 native placeholder"),
2445
+ amountHuman: zod.z.string().min(1).describe("Human-readable amount of tokenIn"),
2446
+ slippagePercent: zod.z.number().gt(0).lt(100).describe("Slippage 0\u2013100 exclusive")
2447
+ });
2448
+ function mcpMultisignInput(fields) {
2449
+ return evmMultisignCommonInputSchema.extend(fields);
2450
+ }
2451
+ var mcpLidoSubmitInputSchema = mcpMultisignInput({
2452
+ valueWei: zod.z.string().min(1).describe("ETH to stake (wei decimal string)"),
2453
+ referral: evmAddressSchema.optional()
2454
+ });
2455
+ var mcpLidoRequestWithdrawalsInputSchema = mcpMultisignInput({
2456
+ stEthAmountsWei: zod.z.array(zod.z.string()).min(1).describe("stETH amounts per withdrawal request (wei strings)")
2457
+ });
2458
+ var mcpLidoClaimWithdrawalInputSchema = mcpMultisignInput({
2459
+ requestId: zod.z.union([zod.z.string(), zod.z.number()]).describe("Withdrawal queue request id")
2460
+ });
2461
+ var mcpLidoWrapStEthInputSchema = mcpMultisignInput({
2462
+ stEthAmountWei: zod.z.string().min(1)
2463
+ });
2464
+ var mcpLidoUnwrapWstEthInputSchema = mcpMultisignInput({
2465
+ wstEthAmountWei: zod.z.string().min(1)
2466
+ });
2467
+ var mcpEthenaStakeInputSchema = mcpMultisignInput({
2468
+ usdeAmountHuman: zod.z.string().min(1),
2469
+ susdeVault: evmAddressSchema.optional()
2470
+ });
2471
+ var mcpEthenaRedeemInputSchema = mcpMultisignInput({
2472
+ susdeSharesHuman: zod.z.string().min(1),
2473
+ susdeVault: evmAddressSchema.optional()
2474
+ });
2475
+ var mcpEthenaCooldownInputSchema = mcpMultisignInput({
2476
+ susdeSharesHuman: zod.z.string().min(1),
2477
+ susdeVault: evmAddressSchema.optional()
2478
+ });
2479
+ var mcpEthenaClaimInputSchema = mcpMultisignInput({
2480
+ susdeVault: evmAddressSchema.optional()
2481
+ });
2482
+ var mcpMapleDepositInputSchema = mcpMultisignInput({
2483
+ syrupRouter: evmAddressSchema,
2484
+ pool: evmAddressSchema,
2485
+ asset: evmAddressSchema,
2486
+ amountHuman: zod.z.string().min(1),
2487
+ authorizeSig: jsonObjectSchema.optional()
2488
+ });
2489
+ var mcpMapleRequestRedeemInputSchema = mcpMultisignInput({
2490
+ pool: evmAddressSchema,
2491
+ sharesHuman: zod.z.string().min(1),
2492
+ receiver: evmAddressSchema
2493
+ });
2494
+ var mcpSkyLockstakeStakeInputSchema = mcpMultisignInput({
2495
+ skyAmountHuman: zod.z.string().min(1),
2496
+ usdsDrawHuman: zod.z.string().optional(),
2497
+ farmRef: zod.z.string().optional()
2498
+ });
2499
+ var mcpSkyLockstakeDrawInputSchema = mcpMultisignInput({
2500
+ usdsAmountHuman: zod.z.string().min(1),
2501
+ urnIndex: zod.z.number().int().nonnegative()
2502
+ });
2503
+ var mcpSkyLockstakeWipeInputSchema = mcpMultisignInput({
2504
+ usdsAmountHuman: zod.z.string().min(1),
2505
+ urnIndex: zod.z.number().int().nonnegative()
2506
+ });
2507
+ var mcpSkyLockstakeCloseInputSchema = mcpMultisignInput({
2508
+ urnIndex: zod.z.number().int().nonnegative()
2509
+ });
2510
+ var mcpSkyLockstakeGetRewardInputSchema = mcpMultisignInput({
2511
+ urnIndex: zod.z.number().int().nonnegative()
2512
+ });
2513
+ var mcpSkySusdsDepositInputSchema = mcpMultisignInput({
2514
+ usdsAmountHuman: zod.z.string().min(1)
2515
+ });
2516
+ var mcpSkySusdsRedeemInputSchema = mcpMultisignInput({
2517
+ sharesHuman: zod.z.string().min(1)
2518
+ });
2519
+ var mcpAaveV4DepositInputSchema = mcpMultisignInput({
2520
+ spoke: evmAddressSchema,
2521
+ underlying: evmAddressSchema,
2522
+ amountHuman: zod.z.string().min(1),
2523
+ marketId: zod.z.string().min(1)
2524
+ });
2525
+ var mcpAaveV4WithdrawInputSchema = mcpMultisignInput({
2526
+ spoke: evmAddressSchema,
2527
+ underlying: evmAddressSchema,
2528
+ amountHuman: zod.z.string().min(1),
2529
+ marketId: zod.z.string().min(1)
2530
+ });
2531
+ var mcpAaveV4BorrowInputSchema = mcpMultisignInput({
2532
+ spoke: evmAddressSchema,
2533
+ underlying: evmAddressSchema,
2534
+ amountHuman: zod.z.string().min(1),
2535
+ marketId: zod.z.string().min(1)
2536
+ });
2537
+ var mcpAaveV4RepayInputSchema = mcpMultisignInput({
2538
+ spoke: evmAddressSchema,
2539
+ underlying: evmAddressSchema,
2540
+ amountHuman: zod.z.string().min(1),
2541
+ marketId: zod.z.string().min(1)
2542
+ });
2543
+ var mcpEulerV2IsolatedLendInputSchema = mcpMultisignInput({
2544
+ vault: evmAddressSchema,
2545
+ assetAmountHuman: zod.z.string().min(1)
2546
+ });
2547
+ var mcpEulerV2IsolatedBorrowInputSchema = mcpMultisignInput({
2548
+ vault: evmAddressSchema,
2549
+ collateralAsset: evmAddressSchema,
2550
+ borrowAsset: evmAddressSchema,
2551
+ collateralAmountHuman: zod.z.string().min(1),
2552
+ loopBorrowWeis: zod.z.array(zod.z.string()).min(1)
2553
+ });
2554
+ var mcpEulerV2VaultWithdrawInputSchema = mcpMultisignInput({
2555
+ vault: evmAddressSchema,
2556
+ sharesHuman: zod.z.string().min(1)
2557
+ });
2558
+ var mcpEulerV2BorrowRepayInputSchema = mcpMultisignInput({
2559
+ vault: evmAddressSchema,
2560
+ amountHuman: zod.z.string().min(1)
2561
+ });
2562
+ var mcpEulerV2CollateralDepositInputSchema = mcpMultisignInput({
2563
+ vault: evmAddressSchema,
2564
+ collateralAsset: evmAddressSchema,
2565
+ amountHuman: zod.z.string().min(1)
2566
+ });
2567
+ var mcpEulerV2CollateralWithdrawInputSchema = mcpMultisignInput({
2568
+ vault: evmAddressSchema,
2569
+ collateralAsset: evmAddressSchema,
2570
+ amountHuman: zod.z.string().min(1)
2571
+ });
2572
+
2573
+ // src/agent/mcpProtocolTools.ts
2574
+ function defineProtocolMcpTool(def) {
2575
+ return {
2576
+ ...def,
2577
+ outputZod: multisignOutputSchema,
2578
+ inputSchema: zodSchemaToMcpJsonSchema(def.inputZod),
2579
+ outputSchema: zodSchemaToMcpJsonSchema(multisignOutputSchema),
2580
+ parseInput: (data) => def.inputZod.parse(data),
2581
+ parseOutput: (data) => multisignOutputSchema.parse(data)
2582
+ };
2583
+ }
2584
+ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
2585
+ defineProtocolMcpTool({
2586
+ name: "ctm_lido_build_submit_multisign",
2587
+ actionId: "lido.submit",
2588
+ protocolId: "lido",
2589
+ chainCategory: "evm",
2590
+ description: "Build mpc-auth multiSignRequest for Lido ETH stake (submit).",
2591
+ prerequisites: ["keyGen", "executorAddress", "RPC URL"],
2592
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2593
+ handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoSubmit" },
2594
+ inputZod: mcpLidoSubmitInputSchema
2595
+ }),
2596
+ defineProtocolMcpTool({
2597
+ name: "ctm_lido_build_request_withdrawals_multisign",
2598
+ actionId: "lido.request-withdrawals",
2599
+ protocolId: "lido",
2600
+ chainCategory: "evm",
2601
+ description: "Build batch for Lido withdrawal queue (approve + requestWithdrawals).",
2602
+ prerequisites: ["keyGen", "executorAddress", "RPC URL"],
2603
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2604
+ handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoRequestWithdrawals" },
2605
+ inputZod: mcpLidoRequestWithdrawalsInputSchema
2606
+ }),
2607
+ defineProtocolMcpTool({
2608
+ name: "ctm_lido_build_claim_withdrawal_multisign",
2609
+ actionId: "lido.claim-withdrawal",
2610
+ protocolId: "lido",
2611
+ chainCategory: "evm",
2612
+ description: "Build tx for Lido claimWithdrawal.",
2613
+ prerequisites: ["keyGen", "executorAddress", "RPC URL"],
2614
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2615
+ handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoClaimWithdrawal" },
2616
+ inputZod: mcpLidoClaimWithdrawalInputSchema
2617
+ }),
2618
+ defineProtocolMcpTool({
2619
+ name: "ctm_lido_build_wrap_steth_multisign",
2620
+ actionId: "lido.wrap-steth",
2621
+ protocolId: "lido",
2622
+ chainCategory: "evm",
2623
+ description: "Build batch for wstETH wrap.",
2624
+ prerequisites: ["keyGen", "executorAddress", "RPC URL"],
2625
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2626
+ handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoWrapStEth" },
2627
+ inputZod: mcpLidoWrapStEthInputSchema
2628
+ }),
2629
+ defineProtocolMcpTool({
2630
+ name: "ctm_lido_build_unwrap_wsteth_multisign",
2631
+ actionId: "lido.unwrap-wsteth",
2632
+ protocolId: "lido",
2633
+ chainCategory: "evm",
2634
+ description: "Build tx for wstETH unwrap.",
2635
+ prerequisites: ["keyGen", "executorAddress", "RPC URL"],
2636
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2637
+ handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoUnwrapWstEth" },
2638
+ inputZod: mcpLidoUnwrapWstEthInputSchema
2639
+ }),
2640
+ defineProtocolMcpTool({
2641
+ name: "ctm_ethena_build_stake_multisign",
2642
+ actionId: "ethena.stake-usde",
2643
+ protocolId: "ethena",
2644
+ chainCategory: "evm",
2645
+ description: "Build batch: USDe approve + sUSDe deposit.",
2646
+ prerequisites: ["keyGen", "executorAddress", "Ethereum mainnet RPC"],
2647
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2648
+ handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaUsdeStakeToSusde" },
2649
+ inputZod: mcpEthenaStakeInputSchema
2650
+ }),
2651
+ defineProtocolMcpTool({
2652
+ name: "ctm_ethena_build_redeem_multisign",
2653
+ actionId: "ethena.redeem-susde",
2654
+ protocolId: "ethena",
2655
+ chainCategory: "evm",
2656
+ description: "Build sUSDe redeem when cooldown is off.",
2657
+ prerequisites: ["keyGen", "executorAddress", "RPC URL"],
2658
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2659
+ handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaSusdeRedeemToUsde" },
2660
+ inputZod: mcpEthenaRedeemInputSchema
2661
+ }),
2662
+ defineProtocolMcpTool({
2663
+ name: "ctm_ethena_build_cooldown_multisign",
2664
+ actionId: "ethena.cooldown-shares",
2665
+ protocolId: "ethena",
2666
+ chainCategory: "evm",
2667
+ description: "Build sUSDe cooldownShares batch step.",
2668
+ prerequisites: ["keyGen", "executorAddress", "RPC URL"],
2669
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2670
+ handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaSusdeCooldownShares" },
2671
+ inputZod: mcpEthenaCooldownInputSchema
2672
+ }),
2673
+ defineProtocolMcpTool({
2674
+ name: "ctm_ethena_build_claim_multisign",
2675
+ actionId: "ethena.claim-unstake",
2676
+ protocolId: "ethena",
2677
+ chainCategory: "evm",
2678
+ description: "Build unstake claim after cooldown.",
2679
+ prerequisites: ["keyGen", "executorAddress", "RPC URL"],
2680
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2681
+ handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaUnstakeClaim" },
2682
+ inputZod: mcpEthenaClaimInputSchema
2683
+ }),
2684
+ defineProtocolMcpTool({
2685
+ name: "ctm_maple_build_deposit_multisign",
2686
+ actionId: "maple-syrup.deposit",
2687
+ protocolId: "maple-syrup",
2688
+ chainCategory: "evm",
2689
+ description: "Build Maple Syrup router deposit batch.",
2690
+ prerequisites: ["keyGen", "executorAddress", "router + pool addresses"],
2691
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2692
+ handler: { importPath: "protocols/evm/maple", exportName: "buildEvmMultisignBodyMapleSyrupDeposit" },
2693
+ inputZod: mcpMapleDepositInputSchema
2694
+ }),
2695
+ defineProtocolMcpTool({
2696
+ name: "ctm_maple_build_request_redeem_multisign",
2697
+ actionId: "maple-syrup.request-redeem",
2698
+ protocolId: "maple-syrup",
2699
+ chainCategory: "evm",
2700
+ description: "Build Maple PoolV2 requestRedeem batch.",
2701
+ prerequisites: ["keyGen", "executorAddress", "pool address"],
2702
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2703
+ handler: { importPath: "protocols/evm/maple", exportName: "buildEvmMultisignBodyMaplePoolRequestRedeem" },
2704
+ inputZod: mcpMapleRequestRedeemInputSchema
2705
+ }),
2706
+ defineProtocolMcpTool({
2707
+ name: "ctm_sky_build_lockstake_stake_multisign",
2708
+ actionId: "sky.lockstake-stake",
2709
+ protocolId: "sky",
2710
+ chainCategory: "evm",
2711
+ description: "Build Sky Lockstake open/stake batch.",
2712
+ prerequisites: ["keyGen", "executorAddress", "Ethereum mainnet RPC"],
2713
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2714
+ handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeStakePositionBatch" },
2715
+ inputZod: mcpSkyLockstakeStakeInputSchema
2716
+ }),
2717
+ defineProtocolMcpTool({
2718
+ name: "ctm_sky_build_lockstake_draw_multisign",
2719
+ actionId: "sky.lockstake-draw",
2720
+ protocolId: "sky",
2721
+ chainCategory: "evm",
2722
+ description: "Build Lockstake draw (borrow USDS).",
2723
+ prerequisites: ["keyGen", "executorAddress", "open urn"],
2724
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2725
+ handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeDrawBatch" },
2726
+ inputZod: mcpSkyLockstakeDrawInputSchema
2727
+ }),
2728
+ defineProtocolMcpTool({
2729
+ name: "ctm_sky_build_lockstake_wipe_multisign",
2730
+ actionId: "sky.lockstake-wipe",
2731
+ protocolId: "sky",
2732
+ chainCategory: "evm",
2733
+ description: "Build Lockstake repay/wipe batch.",
2734
+ prerequisites: ["keyGen", "executorAddress", "urn index"],
2735
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2736
+ handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeWipeBatch" },
2737
+ inputZod: mcpSkyLockstakeWipeInputSchema
2738
+ }),
2739
+ defineProtocolMcpTool({
2740
+ name: "ctm_sky_build_lockstake_close_multisign",
2741
+ actionId: "sky.lockstake-close",
2742
+ protocolId: "sky",
2743
+ chainCategory: "evm",
2744
+ description: "Build Lockstake close position batch.",
2745
+ prerequisites: ["keyGen", "executorAddress", "urn index"],
2746
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2747
+ handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeCloseBatch" },
2748
+ inputZod: mcpSkyLockstakeCloseInputSchema
2749
+ }),
2750
+ defineProtocolMcpTool({
2751
+ name: "ctm_sky_build_lockstake_get_reward_multisign",
2752
+ actionId: "sky.lockstake-get-reward",
2753
+ protocolId: "sky",
2754
+ chainCategory: "evm",
2755
+ description: "Build Lockstake getReward batch.",
2756
+ prerequisites: ["keyGen", "executorAddress", "urn index"],
2757
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2758
+ handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeGetRewardBatch" },
2759
+ inputZod: mcpSkyLockstakeGetRewardInputSchema
2760
+ }),
2761
+ defineProtocolMcpTool({
2762
+ name: "ctm_sky_build_susds_deposit_multisign",
2763
+ actionId: "sky.susds-deposit",
2764
+ protocolId: "sky",
2765
+ chainCategory: "evm",
2766
+ description: "Build USDS \u2192 sUSDS ERC-4626 deposit batch.",
2767
+ prerequisites: ["keyGen", "executorAddress", "RPC URL"],
2768
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2769
+ handler: { importPath: "protocols/evm/sky", exportName: "buildSkySusdsDepositFromUsdsBatch" },
2770
+ inputZod: mcpSkySusdsDepositInputSchema
2771
+ }),
2772
+ defineProtocolMcpTool({
2773
+ name: "ctm_sky_build_susds_redeem_multisign",
2774
+ actionId: "sky.susds-redeem",
2775
+ protocolId: "sky",
2776
+ chainCategory: "evm",
2777
+ description: "Build sUSDS redeem to USDS batch.",
2778
+ prerequisites: ["keyGen", "executorAddress", "RPC URL"],
2779
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2780
+ handler: { importPath: "protocols/evm/sky", exportName: "buildSkySusdsRedeemToUsdsBatch" },
2781
+ inputZod: mcpSkySusdsRedeemInputSchema
2782
+ }),
2783
+ defineProtocolMcpTool({
2784
+ name: "ctm_aave_v4_build_deposit_multisign",
2785
+ actionId: "aave-v4.deposit",
2786
+ protocolId: "aave-v4",
2787
+ chainCategory: "evm",
2788
+ description: "Build Aave v4 Spoke supply/deposit batch.",
2789
+ prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
2790
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2791
+ handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4DepositBatch" },
2792
+ inputZod: mcpAaveV4DepositInputSchema
2793
+ }),
2794
+ defineProtocolMcpTool({
2795
+ name: "ctm_aave_v4_build_withdraw_multisign",
2796
+ actionId: "aave-v4.withdraw",
2797
+ protocolId: "aave-v4",
2798
+ chainCategory: "evm",
2799
+ description: "Build Aave v4 Spoke withdraw batch.",
2800
+ prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
2801
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2802
+ handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeWithdraw" },
2803
+ inputZod: mcpAaveV4WithdrawInputSchema
2804
+ }),
2805
+ defineProtocolMcpTool({
2806
+ name: "ctm_aave_v4_build_borrow_multisign",
2807
+ actionId: "aave-v4.borrow",
2808
+ protocolId: "aave-v4",
2809
+ chainCategory: "evm",
2810
+ description: "Build Aave v4 Spoke borrow batch.",
2811
+ prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
2812
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2813
+ handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeBorrow" },
2814
+ inputZod: mcpAaveV4BorrowInputSchema
2815
+ }),
2816
+ defineProtocolMcpTool({
2817
+ name: "ctm_aave_v4_build_repay_multisign",
2818
+ actionId: "aave-v4.repay",
2819
+ protocolId: "aave-v4",
2820
+ chainCategory: "evm",
2821
+ description: "Build Aave v4 Spoke repay batch.",
2822
+ prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
2823
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2824
+ handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeRepay" },
2825
+ inputZod: mcpAaveV4RepayInputSchema
2826
+ }),
2827
+ defineProtocolMcpTool({
2828
+ name: "ctm_euler_v2_build_isolated_lend_multisign",
2829
+ actionId: "euler-v2.isolated-lend",
2830
+ protocolId: "euler-v2",
2831
+ chainCategory: "evm",
2832
+ description: "Build Euler v2 vault deposit/lend batch.",
2833
+ prerequisites: ["keyGen", "executorAddress", "vault address"],
2834
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2835
+ handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2IsolatedLendDepositBatch" },
2836
+ inputZod: mcpEulerV2IsolatedLendInputSchema
2837
+ }),
2838
+ defineProtocolMcpTool({
2839
+ name: "ctm_euler_v2_build_isolated_borrow_multisign",
2840
+ actionId: "euler-v2.isolated-borrow",
2841
+ protocolId: "euler-v2",
2842
+ chainCategory: "evm",
2843
+ description: "Build Euler v2 isolated borrow loop batch.",
2844
+ prerequisites: ["keyGen", "executorAddress", "vault + collateral"],
2845
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2846
+ handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2IsolatedBorrowBatch" },
2847
+ inputZod: mcpEulerV2IsolatedBorrowInputSchema
2848
+ }),
2849
+ defineProtocolMcpTool({
2850
+ name: "ctm_euler_v2_build_vault_withdraw_multisign",
2851
+ actionId: "euler-v2.vault-withdraw",
2852
+ protocolId: "euler-v2",
2853
+ chainCategory: "evm",
2854
+ description: "Build Euler v2 vault withdraw/redeem batch.",
2855
+ prerequisites: ["keyGen", "executorAddress", "vault address"],
2856
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2857
+ handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2VaultWithdrawBatch" },
2858
+ inputZod: mcpEulerV2VaultWithdrawInputSchema
2859
+ }),
2860
+ defineProtocolMcpTool({
2861
+ name: "ctm_euler_v2_build_borrow_repay_multisign",
2862
+ actionId: "euler-v2.borrow-repay",
2863
+ protocolId: "euler-v2",
2864
+ chainCategory: "evm",
2865
+ description: "Build Euler v2 borrow repay batch.",
2866
+ prerequisites: ["keyGen", "executorAddress", "vault address"],
2867
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2868
+ handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2BorrowRepayBatch" },
2869
+ inputZod: mcpEulerV2BorrowRepayInputSchema
2870
+ }),
2871
+ defineProtocolMcpTool({
2872
+ name: "ctm_euler_v2_build_collateral_deposit_multisign",
2873
+ actionId: "euler-v2.collateral-deposit",
2874
+ protocolId: "euler-v2",
2875
+ chainCategory: "evm",
2876
+ description: "Build Euler v2 borrow collateral deposit batch.",
2877
+ prerequisites: ["keyGen", "executorAddress", "vault + collateral asset"],
2878
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2879
+ handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2BorrowCollateralDepositBatch" },
2880
+ inputZod: mcpEulerV2CollateralDepositInputSchema
2881
+ }),
2882
+ defineProtocolMcpTool({
2883
+ name: "ctm_euler_v2_build_collateral_withdraw_multisign",
2884
+ actionId: "euler-v2.collateral-withdraw",
2885
+ protocolId: "euler-v2",
2886
+ chainCategory: "evm",
2887
+ description: "Build Euler v2 borrow collateral withdraw batch.",
2888
+ prerequisites: ["keyGen", "executorAddress", "vault + collateral asset"],
2889
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2890
+ handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2BorrowCollateralWithdrawBatch" },
2891
+ inputZod: mcpEulerV2CollateralWithdrawInputSchema
2892
+ })
2893
+ ];
2894
+
2895
+ // src/agent/mcpTools.ts
2896
+ function defineMcpTool(def) {
2897
+ return {
2898
+ ...def,
2899
+ inputSchema: zodSchemaToMcpJsonSchema(def.inputZod),
2900
+ outputSchema: zodSchemaToMcpJsonSchema(def.outputZod),
2901
+ parseInput: (data) => def.inputZod.parse(data),
2902
+ parseOutput: (data) => def.outputZod.parse(data)
2903
+ };
2904
+ }
2905
+ var CORE_MCP_TOOL_DEFINITIONS = [
2906
+ defineMcpTool({
2264
2907
  name: "ctm_uniswap_v4_quote",
2265
2908
  actionId: "uniswap-v4.quote",
2266
2909
  protocolId: "uniswap-v4",
@@ -2269,33 +2912,10 @@ var MCP_TOOL_DEFINITIONS = [
2269
2912
  prerequisites: ["Chain must be supported by Uniswap V4 (Universal Router map)."],
2270
2913
  followUp: ["ctm_uniswap_v4_create_swap", "ctm_uniswap_v4_build_swap_multisign"],
2271
2914
  handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapTradeQuote" },
2272
- inputSchema: {
2273
- type: "object",
2274
- properties: paramProperties({
2275
- type: { type: "string", required: true, description: "EXACT_INPUT or EXACT_OUTPUT" },
2276
- amount: { type: "string", required: true, description: "Amount in token-in base units (wei string for ERC-20)" },
2277
- tokenIn: { type: "address", required: true, description: "Input token; 0x0 for native ETH" },
2278
- tokenOut: { type: "address", required: true, description: "Output token address" },
2279
- chainId: { type: "number", required: true, description: "tokenInChainId / same-chain default" },
2280
- uniswapApiKey: { type: "string", required: true, description: "Uniswap Trade API x-api-key" },
2281
- swapper: { type: "address", required: false, description: "MPC executor; omit if keyGen + managementNodeUrl provided" },
2282
- slippage: { type: "number", required: false, description: "Slippage percent; omit for API auto slippage" }
2283
- }),
2284
- required: requiredKeys({
2285
- type: { type: "string", required: true, description: "" },
2286
- amount: { type: "string", required: true, description: "" },
2287
- tokenIn: { type: "address", required: true, description: "" },
2288
- tokenOut: { type: "address", required: true, description: "" },
2289
- chainId: { type: "number", required: true, description: "" },
2290
- uniswapApiKey: { type: "string", required: true, description: "" }
2291
- })
2292
- },
2293
- outputSchema: {
2294
- type: "object",
2295
- description: "Full Uniswap POST /quote JSON (includes nested quote object with input/output amounts)."
2296
- }
2297
- },
2298
- {
2915
+ inputZod: mcpUniswapV4QuoteInputSchema,
2916
+ outputZod: mcpUniswapV4QuoteOutputSchema
2917
+ }),
2918
+ defineMcpTool({
2299
2919
  name: "ctm_uniswap_v4_create_swap",
2300
2920
  actionId: "uniswap-v4.create-swap",
2301
2921
  protocolId: "uniswap-v4",
@@ -2304,33 +2924,10 @@ var MCP_TOOL_DEFINITIONS = [
2304
2924
  prerequisites: ["ctm_uniswap_v4_quote output (fullQuoteFromPermit)"],
2305
2925
  followUp: ["ctm_uniswap_v4_build_swap_multisign"],
2306
2926
  handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapCreateSwap" },
2307
- inputSchema: {
2308
- type: "object",
2309
- properties: paramProperties({
2310
- uniswapApiKey: { type: "string", required: true, description: "Uniswap Trade API key" },
2311
- fullQuoteFromPermit: { type: "object", required: true, description: "Full quote JSON from ctm_uniswap_v4_quote" },
2312
- swapTransactionDeadlineUnix: {
2313
- type: "number",
2314
- required: false,
2315
- description: "On-chain deadline unix seconds; default ~30 min from now"
2316
- },
2317
- useServerProxy: {
2318
- type: "boolean",
2319
- required: false,
2320
- description: "Set false in Node/agents; true only in browser via Next API route"
2321
- }
2322
- }),
2323
- required: requiredKeys({
2324
- uniswapApiKey: { type: "string", required: true, description: "" },
2325
- fullQuoteFromPermit: { type: "object", required: true, description: "" }
2326
- })
2327
- },
2328
- outputSchema: {
2329
- type: "object",
2330
- description: "{ swap: TransactionRequest, requestId?, gasFee? }"
2331
- }
2332
- },
2333
- {
2927
+ inputZod: mcpUniswapV4CreateSwapInputSchema,
2928
+ outputZod: mcpUniswapV4CreateSwapOutputSchema
2929
+ }),
2930
+ defineMcpTool({
2334
2931
  name: "ctm_uniswap_v4_build_swap_multisign",
2335
2932
  actionId: "uniswap-v4.swap-exact-input",
2336
2933
  protocolId: "uniswap-v4",
@@ -2342,73 +2939,47 @@ var MCP_TOOL_DEFINITIONS = [
2342
2939
  "executorAddress matching MPC wallet",
2343
2940
  "RPC URL and chainDetail from node chain config"
2344
2941
  ],
2345
- followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig"],
2942
+ followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig and signedMessage"],
2346
2943
  handler: { importPath: "protocols/evm/uniswap-v4", exportName: "buildEvmMultisignBodyUniswapV4SkipPermit2Batch" },
2347
- inputSchema: {
2348
- type: "object",
2349
- properties: paramProperties(
2350
- {
2351
- tokenIn: { type: "address", required: true, description: "Token in; 0x0 for native ETH" },
2352
- swap: { type: "object", required: true, description: "swap field from create_swap response" },
2353
- createSwapResponse: { type: "object", required: true, description: "Full create_swap response" },
2354
- fullQuoteSnapshot: { type: "object", required: true, description: "Quote JSON used for the swap" },
2355
- swapDeadlineUnix: { type: "number", required: true, description: "Same deadline passed to create_swap" },
2356
- slippagePercent: { type: "number", required: false, description: "Extra approve headroom for EXACT_OUTPUT" }
2357
- },
2358
- ["keyGen", "purposeText", "useCustomGas", "chainId", "rpcUrl", "executorAddress", "chainDetail", "customGasChainDetails"]
2359
- ),
2360
- required: requiredKeys(
2361
- {
2362
- tokenIn: { type: "address", required: true, description: "" },
2363
- swap: { type: "object", required: true, description: "" },
2364
- createSwapResponse: { type: "object", required: true, description: "" },
2365
- fullQuoteSnapshot: { type: "object", required: true, description: "" },
2366
- swapDeadlineUnix: { type: "number", required: true, description: "" }
2367
- },
2368
- ["keyGen", "purposeText", "useCustomGas", "chainId", "rpcUrl", "executorAddress", "chainDetail"]
2369
- )
2370
- },
2371
- outputSchema: multisignOutputSchema
2372
- },
2373
- {
2944
+ inputZod: mcpUniswapV4BuildSwapMultisignInputSchema,
2945
+ outputZod: multisignOutputSchema
2946
+ }),
2947
+ defineMcpTool({
2374
2948
  name: "ctm_curve_dao_build_swap_multisign",
2375
2949
  actionId: "curve-dao.swap",
2376
2950
  protocolId: "curve-dao",
2377
2951
  chainCategory: "evm",
2378
2952
  description: "Build mpc-auth multiSignRequest for a Curve Router NG swap via @curvefi/api populateSwap. Optionally batches ERC-20 approve txs when allowance is insufficient, then exchange. Requires JSON-RPC and Curve-supported chain.",
2379
2953
  prerequisites: ["keyGen", "executorAddress", "tokenIn/tokenOut/amountHuman/slippage", "RPC URL"],
2380
- followUp: ["Sign messageToSign", "POST /multiSignRequest"],
2954
+ followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig and signedMessage"],
2381
2955
  handler: { importPath: "protocols/evm/curve-dao", exportName: "buildEvmMultisignBodyCurveDaoBatch" },
2382
- inputSchema: {
2383
- type: "object",
2384
- properties: paramProperties(
2385
- {
2386
- tokenIn: { type: "address", required: true, description: "ERC-20 sold (native in uses WETH path in UI)" },
2387
- tokenOut: { type: "string", required: true, description: "Output token or 0xeeee\u2026 native placeholder" },
2388
- amountHuman: { type: "string", required: true, description: "Human-readable amount of tokenIn" },
2389
- slippagePercent: { type: "number", required: true, description: "Slippage 0\u2013100 exclusive" }
2390
- },
2391
- ["keyGen", "purposeText", "useCustomGas", "chainId", "rpcUrl", "executorAddress", "chainDetail", "customGasChainDetails"]
2392
- ),
2393
- required: requiredKeys(
2394
- {
2395
- tokenIn: { type: "address", required: true, description: "" },
2396
- tokenOut: { type: "string", required: true, description: "" },
2397
- amountHuman: { type: "string", required: true, description: "" },
2398
- slippagePercent: { type: "number", required: true, description: "" }
2399
- },
2400
- ["keyGen", "purposeText", "useCustomGas", "chainId", "rpcUrl", "executorAddress", "chainDetail"]
2401
- )
2402
- },
2403
- outputSchema: multisignOutputSchema
2404
- }
2956
+ inputZod: mcpCurveDaoBuildSwapMultisignInputSchema,
2957
+ outputZod: multisignOutputSchema
2958
+ })
2959
+ ];
2960
+ var MCP_TOOL_DEFINITIONS = [
2961
+ ...CORE_MCP_TOOL_DEFINITIONS,
2962
+ ...MCP_PROTOCOL_TOOL_DEFINITIONS
2405
2963
  ];
2964
+ function buildToolSchemaMap(kind) {
2965
+ const out = {};
2966
+ for (const tool of MCP_TOOL_DEFINITIONS) {
2967
+ out[tool.name] = kind === "input" ? tool.inputZod : tool.outputZod;
2968
+ }
2969
+ return out;
2970
+ }
2971
+ var MCP_TOOL_INPUT_SCHEMAS = buildToolSchemaMap("input");
2972
+ var MCP_TOOL_OUTPUT_SCHEMAS = buildToolSchemaMap("output");
2406
2973
  function getAgentCatalogForMcp() {
2407
2974
  return {
2408
2975
  tools: MCP_TOOL_DEFINITIONS,
2409
2976
  protocols: getProtocolModules(),
2410
2977
  commonParams: EVM_COMMON_PARAM_DOCS,
2411
2978
  multisignOutput: MULTISIGN_OUTPUT_DOC,
2979
+ managementSig: MANAGEMENT_SIG_DOC,
2980
+ /** Zod schemas for MCP tool I/O — source of truth for continuum-mcp-server validation. */
2981
+ inputSchemas: MCP_TOOL_INPUT_SCHEMAS,
2982
+ outputSchemas: MCP_TOOL_OUTPUT_SCHEMAS,
2412
2983
  workflow: {
2413
2984
  evmSwapTypical: [
2414
2985
  "1. Quote (protocol-specific API if needed)",
@@ -2416,14 +2987,222 @@ function getAgentCatalogForMcp() {
2416
2987
  "3. build_*_multisign \u2192 { bodyForSign, messageToSign }",
2417
2988
  "4. Sign messageToSign (MetaMask or Ed25519)",
2418
2989
  "5. POST /multiSignRequest with clientSig and signedMessage"
2990
+ ],
2991
+ managementPostTypical: [
2992
+ "1. GET /getNodeKey \u2192 nodeKey (128 hex)",
2993
+ "2. GET /getPublicMgtKeyNonce or /getNodeMgtKeyNonce \u2192 nonce",
2994
+ "3. buildManagementPostBody(nonce, nodeKey, { \u2026endpoint fields })",
2995
+ "4. messageToSignManagementBody(body) \u2192 sign \u2192 withManagementClientSig(body, sig)",
2996
+ "5. POST management route with signed body"
2419
2997
  ]
2420
2998
  }
2421
2999
  };
2422
3000
  }
3001
+ viem.getAddress(
3002
+ "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84"
3003
+ );
3004
+ viem.getAddress(
3005
+ "0x7f39C581F595B853cBbF37C12FfeeA971C5a5bEa"
3006
+ );
3007
+ viem.getAddress("0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1");
3008
+ var LIDO_ETHEREUM_MAINNET_CHAIN_ID = 1;
3009
+
3010
+ // src/protocols/evm/lido/index.ts
3011
+ var LIDO_PROTOCOL_ID = "lido";
3012
+ var lidoProtocolModule = {
3013
+ id: LIDO_PROTOCOL_ID,
3014
+ chainCategory: "evm",
3015
+ isChainSupported(ctx) {
3016
+ if (ctx.chainCategory !== "evm") return false;
3017
+ return Number(ctx.chainId) === LIDO_ETHEREUM_MAINNET_CHAIN_ID;
3018
+ },
3019
+ isTokenSupported(token) {
3020
+ return token.category === "evm" && (token.kind === "native" || token.kind === "erc20");
3021
+ },
3022
+ actions: [
3023
+ { id: "lido.submit", protocolId: LIDO_PROTOCOL_ID, chainCategory: "evm", description: "Stake ETH via Lido submit()", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: { valueWei: { type: "string", required: true, description: "ETH to stake (wei string)" } } },
3024
+ { id: "lido.request-withdrawals", protocolId: LIDO_PROTOCOL_ID, chainCategory: "evm", description: "Queue stETH withdrawal", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3025
+ { id: "lido.claim-withdrawal", protocolId: LIDO_PROTOCOL_ID, chainCategory: "evm", description: "Claim finalized withdrawal", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3026
+ { id: "lido.wrap-steth", protocolId: LIDO_PROTOCOL_ID, chainCategory: "evm", description: "Wrap stETH to wstETH", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3027
+ { id: "lido.unwrap-wsteth", protocolId: LIDO_PROTOCOL_ID, chainCategory: "evm", description: "Unwrap wstETH to stETH", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
3028
+ ]
3029
+ };
3030
+ registerProtocolModule(lidoProtocolModule);
3031
+ var USDE_ETHEREUM_MAINNET = "0x4c9edd5852cd905f086c759e8383e09bff1e68b3";
3032
+ var USDE_MOST_L2S = "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34";
3033
+ var USDE_ZKSYNC_ERA = "0x39Fe7a0DACcE31Bd90418e3e659fb0b5f0B3Db0d";
3034
+ var L2_SAME_ADDRESS_CHAIN_IDS = /* @__PURE__ */ new Set([
3035
+ 42161,
3036
+ // Arbitrum One
3037
+ 10,
3038
+ // Optimism
3039
+ 8453,
3040
+ // Base
3041
+ 56,
3042
+ // BNB Chain
3043
+ 59144,
3044
+ // Linea
3045
+ 5e3,
3046
+ // Mantle
3047
+ 81457,
3048
+ // Blast
3049
+ 169,
3050
+ // Manta Pacific
3051
+ 534352,
3052
+ // Scroll
3053
+ 252,
3054
+ // Fraxtal
3055
+ 34443,
3056
+ // Mode
3057
+ 196,
3058
+ // X Layer
3059
+ 1088,
3060
+ // Metis
3061
+ 80084,
3062
+ // Berachain
3063
+ 2222,
3064
+ // Kava
3065
+ 2818,
3066
+ // Morph
3067
+ 1923,
3068
+ // Swell
3069
+ 48900
3070
+ // Zircuit
3071
+ ]);
3072
+ function usdeTokenAddressOnEvmChain(chainId) {
3073
+ if (chainId === 1) return USDE_ETHEREUM_MAINNET;
3074
+ if (chainId === 324) return USDE_ZKSYNC_ERA;
3075
+ if (L2_SAME_ADDRESS_CHAIN_IDS.has(chainId)) return USDE_MOST_L2S;
3076
+ return null;
3077
+ }
3078
+ function isEvmChainInEthenaUsdeList(chainId) {
3079
+ return usdeTokenAddressOnEvmChain(chainId) != null;
3080
+ }
3081
+
3082
+ // src/protocols/evm/ethena/index.ts
3083
+ var ETHENA_PROTOCOL_ID = "ethena";
3084
+ var ethenaProtocolModule = {
3085
+ id: ETHENA_PROTOCOL_ID,
3086
+ chainCategory: "evm",
3087
+ isChainSupported(ctx) {
3088
+ if (ctx.chainCategory !== "evm") return false;
3089
+ const n = typeof ctx.chainId === "number" ? ctx.chainId : Number.parseInt(String(ctx.chainId), 10);
3090
+ return isEvmChainInEthenaUsdeList(n);
3091
+ },
3092
+ isTokenSupported(token) {
3093
+ return token.category === "evm" && token.kind === "erc20";
3094
+ },
3095
+ actions: [
3096
+ { id: "ethena.stake-usde", protocolId: ETHENA_PROTOCOL_ID, chainCategory: "evm", description: "Stake USDe \u2192 sUSDe", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: { amountHuman: { type: "string", required: true, description: "USDe amount" } } },
3097
+ { id: "ethena.redeem-susde", protocolId: ETHENA_PROTOCOL_ID, chainCategory: "evm", description: "Redeem sUSDe \u2192 USDe (no cooldown)", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3098
+ { id: "ethena.cooldown-shares", protocolId: ETHENA_PROTOCOL_ID, chainCategory: "evm", description: "Start sUSDe cooldown", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3099
+ { id: "ethena.claim-unstake", protocolId: ETHENA_PROTOCOL_ID, chainCategory: "evm", description: "Claim after cooldown", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
3100
+ ]
3101
+ };
3102
+ registerProtocolModule(ethenaProtocolModule);
3103
+
3104
+ // src/protocols/evm/maple/constants.ts
3105
+ function isMapleSyrupSupportedChain(chainId) {
3106
+ return chainId === 1 || chainId === 11155111;
3107
+ }
3108
+
3109
+ // src/protocols/evm/maple/index.ts
3110
+ var MAPLE_PROTOCOL_ID = "maple-syrup";
3111
+ var mapleProtocolModule = {
3112
+ id: MAPLE_PROTOCOL_ID,
3113
+ chainCategory: "evm",
3114
+ isChainSupported(ctx) {
3115
+ if (ctx.chainCategory !== "evm") return false;
3116
+ const n = typeof ctx.chainId === "number" ? ctx.chainId : Number.parseInt(String(ctx.chainId), 10);
3117
+ return isMapleSyrupSupportedChain(n);
3118
+ },
3119
+ isTokenSupported(token) {
3120
+ return token.category === "evm" && token.kind === "erc20";
3121
+ },
3122
+ actions: [
3123
+ { id: "maple-syrup.deposit", protocolId: MAPLE_PROTOCOL_ID, chainCategory: "evm", description: "Deposit into Maple Syrup pool", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3124
+ { id: "maple-syrup.request-redeem", protocolId: MAPLE_PROTOCOL_ID, chainCategory: "evm", description: "Request redeem from pool", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
3125
+ ]
3126
+ };
3127
+ registerProtocolModule(mapleProtocolModule);
3128
+
3129
+ // src/protocols/evm/sky/mainnet.ts
3130
+ var SKY_ETHEREUM_MAINNET_CHAIN_ID = 1;
3131
+
3132
+ // src/protocols/evm/sky/index.ts
3133
+ var SKY_PROTOCOL_ID = "sky";
3134
+ var skyProtocolModule = {
3135
+ id: SKY_PROTOCOL_ID,
3136
+ chainCategory: "evm",
3137
+ isChainSupported(ctx) {
3138
+ if (ctx.chainCategory !== "evm") return false;
3139
+ return Number(ctx.chainId) === SKY_ETHEREUM_MAINNET_CHAIN_ID;
3140
+ },
3141
+ isTokenSupported(token) {
3142
+ return token.category === "evm" && token.kind === "erc20";
3143
+ },
3144
+ actions: [
3145
+ { id: "sky.lockstake-stake", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Open Lockstake position", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3146
+ { id: "sky.lockstake-draw", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Borrow USDS from Lockstake", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3147
+ { id: "sky.lockstake-wipe", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Repay Lockstake debt", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3148
+ { id: "sky.lockstake-close", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Close Lockstake position", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3149
+ { id: "sky.susds-deposit", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Deposit USDS into sUSDS vault", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3150
+ { id: "sky.susds-redeem", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Redeem sUSDS to USDS", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
3151
+ ]
3152
+ };
3153
+ registerProtocolModule(skyProtocolModule);
3154
+
3155
+ // src/protocols/evm/aave-v4/index.ts
3156
+ var AAVE_V4_PROTOCOL_ID = "aave-v4";
3157
+ var aaveV4ProtocolModule = {
3158
+ id: AAVE_V4_PROTOCOL_ID,
3159
+ chainCategory: "evm",
3160
+ isChainSupported(ctx) {
3161
+ return ctx.chainCategory === "evm";
3162
+ },
3163
+ isTokenSupported(token) {
3164
+ return token.category === "evm" && (token.kind === "native" || token.kind === "erc20");
3165
+ },
3166
+ actions: [
3167
+ { id: "aave-v4.deposit", protocolId: AAVE_V4_PROTOCOL_ID, chainCategory: "evm", description: "Supply to Aave v4 Spoke", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3168
+ { id: "aave-v4.withdraw", protocolId: AAVE_V4_PROTOCOL_ID, chainCategory: "evm", description: "Withdraw from Spoke", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3169
+ { id: "aave-v4.borrow", protocolId: AAVE_V4_PROTOCOL_ID, chainCategory: "evm", description: "Borrow from Spoke", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3170
+ { id: "aave-v4.repay", protocolId: AAVE_V4_PROTOCOL_ID, chainCategory: "evm", description: "Repay Spoke debt", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
3171
+ ]
3172
+ };
3173
+ registerProtocolModule(aaveV4ProtocolModule);
3174
+
3175
+ // src/protocols/evm/euler-v2/index.ts
3176
+ var EULER_V2_PROTOCOL_ID = "euler-v2";
3177
+ var eulerV2ProtocolModule = {
3178
+ id: EULER_V2_PROTOCOL_ID,
3179
+ chainCategory: "evm",
3180
+ isChainSupported(ctx) {
3181
+ return ctx.chainCategory === "evm";
3182
+ },
3183
+ isTokenSupported(token) {
3184
+ return token.category === "evm" && (token.kind === "native" || token.kind === "erc20");
3185
+ },
3186
+ actions: [
3187
+ { id: "euler-v2.isolated-lend", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Deposit into Euler vault", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3188
+ { id: "euler-v2.isolated-borrow", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Borrow from Euler vault", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3189
+ { id: "euler-v2.vault-withdraw", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Withdraw from Euler vault", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3190
+ { id: "euler-v2.borrow-repay", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Repay Euler borrow", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3191
+ { id: "euler-v2.collateral-deposit", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Deposit borrow collateral", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
3192
+ { id: "euler-v2.collateral-withdraw", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Withdraw borrow collateral", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
3193
+ ]
3194
+ };
3195
+ registerProtocolModule(eulerV2ProtocolModule);
2423
3196
 
2424
3197
  // src/agent/catalog.ts
2425
3198
  registerProtocolModule(uniswapV4ProtocolModule);
2426
3199
  registerProtocolModule(curveDaoProtocolModule);
3200
+ registerProtocolModule(lidoProtocolModule);
3201
+ registerProtocolModule(ethenaProtocolModule);
3202
+ registerProtocolModule(mapleProtocolModule);
3203
+ registerProtocolModule(skyProtocolModule);
3204
+ registerProtocolModule(aaveV4ProtocolModule);
3205
+ registerProtocolModule(eulerV2ProtocolModule);
2427
3206
  function getAgentCatalog() {
2428
3207
  return {
2429
3208
  protocols: getProtocolModules(),
@@ -2434,6 +3213,12 @@ function getAgentCatalog() {
2434
3213
  },
2435
3214
  uniswapV4: uniswapV4ProtocolModule,
2436
3215
  curveDao: curveDaoProtocolModule,
3216
+ lido: lidoProtocolModule,
3217
+ ethena: ethenaProtocolModule,
3218
+ maple: mapleProtocolModule,
3219
+ sky: skyProtocolModule,
3220
+ aaveV4: aaveV4ProtocolModule,
3221
+ eulerV2: eulerV2ProtocolModule,
2437
3222
  /** Prefer getAgentCatalogForMcp() or getMcpToolDefinitions() for MCP servers. */
2438
3223
  mcp: getAgentCatalogForMcp()
2439
3224
  };
@@ -2447,6 +3232,7 @@ exports.NEAR_CHAIN_CATEGORY = NEAR_CHAIN_CATEGORY;
2447
3232
  exports.SOLANA_CHAIN_CATEGORY = SOLANA_CHAIN_CATEGORY;
2448
3233
  exports.alignEip1559FeesWithLatestBase = alignEip1559FeesWithLatestBase;
2449
3234
  exports.buildEvmMultisignBatch = buildEvmMultisignBatch;
3235
+ exports.buildManagementPostBody = buildManagementPostBody;
2450
3236
  exports.chainSnapshotForCustomGasExtraJSON = chainSnapshotForCustomGasExtraJSON;
2451
3237
  exports.composeFeePayloadToTxParams = composeFeePayloadToTxParams;
2452
3238
  exports.coreChainCategoryModule = coreChainCategoryModule;
@@ -2454,6 +3240,8 @@ exports.curveDao = curveDao;
2454
3240
  exports.curveDaoProtocolModule = curveDaoProtocolModule;
2455
3241
  exports.evmChainCategoryModule = evmChainCategoryModule;
2456
3242
  exports.fetchChainFeeParams = fetchChainFeeParams;
3243
+ exports.fetchManagementNonce = fetchManagementNonce;
3244
+ exports.fetchNodeKey = fetchNodeKey;
2457
3245
  exports.finalizeMultisign = finalizeMultisign;
2458
3246
  exports.firstClientIdFromKeyGen = firstClientIdFromKeyGen;
2459
3247
  exports.gasLimitFromEstimateAndChainConfig = gasLimitFromEstimateAndChainConfig;
@@ -2463,11 +3251,15 @@ exports.getProtocolModule = getProtocolModule;
2463
3251
  exports.getProtocolModules = getProtocolModules;
2464
3252
  exports.gweiToDecimalString = gweiToDecimalString;
2465
3253
  exports.isEvmNativeToken = isEvmNativeToken;
3254
+ exports.isValidRpcUrl = isValidRpcUrl;
2466
3255
  exports.keyListFromKeyGen = keyListFromKeyGen;
3256
+ exports.managementSigFields = managementSigFields;
2467
3257
  exports.matchEvmTokenKind = matchEvmTokenKind;
2468
3258
  exports.mergePurposeText = mergePurposeText;
3259
+ exports.messageToSignManagementBody = messageToSignManagementBody;
2469
3260
  exports.nearChainCategoryModule = nearChainCategoryModule;
2470
3261
  exports.nodeFetchWithReadAuth = nodeFetchWithReadAuth;
3262
+ exports.normalizeManagementNodeKey = normalizeManagementNodeKey;
2471
3263
  exports.parseEvmChainIdToNumber = parseEvmChainIdToNumber;
2472
3264
  exports.proposalTxParamsToFeeSnapshot = proposalTxParamsToFeeSnapshot;
2473
3265
  exports.registerProtocolModule = registerProtocolModule;
@@ -2477,5 +3269,6 @@ exports.solanaChainCategoryModule = solanaChainCategoryModule;
2477
3269
  exports.triggerTxParamsFromComposeBody = triggerTxParamsFromComposeBody;
2478
3270
  exports.uniswapV4 = uniswapV4;
2479
3271
  exports.uniswapV4ProtocolModule = uniswapV4ProtocolModule;
3272
+ exports.withManagementClientSig = withManagementClientSig;
2480
3273
  //# sourceMappingURL=index.cjs.map
2481
3274
  //# sourceMappingURL=index.cjs.map