@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.
- package/README.md +16 -1
- package/dist/agent/catalog.cjs +913 -142
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.cts +834 -12
- package/dist/agent/catalog.d.ts +834 -12
- package/dist/agent/catalog.js +863 -143
- package/dist/agent/catalog.js.map +1 -1
- package/dist/chains/evm/index.cjs +13 -0
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.d.cts +3 -1
- package/dist/chains/evm/index.d.ts +3 -1
- package/dist/chains/evm/index.js +13 -1
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/core/index.cjs +76 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +35 -2
- package/dist/core/index.d.ts +35 -2
- package/dist/core/index.js +70 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +934 -141
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +927 -142
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +1987 -0
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -0
- package/dist/protocols/evm/aave-v4/index.d.cts +500 -0
- package/dist/protocols/evm/aave-v4/index.d.ts +500 -0
- package/dist/protocols/evm/aave-v4/index.js +1943 -0
- package/dist/protocols/evm/aave-v4/index.js.map +1 -0
- package/dist/protocols/evm/ethena/index.cjs +965 -0
- package/dist/protocols/evm/ethena/index.cjs.map +1 -0
- package/dist/protocols/evm/ethena/index.d.cts +161 -0
- package/dist/protocols/evm/ethena/index.d.ts +161 -0
- package/dist/protocols/evm/ethena/index.js +943 -0
- package/dist/protocols/evm/ethena/index.js.map +1 -0
- package/dist/protocols/evm/euler-v2/index.cjs +2263 -0
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -0
- package/dist/protocols/evm/euler-v2/index.d.cts +317 -0
- package/dist/protocols/evm/euler-v2/index.d.ts +317 -0
- package/dist/protocols/evm/euler-v2/index.js +2238 -0
- package/dist/protocols/evm/euler-v2/index.js.map +1 -0
- package/dist/protocols/evm/lido/index.cjs +834 -0
- package/dist/protocols/evm/lido/index.cjs.map +1 -0
- package/dist/protocols/evm/lido/index.d.cts +120 -0
- package/dist/protocols/evm/lido/index.d.ts +120 -0
- package/dist/protocols/evm/lido/index.js +809 -0
- package/dist/protocols/evm/lido/index.js.map +1 -0
- package/dist/protocols/evm/maple/index.cjs +707 -0
- package/dist/protocols/evm/maple/index.cjs.map +1 -0
- package/dist/protocols/evm/maple/index.d.cts +109 -0
- package/dist/protocols/evm/maple/index.d.ts +109 -0
- package/dist/protocols/evm/maple/index.js +693 -0
- package/dist/protocols/evm/maple/index.js.map +1 -0
- package/dist/protocols/evm/sky/index.cjs +1254 -0
- package/dist/protocols/evm/sky/index.cjs.map +1 -0
- package/dist/protocols/evm/sky/index.d.cts +218 -0
- package/dist/protocols/evm/sky/index.d.ts +218 -0
- package/dist/protocols/evm/sky/index.js +1229 -0
- package/dist/protocols/evm/sky/index.js.map +1 -0
- package/dist/protocols/evm/uniswap-v4/index.cjs +31 -11
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.d.cts +2 -1
- package/dist/protocols/evm/uniswap-v4/index.d.ts +2 -1
- package/dist/protocols/evm/uniswap-v4/index.js +31 -11
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/package.json +37 -3
package/dist/agent/catalog.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('viem');
|
|
3
|
+
var viem = require('viem');
|
|
4
|
+
var zodToJsonSchema = require('zod-to-json-schema');
|
|
5
|
+
var zod = require('zod');
|
|
4
6
|
|
|
5
7
|
// src/core/registry.ts
|
|
6
8
|
var modules = [];
|
|
@@ -247,46 +249,606 @@ var MULTISIGN_OUTPUT_DOC = {
|
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
251
|
};
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
if (d) out[k] = { type: d.type, description: d.description };
|
|
257
|
-
}
|
|
258
|
-
for (const [k, d] of Object.entries(params)) {
|
|
259
|
-
out[k] = { type: d.type, description: d.description };
|
|
260
|
-
}
|
|
261
|
-
return out;
|
|
262
|
-
}
|
|
263
|
-
function requiredKeys(params, includeCommon = []) {
|
|
264
|
-
const req = [];
|
|
265
|
-
for (const k of includeCommon) {
|
|
266
|
-
if (EVM_COMMON_PARAM_DOCS[k]?.required) req.push(k);
|
|
267
|
-
}
|
|
268
|
-
for (const [k, d] of Object.entries(params)) {
|
|
269
|
-
if (d.required) req.push(k);
|
|
270
|
-
}
|
|
271
|
-
return req;
|
|
272
|
-
}
|
|
273
|
-
var multisignOutputSchema = {
|
|
274
|
-
type: "object",
|
|
275
|
-
description: MULTISIGN_OUTPUT_DOC.description,
|
|
276
|
-
properties: {
|
|
277
|
-
bodyForSign: {
|
|
278
|
-
type: "object",
|
|
279
|
-
description: MULTISIGN_OUTPUT_DOC.fields.bodyForSign.description
|
|
252
|
+
var MANAGEMENT_SIG_DOC = {
|
|
253
|
+
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.",
|
|
254
|
+
fields: {
|
|
255
|
+
nonce: {
|
|
256
|
+
type: "number",
|
|
257
|
+
description: "From GET /getPublicMgtKeyNonce (Ed25519) or GET /getNodeMgtKeyNonce (Ethereum NodeMgtKey)."
|
|
280
258
|
},
|
|
281
|
-
|
|
259
|
+
clientSig: {
|
|
260
|
+
type: "string",
|
|
261
|
+
description: "Management signature; empty string in the message to sign."
|
|
262
|
+
},
|
|
263
|
+
nodeKey: {
|
|
282
264
|
type: "string",
|
|
283
|
-
description:
|
|
265
|
+
description: "Required. 128-hex MPC node id from GET /getNodeKey (no 0x prefix)."
|
|
284
266
|
}
|
|
285
267
|
},
|
|
286
|
-
|
|
268
|
+
helpers: {
|
|
269
|
+
managementSigFields: "Base envelope with clientSig cleared.",
|
|
270
|
+
buildManagementPostBody: "Spread managementSigFields then endpoint fields.",
|
|
271
|
+
messageToSignManagementBody: "Canonical JSON string to sign.",
|
|
272
|
+
withManagementClientSig: "Attach signature to POST body.",
|
|
273
|
+
fetchNodeKey: "GET /getNodeKey via nodeFetchWithReadAuth.",
|
|
274
|
+
fetchManagementNonce: "GET nonce for Ed25519 or Ethereum management key."
|
|
275
|
+
}
|
|
287
276
|
};
|
|
288
|
-
|
|
289
|
-
{
|
|
277
|
+
function zodSchemaToMcpJsonSchema(schema) {
|
|
278
|
+
const raw = zodToJsonSchema.zodToJsonSchema(schema, {
|
|
279
|
+
target: "openApi3",
|
|
280
|
+
$refStrategy: "none"
|
|
281
|
+
});
|
|
282
|
+
if (raw.type === "object" || raw.type === "array" || raw.type === "string") {
|
|
283
|
+
const { $schema: _s, ...rest } = raw;
|
|
284
|
+
return rest;
|
|
285
|
+
}
|
|
286
|
+
const defs = raw.definitions;
|
|
287
|
+
if (defs) {
|
|
288
|
+
const first = Object.values(defs)[0];
|
|
289
|
+
if (first?.type) {
|
|
290
|
+
const { $schema: _s, ...rest } = first;
|
|
291
|
+
return rest;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return raw;
|
|
295
|
+
}
|
|
296
|
+
var evmAddressSchema = zod.z.string().min(1).describe("EVM address (0x-prefixed, 40 hex nibbles)");
|
|
297
|
+
var keyGenSchema = zod.z.object({
|
|
298
|
+
pubkeyhex: zod.z.string().min(1).describe("MPC secp256k1 public key hex (required for multiSignRequest pubKey)"),
|
|
299
|
+
keylist: zod.z.array(zod.z.string()).optional().describe("Key list on the sign request"),
|
|
300
|
+
ClientKeys: zod.z.record(zod.z.string()).optional().describe("Optional client key map from keyGen")
|
|
301
|
+
}).describe(
|
|
302
|
+
"MPC key slice: { pubkeyhex, keylist?, ClientKeys? }. Used for pubKey/keyList on POST /multiSignRequest."
|
|
303
|
+
);
|
|
304
|
+
var chainDetailSchema = zod.z.object({
|
|
305
|
+
legacy: zod.z.boolean().optional(),
|
|
306
|
+
gasLimit: zod.z.number().optional(),
|
|
307
|
+
gasMultiplier: zod.z.number().optional(),
|
|
308
|
+
gasPrice: zod.z.number().optional(),
|
|
309
|
+
baseFee: zod.z.number().optional(),
|
|
310
|
+
priorityFee: zod.z.number().optional(),
|
|
311
|
+
baseFeeMultiplier: zod.z.number().optional()
|
|
312
|
+
}).passthrough().describe(
|
|
313
|
+
"Optional gas config: { legacy?, gasLimit?, gasMultiplier?, gasPrice?, baseFee?, priorityFee?, baseFeeMultiplier? }."
|
|
314
|
+
);
|
|
315
|
+
var evmMultisignCommonInputSchema = zod.z.object({
|
|
316
|
+
keyGen: keyGenSchema,
|
|
317
|
+
purposeText: zod.z.string().min(1).describe(
|
|
318
|
+
"Human-readable purpose for the sign request. Stored in bodyForSign.purpose (may be appended with an automatic batch suffix)."
|
|
319
|
+
),
|
|
320
|
+
useCustomGas: zod.z.boolean().describe(
|
|
321
|
+
"When true, apply chain gas settings from chainDetail / customGasChainDetails instead of raw RPC estimates only."
|
|
322
|
+
),
|
|
323
|
+
chainId: zod.z.number().int().positive().describe("EVM chain id (decimal). Becomes destinationChainID on the sign request."),
|
|
324
|
+
rpcUrl: zod.z.string().min(1).describe("HTTPS JSON-RPC URL for gas estimation, nonce, and allowance reads."),
|
|
325
|
+
executorAddress: evmAddressSchema.describe(
|
|
326
|
+
"MPC wallet address (from keyGen ethereumaddress) \u2014 tx sender for estimates and approvals."
|
|
327
|
+
),
|
|
328
|
+
chainDetail: chainDetailSchema,
|
|
329
|
+
customGasChainDetails: zod.z.record(zod.z.unknown()).optional().describe("Snapshot written to extraJSON.customGasChainDetails when useCustomGas is true.")
|
|
330
|
+
});
|
|
331
|
+
var multisignOutputSchema = zod.z.object({
|
|
332
|
+
bodyForSign: zod.z.record(zod.z.unknown()).describe(
|
|
333
|
+
"POST body fields without clientSig: keyList, pubKey, msgHash, msgRaw, destinationChainID, purpose, extraJSON, proposalTxParams (batch), messageHashes/messageRawBatch when N>1 txs."
|
|
334
|
+
),
|
|
335
|
+
messageToSign: zod.z.string().describe("JSON.stringify(bodyForSign) \u2014 exact string to sign before adding clientSig.")
|
|
336
|
+
}).describe(
|
|
337
|
+
"Unsigned mpc-auth multiSignRequest payload. Sign messageToSign and POST { ...bodyForSign, clientSig, signedMessage } to /multiSignRequest."
|
|
338
|
+
);
|
|
339
|
+
var jsonObjectSchema = zod.z.record(zod.z.unknown());
|
|
340
|
+
var uniswapQuoteTradeTypeSchema = zod.z.enum(["EXACT_INPUT", "EXACT_OUTPUT"]);
|
|
341
|
+
var mcpUniswapV4QuoteInputSchema = zod.z.object({
|
|
342
|
+
type: uniswapQuoteTradeTypeSchema.describe("EXACT_INPUT or EXACT_OUTPUT"),
|
|
343
|
+
amount: zod.z.string().min(1).describe("Amount in token-in base units (wei string for ERC-20)"),
|
|
344
|
+
tokenIn: zod.z.string().min(1).describe("Input token; 0x0 for native ETH"),
|
|
345
|
+
tokenOut: zod.z.string().min(1).describe("Output token address"),
|
|
346
|
+
chainId: zod.z.union([zod.z.number().int().positive(), zod.z.string().min(1)]).describe("tokenInChainId / same-chain default"),
|
|
347
|
+
uniswapApiKey: zod.z.string().min(1).describe("Uniswap Trade API x-api-key"),
|
|
348
|
+
swapper: evmAddressSchema.optional().describe("MPC executor; omit if keyGen + managementNodeUrl provided"),
|
|
349
|
+
slippage: zod.z.union([zod.z.number(), zod.z.string()]).optional().describe("Slippage percent; omit for API auto slippage"),
|
|
350
|
+
keyGen: zod.z.string().optional().describe("KeyGen id \u2014 resolves swapper via GET /getKeyGenResultById when swapper omitted"),
|
|
351
|
+
managementNodeUrl: zod.z.string().min(1).optional().describe("MPC node base URL; required with keyGen when swapper is omitted"),
|
|
352
|
+
tokenInChainId: zod.z.union([zod.z.number(), zod.z.string()]).optional(),
|
|
353
|
+
tokenOutChainId: zod.z.union([zod.z.number(), zod.z.string()]).optional(),
|
|
354
|
+
permit2Disabled: zod.z.boolean().optional(),
|
|
355
|
+
baseUrl: zod.z.string().optional(),
|
|
356
|
+
universalRouterVersion: zod.z.string().optional()
|
|
357
|
+
});
|
|
358
|
+
var mcpUniswapV4QuoteOutputSchema = jsonObjectSchema.describe(
|
|
359
|
+
"Full Uniswap POST /quote JSON (includes nested quote object with input/output amounts)."
|
|
360
|
+
);
|
|
361
|
+
var mcpUniswapV4CreateSwapInputSchema = zod.z.object({
|
|
362
|
+
uniswapApiKey: zod.z.string().min(1).describe("Uniswap Trade API key"),
|
|
363
|
+
fullQuoteFromPermit: jsonObjectSchema.describe("Full quote JSON from ctm_uniswap_v4_quote"),
|
|
364
|
+
swapTransactionDeadlineUnix: zod.z.number().int().positive().optional().describe("On-chain deadline unix seconds; default ~30 min from now"),
|
|
365
|
+
useServerProxy: zod.z.boolean().optional().describe("Set false in Node/agents; true only in browser via Next API route"),
|
|
366
|
+
baseUrl: zod.z.string().optional(),
|
|
367
|
+
universalRouterVersion: zod.z.string().optional()
|
|
368
|
+
});
|
|
369
|
+
var mcpUniswapV4CreateSwapOutputSchema = zod.z.object({
|
|
370
|
+
swap: jsonObjectSchema.describe("Universal Router tx: { to, data, value, gasLimit? }"),
|
|
371
|
+
requestId: zod.z.string().optional(),
|
|
372
|
+
gasFee: zod.z.string().optional()
|
|
373
|
+
}).passthrough().describe("{ swap: TransactionRequest, requestId?, gasFee? }");
|
|
374
|
+
var swapTxRequestSchema = jsonObjectSchema.describe("swap field from create_swap response (to, data, value)");
|
|
375
|
+
var mcpUniswapV4BuildSwapMultisignInputSchema = evmMultisignCommonInputSchema.extend({
|
|
376
|
+
tokenIn: evmAddressSchema.describe("Token in; 0x0 for native ETH"),
|
|
377
|
+
swap: swapTxRequestSchema,
|
|
378
|
+
createSwapResponse: zod.z.object({
|
|
379
|
+
swap: swapTxRequestSchema,
|
|
380
|
+
requestId: zod.z.string().optional(),
|
|
381
|
+
gasFee: zod.z.string().optional()
|
|
382
|
+
}).passthrough().describe("Full create_swap response"),
|
|
383
|
+
fullQuoteSnapshot: jsonObjectSchema.describe("Quote JSON used for the swap"),
|
|
384
|
+
swapDeadlineUnix: zod.z.number().describe("Same deadline passed to create_swap"),
|
|
385
|
+
slippagePercent: zod.z.number().optional().describe("Extra approve headroom for EXACT_OUTPUT")
|
|
386
|
+
});
|
|
387
|
+
var mcpCurveDaoBuildSwapMultisignInputSchema = evmMultisignCommonInputSchema.extend({
|
|
388
|
+
tokenIn: evmAddressSchema.describe("ERC-20 sold (native in uses WETH path in UI)"),
|
|
389
|
+
tokenOut: zod.z.string().min(1).describe("Output token or 0xeeee\u2026 native placeholder"),
|
|
390
|
+
amountHuman: zod.z.string().min(1).describe("Human-readable amount of tokenIn"),
|
|
391
|
+
slippagePercent: zod.z.number().gt(0).lt(100).describe("Slippage 0\u2013100 exclusive")
|
|
392
|
+
});
|
|
393
|
+
function mcpMultisignInput(fields) {
|
|
394
|
+
return evmMultisignCommonInputSchema.extend(fields);
|
|
395
|
+
}
|
|
396
|
+
var mcpLidoSubmitInputSchema = mcpMultisignInput({
|
|
397
|
+
valueWei: zod.z.string().min(1).describe("ETH to stake (wei decimal string)"),
|
|
398
|
+
referral: evmAddressSchema.optional()
|
|
399
|
+
});
|
|
400
|
+
var mcpLidoRequestWithdrawalsInputSchema = mcpMultisignInput({
|
|
401
|
+
stEthAmountsWei: zod.z.array(zod.z.string()).min(1).describe("stETH amounts per withdrawal request (wei strings)")
|
|
402
|
+
});
|
|
403
|
+
var mcpLidoClaimWithdrawalInputSchema = mcpMultisignInput({
|
|
404
|
+
requestId: zod.z.union([zod.z.string(), zod.z.number()]).describe("Withdrawal queue request id")
|
|
405
|
+
});
|
|
406
|
+
var mcpLidoWrapStEthInputSchema = mcpMultisignInput({
|
|
407
|
+
stEthAmountWei: zod.z.string().min(1)
|
|
408
|
+
});
|
|
409
|
+
var mcpLidoUnwrapWstEthInputSchema = mcpMultisignInput({
|
|
410
|
+
wstEthAmountWei: zod.z.string().min(1)
|
|
411
|
+
});
|
|
412
|
+
var mcpEthenaStakeInputSchema = mcpMultisignInput({
|
|
413
|
+
usdeAmountHuman: zod.z.string().min(1),
|
|
414
|
+
susdeVault: evmAddressSchema.optional()
|
|
415
|
+
});
|
|
416
|
+
var mcpEthenaRedeemInputSchema = mcpMultisignInput({
|
|
417
|
+
susdeSharesHuman: zod.z.string().min(1),
|
|
418
|
+
susdeVault: evmAddressSchema.optional()
|
|
419
|
+
});
|
|
420
|
+
var mcpEthenaCooldownInputSchema = mcpMultisignInput({
|
|
421
|
+
susdeSharesHuman: zod.z.string().min(1),
|
|
422
|
+
susdeVault: evmAddressSchema.optional()
|
|
423
|
+
});
|
|
424
|
+
var mcpEthenaClaimInputSchema = mcpMultisignInput({
|
|
425
|
+
susdeVault: evmAddressSchema.optional()
|
|
426
|
+
});
|
|
427
|
+
var mcpMapleDepositInputSchema = mcpMultisignInput({
|
|
428
|
+
syrupRouter: evmAddressSchema,
|
|
429
|
+
pool: evmAddressSchema,
|
|
430
|
+
asset: evmAddressSchema,
|
|
431
|
+
amountHuman: zod.z.string().min(1),
|
|
432
|
+
authorizeSig: jsonObjectSchema.optional()
|
|
433
|
+
});
|
|
434
|
+
var mcpMapleRequestRedeemInputSchema = mcpMultisignInput({
|
|
435
|
+
pool: evmAddressSchema,
|
|
436
|
+
sharesHuman: zod.z.string().min(1),
|
|
437
|
+
receiver: evmAddressSchema
|
|
438
|
+
});
|
|
439
|
+
var mcpSkyLockstakeStakeInputSchema = mcpMultisignInput({
|
|
440
|
+
skyAmountHuman: zod.z.string().min(1),
|
|
441
|
+
usdsDrawHuman: zod.z.string().optional(),
|
|
442
|
+
farmRef: zod.z.string().optional()
|
|
443
|
+
});
|
|
444
|
+
var mcpSkyLockstakeDrawInputSchema = mcpMultisignInput({
|
|
445
|
+
usdsAmountHuman: zod.z.string().min(1),
|
|
446
|
+
urnIndex: zod.z.number().int().nonnegative()
|
|
447
|
+
});
|
|
448
|
+
var mcpSkyLockstakeWipeInputSchema = mcpMultisignInput({
|
|
449
|
+
usdsAmountHuman: zod.z.string().min(1),
|
|
450
|
+
urnIndex: zod.z.number().int().nonnegative()
|
|
451
|
+
});
|
|
452
|
+
var mcpSkyLockstakeCloseInputSchema = mcpMultisignInput({
|
|
453
|
+
urnIndex: zod.z.number().int().nonnegative()
|
|
454
|
+
});
|
|
455
|
+
var mcpSkyLockstakeGetRewardInputSchema = mcpMultisignInput({
|
|
456
|
+
urnIndex: zod.z.number().int().nonnegative()
|
|
457
|
+
});
|
|
458
|
+
var mcpSkySusdsDepositInputSchema = mcpMultisignInput({
|
|
459
|
+
usdsAmountHuman: zod.z.string().min(1)
|
|
460
|
+
});
|
|
461
|
+
var mcpSkySusdsRedeemInputSchema = mcpMultisignInput({
|
|
462
|
+
sharesHuman: zod.z.string().min(1)
|
|
463
|
+
});
|
|
464
|
+
var mcpAaveV4DepositInputSchema = mcpMultisignInput({
|
|
465
|
+
spoke: evmAddressSchema,
|
|
466
|
+
underlying: evmAddressSchema,
|
|
467
|
+
amountHuman: zod.z.string().min(1),
|
|
468
|
+
marketId: zod.z.string().min(1)
|
|
469
|
+
});
|
|
470
|
+
var mcpAaveV4WithdrawInputSchema = mcpMultisignInput({
|
|
471
|
+
spoke: evmAddressSchema,
|
|
472
|
+
underlying: evmAddressSchema,
|
|
473
|
+
amountHuman: zod.z.string().min(1),
|
|
474
|
+
marketId: zod.z.string().min(1)
|
|
475
|
+
});
|
|
476
|
+
var mcpAaveV4BorrowInputSchema = mcpMultisignInput({
|
|
477
|
+
spoke: evmAddressSchema,
|
|
478
|
+
underlying: evmAddressSchema,
|
|
479
|
+
amountHuman: zod.z.string().min(1),
|
|
480
|
+
marketId: zod.z.string().min(1)
|
|
481
|
+
});
|
|
482
|
+
var mcpAaveV4RepayInputSchema = mcpMultisignInput({
|
|
483
|
+
spoke: evmAddressSchema,
|
|
484
|
+
underlying: evmAddressSchema,
|
|
485
|
+
amountHuman: zod.z.string().min(1),
|
|
486
|
+
marketId: zod.z.string().min(1)
|
|
487
|
+
});
|
|
488
|
+
var mcpEulerV2IsolatedLendInputSchema = mcpMultisignInput({
|
|
489
|
+
vault: evmAddressSchema,
|
|
490
|
+
assetAmountHuman: zod.z.string().min(1)
|
|
491
|
+
});
|
|
492
|
+
var mcpEulerV2IsolatedBorrowInputSchema = mcpMultisignInput({
|
|
493
|
+
vault: evmAddressSchema,
|
|
494
|
+
collateralAsset: evmAddressSchema,
|
|
495
|
+
borrowAsset: evmAddressSchema,
|
|
496
|
+
collateralAmountHuman: zod.z.string().min(1),
|
|
497
|
+
loopBorrowWeis: zod.z.array(zod.z.string()).min(1)
|
|
498
|
+
});
|
|
499
|
+
var mcpEulerV2VaultWithdrawInputSchema = mcpMultisignInput({
|
|
500
|
+
vault: evmAddressSchema,
|
|
501
|
+
sharesHuman: zod.z.string().min(1)
|
|
502
|
+
});
|
|
503
|
+
var mcpEulerV2BorrowRepayInputSchema = mcpMultisignInput({
|
|
504
|
+
vault: evmAddressSchema,
|
|
505
|
+
amountHuman: zod.z.string().min(1)
|
|
506
|
+
});
|
|
507
|
+
var mcpEulerV2CollateralDepositInputSchema = mcpMultisignInput({
|
|
508
|
+
vault: evmAddressSchema,
|
|
509
|
+
collateralAsset: evmAddressSchema,
|
|
510
|
+
amountHuman: zod.z.string().min(1)
|
|
511
|
+
});
|
|
512
|
+
var mcpEulerV2CollateralWithdrawInputSchema = mcpMultisignInput({
|
|
513
|
+
vault: evmAddressSchema,
|
|
514
|
+
collateralAsset: evmAddressSchema,
|
|
515
|
+
amountHuman: zod.z.string().min(1)
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
// src/agent/mcpProtocolTools.ts
|
|
519
|
+
function defineProtocolMcpTool(def) {
|
|
520
|
+
return {
|
|
521
|
+
...def,
|
|
522
|
+
outputZod: multisignOutputSchema,
|
|
523
|
+
inputSchema: zodSchemaToMcpJsonSchema(def.inputZod),
|
|
524
|
+
outputSchema: zodSchemaToMcpJsonSchema(multisignOutputSchema),
|
|
525
|
+
parseInput: (data) => def.inputZod.parse(data),
|
|
526
|
+
parseOutput: (data) => multisignOutputSchema.parse(data)
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
530
|
+
defineProtocolMcpTool({
|
|
531
|
+
name: "ctm_lido_build_submit_multisign",
|
|
532
|
+
actionId: "lido.submit",
|
|
533
|
+
protocolId: "lido",
|
|
534
|
+
chainCategory: "evm",
|
|
535
|
+
description: "Build mpc-auth multiSignRequest for Lido ETH stake (submit).",
|
|
536
|
+
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
537
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
538
|
+
handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoSubmit" },
|
|
539
|
+
inputZod: mcpLidoSubmitInputSchema
|
|
540
|
+
}),
|
|
541
|
+
defineProtocolMcpTool({
|
|
542
|
+
name: "ctm_lido_build_request_withdrawals_multisign",
|
|
543
|
+
actionId: "lido.request-withdrawals",
|
|
544
|
+
protocolId: "lido",
|
|
545
|
+
chainCategory: "evm",
|
|
546
|
+
description: "Build batch for Lido withdrawal queue (approve + requestWithdrawals).",
|
|
547
|
+
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
548
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
549
|
+
handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoRequestWithdrawals" },
|
|
550
|
+
inputZod: mcpLidoRequestWithdrawalsInputSchema
|
|
551
|
+
}),
|
|
552
|
+
defineProtocolMcpTool({
|
|
553
|
+
name: "ctm_lido_build_claim_withdrawal_multisign",
|
|
554
|
+
actionId: "lido.claim-withdrawal",
|
|
555
|
+
protocolId: "lido",
|
|
556
|
+
chainCategory: "evm",
|
|
557
|
+
description: "Build tx for Lido claimWithdrawal.",
|
|
558
|
+
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
559
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
560
|
+
handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoClaimWithdrawal" },
|
|
561
|
+
inputZod: mcpLidoClaimWithdrawalInputSchema
|
|
562
|
+
}),
|
|
563
|
+
defineProtocolMcpTool({
|
|
564
|
+
name: "ctm_lido_build_wrap_steth_multisign",
|
|
565
|
+
actionId: "lido.wrap-steth",
|
|
566
|
+
protocolId: "lido",
|
|
567
|
+
chainCategory: "evm",
|
|
568
|
+
description: "Build batch for wstETH wrap.",
|
|
569
|
+
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
570
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
571
|
+
handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoWrapStEth" },
|
|
572
|
+
inputZod: mcpLidoWrapStEthInputSchema
|
|
573
|
+
}),
|
|
574
|
+
defineProtocolMcpTool({
|
|
575
|
+
name: "ctm_lido_build_unwrap_wsteth_multisign",
|
|
576
|
+
actionId: "lido.unwrap-wsteth",
|
|
577
|
+
protocolId: "lido",
|
|
578
|
+
chainCategory: "evm",
|
|
579
|
+
description: "Build tx for wstETH unwrap.",
|
|
580
|
+
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
581
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
582
|
+
handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoUnwrapWstEth" },
|
|
583
|
+
inputZod: mcpLidoUnwrapWstEthInputSchema
|
|
584
|
+
}),
|
|
585
|
+
defineProtocolMcpTool({
|
|
586
|
+
name: "ctm_ethena_build_stake_multisign",
|
|
587
|
+
actionId: "ethena.stake-usde",
|
|
588
|
+
protocolId: "ethena",
|
|
589
|
+
chainCategory: "evm",
|
|
590
|
+
description: "Build batch: USDe approve + sUSDe deposit.",
|
|
591
|
+
prerequisites: ["keyGen", "executorAddress", "Ethereum mainnet RPC"],
|
|
592
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
593
|
+
handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaUsdeStakeToSusde" },
|
|
594
|
+
inputZod: mcpEthenaStakeInputSchema
|
|
595
|
+
}),
|
|
596
|
+
defineProtocolMcpTool({
|
|
597
|
+
name: "ctm_ethena_build_redeem_multisign",
|
|
598
|
+
actionId: "ethena.redeem-susde",
|
|
599
|
+
protocolId: "ethena",
|
|
600
|
+
chainCategory: "evm",
|
|
601
|
+
description: "Build sUSDe redeem when cooldown is off.",
|
|
602
|
+
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
603
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
604
|
+
handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaSusdeRedeemToUsde" },
|
|
605
|
+
inputZod: mcpEthenaRedeemInputSchema
|
|
606
|
+
}),
|
|
607
|
+
defineProtocolMcpTool({
|
|
608
|
+
name: "ctm_ethena_build_cooldown_multisign",
|
|
609
|
+
actionId: "ethena.cooldown-shares",
|
|
610
|
+
protocolId: "ethena",
|
|
611
|
+
chainCategory: "evm",
|
|
612
|
+
description: "Build sUSDe cooldownShares batch step.",
|
|
613
|
+
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
614
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
615
|
+
handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaSusdeCooldownShares" },
|
|
616
|
+
inputZod: mcpEthenaCooldownInputSchema
|
|
617
|
+
}),
|
|
618
|
+
defineProtocolMcpTool({
|
|
619
|
+
name: "ctm_ethena_build_claim_multisign",
|
|
620
|
+
actionId: "ethena.claim-unstake",
|
|
621
|
+
protocolId: "ethena",
|
|
622
|
+
chainCategory: "evm",
|
|
623
|
+
description: "Build unstake claim after cooldown.",
|
|
624
|
+
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
625
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
626
|
+
handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaUnstakeClaim" },
|
|
627
|
+
inputZod: mcpEthenaClaimInputSchema
|
|
628
|
+
}),
|
|
629
|
+
defineProtocolMcpTool({
|
|
630
|
+
name: "ctm_maple_build_deposit_multisign",
|
|
631
|
+
actionId: "maple-syrup.deposit",
|
|
632
|
+
protocolId: "maple-syrup",
|
|
633
|
+
chainCategory: "evm",
|
|
634
|
+
description: "Build Maple Syrup router deposit batch.",
|
|
635
|
+
prerequisites: ["keyGen", "executorAddress", "router + pool addresses"],
|
|
636
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
637
|
+
handler: { importPath: "protocols/evm/maple", exportName: "buildEvmMultisignBodyMapleSyrupDeposit" },
|
|
638
|
+
inputZod: mcpMapleDepositInputSchema
|
|
639
|
+
}),
|
|
640
|
+
defineProtocolMcpTool({
|
|
641
|
+
name: "ctm_maple_build_request_redeem_multisign",
|
|
642
|
+
actionId: "maple-syrup.request-redeem",
|
|
643
|
+
protocolId: "maple-syrup",
|
|
644
|
+
chainCategory: "evm",
|
|
645
|
+
description: "Build Maple PoolV2 requestRedeem batch.",
|
|
646
|
+
prerequisites: ["keyGen", "executorAddress", "pool address"],
|
|
647
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
648
|
+
handler: { importPath: "protocols/evm/maple", exportName: "buildEvmMultisignBodyMaplePoolRequestRedeem" },
|
|
649
|
+
inputZod: mcpMapleRequestRedeemInputSchema
|
|
650
|
+
}),
|
|
651
|
+
defineProtocolMcpTool({
|
|
652
|
+
name: "ctm_sky_build_lockstake_stake_multisign",
|
|
653
|
+
actionId: "sky.lockstake-stake",
|
|
654
|
+
protocolId: "sky",
|
|
655
|
+
chainCategory: "evm",
|
|
656
|
+
description: "Build Sky Lockstake open/stake batch.",
|
|
657
|
+
prerequisites: ["keyGen", "executorAddress", "Ethereum mainnet RPC"],
|
|
658
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
659
|
+
handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeStakePositionBatch" },
|
|
660
|
+
inputZod: mcpSkyLockstakeStakeInputSchema
|
|
661
|
+
}),
|
|
662
|
+
defineProtocolMcpTool({
|
|
663
|
+
name: "ctm_sky_build_lockstake_draw_multisign",
|
|
664
|
+
actionId: "sky.lockstake-draw",
|
|
665
|
+
protocolId: "sky",
|
|
666
|
+
chainCategory: "evm",
|
|
667
|
+
description: "Build Lockstake draw (borrow USDS).",
|
|
668
|
+
prerequisites: ["keyGen", "executorAddress", "open urn"],
|
|
669
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
670
|
+
handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeDrawBatch" },
|
|
671
|
+
inputZod: mcpSkyLockstakeDrawInputSchema
|
|
672
|
+
}),
|
|
673
|
+
defineProtocolMcpTool({
|
|
674
|
+
name: "ctm_sky_build_lockstake_wipe_multisign",
|
|
675
|
+
actionId: "sky.lockstake-wipe",
|
|
676
|
+
protocolId: "sky",
|
|
677
|
+
chainCategory: "evm",
|
|
678
|
+
description: "Build Lockstake repay/wipe batch.",
|
|
679
|
+
prerequisites: ["keyGen", "executorAddress", "urn index"],
|
|
680
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
681
|
+
handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeWipeBatch" },
|
|
682
|
+
inputZod: mcpSkyLockstakeWipeInputSchema
|
|
683
|
+
}),
|
|
684
|
+
defineProtocolMcpTool({
|
|
685
|
+
name: "ctm_sky_build_lockstake_close_multisign",
|
|
686
|
+
actionId: "sky.lockstake-close",
|
|
687
|
+
protocolId: "sky",
|
|
688
|
+
chainCategory: "evm",
|
|
689
|
+
description: "Build Lockstake close position batch.",
|
|
690
|
+
prerequisites: ["keyGen", "executorAddress", "urn index"],
|
|
691
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
692
|
+
handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeCloseBatch" },
|
|
693
|
+
inputZod: mcpSkyLockstakeCloseInputSchema
|
|
694
|
+
}),
|
|
695
|
+
defineProtocolMcpTool({
|
|
696
|
+
name: "ctm_sky_build_lockstake_get_reward_multisign",
|
|
697
|
+
actionId: "sky.lockstake-get-reward",
|
|
698
|
+
protocolId: "sky",
|
|
699
|
+
chainCategory: "evm",
|
|
700
|
+
description: "Build Lockstake getReward batch.",
|
|
701
|
+
prerequisites: ["keyGen", "executorAddress", "urn index"],
|
|
702
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
703
|
+
handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeGetRewardBatch" },
|
|
704
|
+
inputZod: mcpSkyLockstakeGetRewardInputSchema
|
|
705
|
+
}),
|
|
706
|
+
defineProtocolMcpTool({
|
|
707
|
+
name: "ctm_sky_build_susds_deposit_multisign",
|
|
708
|
+
actionId: "sky.susds-deposit",
|
|
709
|
+
protocolId: "sky",
|
|
710
|
+
chainCategory: "evm",
|
|
711
|
+
description: "Build USDS \u2192 sUSDS ERC-4626 deposit batch.",
|
|
712
|
+
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
713
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
714
|
+
handler: { importPath: "protocols/evm/sky", exportName: "buildSkySusdsDepositFromUsdsBatch" },
|
|
715
|
+
inputZod: mcpSkySusdsDepositInputSchema
|
|
716
|
+
}),
|
|
717
|
+
defineProtocolMcpTool({
|
|
718
|
+
name: "ctm_sky_build_susds_redeem_multisign",
|
|
719
|
+
actionId: "sky.susds-redeem",
|
|
720
|
+
protocolId: "sky",
|
|
721
|
+
chainCategory: "evm",
|
|
722
|
+
description: "Build sUSDS redeem to USDS batch.",
|
|
723
|
+
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
724
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
725
|
+
handler: { importPath: "protocols/evm/sky", exportName: "buildSkySusdsRedeemToUsdsBatch" },
|
|
726
|
+
inputZod: mcpSkySusdsRedeemInputSchema
|
|
727
|
+
}),
|
|
728
|
+
defineProtocolMcpTool({
|
|
729
|
+
name: "ctm_aave_v4_build_deposit_multisign",
|
|
730
|
+
actionId: "aave-v4.deposit",
|
|
731
|
+
protocolId: "aave-v4",
|
|
732
|
+
chainCategory: "evm",
|
|
733
|
+
description: "Build Aave v4 Spoke supply/deposit batch.",
|
|
734
|
+
prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
|
|
735
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
736
|
+
handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4DepositBatch" },
|
|
737
|
+
inputZod: mcpAaveV4DepositInputSchema
|
|
738
|
+
}),
|
|
739
|
+
defineProtocolMcpTool({
|
|
740
|
+
name: "ctm_aave_v4_build_withdraw_multisign",
|
|
741
|
+
actionId: "aave-v4.withdraw",
|
|
742
|
+
protocolId: "aave-v4",
|
|
743
|
+
chainCategory: "evm",
|
|
744
|
+
description: "Build Aave v4 Spoke withdraw batch.",
|
|
745
|
+
prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
|
|
746
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
747
|
+
handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeWithdraw" },
|
|
748
|
+
inputZod: mcpAaveV4WithdrawInputSchema
|
|
749
|
+
}),
|
|
750
|
+
defineProtocolMcpTool({
|
|
751
|
+
name: "ctm_aave_v4_build_borrow_multisign",
|
|
752
|
+
actionId: "aave-v4.borrow",
|
|
753
|
+
protocolId: "aave-v4",
|
|
754
|
+
chainCategory: "evm",
|
|
755
|
+
description: "Build Aave v4 Spoke borrow batch.",
|
|
756
|
+
prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
|
|
757
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
758
|
+
handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeBorrow" },
|
|
759
|
+
inputZod: mcpAaveV4BorrowInputSchema
|
|
760
|
+
}),
|
|
761
|
+
defineProtocolMcpTool({
|
|
762
|
+
name: "ctm_aave_v4_build_repay_multisign",
|
|
763
|
+
actionId: "aave-v4.repay",
|
|
764
|
+
protocolId: "aave-v4",
|
|
765
|
+
chainCategory: "evm",
|
|
766
|
+
description: "Build Aave v4 Spoke repay batch.",
|
|
767
|
+
prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
|
|
768
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
769
|
+
handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeRepay" },
|
|
770
|
+
inputZod: mcpAaveV4RepayInputSchema
|
|
771
|
+
}),
|
|
772
|
+
defineProtocolMcpTool({
|
|
773
|
+
name: "ctm_euler_v2_build_isolated_lend_multisign",
|
|
774
|
+
actionId: "euler-v2.isolated-lend",
|
|
775
|
+
protocolId: "euler-v2",
|
|
776
|
+
chainCategory: "evm",
|
|
777
|
+
description: "Build Euler v2 vault deposit/lend batch.",
|
|
778
|
+
prerequisites: ["keyGen", "executorAddress", "vault address"],
|
|
779
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
780
|
+
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2IsolatedLendDepositBatch" },
|
|
781
|
+
inputZod: mcpEulerV2IsolatedLendInputSchema
|
|
782
|
+
}),
|
|
783
|
+
defineProtocolMcpTool({
|
|
784
|
+
name: "ctm_euler_v2_build_isolated_borrow_multisign",
|
|
785
|
+
actionId: "euler-v2.isolated-borrow",
|
|
786
|
+
protocolId: "euler-v2",
|
|
787
|
+
chainCategory: "evm",
|
|
788
|
+
description: "Build Euler v2 isolated borrow loop batch.",
|
|
789
|
+
prerequisites: ["keyGen", "executorAddress", "vault + collateral"],
|
|
790
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
791
|
+
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2IsolatedBorrowBatch" },
|
|
792
|
+
inputZod: mcpEulerV2IsolatedBorrowInputSchema
|
|
793
|
+
}),
|
|
794
|
+
defineProtocolMcpTool({
|
|
795
|
+
name: "ctm_euler_v2_build_vault_withdraw_multisign",
|
|
796
|
+
actionId: "euler-v2.vault-withdraw",
|
|
797
|
+
protocolId: "euler-v2",
|
|
798
|
+
chainCategory: "evm",
|
|
799
|
+
description: "Build Euler v2 vault withdraw/redeem batch.",
|
|
800
|
+
prerequisites: ["keyGen", "executorAddress", "vault address"],
|
|
801
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
802
|
+
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2VaultWithdrawBatch" },
|
|
803
|
+
inputZod: mcpEulerV2VaultWithdrawInputSchema
|
|
804
|
+
}),
|
|
805
|
+
defineProtocolMcpTool({
|
|
806
|
+
name: "ctm_euler_v2_build_borrow_repay_multisign",
|
|
807
|
+
actionId: "euler-v2.borrow-repay",
|
|
808
|
+
protocolId: "euler-v2",
|
|
809
|
+
chainCategory: "evm",
|
|
810
|
+
description: "Build Euler v2 borrow repay batch.",
|
|
811
|
+
prerequisites: ["keyGen", "executorAddress", "vault address"],
|
|
812
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
813
|
+
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2BorrowRepayBatch" },
|
|
814
|
+
inputZod: mcpEulerV2BorrowRepayInputSchema
|
|
815
|
+
}),
|
|
816
|
+
defineProtocolMcpTool({
|
|
817
|
+
name: "ctm_euler_v2_build_collateral_deposit_multisign",
|
|
818
|
+
actionId: "euler-v2.collateral-deposit",
|
|
819
|
+
protocolId: "euler-v2",
|
|
820
|
+
chainCategory: "evm",
|
|
821
|
+
description: "Build Euler v2 borrow collateral deposit batch.",
|
|
822
|
+
prerequisites: ["keyGen", "executorAddress", "vault + collateral asset"],
|
|
823
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
824
|
+
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2BorrowCollateralDepositBatch" },
|
|
825
|
+
inputZod: mcpEulerV2CollateralDepositInputSchema
|
|
826
|
+
}),
|
|
827
|
+
defineProtocolMcpTool({
|
|
828
|
+
name: "ctm_euler_v2_build_collateral_withdraw_multisign",
|
|
829
|
+
actionId: "euler-v2.collateral-withdraw",
|
|
830
|
+
protocolId: "euler-v2",
|
|
831
|
+
chainCategory: "evm",
|
|
832
|
+
description: "Build Euler v2 borrow collateral withdraw batch.",
|
|
833
|
+
prerequisites: ["keyGen", "executorAddress", "vault + collateral asset"],
|
|
834
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
835
|
+
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2BorrowCollateralWithdrawBatch" },
|
|
836
|
+
inputZod: mcpEulerV2CollateralWithdrawInputSchema
|
|
837
|
+
})
|
|
838
|
+
];
|
|
839
|
+
|
|
840
|
+
// src/agent/mcpTools.ts
|
|
841
|
+
function defineMcpTool(def) {
|
|
842
|
+
return {
|
|
843
|
+
...def,
|
|
844
|
+
inputSchema: zodSchemaToMcpJsonSchema(def.inputZod),
|
|
845
|
+
outputSchema: zodSchemaToMcpJsonSchema(def.outputZod),
|
|
846
|
+
parseInput: (data) => def.inputZod.parse(data),
|
|
847
|
+
parseOutput: (data) => def.outputZod.parse(data)
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
var CORE_MCP_TOOL_DEFINITIONS = [
|
|
851
|
+
defineMcpTool({
|
|
290
852
|
name: "ctm_uniswap_v4_quote",
|
|
291
853
|
actionId: "uniswap-v4.quote",
|
|
292
854
|
protocolId: "uniswap-v4",
|
|
@@ -295,33 +857,10 @@ var MCP_TOOL_DEFINITIONS = [
|
|
|
295
857
|
prerequisites: ["Chain must be supported by Uniswap V4 (Universal Router map)."],
|
|
296
858
|
followUp: ["ctm_uniswap_v4_create_swap", "ctm_uniswap_v4_build_swap_multisign"],
|
|
297
859
|
handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapTradeQuote" },
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
amount: { type: "string", required: true, description: "Amount in token-in base units (wei string for ERC-20)" },
|
|
303
|
-
tokenIn: { type: "address", required: true, description: "Input token; 0x0 for native ETH" },
|
|
304
|
-
tokenOut: { type: "address", required: true, description: "Output token address" },
|
|
305
|
-
chainId: { type: "number", required: true, description: "tokenInChainId / same-chain default" },
|
|
306
|
-
uniswapApiKey: { type: "string", required: true, description: "Uniswap Trade API x-api-key" },
|
|
307
|
-
swapper: { type: "address", required: false, description: "MPC executor; omit if keyGen + managementNodeUrl provided" },
|
|
308
|
-
slippage: { type: "number", required: false, description: "Slippage percent; omit for API auto slippage" }
|
|
309
|
-
}),
|
|
310
|
-
required: requiredKeys({
|
|
311
|
-
type: { type: "string", required: true, description: "" },
|
|
312
|
-
amount: { type: "string", required: true, description: "" },
|
|
313
|
-
tokenIn: { type: "address", required: true, description: "" },
|
|
314
|
-
tokenOut: { type: "address", required: true, description: "" },
|
|
315
|
-
chainId: { type: "number", required: true, description: "" },
|
|
316
|
-
uniswapApiKey: { type: "string", required: true, description: "" }
|
|
317
|
-
})
|
|
318
|
-
},
|
|
319
|
-
outputSchema: {
|
|
320
|
-
type: "object",
|
|
321
|
-
description: "Full Uniswap POST /quote JSON (includes nested quote object with input/output amounts)."
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
|
-
{
|
|
860
|
+
inputZod: mcpUniswapV4QuoteInputSchema,
|
|
861
|
+
outputZod: mcpUniswapV4QuoteOutputSchema
|
|
862
|
+
}),
|
|
863
|
+
defineMcpTool({
|
|
325
864
|
name: "ctm_uniswap_v4_create_swap",
|
|
326
865
|
actionId: "uniswap-v4.create-swap",
|
|
327
866
|
protocolId: "uniswap-v4",
|
|
@@ -330,33 +869,10 @@ var MCP_TOOL_DEFINITIONS = [
|
|
|
330
869
|
prerequisites: ["ctm_uniswap_v4_quote output (fullQuoteFromPermit)"],
|
|
331
870
|
followUp: ["ctm_uniswap_v4_build_swap_multisign"],
|
|
332
871
|
handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapCreateSwap" },
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
fullQuoteFromPermit: { type: "object", required: true, description: "Full quote JSON from ctm_uniswap_v4_quote" },
|
|
338
|
-
swapTransactionDeadlineUnix: {
|
|
339
|
-
type: "number",
|
|
340
|
-
required: false,
|
|
341
|
-
description: "On-chain deadline unix seconds; default ~30 min from now"
|
|
342
|
-
},
|
|
343
|
-
useServerProxy: {
|
|
344
|
-
type: "boolean",
|
|
345
|
-
required: false,
|
|
346
|
-
description: "Set false in Node/agents; true only in browser via Next API route"
|
|
347
|
-
}
|
|
348
|
-
}),
|
|
349
|
-
required: requiredKeys({
|
|
350
|
-
uniswapApiKey: { type: "string", required: true, description: "" },
|
|
351
|
-
fullQuoteFromPermit: { type: "object", required: true, description: "" }
|
|
352
|
-
})
|
|
353
|
-
},
|
|
354
|
-
outputSchema: {
|
|
355
|
-
type: "object",
|
|
356
|
-
description: "{ swap: TransactionRequest, requestId?, gasFee? }"
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
{
|
|
872
|
+
inputZod: mcpUniswapV4CreateSwapInputSchema,
|
|
873
|
+
outputZod: mcpUniswapV4CreateSwapOutputSchema
|
|
874
|
+
}),
|
|
875
|
+
defineMcpTool({
|
|
360
876
|
name: "ctm_uniswap_v4_build_swap_multisign",
|
|
361
877
|
actionId: "uniswap-v4.swap-exact-input",
|
|
362
878
|
protocolId: "uniswap-v4",
|
|
@@ -368,79 +884,69 @@ var MCP_TOOL_DEFINITIONS = [
|
|
|
368
884
|
"executorAddress matching MPC wallet",
|
|
369
885
|
"RPC URL and chainDetail from node chain config"
|
|
370
886
|
],
|
|
371
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig"],
|
|
887
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig and signedMessage"],
|
|
372
888
|
handler: { importPath: "protocols/evm/uniswap-v4", exportName: "buildEvmMultisignBodyUniswapV4SkipPermit2Batch" },
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
tokenIn: { type: "address", required: true, description: "Token in; 0x0 for native ETH" },
|
|
378
|
-
swap: { type: "object", required: true, description: "swap field from create_swap response" },
|
|
379
|
-
createSwapResponse: { type: "object", required: true, description: "Full create_swap response" },
|
|
380
|
-
fullQuoteSnapshot: { type: "object", required: true, description: "Quote JSON used for the swap" },
|
|
381
|
-
swapDeadlineUnix: { type: "number", required: true, description: "Same deadline passed to create_swap" },
|
|
382
|
-
slippagePercent: { type: "number", required: false, description: "Extra approve headroom for EXACT_OUTPUT" }
|
|
383
|
-
},
|
|
384
|
-
["keyGen", "purposeText", "useCustomGas", "chainId", "rpcUrl", "executorAddress", "chainDetail", "customGasChainDetails"]
|
|
385
|
-
),
|
|
386
|
-
required: requiredKeys(
|
|
387
|
-
{
|
|
388
|
-
tokenIn: { type: "address", required: true, description: "" },
|
|
389
|
-
swap: { type: "object", required: true, description: "" },
|
|
390
|
-
createSwapResponse: { type: "object", required: true, description: "" },
|
|
391
|
-
fullQuoteSnapshot: { type: "object", required: true, description: "" },
|
|
392
|
-
swapDeadlineUnix: { type: "number", required: true, description: "" }
|
|
393
|
-
},
|
|
394
|
-
["keyGen", "purposeText", "useCustomGas", "chainId", "rpcUrl", "executorAddress", "chainDetail"]
|
|
395
|
-
)
|
|
396
|
-
},
|
|
397
|
-
outputSchema: multisignOutputSchema
|
|
398
|
-
},
|
|
399
|
-
{
|
|
889
|
+
inputZod: mcpUniswapV4BuildSwapMultisignInputSchema,
|
|
890
|
+
outputZod: multisignOutputSchema
|
|
891
|
+
}),
|
|
892
|
+
defineMcpTool({
|
|
400
893
|
name: "ctm_curve_dao_build_swap_multisign",
|
|
401
894
|
actionId: "curve-dao.swap",
|
|
402
895
|
protocolId: "curve-dao",
|
|
403
896
|
chainCategory: "evm",
|
|
404
897
|
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.",
|
|
405
898
|
prerequisites: ["keyGen", "executorAddress", "tokenIn/tokenOut/amountHuman/slippage", "RPC URL"],
|
|
406
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
899
|
+
followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig and signedMessage"],
|
|
407
900
|
handler: { importPath: "protocols/evm/curve-dao", exportName: "buildEvmMultisignBodyCurveDaoBatch" },
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
slippagePercent: { type: "number", required: true, description: "Slippage 0\u2013100 exclusive" }
|
|
416
|
-
},
|
|
417
|
-
["keyGen", "purposeText", "useCustomGas", "chainId", "rpcUrl", "executorAddress", "chainDetail", "customGasChainDetails"]
|
|
418
|
-
),
|
|
419
|
-
required: requiredKeys(
|
|
420
|
-
{
|
|
421
|
-
tokenIn: { type: "address", required: true, description: "" },
|
|
422
|
-
tokenOut: { type: "string", required: true, description: "" },
|
|
423
|
-
amountHuman: { type: "string", required: true, description: "" },
|
|
424
|
-
slippagePercent: { type: "number", required: true, description: "" }
|
|
425
|
-
},
|
|
426
|
-
["keyGen", "purposeText", "useCustomGas", "chainId", "rpcUrl", "executorAddress", "chainDetail"]
|
|
427
|
-
)
|
|
428
|
-
},
|
|
429
|
-
outputSchema: multisignOutputSchema
|
|
430
|
-
}
|
|
901
|
+
inputZod: mcpCurveDaoBuildSwapMultisignInputSchema,
|
|
902
|
+
outputZod: multisignOutputSchema
|
|
903
|
+
})
|
|
904
|
+
];
|
|
905
|
+
var MCP_TOOL_DEFINITIONS = [
|
|
906
|
+
...CORE_MCP_TOOL_DEFINITIONS,
|
|
907
|
+
...MCP_PROTOCOL_TOOL_DEFINITIONS
|
|
431
908
|
];
|
|
909
|
+
function buildToolSchemaMap(kind) {
|
|
910
|
+
const out = {};
|
|
911
|
+
for (const tool of MCP_TOOL_DEFINITIONS) {
|
|
912
|
+
out[tool.name] = kind === "input" ? tool.inputZod : tool.outputZod;
|
|
913
|
+
}
|
|
914
|
+
return out;
|
|
915
|
+
}
|
|
916
|
+
var MCP_TOOL_INPUT_SCHEMAS = buildToolSchemaMap("input");
|
|
917
|
+
var MCP_TOOL_OUTPUT_SCHEMAS = buildToolSchemaMap("output");
|
|
432
918
|
function getMcpToolDefinitions() {
|
|
433
919
|
return MCP_TOOL_DEFINITIONS;
|
|
434
920
|
}
|
|
435
921
|
function getMcpToolByName(name) {
|
|
436
922
|
return MCP_TOOL_DEFINITIONS.find((t) => t.name === name);
|
|
437
923
|
}
|
|
924
|
+
function getMcpToolInputSchema(name) {
|
|
925
|
+
const schema = MCP_TOOL_INPUT_SCHEMAS[name];
|
|
926
|
+
if (!schema) throw new Error(`Unknown MCP tool: ${name}`);
|
|
927
|
+
return schema;
|
|
928
|
+
}
|
|
929
|
+
function getMcpToolOutputSchema(name) {
|
|
930
|
+
const schema = MCP_TOOL_OUTPUT_SCHEMAS[name];
|
|
931
|
+
if (!schema) throw new Error(`Unknown MCP tool: ${name}`);
|
|
932
|
+
return schema;
|
|
933
|
+
}
|
|
934
|
+
function parseMcpToolInput(name, data) {
|
|
935
|
+
return getMcpToolInputSchema(name).parse(data);
|
|
936
|
+
}
|
|
937
|
+
function parseMcpToolOutput(name, data) {
|
|
938
|
+
return getMcpToolOutputSchema(name).parse(data);
|
|
939
|
+
}
|
|
438
940
|
function getAgentCatalogForMcp() {
|
|
439
941
|
return {
|
|
440
942
|
tools: MCP_TOOL_DEFINITIONS,
|
|
441
943
|
protocols: getProtocolModules(),
|
|
442
944
|
commonParams: EVM_COMMON_PARAM_DOCS,
|
|
443
945
|
multisignOutput: MULTISIGN_OUTPUT_DOC,
|
|
946
|
+
managementSig: MANAGEMENT_SIG_DOC,
|
|
947
|
+
/** Zod schemas for MCP tool I/O — source of truth for continuum-mcp-server validation. */
|
|
948
|
+
inputSchemas: MCP_TOOL_INPUT_SCHEMAS,
|
|
949
|
+
outputSchemas: MCP_TOOL_OUTPUT_SCHEMAS,
|
|
444
950
|
workflow: {
|
|
445
951
|
evmSwapTypical: [
|
|
446
952
|
"1. Quote (protocol-specific API if needed)",
|
|
@@ -448,14 +954,222 @@ function getAgentCatalogForMcp() {
|
|
|
448
954
|
"3. build_*_multisign \u2192 { bodyForSign, messageToSign }",
|
|
449
955
|
"4. Sign messageToSign (MetaMask or Ed25519)",
|
|
450
956
|
"5. POST /multiSignRequest with clientSig and signedMessage"
|
|
957
|
+
],
|
|
958
|
+
managementPostTypical: [
|
|
959
|
+
"1. GET /getNodeKey \u2192 nodeKey (128 hex)",
|
|
960
|
+
"2. GET /getPublicMgtKeyNonce or /getNodeMgtKeyNonce \u2192 nonce",
|
|
961
|
+
"3. buildManagementPostBody(nonce, nodeKey, { \u2026endpoint fields })",
|
|
962
|
+
"4. messageToSignManagementBody(body) \u2192 sign \u2192 withManagementClientSig(body, sig)",
|
|
963
|
+
"5. POST management route with signed body"
|
|
451
964
|
]
|
|
452
965
|
}
|
|
453
966
|
};
|
|
454
967
|
}
|
|
968
|
+
viem.getAddress(
|
|
969
|
+
"0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84"
|
|
970
|
+
);
|
|
971
|
+
viem.getAddress(
|
|
972
|
+
"0x7f39C581F595B853cBbF37C12FfeeA971C5a5bEa"
|
|
973
|
+
);
|
|
974
|
+
viem.getAddress("0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1");
|
|
975
|
+
var LIDO_ETHEREUM_MAINNET_CHAIN_ID = 1;
|
|
976
|
+
|
|
977
|
+
// src/protocols/evm/lido/index.ts
|
|
978
|
+
var LIDO_PROTOCOL_ID = "lido";
|
|
979
|
+
var lidoProtocolModule = {
|
|
980
|
+
id: LIDO_PROTOCOL_ID,
|
|
981
|
+
chainCategory: "evm",
|
|
982
|
+
isChainSupported(ctx) {
|
|
983
|
+
if (ctx.chainCategory !== "evm") return false;
|
|
984
|
+
return Number(ctx.chainId) === LIDO_ETHEREUM_MAINNET_CHAIN_ID;
|
|
985
|
+
},
|
|
986
|
+
isTokenSupported(token) {
|
|
987
|
+
return token.category === "evm" && (token.kind === "native" || token.kind === "erc20");
|
|
988
|
+
},
|
|
989
|
+
actions: [
|
|
990
|
+
{ 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)" } } },
|
|
991
|
+
{ id: "lido.request-withdrawals", protocolId: LIDO_PROTOCOL_ID, chainCategory: "evm", description: "Queue stETH withdrawal", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
992
|
+
{ id: "lido.claim-withdrawal", protocolId: LIDO_PROTOCOL_ID, chainCategory: "evm", description: "Claim finalized withdrawal", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
993
|
+
{ id: "lido.wrap-steth", protocolId: LIDO_PROTOCOL_ID, chainCategory: "evm", description: "Wrap stETH to wstETH", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
994
|
+
{ id: "lido.unwrap-wsteth", protocolId: LIDO_PROTOCOL_ID, chainCategory: "evm", description: "Unwrap wstETH to stETH", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
|
|
995
|
+
]
|
|
996
|
+
};
|
|
997
|
+
registerProtocolModule(lidoProtocolModule);
|
|
998
|
+
var USDE_ETHEREUM_MAINNET = "0x4c9edd5852cd905f086c759e8383e09bff1e68b3";
|
|
999
|
+
var USDE_MOST_L2S = "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34";
|
|
1000
|
+
var USDE_ZKSYNC_ERA = "0x39Fe7a0DACcE31Bd90418e3e659fb0b5f0B3Db0d";
|
|
1001
|
+
var L2_SAME_ADDRESS_CHAIN_IDS = /* @__PURE__ */ new Set([
|
|
1002
|
+
42161,
|
|
1003
|
+
// Arbitrum One
|
|
1004
|
+
10,
|
|
1005
|
+
// Optimism
|
|
1006
|
+
8453,
|
|
1007
|
+
// Base
|
|
1008
|
+
56,
|
|
1009
|
+
// BNB Chain
|
|
1010
|
+
59144,
|
|
1011
|
+
// Linea
|
|
1012
|
+
5e3,
|
|
1013
|
+
// Mantle
|
|
1014
|
+
81457,
|
|
1015
|
+
// Blast
|
|
1016
|
+
169,
|
|
1017
|
+
// Manta Pacific
|
|
1018
|
+
534352,
|
|
1019
|
+
// Scroll
|
|
1020
|
+
252,
|
|
1021
|
+
// Fraxtal
|
|
1022
|
+
34443,
|
|
1023
|
+
// Mode
|
|
1024
|
+
196,
|
|
1025
|
+
// X Layer
|
|
1026
|
+
1088,
|
|
1027
|
+
// Metis
|
|
1028
|
+
80084,
|
|
1029
|
+
// Berachain
|
|
1030
|
+
2222,
|
|
1031
|
+
// Kava
|
|
1032
|
+
2818,
|
|
1033
|
+
// Morph
|
|
1034
|
+
1923,
|
|
1035
|
+
// Swell
|
|
1036
|
+
48900
|
|
1037
|
+
// Zircuit
|
|
1038
|
+
]);
|
|
1039
|
+
function usdeTokenAddressOnEvmChain(chainId) {
|
|
1040
|
+
if (chainId === 1) return USDE_ETHEREUM_MAINNET;
|
|
1041
|
+
if (chainId === 324) return USDE_ZKSYNC_ERA;
|
|
1042
|
+
if (L2_SAME_ADDRESS_CHAIN_IDS.has(chainId)) return USDE_MOST_L2S;
|
|
1043
|
+
return null;
|
|
1044
|
+
}
|
|
1045
|
+
function isEvmChainInEthenaUsdeList(chainId) {
|
|
1046
|
+
return usdeTokenAddressOnEvmChain(chainId) != null;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
// src/protocols/evm/ethena/index.ts
|
|
1050
|
+
var ETHENA_PROTOCOL_ID = "ethena";
|
|
1051
|
+
var ethenaProtocolModule = {
|
|
1052
|
+
id: ETHENA_PROTOCOL_ID,
|
|
1053
|
+
chainCategory: "evm",
|
|
1054
|
+
isChainSupported(ctx) {
|
|
1055
|
+
if (ctx.chainCategory !== "evm") return false;
|
|
1056
|
+
const n = typeof ctx.chainId === "number" ? ctx.chainId : Number.parseInt(String(ctx.chainId), 10);
|
|
1057
|
+
return isEvmChainInEthenaUsdeList(n);
|
|
1058
|
+
},
|
|
1059
|
+
isTokenSupported(token) {
|
|
1060
|
+
return token.category === "evm" && token.kind === "erc20";
|
|
1061
|
+
},
|
|
1062
|
+
actions: [
|
|
1063
|
+
{ 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" } } },
|
|
1064
|
+
{ id: "ethena.redeem-susde", protocolId: ETHENA_PROTOCOL_ID, chainCategory: "evm", description: "Redeem sUSDe \u2192 USDe (no cooldown)", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1065
|
+
{ id: "ethena.cooldown-shares", protocolId: ETHENA_PROTOCOL_ID, chainCategory: "evm", description: "Start sUSDe cooldown", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1066
|
+
{ id: "ethena.claim-unstake", protocolId: ETHENA_PROTOCOL_ID, chainCategory: "evm", description: "Claim after cooldown", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
|
|
1067
|
+
]
|
|
1068
|
+
};
|
|
1069
|
+
registerProtocolModule(ethenaProtocolModule);
|
|
1070
|
+
|
|
1071
|
+
// src/protocols/evm/maple/constants.ts
|
|
1072
|
+
function isMapleSyrupSupportedChain(chainId) {
|
|
1073
|
+
return chainId === 1 || chainId === 11155111;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
// src/protocols/evm/maple/index.ts
|
|
1077
|
+
var MAPLE_PROTOCOL_ID = "maple-syrup";
|
|
1078
|
+
var mapleProtocolModule = {
|
|
1079
|
+
id: MAPLE_PROTOCOL_ID,
|
|
1080
|
+
chainCategory: "evm",
|
|
1081
|
+
isChainSupported(ctx) {
|
|
1082
|
+
if (ctx.chainCategory !== "evm") return false;
|
|
1083
|
+
const n = typeof ctx.chainId === "number" ? ctx.chainId : Number.parseInt(String(ctx.chainId), 10);
|
|
1084
|
+
return isMapleSyrupSupportedChain(n);
|
|
1085
|
+
},
|
|
1086
|
+
isTokenSupported(token) {
|
|
1087
|
+
return token.category === "evm" && token.kind === "erc20";
|
|
1088
|
+
},
|
|
1089
|
+
actions: [
|
|
1090
|
+
{ id: "maple-syrup.deposit", protocolId: MAPLE_PROTOCOL_ID, chainCategory: "evm", description: "Deposit into Maple Syrup pool", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1091
|
+
{ id: "maple-syrup.request-redeem", protocolId: MAPLE_PROTOCOL_ID, chainCategory: "evm", description: "Request redeem from pool", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
|
|
1092
|
+
]
|
|
1093
|
+
};
|
|
1094
|
+
registerProtocolModule(mapleProtocolModule);
|
|
1095
|
+
|
|
1096
|
+
// src/protocols/evm/sky/mainnet.ts
|
|
1097
|
+
var SKY_ETHEREUM_MAINNET_CHAIN_ID = 1;
|
|
1098
|
+
|
|
1099
|
+
// src/protocols/evm/sky/index.ts
|
|
1100
|
+
var SKY_PROTOCOL_ID = "sky";
|
|
1101
|
+
var skyProtocolModule = {
|
|
1102
|
+
id: SKY_PROTOCOL_ID,
|
|
1103
|
+
chainCategory: "evm",
|
|
1104
|
+
isChainSupported(ctx) {
|
|
1105
|
+
if (ctx.chainCategory !== "evm") return false;
|
|
1106
|
+
return Number(ctx.chainId) === SKY_ETHEREUM_MAINNET_CHAIN_ID;
|
|
1107
|
+
},
|
|
1108
|
+
isTokenSupported(token) {
|
|
1109
|
+
return token.category === "evm" && token.kind === "erc20";
|
|
1110
|
+
},
|
|
1111
|
+
actions: [
|
|
1112
|
+
{ id: "sky.lockstake-stake", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Open Lockstake position", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1113
|
+
{ id: "sky.lockstake-draw", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Borrow USDS from Lockstake", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1114
|
+
{ id: "sky.lockstake-wipe", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Repay Lockstake debt", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1115
|
+
{ id: "sky.lockstake-close", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Close Lockstake position", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1116
|
+
{ id: "sky.susds-deposit", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Deposit USDS into sUSDS vault", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1117
|
+
{ id: "sky.susds-redeem", protocolId: SKY_PROTOCOL_ID, chainCategory: "evm", description: "Redeem sUSDS to USDS", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
|
|
1118
|
+
]
|
|
1119
|
+
};
|
|
1120
|
+
registerProtocolModule(skyProtocolModule);
|
|
1121
|
+
|
|
1122
|
+
// src/protocols/evm/aave-v4/index.ts
|
|
1123
|
+
var AAVE_V4_PROTOCOL_ID = "aave-v4";
|
|
1124
|
+
var aaveV4ProtocolModule = {
|
|
1125
|
+
id: AAVE_V4_PROTOCOL_ID,
|
|
1126
|
+
chainCategory: "evm",
|
|
1127
|
+
isChainSupported(ctx) {
|
|
1128
|
+
return ctx.chainCategory === "evm";
|
|
1129
|
+
},
|
|
1130
|
+
isTokenSupported(token) {
|
|
1131
|
+
return token.category === "evm" && (token.kind === "native" || token.kind === "erc20");
|
|
1132
|
+
},
|
|
1133
|
+
actions: [
|
|
1134
|
+
{ id: "aave-v4.deposit", protocolId: AAVE_V4_PROTOCOL_ID, chainCategory: "evm", description: "Supply to Aave v4 Spoke", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1135
|
+
{ id: "aave-v4.withdraw", protocolId: AAVE_V4_PROTOCOL_ID, chainCategory: "evm", description: "Withdraw from Spoke", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1136
|
+
{ id: "aave-v4.borrow", protocolId: AAVE_V4_PROTOCOL_ID, chainCategory: "evm", description: "Borrow from Spoke", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1137
|
+
{ id: "aave-v4.repay", protocolId: AAVE_V4_PROTOCOL_ID, chainCategory: "evm", description: "Repay Spoke debt", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
|
|
1138
|
+
]
|
|
1139
|
+
};
|
|
1140
|
+
registerProtocolModule(aaveV4ProtocolModule);
|
|
1141
|
+
|
|
1142
|
+
// src/protocols/evm/euler-v2/index.ts
|
|
1143
|
+
var EULER_V2_PROTOCOL_ID = "euler-v2";
|
|
1144
|
+
var eulerV2ProtocolModule = {
|
|
1145
|
+
id: EULER_V2_PROTOCOL_ID,
|
|
1146
|
+
chainCategory: "evm",
|
|
1147
|
+
isChainSupported(ctx) {
|
|
1148
|
+
return ctx.chainCategory === "evm";
|
|
1149
|
+
},
|
|
1150
|
+
isTokenSupported(token) {
|
|
1151
|
+
return token.category === "evm" && (token.kind === "native" || token.kind === "erc20");
|
|
1152
|
+
},
|
|
1153
|
+
actions: [
|
|
1154
|
+
{ id: "euler-v2.isolated-lend", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Deposit into Euler vault", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1155
|
+
{ id: "euler-v2.isolated-borrow", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Borrow from Euler vault", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1156
|
+
{ id: "euler-v2.vault-withdraw", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Withdraw from Euler vault", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1157
|
+
{ id: "euler-v2.borrow-repay", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Repay Euler borrow", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1158
|
+
{ id: "euler-v2.collateral-deposit", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Deposit borrow collateral", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} },
|
|
1159
|
+
{ id: "euler-v2.collateral-withdraw", protocolId: EULER_V2_PROTOCOL_ID, chainCategory: "evm", description: "Withdraw borrow collateral", commonParams: ["keyGen", "purposeText", "useCustomGas"], params: {} }
|
|
1160
|
+
]
|
|
1161
|
+
};
|
|
1162
|
+
registerProtocolModule(eulerV2ProtocolModule);
|
|
455
1163
|
|
|
456
1164
|
// src/agent/catalog.ts
|
|
457
1165
|
registerProtocolModule(uniswapV4ProtocolModule);
|
|
458
1166
|
registerProtocolModule(curveDaoProtocolModule);
|
|
1167
|
+
registerProtocolModule(lidoProtocolModule);
|
|
1168
|
+
registerProtocolModule(ethenaProtocolModule);
|
|
1169
|
+
registerProtocolModule(mapleProtocolModule);
|
|
1170
|
+
registerProtocolModule(skyProtocolModule);
|
|
1171
|
+
registerProtocolModule(aaveV4ProtocolModule);
|
|
1172
|
+
registerProtocolModule(eulerV2ProtocolModule);
|
|
459
1173
|
function getAgentCatalog() {
|
|
460
1174
|
return {
|
|
461
1175
|
protocols: getProtocolModules(),
|
|
@@ -466,19 +1180,76 @@ function getAgentCatalog() {
|
|
|
466
1180
|
},
|
|
467
1181
|
uniswapV4: uniswapV4ProtocolModule,
|
|
468
1182
|
curveDao: curveDaoProtocolModule,
|
|
1183
|
+
lido: lidoProtocolModule,
|
|
1184
|
+
ethena: ethenaProtocolModule,
|
|
1185
|
+
maple: mapleProtocolModule,
|
|
1186
|
+
sky: skyProtocolModule,
|
|
1187
|
+
aaveV4: aaveV4ProtocolModule,
|
|
1188
|
+
eulerV2: eulerV2ProtocolModule,
|
|
469
1189
|
/** Prefer getAgentCatalogForMcp() or getMcpToolDefinitions() for MCP servers. */
|
|
470
1190
|
mcp: getAgentCatalogForMcp()
|
|
471
1191
|
};
|
|
472
1192
|
}
|
|
473
1193
|
|
|
474
1194
|
exports.EVM_COMMON_PARAM_DOCS = EVM_COMMON_PARAM_DOCS;
|
|
1195
|
+
exports.MANAGEMENT_SIG_DOC = MANAGEMENT_SIG_DOC;
|
|
475
1196
|
exports.MCP_TOOL_DEFINITIONS = MCP_TOOL_DEFINITIONS;
|
|
1197
|
+
exports.MCP_TOOL_INPUT_SCHEMAS = MCP_TOOL_INPUT_SCHEMAS;
|
|
1198
|
+
exports.MCP_TOOL_OUTPUT_SCHEMAS = MCP_TOOL_OUTPUT_SCHEMAS;
|
|
476
1199
|
exports.MULTISIGN_OUTPUT_DOC = MULTISIGN_OUTPUT_DOC;
|
|
1200
|
+
exports.chainDetailSchema = chainDetailSchema;
|
|
1201
|
+
exports.evmAddressSchema = evmAddressSchema;
|
|
1202
|
+
exports.evmMultisignCommonInputSchema = evmMultisignCommonInputSchema;
|
|
477
1203
|
exports.getActionsByChainCategory = getActionsByChainCategory;
|
|
478
1204
|
exports.getAgentCatalog = getAgentCatalog;
|
|
479
1205
|
exports.getAgentCatalogForMcp = getAgentCatalogForMcp;
|
|
480
1206
|
exports.getMcpToolByName = getMcpToolByName;
|
|
481
1207
|
exports.getMcpToolDefinitions = getMcpToolDefinitions;
|
|
1208
|
+
exports.getMcpToolInputSchema = getMcpToolInputSchema;
|
|
1209
|
+
exports.getMcpToolOutputSchema = getMcpToolOutputSchema;
|
|
482
1210
|
exports.getProtocolModules = getProtocolModules;
|
|
1211
|
+
exports.jsonObjectSchema = jsonObjectSchema;
|
|
1212
|
+
exports.keyGenSchema = keyGenSchema;
|
|
1213
|
+
exports.mcpAaveV4BorrowInputSchema = mcpAaveV4BorrowInputSchema;
|
|
1214
|
+
exports.mcpAaveV4DepositInputSchema = mcpAaveV4DepositInputSchema;
|
|
1215
|
+
exports.mcpAaveV4RepayInputSchema = mcpAaveV4RepayInputSchema;
|
|
1216
|
+
exports.mcpAaveV4WithdrawInputSchema = mcpAaveV4WithdrawInputSchema;
|
|
1217
|
+
exports.mcpCurveDaoBuildSwapMultisignInputSchema = mcpCurveDaoBuildSwapMultisignInputSchema;
|
|
1218
|
+
exports.mcpEthenaClaimInputSchema = mcpEthenaClaimInputSchema;
|
|
1219
|
+
exports.mcpEthenaCooldownInputSchema = mcpEthenaCooldownInputSchema;
|
|
1220
|
+
exports.mcpEthenaRedeemInputSchema = mcpEthenaRedeemInputSchema;
|
|
1221
|
+
exports.mcpEthenaStakeInputSchema = mcpEthenaStakeInputSchema;
|
|
1222
|
+
exports.mcpEulerV2BorrowRepayInputSchema = mcpEulerV2BorrowRepayInputSchema;
|
|
1223
|
+
exports.mcpEulerV2CollateralDepositInputSchema = mcpEulerV2CollateralDepositInputSchema;
|
|
1224
|
+
exports.mcpEulerV2CollateralWithdrawInputSchema = mcpEulerV2CollateralWithdrawInputSchema;
|
|
1225
|
+
exports.mcpEulerV2IsolatedBorrowInputSchema = mcpEulerV2IsolatedBorrowInputSchema;
|
|
1226
|
+
exports.mcpEulerV2IsolatedLendInputSchema = mcpEulerV2IsolatedLendInputSchema;
|
|
1227
|
+
exports.mcpEulerV2VaultWithdrawInputSchema = mcpEulerV2VaultWithdrawInputSchema;
|
|
1228
|
+
exports.mcpLidoClaimWithdrawalInputSchema = mcpLidoClaimWithdrawalInputSchema;
|
|
1229
|
+
exports.mcpLidoRequestWithdrawalsInputSchema = mcpLidoRequestWithdrawalsInputSchema;
|
|
1230
|
+
exports.mcpLidoSubmitInputSchema = mcpLidoSubmitInputSchema;
|
|
1231
|
+
exports.mcpLidoUnwrapWstEthInputSchema = mcpLidoUnwrapWstEthInputSchema;
|
|
1232
|
+
exports.mcpLidoWrapStEthInputSchema = mcpLidoWrapStEthInputSchema;
|
|
1233
|
+
exports.mcpMapleDepositInputSchema = mcpMapleDepositInputSchema;
|
|
1234
|
+
exports.mcpMapleRequestRedeemInputSchema = mcpMapleRequestRedeemInputSchema;
|
|
1235
|
+
exports.mcpMultisignInput = mcpMultisignInput;
|
|
1236
|
+
exports.mcpMultisignOutputSchema = multisignOutputSchema;
|
|
1237
|
+
exports.mcpSkyLockstakeCloseInputSchema = mcpSkyLockstakeCloseInputSchema;
|
|
1238
|
+
exports.mcpSkyLockstakeDrawInputSchema = mcpSkyLockstakeDrawInputSchema;
|
|
1239
|
+
exports.mcpSkyLockstakeGetRewardInputSchema = mcpSkyLockstakeGetRewardInputSchema;
|
|
1240
|
+
exports.mcpSkyLockstakeStakeInputSchema = mcpSkyLockstakeStakeInputSchema;
|
|
1241
|
+
exports.mcpSkyLockstakeWipeInputSchema = mcpSkyLockstakeWipeInputSchema;
|
|
1242
|
+
exports.mcpSkySusdsDepositInputSchema = mcpSkySusdsDepositInputSchema;
|
|
1243
|
+
exports.mcpSkySusdsRedeemInputSchema = mcpSkySusdsRedeemInputSchema;
|
|
1244
|
+
exports.mcpUniswapV4BuildSwapMultisignInputSchema = mcpUniswapV4BuildSwapMultisignInputSchema;
|
|
1245
|
+
exports.mcpUniswapV4CreateSwapInputSchema = mcpUniswapV4CreateSwapInputSchema;
|
|
1246
|
+
exports.mcpUniswapV4CreateSwapOutputSchema = mcpUniswapV4CreateSwapOutputSchema;
|
|
1247
|
+
exports.mcpUniswapV4QuoteInputSchema = mcpUniswapV4QuoteInputSchema;
|
|
1248
|
+
exports.mcpUniswapV4QuoteOutputSchema = mcpUniswapV4QuoteOutputSchema;
|
|
1249
|
+
exports.multisignOutputSchema = multisignOutputSchema;
|
|
1250
|
+
exports.parseMcpToolInput = parseMcpToolInput;
|
|
1251
|
+
exports.parseMcpToolOutput = parseMcpToolOutput;
|
|
1252
|
+
exports.uniswapQuoteTradeTypeSchema = uniswapQuoteTradeTypeSchema;
|
|
1253
|
+
exports.zodSchemaToMcpJsonSchema = zodSchemaToMcpJsonSchema;
|
|
483
1254
|
//# sourceMappingURL=catalog.cjs.map
|
|
484
1255
|
//# sourceMappingURL=catalog.cjs.map
|