@continuumdao/ctm-mpc-defi 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/agent/catalog.cjs +62 -11
  2. package/dist/agent/catalog.cjs.map +1 -1
  3. package/dist/agent/catalog.d.ts +27 -1
  4. package/dist/agent/catalog.js +61 -12
  5. package/dist/agent/catalog.js.map +1 -1
  6. package/dist/agent/skills/curve-dao/SKILL.md +2 -1
  7. package/dist/chains/evm/index.cjs +54 -0
  8. package/dist/chains/evm/index.cjs.map +1 -1
  9. package/dist/chains/evm/index.d.ts +13 -1
  10. package/dist/chains/evm/index.js +52 -2
  11. package/dist/chains/evm/index.js.map +1 -1
  12. package/dist/core/index.cjs +64 -0
  13. package/dist/core/index.cjs.map +1 -1
  14. package/dist/core/index.d.ts +20 -1
  15. package/dist/core/index.js +56 -1
  16. package/dist/core/index.js.map +1 -1
  17. package/dist/index.cjs +131 -0
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +120 -2
  21. package/dist/index.js.map +1 -1
  22. package/dist/protocols/evm/aave-v4/index.cjs +766 -6
  23. package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
  24. package/dist/protocols/evm/aave-v4/index.d.ts +417 -1
  25. package/dist/protocols/evm/aave-v4/index.js +741 -8
  26. package/dist/protocols/evm/aave-v4/index.js.map +1 -1
  27. package/dist/protocols/evm/curve-dao/index.cjs +233 -7
  28. package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
  29. package/dist/protocols/evm/curve-dao/index.d.ts +66 -1
  30. package/dist/protocols/evm/curve-dao/index.js +227 -9
  31. package/dist/protocols/evm/curve-dao/index.js.map +1 -1
  32. package/dist/protocols/evm/ethena/index.cjs +104 -0
  33. package/dist/protocols/evm/ethena/index.cjs.map +1 -1
  34. package/dist/protocols/evm/ethena/index.d.ts +46 -1
  35. package/dist/protocols/evm/ethena/index.js +99 -1
  36. package/dist/protocols/evm/ethena/index.js.map +1 -1
  37. package/dist/protocols/evm/euler-v2/index.cjs +2334 -37
  38. package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
  39. package/dist/protocols/evm/euler-v2/index.d.ts +464 -1
  40. package/dist/protocols/evm/euler-v2/index.js +2286 -39
  41. package/dist/protocols/evm/euler-v2/index.js.map +1 -1
  42. package/dist/protocols/evm/lido/index.cjs +110 -0
  43. package/dist/protocols/evm/lido/index.cjs.map +1 -1
  44. package/dist/protocols/evm/lido/index.d.ts +33 -2
  45. package/dist/protocols/evm/lido/index.js +107 -2
  46. package/dist/protocols/evm/lido/index.js.map +1 -1
  47. package/dist/protocols/evm/maple/index.cjs +83 -0
  48. package/dist/protocols/evm/maple/index.cjs.map +1 -1
  49. package/dist/protocols/evm/maple/index.d.ts +22 -1
  50. package/dist/protocols/evm/maple/index.js +82 -1
  51. package/dist/protocols/evm/maple/index.js.map +1 -1
  52. package/dist/protocols/evm/sky/index.cjs +217 -0
  53. package/dist/protocols/evm/sky/index.cjs.map +1 -1
  54. package/dist/protocols/evm/sky/index.d.ts +56 -1
  55. package/dist/protocols/evm/sky/index.js +210 -2
  56. package/dist/protocols/evm/sky/index.js.map +1 -1
  57. package/package.json +1 -1
@@ -270,6 +270,19 @@ var curveDaoProtocolModule = {
270
270
  return token.kind === "native" || token.kind === "erc20";
271
271
  },
272
272
  actions: [
273
+ {
274
+ id: "curve-dao.quote",
275
+ protocolId: CURVE_DAO_PROTOCOL_ID,
276
+ chainCategory: "evm",
277
+ description: "Quote swap via Curve Router NG (getBestRouteAndOutput)",
278
+ commonParams: [],
279
+ params: {
280
+ chainId: { type: "number", required: true, description: "EVM chain id" },
281
+ tokenIn: { type: "address", required: true, description: "Token in or native placeholder" },
282
+ tokenOut: { type: "address", required: true, description: "Token out or native placeholder" },
283
+ amountHuman: { type: "string", required: true, description: "Human-readable input amount" }
284
+ }
285
+ },
273
286
  {
274
287
  id: "curve-dao.swap",
275
288
  protocolId: CURVE_DAO_PROTOCOL_ID,
@@ -490,6 +503,17 @@ var mcpUniswapV4BuildSwapMultisignInputSchema = evmMultisignCommonInputSchema.ex
490
503
  swapDeadlineUnix: zod.z.number().describe("Same deadline passed to create_swap"),
491
504
  slippagePercent: zod.z.number().optional().describe("Extra approve headroom for EXACT_OUTPUT")
492
505
  });
506
+ var mcpCurveDaoQuoteInputSchema = zod.z.object({
507
+ chainId: zod.z.number().int().positive().describe("EVM chain id (rpcUrl resolved from get_chain_registry rpcGateway)"),
508
+ rpcUrl: zod.z.string().min(1).optional().describe("JSON-RPC URL; continuum-mcp-server injects from chain registry \u2014 do not pass a public RPC URL"),
509
+ tokenIn: zod.z.string().min(1).describe("Input token address, or 0xeeee\u2026 / 0x0 / eth for native"),
510
+ tokenOut: zod.z.string().min(1).describe("Output token address or 0xeeee\u2026 native placeholder"),
511
+ amountHuman: zod.z.string().min(1).describe("Human-readable amount of tokenIn"),
512
+ tokenInDecimals: zod.z.number().int().min(0).max(18).optional().describe("Token-in decimals; omit to read on-chain (native uses 18)")
513
+ });
514
+ var mcpCurveDaoQuoteOutputSchema = jsonObjectSchema.describe(
515
+ "Curve router quote: { inputAmount, output, route, priceImpactPercent?, tokenInRouterId, tokenOutRouterId }"
516
+ );
493
517
  var mcpCurveDaoBuildSwapMultisignInputSchema = evmMultisignCommonInputSchema.extend({
494
518
  tokenIn: evmAddressSchema.describe("ERC-20 sold (native in uses WETH path in UI)"),
495
519
  tokenOut: zod.z.string().min(1).describe("Output token or 0xeeee\u2026 native placeholder"),
@@ -995,13 +1019,32 @@ var CORE_MCP_TOOL_DEFINITIONS = [
995
1019
  inputZod: mcpUniswapV4BuildSwapMultisignInputSchema,
996
1020
  outputZod: multisignOutputSchema
997
1021
  }),
1022
+ defineMcpTool({
1023
+ name: "ctm_curve_dao_quote",
1024
+ actionId: "curve-dao.quote",
1025
+ protocolId: "curve-dao",
1026
+ chainCategory: "evm",
1027
+ 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.",
1028
+ prerequisites: [
1029
+ "Chain must be supported by Curve (@curvefi/api network constants).",
1030
+ "Configure rpcGateway for chainId in get_chain_registry."
1031
+ ],
1032
+ followUp: ["ctm_curve_dao_build_swap_multisign"],
1033
+ handler: { importPath: "protocols/evm/curve-dao", exportName: "curveDaoQuote" },
1034
+ inputZod: mcpCurveDaoQuoteInputSchema,
1035
+ outputZod: mcpCurveDaoQuoteOutputSchema
1036
+ }),
998
1037
  defineMcpTool({
999
1038
  name: "ctm_curve_dao_build_swap_multisign",
1000
1039
  actionId: "curve-dao.swap",
1001
1040
  protocolId: "curve-dao",
1002
1041
  chainCategory: "evm",
1003
1042
  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.",
1004
- prerequisites: ["keyGen", "executorAddress", "tokenIn/tokenOut/amountHuman/slippage", "RPC URL"],
1043
+ prerequisites: [
1044
+ "ctm_curve_dao_quote (recommended) or known-good route",
1045
+ "keyGenId + chainId + purposeText",
1046
+ "tokenIn/tokenOut/amountHuman/slippagePercent"
1047
+ ],
1005
1048
  followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig and signedMessage"],
1006
1049
  handler: { importPath: "protocols/evm/curve-dao", exportName: "buildEvmMultisignBodyCurveDaoBatch" },
1007
1050
  inputZod: mcpCurveDaoBuildSwapMultisignInputSchema,
@@ -1226,6 +1269,18 @@ registerProtocolModule(ethenaProtocolModule);
1226
1269
  function isMapleSyrupSupportedChain(chainId) {
1227
1270
  return chainId === 1 || chainId === 11155111;
1228
1271
  }
1272
+ async function postJsonViaOptionalProxy(args) {
1273
+ const r = await fetch(args.directUrl, {
1274
+ method: "POST",
1275
+ headers: { "content-type": "application/json" },
1276
+ body: JSON.stringify(args.body)
1277
+ });
1278
+ if (!r.ok) {
1279
+ const t = await r.text().catch(() => "");
1280
+ throw new Error(t ? `HTTP ${r.status}: ${t.slice(0, 200)}` : `HTTP ${r.status}`);
1281
+ }
1282
+ return await r.json();
1283
+ }
1229
1284
 
1230
1285
  // src/protocols/evm/maple/index.ts
1231
1286
  var MAPLE_PROTOCOL_ID = "maple-syrup";
@@ -1274,16 +1329,10 @@ var skyProtocolModule = {
1274
1329
  registerProtocolModule(skyProtocolModule);
1275
1330
  var AAVE_V4_GRAPHQL_URL = "https://api.v4.aave.com/graphql";
1276
1331
  async function aaveV4Gql(query, variables) {
1277
- const r = await fetch(AAVE_V4_GRAPHQL_URL, {
1278
- method: "POST",
1279
- headers: { "content-type": "application/json" },
1280
- body: JSON.stringify({ query, variables: variables ?? {} })
1281
- });
1282
- if (!r.ok) {
1283
- const t = await r.text().catch(() => "");
1284
- throw new Error(t ? `Aave V4 API HTTP ${r.status}: ${t.slice(0, 200)}` : `Aave V4 API HTTP ${r.status}`);
1285
- }
1286
- const j = await r.json();
1332
+ const body = { query, variables: variables ?? {} };
1333
+ const j = await postJsonViaOptionalProxy({
1334
+ directUrl: AAVE_V4_GRAPHQL_URL,
1335
+ body});
1287
1336
  if (j.errors?.length) {
1288
1337
  const msg = j.errors.map((e) => e.message ?? "Unknown").join("; ");
1289
1338
  throw new Error(msg);
@@ -1719,6 +1768,8 @@ exports.mcpAaveV4DepositInputSchema = mcpAaveV4DepositInputSchema;
1719
1768
  exports.mcpAaveV4RepayInputSchema = mcpAaveV4RepayInputSchema;
1720
1769
  exports.mcpAaveV4WithdrawInputSchema = mcpAaveV4WithdrawInputSchema;
1721
1770
  exports.mcpCurveDaoBuildSwapMultisignInputSchema = mcpCurveDaoBuildSwapMultisignInputSchema;
1771
+ exports.mcpCurveDaoQuoteInputSchema = mcpCurveDaoQuoteInputSchema;
1772
+ exports.mcpCurveDaoQuoteOutputSchema = mcpCurveDaoQuoteOutputSchema;
1722
1773
  exports.mcpEthenaClaimInputSchema = mcpEthenaClaimInputSchema;
1723
1774
  exports.mcpEthenaCooldownInputSchema = mcpEthenaCooldownInputSchema;
1724
1775
  exports.mcpEthenaRedeemInputSchema = mcpEthenaRedeemInputSchema;