@continuumdao/ctm-mpc-defi 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/catalog.cjs +96 -25
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +27 -1
- package/dist/agent/catalog.js +95 -26
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/curve-dao/SKILL.md +2 -1
- package/dist/chains/evm/index.cjs +54 -0
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.d.ts +13 -1
- package/dist/chains/evm/index.js +52 -2
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/core/index.cjs +64 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +20 -1
- package/dist/core/index.js +56 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +165 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +154 -16
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +766 -6
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.d.ts +417 -1
- package/dist/protocols/evm/aave-v4/index.js +741 -8
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +268 -21
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.d.ts +74 -9
- package/dist/protocols/evm/curve-dao/index.js +262 -23
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +104 -0
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.d.ts +46 -1
- package/dist/protocols/evm/ethena/index.js +99 -1
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +2334 -37
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.d.ts +464 -1
- package/dist/protocols/evm/euler-v2/index.js +2286 -39
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +110 -0
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.d.ts +33 -2
- package/dist/protocols/evm/lido/index.js +107 -2
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +83 -0
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.d.ts +22 -1
- package/dist/protocols/evm/maple/index.js +82 -1
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs +217 -0
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.d.ts +56 -1
- package/dist/protocols/evm/sky/index.js +210 -2
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/package.json +3 -3
package/dist/agent/catalog.d.ts
CHANGED
|
@@ -655,6 +655,30 @@ type McpUniswapV4CreateSwapInput = z.infer<typeof mcpUniswapV4CreateSwapInputSch
|
|
|
655
655
|
type McpUniswapV4CreateSwapOutput = z.infer<typeof mcpUniswapV4CreateSwapOutputSchema>;
|
|
656
656
|
type McpUniswapV4BuildSwapMultisignInput = z.infer<typeof mcpUniswapV4BuildSwapMultisignInputSchema>;
|
|
657
657
|
|
|
658
|
+
/** Input for MCP tool `ctm_curve_dao_quote` → handler `curveDaoQuote`. */
|
|
659
|
+
declare const mcpCurveDaoQuoteInputSchema: z.ZodObject<{
|
|
660
|
+
chainId: z.ZodNumber;
|
|
661
|
+
rpcUrl: z.ZodOptional<z.ZodString>;
|
|
662
|
+
tokenIn: z.ZodString;
|
|
663
|
+
tokenOut: z.ZodString;
|
|
664
|
+
amountHuman: z.ZodString;
|
|
665
|
+
tokenInDecimals: z.ZodOptional<z.ZodNumber>;
|
|
666
|
+
}, "strip", z.ZodTypeAny, {
|
|
667
|
+
chainId: number;
|
|
668
|
+
tokenIn: string;
|
|
669
|
+
tokenOut: string;
|
|
670
|
+
amountHuman: string;
|
|
671
|
+
tokenInDecimals?: number | undefined;
|
|
672
|
+
rpcUrl?: string | undefined;
|
|
673
|
+
}, {
|
|
674
|
+
chainId: number;
|
|
675
|
+
tokenIn: string;
|
|
676
|
+
tokenOut: string;
|
|
677
|
+
amountHuman: string;
|
|
678
|
+
tokenInDecimals?: number | undefined;
|
|
679
|
+
rpcUrl?: string | undefined;
|
|
680
|
+
}>;
|
|
681
|
+
declare const mcpCurveDaoQuoteOutputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
658
682
|
/** Input for MCP tool `ctm_curve_dao_build_swap_multisign`. */
|
|
659
683
|
declare const mcpCurveDaoBuildSwapMultisignInputSchema: z.ZodObject<{
|
|
660
684
|
keyGen: z.ZodObject<{
|
|
@@ -761,6 +785,8 @@ declare const mcpCurveDaoBuildSwapMultisignInputSchema: z.ZodObject<{
|
|
|
761
785
|
amountHuman: string;
|
|
762
786
|
customGasChainDetails?: Record<string, unknown> | undefined;
|
|
763
787
|
}>;
|
|
788
|
+
type McpCurveDaoQuoteInput = z.infer<typeof mcpCurveDaoQuoteInputSchema>;
|
|
789
|
+
type McpCurveDaoQuoteOutput = z.infer<typeof mcpCurveDaoQuoteOutputSchema>;
|
|
764
790
|
type McpCurveDaoBuildSwapMultisignInput = z.infer<typeof mcpCurveDaoBuildSwapMultisignInputSchema>;
|
|
765
791
|
|
|
766
792
|
/** Extend common multisign inputs with protocol-specific fields. */
|
|
@@ -1056,4 +1082,4 @@ declare function getAgentCatalog(): {
|
|
|
1056
1082
|
};
|
|
1057
1083
|
};
|
|
1058
1084
|
|
|
1059
|
-
export { type ChainDetailMcpInput, EVM_COMMON_PARAM_DOCS, type EvmMultisignCommonInput, type KeyGenMcpInput, MANAGEMENT_SIG_DOC, MCP_NON_SUBMIT_TOOL_NAMES, MCP_TOOL_DEFINITIONS, MCP_TOOL_INPUT_SCHEMAS, MCP_TOOL_OUTPUT_SCHEMAS, MULTISIGN_OUTPUT_DOC, type McpAaveV4DepositInput, type McpCurveDaoBuildSwapMultisignInput, type McpEthenaStakeInput, type McpEulerV2IsolatedLendInput, type McpJsonSchema, type McpLidoSubmitInput, type McpMapleDepositInput, type McpSchemaProperty, type McpSkyLockstakeStakeInput, type McpToolDefinition, type McpToolHandler, type McpToolInputMap, type McpToolName, type McpToolOutputMap, type McpUniswapV4BuildSwapMultisignInput, type McpUniswapV4CreateSwapInput, type McpUniswapV4CreateSwapOutput, type McpUniswapV4QuoteInput, type McpUniswapV4QuoteOutput, type MultisignOutput, PROTOCOL_SUPPORT_ADVISORS, type ProtocolSupportAdvisor, type SupportedTokenRow, type TokenFilterKind, chainDetailSchema, evmAddressSchema, evmMultisignCommonInputSchema, getAgentCatalog, getAgentCatalogForMcp, getMcpToolByName, getMcpToolDefinitions, getMcpToolInputSchema, getMcpToolOutputSchema, getProtocolDiscoverySummary, getProtocolSkill, getProtocolSupportAdvisor, getToolsForProtocol, jsonObjectSchema, keyGenSchema, listProtocolSupportAdvisorIds, listProtocolsWithSkills, mcpAaveV4BorrowInputSchema, mcpAaveV4DepositInputSchema, mcpAaveV4RepayInputSchema, mcpAaveV4WithdrawInputSchema, mcpCurveDaoBuildSwapMultisignInputSchema, mcpEthenaClaimInputSchema, mcpEthenaCooldownInputSchema, mcpEthenaRedeemInputSchema, mcpEthenaStakeInputSchema, mcpEulerV2BorrowRepayInputSchema, mcpEulerV2CollateralDepositInputSchema, mcpEulerV2CollateralWithdrawInputSchema, mcpEulerV2IsolatedBorrowInputSchema, mcpEulerV2IsolatedLendInputSchema, mcpEulerV2VaultWithdrawInputSchema, mcpLidoClaimWithdrawalInputSchema, mcpLidoRequestWithdrawalsInputSchema, mcpLidoSubmitInputSchema, mcpLidoUnwrapWstEthInputSchema, mcpLidoWrapStEthInputSchema, mcpMapleDepositInputSchema, mcpMapleRequestRedeemInputSchema, mcpMultisignInput, multisignOutputSchema as mcpMultisignOutputSchema, mcpServerCommonInputSchema, mcpServerMultisignInput, mcpServerSubmitOutputSchema, mcpSkyLockstakeCloseInputSchema, mcpSkyLockstakeDrawInputSchema, mcpSkyLockstakeGetRewardInputSchema, mcpSkyLockstakeStakeInputSchema, mcpSkyLockstakeWipeInputSchema, mcpSkySusdsDepositInputSchema, mcpSkySusdsRedeemInputSchema, mcpUniswapV4BuildSwapMultisignInputSchema, mcpUniswapV4CreateSwapInputSchema, mcpUniswapV4CreateSwapOutputSchema, mcpUniswapV4QuoteInputSchema, mcpUniswapV4QuoteOutputSchema, multisignOutputSchema, parseMcpToolInput, parseMcpToolOutput, uniswapQuoteTradeTypeSchema, zodSchemaToMcpJsonSchema };
|
|
1085
|
+
export { type ChainDetailMcpInput, EVM_COMMON_PARAM_DOCS, type EvmMultisignCommonInput, type KeyGenMcpInput, MANAGEMENT_SIG_DOC, MCP_NON_SUBMIT_TOOL_NAMES, MCP_TOOL_DEFINITIONS, MCP_TOOL_INPUT_SCHEMAS, MCP_TOOL_OUTPUT_SCHEMAS, MULTISIGN_OUTPUT_DOC, type McpAaveV4DepositInput, type McpCurveDaoBuildSwapMultisignInput, type McpCurveDaoQuoteInput, type McpCurveDaoQuoteOutput, type McpEthenaStakeInput, type McpEulerV2IsolatedLendInput, type McpJsonSchema, type McpLidoSubmitInput, type McpMapleDepositInput, type McpSchemaProperty, type McpSkyLockstakeStakeInput, type McpToolDefinition, type McpToolHandler, type McpToolInputMap, type McpToolName, type McpToolOutputMap, type McpUniswapV4BuildSwapMultisignInput, type McpUniswapV4CreateSwapInput, type McpUniswapV4CreateSwapOutput, type McpUniswapV4QuoteInput, type McpUniswapV4QuoteOutput, type MultisignOutput, PROTOCOL_SUPPORT_ADVISORS, type ProtocolSupportAdvisor, type SupportedTokenRow, type TokenFilterKind, chainDetailSchema, evmAddressSchema, evmMultisignCommonInputSchema, getAgentCatalog, getAgentCatalogForMcp, getMcpToolByName, getMcpToolDefinitions, getMcpToolInputSchema, getMcpToolOutputSchema, getProtocolDiscoverySummary, getProtocolSkill, getProtocolSupportAdvisor, getToolsForProtocol, jsonObjectSchema, keyGenSchema, listProtocolSupportAdvisorIds, listProtocolsWithSkills, mcpAaveV4BorrowInputSchema, mcpAaveV4DepositInputSchema, mcpAaveV4RepayInputSchema, mcpAaveV4WithdrawInputSchema, mcpCurveDaoBuildSwapMultisignInputSchema, mcpCurveDaoQuoteInputSchema, mcpCurveDaoQuoteOutputSchema, mcpEthenaClaimInputSchema, mcpEthenaCooldownInputSchema, mcpEthenaRedeemInputSchema, mcpEthenaStakeInputSchema, mcpEulerV2BorrowRepayInputSchema, mcpEulerV2CollateralDepositInputSchema, mcpEulerV2CollateralWithdrawInputSchema, mcpEulerV2IsolatedBorrowInputSchema, mcpEulerV2IsolatedLendInputSchema, mcpEulerV2VaultWithdrawInputSchema, mcpLidoClaimWithdrawalInputSchema, mcpLidoRequestWithdrawalsInputSchema, mcpLidoSubmitInputSchema, mcpLidoUnwrapWstEthInputSchema, mcpLidoWrapStEthInputSchema, mcpMapleDepositInputSchema, mcpMapleRequestRedeemInputSchema, mcpMultisignInput, multisignOutputSchema as mcpMultisignOutputSchema, mcpServerCommonInputSchema, mcpServerMultisignInput, mcpServerSubmitOutputSchema, mcpSkyLockstakeCloseInputSchema, mcpSkyLockstakeDrawInputSchema, mcpSkyLockstakeGetRewardInputSchema, mcpSkyLockstakeStakeInputSchema, mcpSkyLockstakeWipeInputSchema, mcpSkySusdsDepositInputSchema, mcpSkySusdsRedeemInputSchema, mcpUniswapV4BuildSwapMultisignInputSchema, mcpUniswapV4CreateSwapInputSchema, mcpUniswapV4CreateSwapOutputSchema, mcpUniswapV4QuoteInputSchema, mcpUniswapV4QuoteOutputSchema, multisignOutputSchema, parseMcpToolInput, parseMcpToolOutput, uniswapQuoteTradeTypeSchema, zodSchemaToMcpJsonSchema };
|
package/dist/agent/catalog.js
CHANGED
|
@@ -212,44 +212,64 @@ function swappableCurveGraphNodeKeys(adj) {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
// src/protocols/evm/curve-dao/apiSession.ts
|
|
215
|
+
var CURVE_SESSION_CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
216
|
+
var curveSessionCache = /* @__PURE__ */ new Map();
|
|
215
217
|
async function fetchAllCurvePools(curve) {
|
|
216
218
|
const run = (p) => p.catch(() => void 0);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
219
|
+
const tasks = [];
|
|
220
|
+
for (const key of [
|
|
221
|
+
"factory",
|
|
222
|
+
"crvUSDFactory",
|
|
223
|
+
"EYWAFactory",
|
|
224
|
+
"cryptoFactory",
|
|
225
|
+
"twocryptoFactory",
|
|
226
|
+
"tricryptoFactory",
|
|
227
|
+
"stableNgFactory"
|
|
228
|
+
]) {
|
|
229
|
+
const f = curve[key];
|
|
230
|
+
if (f?.fetchPools) {
|
|
231
|
+
tasks.push(run(f.fetchPools()));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
await Promise.all(tasks);
|
|
226
235
|
}
|
|
227
236
|
async function loadFullCurveSessionForRpc(rpcUrl) {
|
|
228
237
|
const url = (rpcUrl ?? "").trim();
|
|
229
|
-
if (!url)
|
|
238
|
+
if (!url) {
|
|
239
|
+
throw new Error("rpcUrl is required.");
|
|
240
|
+
}
|
|
241
|
+
const cached = curveSessionCache.get(url);
|
|
242
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
243
|
+
return cached.session;
|
|
244
|
+
}
|
|
230
245
|
try {
|
|
231
246
|
const { default: curve } = await import('@curvefi/api');
|
|
232
247
|
await curve.init("JsonRpc", { url }, {});
|
|
233
248
|
const wrapped = curve.getNetworkConstants().NATIVE_COIN?.wrappedAddress;
|
|
234
249
|
if (!curve.hasRouter || !curve.hasRouter()) {
|
|
235
|
-
|
|
250
|
+
const session2 = {
|
|
236
251
|
curve,
|
|
237
252
|
adj: /* @__PURE__ */ new Map(),
|
|
238
253
|
swappableNodeKeys: /* @__PURE__ */ new Set(),
|
|
239
254
|
wrappedNative: wrapped
|
|
240
255
|
};
|
|
256
|
+
curveSessionCache.set(url, { session: session2, expiresAt: Date.now() + CURVE_SESSION_CACHE_TTL_MS });
|
|
257
|
+
return session2;
|
|
241
258
|
}
|
|
242
259
|
await fetchAllCurvePools(curve);
|
|
243
260
|
const adj = buildCurveLiquidityGraphFromApi(curve);
|
|
244
261
|
addNativeWethBridge(adj, wrapped);
|
|
245
|
-
|
|
262
|
+
const session = {
|
|
246
263
|
curve,
|
|
247
264
|
adj,
|
|
248
265
|
swappableNodeKeys: swappableCurveGraphNodeKeys(adj),
|
|
249
266
|
wrappedNative: wrapped
|
|
250
267
|
};
|
|
251
|
-
|
|
252
|
-
return
|
|
268
|
+
curveSessionCache.set(url, { session, expiresAt: Date.now() + CURVE_SESSION_CACHE_TTL_MS });
|
|
269
|
+
return session;
|
|
270
|
+
} catch (e) {
|
|
271
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
272
|
+
throw new Error(`Curve session init failed for RPC: ${msg}`);
|
|
253
273
|
}
|
|
254
274
|
}
|
|
255
275
|
|
|
@@ -267,6 +287,19 @@ var curveDaoProtocolModule = {
|
|
|
267
287
|
return token.kind === "native" || token.kind === "erc20";
|
|
268
288
|
},
|
|
269
289
|
actions: [
|
|
290
|
+
{
|
|
291
|
+
id: "curve-dao.quote",
|
|
292
|
+
protocolId: CURVE_DAO_PROTOCOL_ID,
|
|
293
|
+
chainCategory: "evm",
|
|
294
|
+
description: "Quote swap via Curve Router NG (getBestRouteAndOutput)",
|
|
295
|
+
commonParams: [],
|
|
296
|
+
params: {
|
|
297
|
+
chainId: { type: "number", required: true, description: "EVM chain id" },
|
|
298
|
+
tokenIn: { type: "address", required: true, description: "Token in or native placeholder" },
|
|
299
|
+
tokenOut: { type: "address", required: true, description: "Token out or native placeholder" },
|
|
300
|
+
amountHuman: { type: "string", required: true, description: "Human-readable input amount" }
|
|
301
|
+
}
|
|
302
|
+
},
|
|
270
303
|
{
|
|
271
304
|
id: "curve-dao.swap",
|
|
272
305
|
protocolId: CURVE_DAO_PROTOCOL_ID,
|
|
@@ -487,6 +520,17 @@ var mcpUniswapV4BuildSwapMultisignInputSchema = evmMultisignCommonInputSchema.ex
|
|
|
487
520
|
swapDeadlineUnix: z.number().describe("Same deadline passed to create_swap"),
|
|
488
521
|
slippagePercent: z.number().optional().describe("Extra approve headroom for EXACT_OUTPUT")
|
|
489
522
|
});
|
|
523
|
+
var mcpCurveDaoQuoteInputSchema = z.object({
|
|
524
|
+
chainId: z.number().int().positive().describe("EVM chain id (rpcUrl resolved from get_chain_registry rpcGateway)"),
|
|
525
|
+
rpcUrl: z.string().min(1).optional().describe("JSON-RPC URL; continuum-mcp-server injects from chain registry \u2014 do not pass a public RPC URL"),
|
|
526
|
+
tokenIn: z.string().min(1).describe("Input token address, or 0xeeee\u2026 / 0x0 / eth for native"),
|
|
527
|
+
tokenOut: z.string().min(1).describe("Output token address or 0xeeee\u2026 native placeholder"),
|
|
528
|
+
amountHuman: z.string().min(1).describe("Human-readable amount of tokenIn"),
|
|
529
|
+
tokenInDecimals: z.number().int().min(0).max(18).optional().describe("Token-in decimals; omit to read on-chain (native uses 18)")
|
|
530
|
+
});
|
|
531
|
+
var mcpCurveDaoQuoteOutputSchema = jsonObjectSchema.describe(
|
|
532
|
+
"Curve router quote: { inputAmount, output, route, priceImpactPercent?, tokenInRouterId, tokenOutRouterId }"
|
|
533
|
+
);
|
|
490
534
|
var mcpCurveDaoBuildSwapMultisignInputSchema = evmMultisignCommonInputSchema.extend({
|
|
491
535
|
tokenIn: evmAddressSchema.describe("ERC-20 sold (native in uses WETH path in UI)"),
|
|
492
536
|
tokenOut: z.string().min(1).describe("Output token or 0xeeee\u2026 native placeholder"),
|
|
@@ -992,13 +1036,32 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
992
1036
|
inputZod: mcpUniswapV4BuildSwapMultisignInputSchema,
|
|
993
1037
|
outputZod: multisignOutputSchema
|
|
994
1038
|
}),
|
|
1039
|
+
defineMcpTool({
|
|
1040
|
+
name: "ctm_curve_dao_quote",
|
|
1041
|
+
actionId: "curve-dao.quote",
|
|
1042
|
+
protocolId: "curve-dao",
|
|
1043
|
+
chainCategory: "evm",
|
|
1044
|
+
description: "Fetch a Curve Router NG quote via @curvefi/api getBestRouteAndOutput. Returns output amount, route, and optional priceImpactPercent. Does NOT create a sign request \u2014 call ctm_curve_dao_build_swap_multisign after quoting. Pass chainId only; rpcUrl is resolved from get_chain_registry rpcGateway.",
|
|
1045
|
+
prerequisites: [
|
|
1046
|
+
"Chain must be supported by Curve (@curvefi/api network constants).",
|
|
1047
|
+
"Configure rpcGateway for chainId in get_chain_registry."
|
|
1048
|
+
],
|
|
1049
|
+
followUp: ["ctm_curve_dao_build_swap_multisign"],
|
|
1050
|
+
handler: { importPath: "protocols/evm/curve-dao", exportName: "curveDaoQuote" },
|
|
1051
|
+
inputZod: mcpCurveDaoQuoteInputSchema,
|
|
1052
|
+
outputZod: mcpCurveDaoQuoteOutputSchema
|
|
1053
|
+
}),
|
|
995
1054
|
defineMcpTool({
|
|
996
1055
|
name: "ctm_curve_dao_build_swap_multisign",
|
|
997
1056
|
actionId: "curve-dao.swap",
|
|
998
1057
|
protocolId: "curve-dao",
|
|
999
1058
|
chainCategory: "evm",
|
|
1000
1059
|
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.",
|
|
1001
|
-
prerequisites: [
|
|
1060
|
+
prerequisites: [
|
|
1061
|
+
"ctm_curve_dao_quote (recommended) or known-good route",
|
|
1062
|
+
"keyGenId + chainId + purposeText",
|
|
1063
|
+
"tokenIn/tokenOut/amountHuman/slippagePercent"
|
|
1064
|
+
],
|
|
1002
1065
|
followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig and signedMessage"],
|
|
1003
1066
|
handler: { importPath: "protocols/evm/curve-dao", exportName: "buildEvmMultisignBodyCurveDaoBatch" },
|
|
1004
1067
|
inputZod: mcpCurveDaoBuildSwapMultisignInputSchema,
|
|
@@ -1223,6 +1286,18 @@ registerProtocolModule(ethenaProtocolModule);
|
|
|
1223
1286
|
function isMapleSyrupSupportedChain(chainId) {
|
|
1224
1287
|
return chainId === 1 || chainId === 11155111;
|
|
1225
1288
|
}
|
|
1289
|
+
async function postJsonViaOptionalProxy(args) {
|
|
1290
|
+
const r = await fetch(args.directUrl, {
|
|
1291
|
+
method: "POST",
|
|
1292
|
+
headers: { "content-type": "application/json" },
|
|
1293
|
+
body: JSON.stringify(args.body)
|
|
1294
|
+
});
|
|
1295
|
+
if (!r.ok) {
|
|
1296
|
+
const t = await r.text().catch(() => "");
|
|
1297
|
+
throw new Error(t ? `HTTP ${r.status}: ${t.slice(0, 200)}` : `HTTP ${r.status}`);
|
|
1298
|
+
}
|
|
1299
|
+
return await r.json();
|
|
1300
|
+
}
|
|
1226
1301
|
|
|
1227
1302
|
// src/protocols/evm/maple/index.ts
|
|
1228
1303
|
var MAPLE_PROTOCOL_ID = "maple-syrup";
|
|
@@ -1271,16 +1346,10 @@ var skyProtocolModule = {
|
|
|
1271
1346
|
registerProtocolModule(skyProtocolModule);
|
|
1272
1347
|
var AAVE_V4_GRAPHQL_URL = "https://api.v4.aave.com/graphql";
|
|
1273
1348
|
async function aaveV4Gql(query, variables) {
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
body
|
|
1278
|
-
});
|
|
1279
|
-
if (!r.ok) {
|
|
1280
|
-
const t = await r.text().catch(() => "");
|
|
1281
|
-
throw new Error(t ? `Aave V4 API HTTP ${r.status}: ${t.slice(0, 200)}` : `Aave V4 API HTTP ${r.status}`);
|
|
1282
|
-
}
|
|
1283
|
-
const j = await r.json();
|
|
1349
|
+
const body = { query, variables: variables ?? {} };
|
|
1350
|
+
const j = await postJsonViaOptionalProxy({
|
|
1351
|
+
directUrl: AAVE_V4_GRAPHQL_URL,
|
|
1352
|
+
body});
|
|
1284
1353
|
if (j.errors?.length) {
|
|
1285
1354
|
const msg = j.errors.map((e) => e.message ?? "Unknown").join("; ");
|
|
1286
1355
|
throw new Error(msg);
|
|
@@ -1684,6 +1753,6 @@ function getAgentCatalog() {
|
|
|
1684
1753
|
};
|
|
1685
1754
|
}
|
|
1686
1755
|
|
|
1687
|
-
export { EVM_COMMON_PARAM_DOCS, MANAGEMENT_SIG_DOC, MCP_NON_SUBMIT_TOOL_NAMES, MCP_TOOL_DEFINITIONS, MCP_TOOL_INPUT_SCHEMAS, MCP_TOOL_OUTPUT_SCHEMAS, MULTISIGN_OUTPUT_DOC, PROTOCOL_SUPPORT_ADVISORS, chainDetailSchema, evmAddressSchema, evmMultisignCommonInputSchema, getActionsByChainCategory, getAgentCatalog, getAgentCatalogForMcp, getMcpToolByName, getMcpToolDefinitions, getMcpToolInputSchema, getMcpToolOutputSchema, getProtocolDiscoverySummary, getProtocolModules, getProtocolSkill, getProtocolSupportAdvisor, getToolsForProtocol, jsonObjectSchema, keyGenSchema, listProtocolSupportAdvisorIds, listProtocolsWithSkills, mcpAaveV4BorrowInputSchema, mcpAaveV4DepositInputSchema, mcpAaveV4RepayInputSchema, mcpAaveV4WithdrawInputSchema, mcpCurveDaoBuildSwapMultisignInputSchema, mcpEthenaClaimInputSchema, mcpEthenaCooldownInputSchema, mcpEthenaRedeemInputSchema, mcpEthenaStakeInputSchema, mcpEulerV2BorrowRepayInputSchema, mcpEulerV2CollateralDepositInputSchema, mcpEulerV2CollateralWithdrawInputSchema, mcpEulerV2IsolatedBorrowInputSchema, mcpEulerV2IsolatedLendInputSchema, mcpEulerV2VaultWithdrawInputSchema, mcpLidoClaimWithdrawalInputSchema, mcpLidoRequestWithdrawalsInputSchema, mcpLidoSubmitInputSchema, mcpLidoUnwrapWstEthInputSchema, mcpLidoWrapStEthInputSchema, mcpMapleDepositInputSchema, mcpMapleRequestRedeemInputSchema, mcpMultisignInput, multisignOutputSchema as mcpMultisignOutputSchema, mcpServerCommonInputSchema, mcpServerMultisignInput, mcpServerSubmitOutputSchema, mcpSkyLockstakeCloseInputSchema, mcpSkyLockstakeDrawInputSchema, mcpSkyLockstakeGetRewardInputSchema, mcpSkyLockstakeStakeInputSchema, mcpSkyLockstakeWipeInputSchema, mcpSkySusdsDepositInputSchema, mcpSkySusdsRedeemInputSchema, mcpUniswapV4BuildSwapMultisignInputSchema, mcpUniswapV4CreateSwapInputSchema, mcpUniswapV4CreateSwapOutputSchema, mcpUniswapV4QuoteInputSchema, mcpUniswapV4QuoteOutputSchema, multisignOutputSchema, parseMcpToolInput, parseMcpToolOutput, uniswapQuoteTradeTypeSchema, zodSchemaToMcpJsonSchema };
|
|
1756
|
+
export { EVM_COMMON_PARAM_DOCS, MANAGEMENT_SIG_DOC, MCP_NON_SUBMIT_TOOL_NAMES, MCP_TOOL_DEFINITIONS, MCP_TOOL_INPUT_SCHEMAS, MCP_TOOL_OUTPUT_SCHEMAS, MULTISIGN_OUTPUT_DOC, PROTOCOL_SUPPORT_ADVISORS, chainDetailSchema, evmAddressSchema, evmMultisignCommonInputSchema, getActionsByChainCategory, getAgentCatalog, getAgentCatalogForMcp, getMcpToolByName, getMcpToolDefinitions, getMcpToolInputSchema, getMcpToolOutputSchema, getProtocolDiscoverySummary, getProtocolModules, getProtocolSkill, getProtocolSupportAdvisor, getToolsForProtocol, jsonObjectSchema, keyGenSchema, listProtocolSupportAdvisorIds, listProtocolsWithSkills, mcpAaveV4BorrowInputSchema, mcpAaveV4DepositInputSchema, mcpAaveV4RepayInputSchema, mcpAaveV4WithdrawInputSchema, mcpCurveDaoBuildSwapMultisignInputSchema, mcpCurveDaoQuoteInputSchema, mcpCurveDaoQuoteOutputSchema, mcpEthenaClaimInputSchema, mcpEthenaCooldownInputSchema, mcpEthenaRedeemInputSchema, mcpEthenaStakeInputSchema, mcpEulerV2BorrowRepayInputSchema, mcpEulerV2CollateralDepositInputSchema, mcpEulerV2CollateralWithdrawInputSchema, mcpEulerV2IsolatedBorrowInputSchema, mcpEulerV2IsolatedLendInputSchema, mcpEulerV2VaultWithdrawInputSchema, mcpLidoClaimWithdrawalInputSchema, mcpLidoRequestWithdrawalsInputSchema, mcpLidoSubmitInputSchema, mcpLidoUnwrapWstEthInputSchema, mcpLidoWrapStEthInputSchema, mcpMapleDepositInputSchema, mcpMapleRequestRedeemInputSchema, mcpMultisignInput, multisignOutputSchema as mcpMultisignOutputSchema, mcpServerCommonInputSchema, mcpServerMultisignInput, mcpServerSubmitOutputSchema, mcpSkyLockstakeCloseInputSchema, mcpSkyLockstakeDrawInputSchema, mcpSkyLockstakeGetRewardInputSchema, mcpSkyLockstakeStakeInputSchema, mcpSkyLockstakeWipeInputSchema, mcpSkySusdsDepositInputSchema, mcpSkySusdsRedeemInputSchema, mcpUniswapV4BuildSwapMultisignInputSchema, mcpUniswapV4CreateSwapInputSchema, mcpUniswapV4CreateSwapOutputSchema, mcpUniswapV4QuoteInputSchema, mcpUniswapV4QuoteOutputSchema, multisignOutputSchema, parseMcpToolInput, parseMcpToolOutput, uniswapQuoteTradeTypeSchema, zodSchemaToMcpJsonSchema };
|
|
1688
1757
|
//# sourceMappingURL=catalog.js.map
|
|
1689
1758
|
//# sourceMappingURL=catalog.js.map
|