@continuumdao/ctm-mpc-defi 0.2.11 → 0.2.12
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 -47
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +879 -339
- package/dist/agent/catalog.js +96 -47
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/morpho/SKILL.md +8 -0
- package/dist/chains/evm/index.cjs +1 -1
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.js +1 -1
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.js +1 -1
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.js +1 -1
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +1 -1
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.js +1 -1
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.js +1 -1
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/gmx/index.cjs +1 -1
- package/dist/protocols/evm/gmx/index.cjs.map +1 -1
- package/dist/protocols/evm/gmx/index.js +1 -1
- package/dist/protocols/evm/gmx/index.js.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.js +1 -1
- package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +1 -1
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.js +1 -1
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +1 -1
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.js +1 -1
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +1 -1
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.js +1 -1
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs +1 -1
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.js +1 -1
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/package.json +1 -1
package/dist/agent/catalog.js
CHANGED
|
@@ -413,6 +413,14 @@ var MULTISIGN_SUBMIT_OUTPUT_DOC = {
|
|
|
413
413
|
requestId: {
|
|
414
414
|
type: "string",
|
|
415
415
|
description: "Sign request id from POST /multiSignRequest."
|
|
416
|
+
},
|
|
417
|
+
status: {
|
|
418
|
+
type: "string",
|
|
419
|
+
description: "submitted when POST succeeded \u2014 do not call the same build tool again."
|
|
420
|
+
},
|
|
421
|
+
followUp: {
|
|
422
|
+
type: "string",
|
|
423
|
+
description: "Lifecycle next steps (wait_for_sign_request_ready \u2192 agree \u2192 trigger \u2192 broadcast)."
|
|
416
424
|
}
|
|
417
425
|
}
|
|
418
426
|
};
|
|
@@ -481,6 +489,22 @@ function withMultisignSubmitMcpMeta(description, followUp = MCP_MULTISIGN_SUBMIT
|
|
|
481
489
|
followUp: [...followUp]
|
|
482
490
|
};
|
|
483
491
|
}
|
|
492
|
+
var MULTISIGN_SERVER_RESOLVED_KEYS = /* @__PURE__ */ new Set([
|
|
493
|
+
"keyGen",
|
|
494
|
+
"rpcUrl",
|
|
495
|
+
"executorAddress",
|
|
496
|
+
"chainDetail",
|
|
497
|
+
"customGasChainDetails"
|
|
498
|
+
]);
|
|
499
|
+
function agentFacingMultisignJsonSchema(schema) {
|
|
500
|
+
const raw = zodSchemaToMcpJsonSchema(schema);
|
|
501
|
+
const prevRequired = Array.isArray(raw.required) ? [...raw.required] : [];
|
|
502
|
+
const agentRequired = prevRequired.filter((k) => !MULTISIGN_SERVER_RESOLVED_KEYS.has(k));
|
|
503
|
+
if (!agentRequired.includes("keyGenId")) {
|
|
504
|
+
agentRequired.unshift("keyGenId");
|
|
505
|
+
}
|
|
506
|
+
return { ...raw, required: agentRequired };
|
|
507
|
+
}
|
|
484
508
|
function zodSchemaToMcpJsonSchema(schema) {
|
|
485
509
|
const raw = zodToJsonSchema(schema, {
|
|
486
510
|
target: "openApi3",
|
|
@@ -521,23 +545,30 @@ var chainDetailSchema = z.object({
|
|
|
521
545
|
);
|
|
522
546
|
var evmMultisignCommonInputSchema = z.object({
|
|
523
547
|
keyGenId: z.string().min(1).optional().describe(
|
|
524
|
-
"KeyGen request id from get_preferred_key_gen / conversation context. MCP server resolves keyGen, executorAddress, rpcUrl, and chainDetail \u2014
|
|
548
|
+
"KeyGen request id from get_preferred_key_gen / conversation context. MCP server resolves keyGen, executorAddress, rpcUrl, and chainDetail \u2014 agents must pass keyGenId only."
|
|
525
549
|
),
|
|
526
|
-
keyGen: keyGenSchema,
|
|
550
|
+
keyGen: keyGenSchema.optional().describe("Server-filled from keyGenId. Agents must not pass keyGen."),
|
|
527
551
|
purposeText: z.string().min(1).describe(
|
|
528
552
|
"Human-readable purpose for the sign request. Stored in bodyForSign.purpose (may be appended with an automatic batch suffix)."
|
|
529
553
|
),
|
|
530
|
-
useCustomGas: z.boolean().describe(
|
|
554
|
+
useCustomGas: z.boolean().default(false).describe(
|
|
531
555
|
"When true, apply Custom Gas Config from chainDetail / customGasChainDetails. Omitted baseFee/priorityFee is valid \u2014 builder uses live RPC fees; configured values are optional floors/multipliers. When false, use live RPC estimates only."
|
|
532
556
|
),
|
|
533
557
|
chainId: z.number().int().positive().describe("EVM chain id (decimal). Becomes destinationChainID on the sign request."),
|
|
534
|
-
rpcUrl: z.string().min(1).describe("
|
|
535
|
-
executorAddress: evmAddressSchema.describe(
|
|
536
|
-
|
|
537
|
-
),
|
|
538
|
-
chainDetail: chainDetailSchema,
|
|
558
|
+
rpcUrl: z.string().min(1).optional().describe("Server-filled from chain registry when keyGenId is set. Agents must not pass rpcUrl."),
|
|
559
|
+
executorAddress: evmAddressSchema.optional().describe("Server-filled MPC wallet from keyGenId. Agents must not pass executorAddress."),
|
|
560
|
+
chainDetail: chainDetailSchema.optional().describe("Server-filled gas row from chain registry when keyGenId is set."),
|
|
539
561
|
customGasChainDetails: z.record(z.unknown()).optional().describe("Snapshot written to extraJSON.customGasChainDetails when useCustomGas is true.")
|
|
540
562
|
});
|
|
563
|
+
function withMultisignKeySourceRefine(schema) {
|
|
564
|
+
return schema.refine(
|
|
565
|
+
(d) => Boolean(d.keyGenId?.trim()) || Boolean(d.keyGen?.pubkeyhex?.trim() && d.executorAddress?.trim() && d.rpcUrl?.trim()),
|
|
566
|
+
{
|
|
567
|
+
message: "keyGenId is required for MCP agents (or pass keyGen + executorAddress + rpcUrl for manual calls).",
|
|
568
|
+
path: ["keyGenId"]
|
|
569
|
+
}
|
|
570
|
+
);
|
|
571
|
+
}
|
|
541
572
|
var multisignOutputSchema = z.object({
|
|
542
573
|
bodyForSign: z.record(z.unknown()).describe(
|
|
543
574
|
"POST body fields without clientSig: keyList, pubKey, msgHash, msgRaw, destinationChainID, purpose, extraJSON, proposalTxParams (batch), messageHashes/messageRawBatch when N>1 txs."
|
|
@@ -585,18 +616,20 @@ var mcpUniswapV4CreateSwapOutputSchema = z.object({
|
|
|
585
616
|
gasFee: z.string().optional()
|
|
586
617
|
}).passthrough().describe("{ swap: TransactionRequest, requestId?, gasFee? }");
|
|
587
618
|
var swapTxRequestSchema = jsonObjectSchema.describe("swap field from create_swap response (to, data, value)");
|
|
588
|
-
var mcpUniswapV4BuildSwapMultisignInputSchema =
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
createSwapResponse: z.object({
|
|
619
|
+
var mcpUniswapV4BuildSwapMultisignInputSchema = withMultisignKeySourceRefine(
|
|
620
|
+
evmMultisignCommonInputSchema.extend({
|
|
621
|
+
tokenIn: evmAddressSchema.describe("Token in; 0x0 for native ETH"),
|
|
592
622
|
swap: swapTxRequestSchema,
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
623
|
+
createSwapResponse: z.object({
|
|
624
|
+
swap: swapTxRequestSchema,
|
|
625
|
+
requestId: z.string().optional(),
|
|
626
|
+
gasFee: z.string().optional()
|
|
627
|
+
}).passthrough().describe("Full create_swap response"),
|
|
628
|
+
fullQuoteSnapshot: jsonObjectSchema.describe("Quote JSON used for the swap"),
|
|
629
|
+
swapDeadlineUnix: z.number().describe("Same deadline passed to create_swap"),
|
|
630
|
+
slippagePercent: z.number().optional().describe("Extra approve headroom for EXACT_OUTPUT")
|
|
631
|
+
})
|
|
632
|
+
);
|
|
600
633
|
var lpExistingPoolSchema = z.object({
|
|
601
634
|
token0Address: evmAddressSchema,
|
|
602
635
|
token1Address: evmAddressSchema,
|
|
@@ -736,21 +769,27 @@ var lpBuildCommonSchema = {
|
|
|
736
769
|
nativeWrapped: evmAddressSchema.optional(),
|
|
737
770
|
poolReference: z.string().optional()
|
|
738
771
|
};
|
|
739
|
-
var mcpUniswapV4BuildMintLiquidityMultisignInputSchema =
|
|
740
|
-
lpBuildCommonSchema
|
|
772
|
+
var mcpUniswapV4BuildMintLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
773
|
+
evmMultisignCommonInputSchema.extend(lpBuildCommonSchema)
|
|
774
|
+
);
|
|
775
|
+
var mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
776
|
+
evmMultisignCommonInputSchema.extend({
|
|
777
|
+
...lpBuildCommonSchema,
|
|
778
|
+
nftTokenId: z.union([z.string(), z.number()])
|
|
779
|
+
})
|
|
780
|
+
);
|
|
781
|
+
var mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
782
|
+
evmMultisignCommonInputSchema.extend({
|
|
783
|
+
...lpBuildCommonSchema,
|
|
784
|
+
nftTokenId: z.union([z.string(), z.number()])
|
|
785
|
+
})
|
|
786
|
+
);
|
|
787
|
+
var mcpUniswapV4BuildCollectFeesMultisignInputSchema = withMultisignKeySourceRefine(
|
|
788
|
+
evmMultisignCommonInputSchema.extend({
|
|
789
|
+
...lpBuildCommonSchema,
|
|
790
|
+
nftTokenId: z.union([z.string(), z.number()])
|
|
791
|
+
})
|
|
741
792
|
);
|
|
742
|
-
var mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema = evmMultisignCommonInputSchema.extend({
|
|
743
|
-
...lpBuildCommonSchema,
|
|
744
|
-
nftTokenId: z.union([z.string(), z.number()])
|
|
745
|
-
});
|
|
746
|
-
var mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema = evmMultisignCommonInputSchema.extend({
|
|
747
|
-
...lpBuildCommonSchema,
|
|
748
|
-
nftTokenId: z.union([z.string(), z.number()])
|
|
749
|
-
});
|
|
750
|
-
var mcpUniswapV4BuildCollectFeesMultisignInputSchema = evmMultisignCommonInputSchema.extend({
|
|
751
|
-
...lpBuildCommonSchema,
|
|
752
|
-
nftTokenId: z.union([z.string(), z.number()])
|
|
753
|
-
});
|
|
754
793
|
var mcpCurveDaoQuoteInputSchema = z.object({
|
|
755
794
|
chainId: z.number().int().positive().describe("EVM chain id (rpcUrl resolved from get_chain_registry rpcGateway)"),
|
|
756
795
|
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"),
|
|
@@ -762,12 +801,14 @@ var mcpCurveDaoQuoteInputSchema = z.object({
|
|
|
762
801
|
var mcpCurveDaoQuoteOutputSchema = jsonObjectSchema.describe(
|
|
763
802
|
"Curve router quote: { inputAmount, output, route, priceImpactPercent?, tokenInRouterId, tokenOutRouterId }"
|
|
764
803
|
);
|
|
765
|
-
var mcpCurveDaoBuildSwapMultisignInputSchema =
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
804
|
+
var mcpCurveDaoBuildSwapMultisignInputSchema = withMultisignKeySourceRefine(
|
|
805
|
+
evmMultisignCommonInputSchema.extend({
|
|
806
|
+
tokenIn: evmAddressSchema.describe("ERC-20 sold (native in uses WETH path in UI)"),
|
|
807
|
+
tokenOut: z.string().min(1).describe("Output token or 0xeeee\u2026 native placeholder"),
|
|
808
|
+
amountHuman: z.string().min(1).describe("Human-readable amount of tokenIn"),
|
|
809
|
+
slippagePercent: z.number().gt(0).lt(100).describe("Slippage 0\u2013100 exclusive")
|
|
810
|
+
})
|
|
811
|
+
);
|
|
771
812
|
var mcpServerCommonInputSchema = z.object({
|
|
772
813
|
keyGenId: z.string().min(1).describe("KeyGen id from fetch_key_gen_result / node preferred KeyGen"),
|
|
773
814
|
chainId: z.number().int().positive().describe("EVM chain id; RPC and gas config resolved from chain registry"),
|
|
@@ -778,7 +819,11 @@ function mcpServerMultisignInput(fields) {
|
|
|
778
819
|
return mcpServerCommonInputSchema.extend(fields);
|
|
779
820
|
}
|
|
780
821
|
var mcpServerSubmitOutputSchema = z.object({
|
|
781
|
-
requestId: z.string().min(1).describe("Sign request id from POST /multiSignRequest \u2014 success; do not retry the same build tool.")
|
|
822
|
+
requestId: z.string().min(1).describe("Sign request id from POST /multiSignRequest \u2014 success; do not retry the same build tool."),
|
|
823
|
+
status: z.literal("submitted").optional().describe("Present when POST /multiSignRequest succeeded. Confirms the request exists on the node."),
|
|
824
|
+
followUp: z.string().optional().describe(
|
|
825
|
+
"Next MCP lifecycle steps. Do not call the same build_*_multisign tool again unless the user explicitly wants a duplicate order."
|
|
826
|
+
)
|
|
782
827
|
}).describe(
|
|
783
828
|
"Submitted mpc-auth multiSignRequest. Continue with wait_for_sign_request_ready \u2192 sign_request_agree \u2192 trigger_sign_result \u2192 broadcast_sign_result."
|
|
784
829
|
);
|
|
@@ -789,7 +834,7 @@ var MCP_NON_SUBMIT_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
789
834
|
|
|
790
835
|
// src/agent/schemas/protocols.ts
|
|
791
836
|
function mcpMultisignInput(fields) {
|
|
792
|
-
return evmMultisignCommonInputSchema.extend(fields);
|
|
837
|
+
return withMultisignKeySourceRefine(evmMultisignCommonInputSchema.extend(fields));
|
|
793
838
|
}
|
|
794
839
|
var mcpLidoSubmitInputSchema = mcpMultisignInput({
|
|
795
840
|
valueWei: z.string().min(1).describe("ETH to stake (wei decimal string)"),
|
|
@@ -996,7 +1041,7 @@ var mcpMorphoFetchEarnVaultsOutputSchema = z.object({
|
|
|
996
1041
|
)
|
|
997
1042
|
});
|
|
998
1043
|
function mcpGmxMultisignInput(fields) {
|
|
999
|
-
return evmMultisignCommonInputSchema.extend(fields);
|
|
1044
|
+
return withMultisignKeySourceRefine(evmMultisignCommonInputSchema.extend(fields));
|
|
1000
1045
|
}
|
|
1001
1046
|
var gmxDirectionSchema = z.enum(["long", "short"]);
|
|
1002
1047
|
var gmxOrderTypeSchema = z.enum(["market", "limit"]);
|
|
@@ -1144,7 +1189,7 @@ var mcpGmxFetchOhlcvOutputSchema = z.object({
|
|
|
1144
1189
|
candles: z.array(gmxOhlcvCandleSchema)
|
|
1145
1190
|
});
|
|
1146
1191
|
function mcpHyperliquidMultisignInput(fields) {
|
|
1147
|
-
return evmMultisignCommonInputSchema.extend(fields);
|
|
1192
|
+
return withMultisignKeySourceRefine(evmMultisignCommonInputSchema.extend(fields));
|
|
1148
1193
|
}
|
|
1149
1194
|
var hyperliquidTifSchema = z.enum(["alo", "gtc", "ioc"]);
|
|
1150
1195
|
var hyperliquidOhlcvIntervalSchema = z.enum([
|
|
@@ -1457,7 +1502,7 @@ function defineProtocolMcpTool(def) {
|
|
|
1457
1502
|
description: meta.description,
|
|
1458
1503
|
followUp: meta.followUp,
|
|
1459
1504
|
outputZod: mcpServerSubmitOutputSchema,
|
|
1460
|
-
inputSchema:
|
|
1505
|
+
inputSchema: agentFacingMultisignJsonSchema(def.inputZod),
|
|
1461
1506
|
outputSchema: zodSchemaToMcpJsonSchema(mcpServerSubmitOutputSchema),
|
|
1462
1507
|
parseInput: (data) => def.inputZod.parse(data),
|
|
1463
1508
|
parseOutput: (data) => mcpServerSubmitOutputSchema.parse(data)
|
|
@@ -2018,12 +2063,16 @@ function defineMcpTool(def) {
|
|
|
2018
2063
|
}
|
|
2019
2064
|
function defineMultisignSubmitMcpTool(def) {
|
|
2020
2065
|
const meta = withMultisignSubmitMcpMeta(def.description, def.followUp ?? MCP_MULTISIGN_SUBMIT_FOLLOW_UP);
|
|
2021
|
-
return
|
|
2066
|
+
return {
|
|
2022
2067
|
...def,
|
|
2023
2068
|
description: meta.description,
|
|
2024
2069
|
followUp: meta.followUp,
|
|
2025
|
-
outputZod: mcpServerSubmitOutputSchema
|
|
2026
|
-
|
|
2070
|
+
outputZod: mcpServerSubmitOutputSchema,
|
|
2071
|
+
inputSchema: agentFacingMultisignJsonSchema(def.inputZod),
|
|
2072
|
+
outputSchema: zodSchemaToMcpJsonSchema(mcpServerSubmitOutputSchema),
|
|
2073
|
+
parseInput: (data) => def.inputZod.parse(data),
|
|
2074
|
+
parseOutput: (data) => mcpServerSubmitOutputSchema.parse(data)
|
|
2075
|
+
};
|
|
2027
2076
|
}
|
|
2028
2077
|
var CORE_MCP_TOOL_DEFINITIONS = [
|
|
2029
2078
|
defineMcpTool({
|