@continuumdao/ctm-mpc-defi 0.2.12 → 0.2.16
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 +868 -283
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +1657 -304
- package/dist/agent/catalog.js +861 -284
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/morpho/SKILL.md +8 -22
- package/dist/chains/evm/index.cjs +75 -0
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.d.ts +31 -1
- package/dist/chains/evm/index.js +73 -2
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/index.cjs +140 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +138 -34
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +29 -2
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.d.ts +23 -1
- package/dist/protocols/evm/euler-v2/index.js +29 -3
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/gmx/index.cjs +42 -8
- package/dist/protocols/evm/gmx/index.cjs.map +1 -1
- package/dist/protocols/evm/gmx/index.d.ts +20 -4
- package/dist/protocols/evm/gmx/index.js +42 -9
- package/dist/protocols/evm/gmx/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +9 -1
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.d.ts +2 -1
- package/dist/protocols/evm/maple/index.js +9 -1
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +56 -0
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.d.ts +28 -1
- package/dist/protocols/evm/morpho/index.js +56 -1
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs +98 -26
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js +99 -27
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/package.json +1 -1
package/dist/agent/catalog.cjs
CHANGED
|
@@ -527,6 +527,41 @@ function zodSchemaToMcpJsonSchema(schema) {
|
|
|
527
527
|
}
|
|
528
528
|
return raw;
|
|
529
529
|
}
|
|
530
|
+
function parseAgentBoolean(raw, defaultValue = false) {
|
|
531
|
+
if (raw === void 0 || raw === null) return defaultValue;
|
|
532
|
+
if (typeof raw === "boolean") return raw;
|
|
533
|
+
if (typeof raw === "number") return raw !== 0;
|
|
534
|
+
if (typeof raw === "string") {
|
|
535
|
+
const t = raw.trim().toLowerCase();
|
|
536
|
+
if (t === "true" || t === "1" || t === "yes") return true;
|
|
537
|
+
if (t === "false" || t === "0" || t === "no" || t === "") return false;
|
|
538
|
+
}
|
|
539
|
+
return Boolean(raw);
|
|
540
|
+
}
|
|
541
|
+
var CHAIN_ID_DECIMAL_HEX_TYPOS = {
|
|
542
|
+
33875: 8453
|
|
543
|
+
};
|
|
544
|
+
function parseAgentEvmChainId(raw) {
|
|
545
|
+
if (typeof raw === "number" && Number.isInteger(raw) && raw > 0) return raw;
|
|
546
|
+
if (typeof raw !== "string") return Number.NaN;
|
|
547
|
+
const t = raw.trim();
|
|
548
|
+
if (!t) return Number.NaN;
|
|
549
|
+
if (t.toLowerCase().startsWith("0x")) {
|
|
550
|
+
const hexVal = Number.parseInt(t, 16);
|
|
551
|
+
if (!Number.isFinite(hexVal) || hexVal <= 0) return Number.NaN;
|
|
552
|
+
return CHAIN_ID_DECIMAL_HEX_TYPOS[hexVal] ?? hexVal;
|
|
553
|
+
}
|
|
554
|
+
const dec = Number.parseInt(t, 10);
|
|
555
|
+
return Number.isFinite(dec) && dec > 0 ? dec : Number.NaN;
|
|
556
|
+
}
|
|
557
|
+
var agentBooleanSchema = (defaultValue = false) => zod.z.preprocess((val) => parseAgentBoolean(val, defaultValue), zod.z.boolean());
|
|
558
|
+
var agentOptionalBooleanSchema = () => zod.z.preprocess((val) => val === void 0 || val === null ? void 0 : parseAgentBoolean(val, false), zod.z.boolean().optional());
|
|
559
|
+
var agentEvmChainIdSchema = zod.z.preprocess(
|
|
560
|
+
(val) => parseAgentEvmChainId(val),
|
|
561
|
+
zod.z.number().int().positive().describe("EVM chain id (decimal, e.g. 8453 for Base \u2014 not 0x8453).")
|
|
562
|
+
);
|
|
563
|
+
|
|
564
|
+
// src/agent/schemas/common.ts
|
|
530
565
|
var evmAddressSchema = zod.z.string().min(1).describe("EVM address (0x-prefixed, 40 hex nibbles)");
|
|
531
566
|
var keyGenSchema = zod.z.object({
|
|
532
567
|
pubkeyhex: zod.z.string().min(1).describe("MPC secp256k1 public key hex (required for multiSignRequest pubKey)"),
|
|
@@ -554,10 +589,10 @@ var evmMultisignCommonInputSchema = zod.z.object({
|
|
|
554
589
|
purposeText: zod.z.string().min(1).describe(
|
|
555
590
|
"Human-readable purpose for the sign request. Stored in bodyForSign.purpose (may be appended with an automatic batch suffix)."
|
|
556
591
|
),
|
|
557
|
-
useCustomGas:
|
|
558
|
-
"
|
|
592
|
+
useCustomGas: agentBooleanSchema(false).describe(
|
|
593
|
+
"JSON boolean only: false = live RPC fees (default), true = chain registry Custom Gas Config. Omitted baseFee/priorityFee is valid when true."
|
|
559
594
|
),
|
|
560
|
-
chainId:
|
|
595
|
+
chainId: agentEvmChainIdSchema,
|
|
561
596
|
rpcUrl: zod.z.string().min(1).optional().describe("Server-filled from chain registry when keyGenId is set. Agents must not pass rpcUrl."),
|
|
562
597
|
executorAddress: evmAddressSchema.optional().describe("Server-filled MPC wallet from keyGenId. Agents must not pass executorAddress."),
|
|
563
598
|
chainDetail: chainDetailSchema.optional().describe("Server-filled gas row from chain registry when keyGenId is set."),
|
|
@@ -584,13 +619,287 @@ var jsonObjectSchema = zod.z.record(zod.z.unknown());
|
|
|
584
619
|
function parseMultisignBuilderOutput(data) {
|
|
585
620
|
return multisignOutputSchema.parse(data);
|
|
586
621
|
}
|
|
622
|
+
|
|
623
|
+
// src/agent/schemas/chainPreprocess.ts
|
|
624
|
+
function preprocessObject(raw) {
|
|
625
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
626
|
+
return { ...raw };
|
|
627
|
+
}
|
|
628
|
+
function firstDefined(...values) {
|
|
629
|
+
for (const v of values) {
|
|
630
|
+
if (v === void 0 || v === null) continue;
|
|
631
|
+
if (typeof v === "string" && !v.trim()) continue;
|
|
632
|
+
return v;
|
|
633
|
+
}
|
|
634
|
+
return void 0;
|
|
635
|
+
}
|
|
636
|
+
function aliasField(o, target, ...sources) {
|
|
637
|
+
if (firstDefined(o[target]) != null) return;
|
|
638
|
+
const val = firstDefined(...sources.map((k) => o[k]));
|
|
639
|
+
if (val != null) o[target] = val;
|
|
640
|
+
}
|
|
641
|
+
function derivePurposeIfMissing(o, build) {
|
|
642
|
+
const purposeText = String(o.purposeText ?? o.purpose ?? "").trim();
|
|
643
|
+
if (purposeText) {
|
|
644
|
+
o.purposeText = purposeText;
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
const derived = build(o);
|
|
648
|
+
if (derived) o.purposeText = derived;
|
|
649
|
+
}
|
|
650
|
+
function isLongToDirection(o) {
|
|
651
|
+
if (firstDefined(o.direction) != null) return;
|
|
652
|
+
const raw = o.isLong;
|
|
653
|
+
if (typeof raw === "boolean") {
|
|
654
|
+
o.direction = raw ? "long" : "short";
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
if (typeof raw === "string") {
|
|
658
|
+
const t = raw.trim().toLowerCase();
|
|
659
|
+
if (t === "true" || t === "long") o.direction = "long";
|
|
660
|
+
else if (t === "false" || t === "short") o.direction = "short";
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
function preprocessGmxGmBuildInput(raw) {
|
|
664
|
+
const o = preprocessObject(raw);
|
|
665
|
+
if (!o) return raw;
|
|
666
|
+
aliasField(o, "marketSymbol", "symbol", "market", "gmSymbol");
|
|
667
|
+
derivePurposeIfMissing(o, (x) => {
|
|
668
|
+
const sym = String(x.marketSymbol ?? x.symbol ?? "").trim();
|
|
669
|
+
const amt = String(x.collateralAmountHuman ?? x.gmAmountHuman ?? "").trim();
|
|
670
|
+
if (sym && amt) return `GMX GM ${sym} ${amt}`;
|
|
671
|
+
return void 0;
|
|
672
|
+
});
|
|
673
|
+
return o;
|
|
674
|
+
}
|
|
675
|
+
function preprocessGmxDecreaseInput(raw) {
|
|
676
|
+
const o = preprocessObject(raw);
|
|
677
|
+
if (!o) return raw;
|
|
678
|
+
aliasField(o, "symbol", "symbol", "indexName", "marketSymbol");
|
|
679
|
+
aliasField(o, "sizeUsdHuman", "sizeUsdHuman", "sizeUsd", "sizeInUsd");
|
|
680
|
+
aliasField(o, "collateralToken", "collateralToken", "collateralSymbol");
|
|
681
|
+
isLongToDirection(o);
|
|
682
|
+
derivePurposeIfMissing(o, (x) => {
|
|
683
|
+
const sym = String(x.symbol ?? "").trim();
|
|
684
|
+
const dir = String(x.direction ?? "").trim();
|
|
685
|
+
const size = String(x.sizeUsdHuman ?? "").trim();
|
|
686
|
+
if (sym && dir && size) return `GMX decrease ${dir} ${sym} ${size} USD`;
|
|
687
|
+
return void 0;
|
|
688
|
+
});
|
|
689
|
+
return o;
|
|
690
|
+
}
|
|
691
|
+
function preprocessGmxIncreaseInput(raw) {
|
|
692
|
+
const o = preprocessObject(raw);
|
|
693
|
+
if (!o) return raw;
|
|
694
|
+
aliasField(o, "symbol", "symbol", "indexName", "marketSymbol");
|
|
695
|
+
derivePurposeIfMissing(o, (x) => {
|
|
696
|
+
const sym = String(x.symbol ?? "").trim();
|
|
697
|
+
const dir = String(x.direction ?? "").trim();
|
|
698
|
+
const size = String(x.sizeUsdHuman ?? "").trim();
|
|
699
|
+
if (sym && dir && size) return `GMX ${dir} ${sym} ${size} USD`;
|
|
700
|
+
return void 0;
|
|
701
|
+
});
|
|
702
|
+
return o;
|
|
703
|
+
}
|
|
704
|
+
function preprocessHyperliquidCoinInput(raw) {
|
|
705
|
+
const o = preprocessObject(raw);
|
|
706
|
+
if (!o) return raw;
|
|
707
|
+
aliasField(o, "coin", "coin", "name", "resolvedCoin", "symbol");
|
|
708
|
+
return o;
|
|
709
|
+
}
|
|
710
|
+
function preprocessHyperliquidLimitOrderInput(raw) {
|
|
711
|
+
const o = preprocessHyperliquidCoinInput(raw);
|
|
712
|
+
if (!preprocessObject(o)) return raw;
|
|
713
|
+
aliasField(o, "limitPxHuman", "limitPxHuman", "limitPx", "markPx");
|
|
714
|
+
aliasField(o, "szHuman", "szHuman", "sz", "size");
|
|
715
|
+
derivePurposeIfMissing(o, (x) => {
|
|
716
|
+
const coin = String(x.coin ?? "").trim();
|
|
717
|
+
const side = x.isBuy === true || x.isBuy === "true" ? "buy" : "sell";
|
|
718
|
+
const sz = String(x.szHuman ?? "").trim();
|
|
719
|
+
if (coin && sz) return `HL limit ${side} ${coin} ${sz}`;
|
|
720
|
+
return void 0;
|
|
721
|
+
});
|
|
722
|
+
return o;
|
|
723
|
+
}
|
|
724
|
+
function preprocessHyperliquidCloseInput(raw) {
|
|
725
|
+
const o = preprocessHyperliquidCoinInput(raw);
|
|
726
|
+
if (!preprocessObject(o)) return raw;
|
|
727
|
+
aliasField(o, "szHuman", "szHuman", "sz", "size");
|
|
728
|
+
aliasField(o, "limitPxHuman", "limitPxHuman", "limitPx", "markPx");
|
|
729
|
+
derivePurposeIfMissing(o, (x) => {
|
|
730
|
+
const coin = String(x.coin ?? "").trim();
|
|
731
|
+
const sz = String(x.szHuman ?? "").trim();
|
|
732
|
+
if (coin && sz) return `HL close ${coin} ${sz}`;
|
|
733
|
+
return void 0;
|
|
734
|
+
});
|
|
735
|
+
return o;
|
|
736
|
+
}
|
|
737
|
+
function preprocessHyperliquidVaultDepositInput(raw) {
|
|
738
|
+
const o = preprocessObject(raw);
|
|
739
|
+
if (!o) return raw;
|
|
740
|
+
derivePurposeIfMissing(o, (x) => {
|
|
741
|
+
const name = String(x.vaultName ?? "").trim();
|
|
742
|
+
const usd = String(x.usdHuman ?? "").trim();
|
|
743
|
+
if (name && usd) return `HL vault deposit ${usd} into ${name}`;
|
|
744
|
+
if (usd) return `HL vault deposit ${usd}`;
|
|
745
|
+
return void 0;
|
|
746
|
+
});
|
|
747
|
+
return o;
|
|
748
|
+
}
|
|
749
|
+
function preprocessHyperliquidVaultWithdrawInput(raw) {
|
|
750
|
+
const o = preprocessObject(raw);
|
|
751
|
+
if (!o) return raw;
|
|
752
|
+
aliasField(o, "usdHuman", "usdHuman", "equity");
|
|
753
|
+
derivePurposeIfMissing(o, (x) => {
|
|
754
|
+
const usd = String(x.usdHuman ?? "").trim();
|
|
755
|
+
if (usd) return `HL vault withdraw ${usd}`;
|
|
756
|
+
return void 0;
|
|
757
|
+
});
|
|
758
|
+
return o;
|
|
759
|
+
}
|
|
760
|
+
function preprocessHyperliquidUndelegateInput(raw) {
|
|
761
|
+
const o = preprocessObject(raw);
|
|
762
|
+
if (!o) return raw;
|
|
763
|
+
aliasField(o, "hypeHuman", "hypeHuman", "amount");
|
|
764
|
+
return o;
|
|
765
|
+
}
|
|
766
|
+
function preprocessUniswapLpCreateInput(raw) {
|
|
767
|
+
const o = preprocessObject(raw);
|
|
768
|
+
if (!o) return raw;
|
|
769
|
+
aliasField(o, "poolPreset", "poolPreset", "presetId");
|
|
770
|
+
const pool = o.existingPool;
|
|
771
|
+
if (pool && typeof pool === "object" && !Array.isArray(pool)) {
|
|
772
|
+
const p = pool;
|
|
773
|
+
aliasField(p, "token0Address", "token0Address", "token0");
|
|
774
|
+
aliasField(p, "token1Address", "token1Address", "token1");
|
|
775
|
+
aliasField(p, "poolReference", "poolReference", "poolId");
|
|
776
|
+
}
|
|
777
|
+
return o;
|
|
778
|
+
}
|
|
779
|
+
function preprocessUniswapLpNftInput(raw) {
|
|
780
|
+
const o = preprocessObject(raw);
|
|
781
|
+
if (!o) return raw;
|
|
782
|
+
aliasField(o, "nftTokenId", "nftTokenId", "tokenId");
|
|
783
|
+
return o;
|
|
784
|
+
}
|
|
785
|
+
function preprocessUniswapLpCollectInput(raw) {
|
|
786
|
+
const o = preprocessObject(raw);
|
|
787
|
+
if (!o) return raw;
|
|
788
|
+
aliasField(o, "tokenId", "tokenId", "nftTokenId");
|
|
789
|
+
return o;
|
|
790
|
+
}
|
|
791
|
+
function tokenAddressFromQuoteSnapshot(quote, side) {
|
|
792
|
+
const inner = quote.quote;
|
|
793
|
+
if (!inner || typeof inner !== "object" || Array.isArray(inner)) return void 0;
|
|
794
|
+
const row = inner[side];
|
|
795
|
+
const token = row?.token;
|
|
796
|
+
return typeof token === "string" && token.trim() ? token.trim() : void 0;
|
|
797
|
+
}
|
|
798
|
+
function preprocessUniswapBuildSwapInput(raw) {
|
|
799
|
+
const o = preprocessObject(raw);
|
|
800
|
+
if (!o) return raw;
|
|
801
|
+
aliasField(o, "fullQuoteSnapshot", "fullQuoteSnapshot", "fullQuoteFromPermit", "quote");
|
|
802
|
+
const createResp = firstDefined(o.createSwapResponse, o.create_swap_response, o.createSwap);
|
|
803
|
+
if (createResp != null) o.createSwapResponse = createResp;
|
|
804
|
+
if (!firstDefined(o.swap) && createResp && typeof createResp === "object" && !Array.isArray(createResp)) {
|
|
805
|
+
const nested = createResp.swap;
|
|
806
|
+
if (nested != null) o.swap = nested;
|
|
807
|
+
}
|
|
808
|
+
const quote = o.fullQuoteSnapshot && typeof o.fullQuoteSnapshot === "object" && !Array.isArray(o.fullQuoteSnapshot) ? o.fullQuoteSnapshot : null;
|
|
809
|
+
if (quote && !firstDefined(o.tokenIn)) {
|
|
810
|
+
const tokenIn = tokenAddressFromQuoteSnapshot(quote, "input");
|
|
811
|
+
if (tokenIn) o.tokenIn = tokenIn;
|
|
812
|
+
}
|
|
813
|
+
derivePurposeIfMissing(o, () => "Uniswap V4 swap");
|
|
814
|
+
return o;
|
|
815
|
+
}
|
|
816
|
+
function preprocessUniswapBuildLpInput(raw) {
|
|
817
|
+
const o = preprocessUniswapLpNftInput(raw);
|
|
818
|
+
if (!preprocessObject(o)) return raw;
|
|
819
|
+
derivePurposeIfMissing(o, () => "Uniswap V4 liquidity");
|
|
820
|
+
return o;
|
|
821
|
+
}
|
|
822
|
+
function preprocessCurveBuildSwapInput(raw) {
|
|
823
|
+
const o = preprocessObject(raw);
|
|
824
|
+
if (!o) return raw;
|
|
825
|
+
const quote = o.quoteSnapshot && typeof o.quoteSnapshot === "object" && !Array.isArray(o.quoteSnapshot) ? o.quoteSnapshot : o;
|
|
826
|
+
aliasField(o, "tokenIn", "tokenIn", "tokenInRouterId", "tokenInAddress");
|
|
827
|
+
aliasField(o, "tokenOut", "tokenOut", "tokenOutRouterId", "tokenOutAddress");
|
|
828
|
+
aliasField(o, "amountHuman", "amountHuman", "inputAmount");
|
|
829
|
+
if (!firstDefined(o.tokenIn) && firstDefined(quote.tokenInRouterId)) {
|
|
830
|
+
o.tokenIn = quote.tokenInRouterId;
|
|
831
|
+
}
|
|
832
|
+
if (!firstDefined(o.tokenOut) && firstDefined(quote.tokenOutRouterId)) {
|
|
833
|
+
o.tokenOut = quote.tokenOutRouterId;
|
|
834
|
+
}
|
|
835
|
+
if (!firstDefined(o.amountHuman) && firstDefined(quote.inputAmount)) {
|
|
836
|
+
o.amountHuman = quote.inputAmount;
|
|
837
|
+
}
|
|
838
|
+
derivePurposeIfMissing(o, (x) => {
|
|
839
|
+
const amt = String(x.amountHuman ?? "").trim();
|
|
840
|
+
if (amt) return `Curve swap ${amt}`;
|
|
841
|
+
return void 0;
|
|
842
|
+
});
|
|
843
|
+
return o;
|
|
844
|
+
}
|
|
845
|
+
function preprocessMorphoBlueCollateralDepositInput(raw) {
|
|
846
|
+
const o = preprocessObject(raw);
|
|
847
|
+
if (!o) return raw;
|
|
848
|
+
aliasField(o, "collateralToken", "collateralToken", "collateralTokenAddress");
|
|
849
|
+
aliasField(o, "marketId", "marketId", "marketID");
|
|
850
|
+
derivePurposeIfMissing(o, (x) => {
|
|
851
|
+
const amt = String(x.amountHuman ?? "").trim();
|
|
852
|
+
const label = String(x.marketLabel ?? "").trim();
|
|
853
|
+
if (amt && label) return `Morpho Blue collateral ${amt} for ${label}`;
|
|
854
|
+
if (amt) return `Morpho Blue collateral deposit ${amt}`;
|
|
855
|
+
return void 0;
|
|
856
|
+
});
|
|
857
|
+
return o;
|
|
858
|
+
}
|
|
859
|
+
function preprocessMorphoBlueBorrowRepayInput(raw) {
|
|
860
|
+
const o = preprocessObject(raw);
|
|
861
|
+
if (!o) return raw;
|
|
862
|
+
aliasField(o, "loanToken", "loanToken", "loanTokenAddress");
|
|
863
|
+
return o;
|
|
864
|
+
}
|
|
865
|
+
function preprocessEulerV2IsolatedLendInput(raw) {
|
|
866
|
+
const o = preprocessObject(raw);
|
|
867
|
+
if (!o) return raw;
|
|
868
|
+
aliasField(o, "vault", "vault", "evaultAddress");
|
|
869
|
+
aliasField(o, "underlyingAddress", "underlyingAddress", "underlying");
|
|
870
|
+
aliasField(o, "marketName", "marketName", "vaultName");
|
|
871
|
+
derivePurposeIfMissing(o, (x) => {
|
|
872
|
+
const amt = String(x.assetAmountHuman ?? x.amountHuman ?? "").trim();
|
|
873
|
+
const label = String(x.marketName ?? x.vaultName ?? "").trim();
|
|
874
|
+
if (amt && label) return `Euler lend ${amt} into ${label}`;
|
|
875
|
+
if (amt) return `Euler vault deposit ${amt}`;
|
|
876
|
+
return void 0;
|
|
877
|
+
});
|
|
878
|
+
return o;
|
|
879
|
+
}
|
|
880
|
+
function preprocessAaveMultisignInput(action) {
|
|
881
|
+
return (raw) => {
|
|
882
|
+
const o = preprocessObject(raw);
|
|
883
|
+
if (!o) return raw;
|
|
884
|
+
derivePurposeIfMissing(o, (x) => {
|
|
885
|
+
const amt = String(x.amountHuman ?? "").trim();
|
|
886
|
+
const asset = String(x.underlying ?? "").trim();
|
|
887
|
+
if (amt && asset) return `Aave ${action} ${amt} ${asset}`;
|
|
888
|
+
if (amt) return `Aave ${action} ${amt}`;
|
|
889
|
+
return void 0;
|
|
890
|
+
});
|
|
891
|
+
return o;
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
// src/agent/schemas/uniswapV4.ts
|
|
587
896
|
var uniswapQuoteTradeTypeSchema = zod.z.enum(["EXACT_INPUT", "EXACT_OUTPUT"]);
|
|
588
897
|
var mcpUniswapV4QuoteInputSchema = zod.z.object({
|
|
589
898
|
type: uniswapQuoteTradeTypeSchema.describe("EXACT_INPUT or EXACT_OUTPUT"),
|
|
590
899
|
amount: zod.z.string().min(1).describe("Amount in token-in base units (wei string for ERC-20)"),
|
|
591
900
|
tokenIn: zod.z.string().min(1).describe("Input token; 0x0 for native ETH"),
|
|
592
901
|
tokenOut: zod.z.string().min(1).describe("Output token address"),
|
|
593
|
-
chainId:
|
|
902
|
+
chainId: agentEvmChainIdSchema.describe("tokenInChainId / same-chain default"),
|
|
594
903
|
uniswapApiKey: zod.z.string().min(1).describe("Uniswap Trade API x-api-key"),
|
|
595
904
|
swapper: evmAddressSchema.optional().describe("MPC executor; omit if keyGen + managementNodeUrl provided"),
|
|
596
905
|
slippage: zod.z.union([zod.z.number(), zod.z.string()]).optional().describe("Slippage percent; omit for API auto slippage"),
|
|
@@ -598,7 +907,7 @@ var mcpUniswapV4QuoteInputSchema = zod.z.object({
|
|
|
598
907
|
managementNodeUrl: zod.z.string().min(1).optional().describe("MPC node base URL; required with keyGen when swapper is omitted"),
|
|
599
908
|
tokenInChainId: zod.z.union([zod.z.number(), zod.z.string()]).optional(),
|
|
600
909
|
tokenOutChainId: zod.z.union([zod.z.number(), zod.z.string()]).optional(),
|
|
601
|
-
permit2Disabled:
|
|
910
|
+
permit2Disabled: agentOptionalBooleanSchema(),
|
|
602
911
|
baseUrl: zod.z.string().optional(),
|
|
603
912
|
universalRouterVersion: zod.z.string().optional()
|
|
604
913
|
});
|
|
@@ -620,18 +929,21 @@ var mcpUniswapV4CreateSwapOutputSchema = zod.z.object({
|
|
|
620
929
|
}).passthrough().describe("{ swap: TransactionRequest, requestId?, gasFee? }");
|
|
621
930
|
var swapTxRequestSchema = jsonObjectSchema.describe("swap field from create_swap response (to, data, value)");
|
|
622
931
|
var mcpUniswapV4BuildSwapMultisignInputSchema = withMultisignKeySourceRefine(
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
932
|
+
zod.z.preprocess(
|
|
933
|
+
preprocessUniswapBuildSwapInput,
|
|
934
|
+
evmMultisignCommonInputSchema.extend({
|
|
935
|
+
tokenIn: evmAddressSchema.describe("Token in; 0x0 for native ETH"),
|
|
627
936
|
swap: swapTxRequestSchema,
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
937
|
+
createSwapResponse: zod.z.object({
|
|
938
|
+
swap: swapTxRequestSchema,
|
|
939
|
+
requestId: zod.z.string().optional(),
|
|
940
|
+
gasFee: zod.z.string().optional()
|
|
941
|
+
}).passthrough().describe("Full create_swap response"),
|
|
942
|
+
fullQuoteSnapshot: jsonObjectSchema.describe("Quote JSON used for the swap"),
|
|
943
|
+
swapDeadlineUnix: zod.z.number().describe("Same deadline passed to create_swap"),
|
|
944
|
+
slippagePercent: zod.z.number().optional().describe("Extra approve headroom for EXACT_OUTPUT")
|
|
945
|
+
})
|
|
946
|
+
)
|
|
635
947
|
);
|
|
636
948
|
var lpExistingPoolSchema = zod.z.object({
|
|
637
949
|
token0Address: evmAddressSchema,
|
|
@@ -661,22 +973,26 @@ var lpTickBoundsSchema = zod.z.object({
|
|
|
661
973
|
var lpCommonApiInputSchema = zod.z.object({
|
|
662
974
|
uniswapApiKey: zod.z.string().min(1),
|
|
663
975
|
walletAddress: evmAddressSchema.optional(),
|
|
664
|
-
chainId:
|
|
976
|
+
chainId: agentEvmChainIdSchema,
|
|
665
977
|
slippageTolerance: zod.z.number().optional(),
|
|
666
|
-
simulateTransaction:
|
|
978
|
+
simulateTransaction: agentOptionalBooleanSchema(),
|
|
667
979
|
baseUrl: zod.z.string().optional(),
|
|
668
980
|
keyGen: zod.z.string().optional(),
|
|
669
981
|
managementNodeUrl: zod.z.string().optional()
|
|
670
982
|
});
|
|
671
|
-
var mcpUniswapV4LpCreatePositionInputSchema =
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
983
|
+
var mcpUniswapV4LpCreatePositionInputSchema = zod.z.preprocess(
|
|
984
|
+
preprocessUniswapLpCreateInput,
|
|
985
|
+
lpCommonApiInputSchema.extend({
|
|
986
|
+
poolPreset: zod.z.string().optional().describe("presetId from ctm_uniswap_v4_list_lp_pools \u2014 server resolves existingPool"),
|
|
987
|
+
existingPool: lpExistingPoolSchema.optional(),
|
|
988
|
+
newPool: lpNewPoolSchema.optional(),
|
|
989
|
+
independentToken: lpIndependentTokenSchema,
|
|
990
|
+
priceBounds: lpPriceBoundsSchema.optional(),
|
|
991
|
+
tickBounds: lpTickBoundsSchema.optional()
|
|
992
|
+
})
|
|
993
|
+
);
|
|
678
994
|
var mcpUniswapV4LpListPoolsInputSchema = zod.z.object({
|
|
679
|
-
chainId:
|
|
995
|
+
chainId: agentEvmChainIdSchema,
|
|
680
996
|
pair: zod.z.string().optional().describe("Optional filter, e.g. eth-usdc or ETH/USDC")
|
|
681
997
|
});
|
|
682
998
|
var mcpUniswapV4LpListPoolsOutputSchema = zod.z.object({
|
|
@@ -703,26 +1019,35 @@ var mcpUniswapV4LpListPoolsOutputSchema = zod.z.object({
|
|
|
703
1019
|
notes: zod.z.string()
|
|
704
1020
|
});
|
|
705
1021
|
var mcpUniswapV4LpCreatePositionOutputSchema = jsonObjectSchema;
|
|
706
|
-
var mcpUniswapV4LpIncreaseInputSchema =
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
1022
|
+
var mcpUniswapV4LpIncreaseInputSchema = zod.z.preprocess(
|
|
1023
|
+
preprocessUniswapLpNftInput,
|
|
1024
|
+
lpCommonApiInputSchema.extend({
|
|
1025
|
+
token0Address: evmAddressSchema,
|
|
1026
|
+
token1Address: evmAddressSchema,
|
|
1027
|
+
nftTokenId: zod.z.union([zod.z.string(), zod.z.number()]).describe("tokenId from lp_list_positions"),
|
|
1028
|
+
independentToken: lpIndependentTokenSchema
|
|
1029
|
+
})
|
|
1030
|
+
);
|
|
712
1031
|
var mcpUniswapV4LpIncreaseOutputSchema = jsonObjectSchema;
|
|
713
|
-
var mcpUniswapV4LpDecreaseInputSchema =
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
1032
|
+
var mcpUniswapV4LpDecreaseInputSchema = zod.z.preprocess(
|
|
1033
|
+
preprocessUniswapLpNftInput,
|
|
1034
|
+
lpCommonApiInputSchema.extend({
|
|
1035
|
+
token0Address: evmAddressSchema,
|
|
1036
|
+
token1Address: evmAddressSchema,
|
|
1037
|
+
nftTokenId: zod.z.union([zod.z.string(), zod.z.number()]).describe("tokenId from lp_list_positions"),
|
|
1038
|
+
liquidityPercentageToDecrease: zod.z.number().int().min(1).max(100)
|
|
1039
|
+
})
|
|
1040
|
+
);
|
|
719
1041
|
var mcpUniswapV4LpDecreaseOutputSchema = jsonObjectSchema;
|
|
720
|
-
var mcpUniswapV4LpClaimInputSchema =
|
|
721
|
-
|
|
722
|
-
|
|
1042
|
+
var mcpUniswapV4LpClaimInputSchema = zod.z.preprocess(
|
|
1043
|
+
preprocessUniswapLpCollectInput,
|
|
1044
|
+
lpCommonApiInputSchema.extend({
|
|
1045
|
+
tokenId: zod.z.union([zod.z.string(), zod.z.number()]).describe("tokenId from lp_list_positions")
|
|
1046
|
+
})
|
|
1047
|
+
);
|
|
723
1048
|
var mcpUniswapV4LpClaimOutputSchema = jsonObjectSchema;
|
|
724
1049
|
var mcpUniswapV4LpListPositionsInputSchema = zod.z.object({
|
|
725
|
-
chainId:
|
|
1050
|
+
chainId: agentEvmChainIdSchema,
|
|
726
1051
|
keyGenId: zod.z.string().min(1).optional(),
|
|
727
1052
|
walletAddress: evmAddressSchema.optional(),
|
|
728
1053
|
positionManagerAddress: evmAddressSchema.optional()
|
|
@@ -740,7 +1065,7 @@ var mcpUniswapV4LpListPositionsOutputSchema = zod.z.object({
|
|
|
740
1065
|
)
|
|
741
1066
|
});
|
|
742
1067
|
var mcpUniswapV4RegisterPositionNftInputSchema = zod.z.object({
|
|
743
|
-
chainId:
|
|
1068
|
+
chainId: agentEvmChainIdSchema,
|
|
744
1069
|
tokenId: zod.z.union([zod.z.string(), zod.z.number()]),
|
|
745
1070
|
keyGenId: zod.z.string().min(1).optional(),
|
|
746
1071
|
positionManagerAddress: evmAddressSchema.optional(),
|
|
@@ -754,7 +1079,7 @@ var mcpUniswapV4RegisterPositionNftOutputSchema = zod.z.object({
|
|
|
754
1079
|
positionManager: evmAddressSchema
|
|
755
1080
|
});
|
|
756
1081
|
var mcpUniswapV4RegisterPositionFromMintTxInputSchema = zod.z.object({
|
|
757
|
-
chainId:
|
|
1082
|
+
chainId: agentEvmChainIdSchema,
|
|
758
1083
|
txHash: zod.z.string().min(1),
|
|
759
1084
|
keyGenId: zod.z.string().min(1).optional(),
|
|
760
1085
|
walletAddress: evmAddressSchema.optional(),
|
|
@@ -773,28 +1098,37 @@ var lpBuildCommonSchema = {
|
|
|
773
1098
|
poolReference: zod.z.string().optional()
|
|
774
1099
|
};
|
|
775
1100
|
var mcpUniswapV4BuildMintLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
776
|
-
evmMultisignCommonInputSchema.extend(lpBuildCommonSchema)
|
|
1101
|
+
zod.z.preprocess(preprocessUniswapBuildLpInput, evmMultisignCommonInputSchema.extend(lpBuildCommonSchema))
|
|
777
1102
|
);
|
|
778
1103
|
var mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
1104
|
+
zod.z.preprocess(
|
|
1105
|
+
preprocessUniswapBuildLpInput,
|
|
1106
|
+
evmMultisignCommonInputSchema.extend({
|
|
1107
|
+
...lpBuildCommonSchema,
|
|
1108
|
+
nftTokenId: zod.z.union([zod.z.string(), zod.z.number()]).describe("tokenId from lp_list_positions")
|
|
1109
|
+
})
|
|
1110
|
+
)
|
|
783
1111
|
);
|
|
784
1112
|
var mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
1113
|
+
zod.z.preprocess(
|
|
1114
|
+
preprocessUniswapBuildLpInput,
|
|
1115
|
+
evmMultisignCommonInputSchema.extend({
|
|
1116
|
+
...lpBuildCommonSchema,
|
|
1117
|
+
nftTokenId: zod.z.union([zod.z.string(), zod.z.number()])
|
|
1118
|
+
})
|
|
1119
|
+
)
|
|
789
1120
|
);
|
|
790
1121
|
var mcpUniswapV4BuildCollectFeesMultisignInputSchema = withMultisignKeySourceRefine(
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
1122
|
+
zod.z.preprocess(
|
|
1123
|
+
preprocessUniswapBuildLpInput,
|
|
1124
|
+
evmMultisignCommonInputSchema.extend({
|
|
1125
|
+
...lpBuildCommonSchema,
|
|
1126
|
+
nftTokenId: zod.z.union([zod.z.string(), zod.z.number()])
|
|
1127
|
+
})
|
|
1128
|
+
)
|
|
795
1129
|
);
|
|
796
1130
|
var mcpCurveDaoQuoteInputSchema = zod.z.object({
|
|
797
|
-
chainId:
|
|
1131
|
+
chainId: agentEvmChainIdSchema.describe("EVM chain id (rpcUrl resolved from get_chain_registry rpcGateway)"),
|
|
798
1132
|
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"),
|
|
799
1133
|
tokenIn: zod.z.string().min(1).describe("Input token address, or 0xeeee\u2026 / 0x0 / eth for native"),
|
|
800
1134
|
tokenOut: zod.z.string().min(1).describe("Output token address or 0xeeee\u2026 native placeholder"),
|
|
@@ -805,13 +1139,112 @@ var mcpCurveDaoQuoteOutputSchema = jsonObjectSchema.describe(
|
|
|
805
1139
|
"Curve router quote: { inputAmount, output, route, priceImpactPercent?, tokenInRouterId, tokenOutRouterId }"
|
|
806
1140
|
);
|
|
807
1141
|
var mcpCurveDaoBuildSwapMultisignInputSchema = withMultisignKeySourceRefine(
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
1142
|
+
zod.z.preprocess(
|
|
1143
|
+
preprocessCurveBuildSwapInput,
|
|
1144
|
+
evmMultisignCommonInputSchema.extend({
|
|
1145
|
+
tokenIn: evmAddressSchema.describe("ERC-20 sold (native in uses WETH path in UI)"),
|
|
1146
|
+
tokenOut: zod.z.string().min(1).describe("Output token or 0xeeee\u2026 native placeholder"),
|
|
1147
|
+
amountHuman: zod.z.string().min(1).describe("Human-readable amount of tokenIn"),
|
|
1148
|
+
slippagePercent: zod.z.number().gt(0).lt(100).describe("Slippage 0\u2013100 exclusive"),
|
|
1149
|
+
quoteSnapshot: jsonObjectSchema.optional().describe("Optional quote row from ctm_curve_dao_quote \u2014 aliases tokenIn/tokenOut/amountHuman")
|
|
1150
|
+
})
|
|
1151
|
+
)
|
|
814
1152
|
);
|
|
1153
|
+
var morphoExposureRowSchema = zod.z.object({
|
|
1154
|
+
label: zod.z.string(),
|
|
1155
|
+
allocatedUsdLabel: zod.z.string(),
|
|
1156
|
+
allocationPercentLabel: zod.z.string()
|
|
1157
|
+
});
|
|
1158
|
+
function preprocessMorphoVaultDepositInput(raw) {
|
|
1159
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
1160
|
+
const o = { ...raw };
|
|
1161
|
+
const vaultAddr = o.vaultAddress ?? o.vault;
|
|
1162
|
+
if (vaultAddr != null) {
|
|
1163
|
+
o.vaultAddress = vaultAddr;
|
|
1164
|
+
o.vault = vaultAddr;
|
|
1165
|
+
}
|
|
1166
|
+
const underlyingAddr = o.underlyingAddress ?? o.underlying;
|
|
1167
|
+
if (underlyingAddr != null) {
|
|
1168
|
+
o.underlyingAddress = underlyingAddr;
|
|
1169
|
+
o.underlying = underlyingAddr;
|
|
1170
|
+
}
|
|
1171
|
+
const purposeText = String(o.purposeText ?? o.purpose ?? "").trim();
|
|
1172
|
+
if (!purposeText) {
|
|
1173
|
+
const amt = String(o.amountHuman ?? "").trim();
|
|
1174
|
+
const label = String(o.vaultName ?? o.vaultSymbol ?? "").trim();
|
|
1175
|
+
if (amt && label) o.purposeText = `Deposit ${amt} into ${label}`;
|
|
1176
|
+
else if (amt) o.purposeText = `Morpho vault deposit ${amt}`;
|
|
1177
|
+
}
|
|
1178
|
+
return o;
|
|
1179
|
+
}
|
|
1180
|
+
function preprocessMorphoVaultWithdrawInput(raw) {
|
|
1181
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return raw;
|
|
1182
|
+
const o = { ...raw };
|
|
1183
|
+
const vaultAddr = o.vaultAddress ?? o.vault;
|
|
1184
|
+
if (vaultAddr != null) {
|
|
1185
|
+
o.vaultAddress = vaultAddr;
|
|
1186
|
+
o.vault = vaultAddr;
|
|
1187
|
+
}
|
|
1188
|
+
const purposeText = String(o.purposeText ?? o.purpose ?? "").trim();
|
|
1189
|
+
if (!purposeText) {
|
|
1190
|
+
const amt = String(o.amountHuman ?? "").trim();
|
|
1191
|
+
const label = String(o.vaultName ?? o.vaultSymbol ?? "").trim();
|
|
1192
|
+
if (amt && label) o.purposeText = `Withdraw ${amt} from ${label}`;
|
|
1193
|
+
else if (amt) o.purposeText = `Morpho vault withdraw ${amt}`;
|
|
1194
|
+
}
|
|
1195
|
+
return o;
|
|
1196
|
+
}
|
|
1197
|
+
var mcpMorphoFetchEarnVaultsInputSchema = zod.z.object({
|
|
1198
|
+
chainId: agentEvmChainIdSchema,
|
|
1199
|
+
underlying: zod.z.string().trim().min(1).optional().describe("Deposit asset symbol (e.g. USDC) or ERC-20 address. Omit to search all listed vaults on the chain."),
|
|
1200
|
+
query: zod.z.string().trim().min(1).optional().describe("Case-insensitive filter on vault name, symbol, address, or underlying symbol (e.g. Steakhouse, bbqUSDC)."),
|
|
1201
|
+
limit: zod.z.number().int().min(1).max(200).optional().describe("Max rows (default 50).")
|
|
1202
|
+
});
|
|
1203
|
+
var mcpMorphoFetchEarnVaultsOutputSchema = zod.z.object({
|
|
1204
|
+
vaults: zod.z.array(
|
|
1205
|
+
zod.z.object({
|
|
1206
|
+
vaultAddress: zod.z.string(),
|
|
1207
|
+
vaultName: zod.z.string(),
|
|
1208
|
+
vaultSymbol: zod.z.string(),
|
|
1209
|
+
underlyingAddress: zod.z.string(),
|
|
1210
|
+
underlyingSymbol: zod.z.string(),
|
|
1211
|
+
apy: zod.z.string(),
|
|
1212
|
+
netApy: zod.z.string(),
|
|
1213
|
+
netApy7d: zod.z.string(),
|
|
1214
|
+
netApy30d: zod.z.string(),
|
|
1215
|
+
netApy90d: zod.z.string(),
|
|
1216
|
+
performanceFee: zod.z.string(),
|
|
1217
|
+
managementFee: zod.z.string().nullable(),
|
|
1218
|
+
totalDepositsUsd: zod.z.string(),
|
|
1219
|
+
liquidityUsd: zod.z.string(),
|
|
1220
|
+
exposure: zod.z.array(morphoExposureRowSchema)
|
|
1221
|
+
})
|
|
1222
|
+
)
|
|
1223
|
+
});
|
|
1224
|
+
var mcpMorphoFetchBlueMarketsInputSchema = zod.z.object({
|
|
1225
|
+
chainId: agentEvmChainIdSchema,
|
|
1226
|
+
collateral: zod.z.string().trim().min(1).optional().describe("Collateral asset symbol or address (e.g. WETH, cbETH)."),
|
|
1227
|
+
loan: zod.z.string().trim().min(1).optional().describe("Loan asset symbol or address (e.g. USDC)."),
|
|
1228
|
+
query: zod.z.string().trim().min(1).optional().describe("Filter on market label, symbols, or marketId."),
|
|
1229
|
+
limit: zod.z.number().int().min(1).max(200).optional()
|
|
1230
|
+
});
|
|
1231
|
+
var mcpMorphoFetchBlueMarketsOutputSchema = zod.z.object({
|
|
1232
|
+
markets: zod.z.array(
|
|
1233
|
+
zod.z.object({
|
|
1234
|
+
marketId: zod.z.string().describe("Pass to build_blue_* multisign tools"),
|
|
1235
|
+
marketLabel: zod.z.string(),
|
|
1236
|
+
morphoBlueAddress: zod.z.string(),
|
|
1237
|
+
collateralTokenAddress: zod.z.string().describe("Copy as collateralToken for supply collateral"),
|
|
1238
|
+
collateralTokenSymbol: zod.z.string(),
|
|
1239
|
+
collateralTokenDecimals: zod.z.number().int(),
|
|
1240
|
+
loanTokenAddress: zod.z.string().describe("Copy as loanToken for borrow/repay"),
|
|
1241
|
+
loanTokenSymbol: zod.z.string(),
|
|
1242
|
+
loanTokenDecimals: zod.z.number().int(),
|
|
1243
|
+
borrowApyLabel: zod.z.string(),
|
|
1244
|
+
supplyApyLabel: zod.z.string()
|
|
1245
|
+
})
|
|
1246
|
+
)
|
|
1247
|
+
});
|
|
815
1248
|
var mcpServerCommonInputSchema = zod.z.object({
|
|
816
1249
|
keyGenId: zod.z.string().min(1).describe("KeyGen id from fetch_key_gen_result / node preferred KeyGen"),
|
|
817
1250
|
chainId: zod.z.number().int().positive().describe("EVM chain id; RPC and gas config resolved from chain registry"),
|
|
@@ -908,48 +1341,79 @@ var mcpSkySusdsRedeemInputSchema = mcpMultisignInput({
|
|
|
908
1341
|
sharesHuman: zod.z.string().min(1)
|
|
909
1342
|
});
|
|
910
1343
|
var mcpAaveV4MarketIdSchema = zod.z.string().min(1).optional().describe("UI market segment: main (Plus), core, or bluechip (Prime). Default main.");
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
1344
|
+
function mcpAaveV4MultisignInput(fields, action) {
|
|
1345
|
+
return withMultisignKeySourceRefine(
|
|
1346
|
+
zod.z.preprocess(preprocessAaveMultisignInput(action), evmMultisignCommonInputSchema.extend(fields))
|
|
1347
|
+
);
|
|
1348
|
+
}
|
|
1349
|
+
var mcpAaveV4HealthPreviewFields = {
|
|
1350
|
+
skipHealthPreview: agentOptionalBooleanSchema().describe(
|
|
1351
|
+
"Skip Aave v4 health-factor preview before withdraw/borrow/repay (not recommended)."
|
|
1352
|
+
),
|
|
1353
|
+
acknowledgeHealthRisk: agentOptionalBooleanSchema().describe(
|
|
914
1354
|
"Required true when preview returns a confirm-level health risk (withdraw/borrow/repay)."
|
|
915
1355
|
)
|
|
916
1356
|
};
|
|
917
|
-
var mcpAaveV4DepositInputSchema =
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
var
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
}
|
|
1357
|
+
var mcpAaveV4DepositInputSchema = mcpAaveV4MultisignInput(
|
|
1358
|
+
{
|
|
1359
|
+
spoke: evmAddressSchema.optional().describe("Omit \u2014 continuum-mcp-server resolves spoke from Aave v4 API."),
|
|
1360
|
+
underlying: evmAddressSchema.describe(
|
|
1361
|
+
"Asset to supply. Native ETH: 0x0 or wrapped native with isNativeIn true."
|
|
1362
|
+
),
|
|
1363
|
+
amountHuman: zod.z.string().min(1),
|
|
1364
|
+
marketId: mcpAaveV4MarketIdSchema,
|
|
1365
|
+
isNativeIn: agentOptionalBooleanSchema().describe(
|
|
1366
|
+
"Wrap native to wrapped native before supply (e.g. ETH \u2192 WETH)."
|
|
1367
|
+
),
|
|
1368
|
+
enableAsCollateralAfterSupply: agentOptionalBooleanSchema().describe(
|
|
1369
|
+
"Append setUsingAsCollateral after supply in the same batch."
|
|
1370
|
+
)
|
|
1371
|
+
},
|
|
1372
|
+
"deposit"
|
|
1373
|
+
);
|
|
1374
|
+
var mcpAaveV4WithdrawInputSchema = mcpAaveV4MultisignInput(
|
|
1375
|
+
{
|
|
1376
|
+
spoke: evmAddressSchema.optional().describe("Omit \u2014 server resolves from Aave v4 API."),
|
|
1377
|
+
underlying: evmAddressSchema.describe("Supplied asset to withdraw."),
|
|
1378
|
+
amountHuman: zod.z.string().min(1),
|
|
1379
|
+
marketId: mcpAaveV4MarketIdSchema,
|
|
1380
|
+
...mcpAaveV4HealthPreviewFields
|
|
1381
|
+
},
|
|
1382
|
+
"withdraw"
|
|
1383
|
+
);
|
|
1384
|
+
var mcpAaveV4BorrowInputSchema = mcpAaveV4MultisignInput(
|
|
1385
|
+
{
|
|
1386
|
+
spoke: evmAddressSchema.optional().describe("Omit \u2014 server resolves from Aave v4 API."),
|
|
1387
|
+
underlying: evmAddressSchema.describe("Debt asset to borrow (e.g. USDC), not collateral."),
|
|
1388
|
+
amountHuman: zod.z.string().min(1),
|
|
1389
|
+
marketId: mcpAaveV4MarketIdSchema,
|
|
1390
|
+
collateralUnderlying: evmAddressSchema.optional().describe("Collateral token already supplied; helps pick hub when debt exists on multiple hubs."),
|
|
1391
|
+
...mcpAaveV4HealthPreviewFields
|
|
1392
|
+
},
|
|
1393
|
+
"borrow"
|
|
1394
|
+
);
|
|
1395
|
+
var mcpAaveV4RepayInputSchema = mcpAaveV4MultisignInput(
|
|
1396
|
+
{
|
|
1397
|
+
spoke: evmAddressSchema.optional().describe("Omit \u2014 server resolves from Aave v4 API."),
|
|
1398
|
+
underlying: evmAddressSchema.describe("Debt token to repay."),
|
|
1399
|
+
amountHuman: zod.z.string().min(1),
|
|
1400
|
+
marketId: mcpAaveV4MarketIdSchema,
|
|
1401
|
+
...mcpAaveV4HealthPreviewFields
|
|
1402
|
+
},
|
|
1403
|
+
"repay"
|
|
1404
|
+
);
|
|
1405
|
+
var mcpEulerV2IsolatedLendInputSchema = withMultisignKeySourceRefine(
|
|
1406
|
+
zod.z.preprocess(
|
|
1407
|
+
preprocessEulerV2IsolatedLendInput,
|
|
1408
|
+
evmMultisignCommonInputSchema.extend({
|
|
1409
|
+
vault: evmAddressSchema.describe("evaultAddress from ctm_euler_v2_fetch_lend_vaults"),
|
|
1410
|
+
assetAmountHuman: zod.z.string().min(1),
|
|
1411
|
+
underlyingAddress: evmAddressSchema.optional().describe("underlyingAddress from fetch row \u2014 server resolves if omitted"),
|
|
1412
|
+
marketName: zod.z.string().optional().describe("marketName from fetch row (purposeText)"),
|
|
1413
|
+
isNativeIn: agentOptionalBooleanSchema()
|
|
1414
|
+
})
|
|
1415
|
+
)
|
|
1416
|
+
);
|
|
953
1417
|
var mcpEulerV2IsolatedBorrowInputSchema = mcpMultisignInput({
|
|
954
1418
|
vault: evmAddressSchema,
|
|
955
1419
|
collateralAsset: evmAddressSchema,
|
|
@@ -975,32 +1439,68 @@ var mcpEulerV2CollateralWithdrawInputSchema = mcpMultisignInput({
|
|
|
975
1439
|
collateralAsset: evmAddressSchema,
|
|
976
1440
|
amountHuman: zod.z.string().min(1)
|
|
977
1441
|
});
|
|
978
|
-
var mcpMorphoVaultDepositInputSchema =
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1442
|
+
var mcpMorphoVaultDepositInputSchema = withMultisignKeySourceRefine(
|
|
1443
|
+
zod.z.preprocess(
|
|
1444
|
+
preprocessMorphoVaultDepositInput,
|
|
1445
|
+
evmMultisignCommonInputSchema.extend({
|
|
1446
|
+
vaultAddress: evmAddressSchema.describe(
|
|
1447
|
+
"Vault contract address \u2014 copy vaultAddress from ctm_morpho_fetch_earn_vaults row."
|
|
1448
|
+
),
|
|
1449
|
+
underlyingAddress: evmAddressSchema.describe(
|
|
1450
|
+
"Deposit asset address \u2014 copy underlyingAddress from the same fetch row."
|
|
1451
|
+
),
|
|
1452
|
+
amountHuman: zod.z.string().min(1).describe('Human-readable deposit amount (e.g. "1000" USDC).'),
|
|
1453
|
+
vaultName: zod.z.string().optional().describe("Optional vaultName from fetch row (fills purposeText when omitted)."),
|
|
1454
|
+
vaultSymbol: zod.z.string().optional().describe("Optional vaultSymbol from fetch row."),
|
|
1455
|
+
isNativeIn: agentOptionalBooleanSchema()
|
|
1456
|
+
})
|
|
1457
|
+
)
|
|
1458
|
+
);
|
|
1459
|
+
var mcpMorphoVaultWithdrawInputSchema = withMultisignKeySourceRefine(
|
|
1460
|
+
zod.z.preprocess(
|
|
1461
|
+
preprocessMorphoVaultWithdrawInput,
|
|
1462
|
+
evmMultisignCommonInputSchema.extend({
|
|
1463
|
+
vaultAddress: evmAddressSchema.describe(
|
|
1464
|
+
"Vault contract address \u2014 copy vaultAddress from ctm_morpho_fetch_earn_vaults or positions."
|
|
1465
|
+
),
|
|
1466
|
+
amountHuman: zod.z.string().min(1),
|
|
1467
|
+
vaultName: zod.z.string().optional(),
|
|
1468
|
+
vaultSymbol: zod.z.string().optional()
|
|
1469
|
+
})
|
|
1470
|
+
)
|
|
1471
|
+
);
|
|
1472
|
+
var mcpMorphoBlueCollateralDepositInputSchema = withMultisignKeySourceRefine(
|
|
1473
|
+
zod.z.preprocess(
|
|
1474
|
+
preprocessMorphoBlueCollateralDepositInput,
|
|
1475
|
+
evmMultisignCommonInputSchema.extend({
|
|
1476
|
+
marketId: zod.z.string().min(1).describe("marketId from ctm_morpho_fetch_blue_markets"),
|
|
1477
|
+
collateralToken: evmAddressSchema.describe("collateralTokenAddress from fetch row"),
|
|
1478
|
+
amountHuman: zod.z.string().min(1),
|
|
1479
|
+
marketLabel: zod.z.string().optional(),
|
|
1480
|
+
isNativeIn: agentOptionalBooleanSchema()
|
|
1481
|
+
})
|
|
1482
|
+
)
|
|
1483
|
+
);
|
|
1484
|
+
var mcpMorphoBlueBorrowInputSchema = withMultisignKeySourceRefine(
|
|
1485
|
+
zod.z.preprocess(
|
|
1486
|
+
preprocessMorphoBlueBorrowRepayInput,
|
|
1487
|
+
evmMultisignCommonInputSchema.extend({
|
|
1488
|
+
marketId: zod.z.string().min(1),
|
|
1489
|
+
loanToken: evmAddressSchema.describe("loanTokenAddress from ctm_morpho_fetch_blue_markets"),
|
|
1490
|
+
amountHuman: zod.z.string().min(1)
|
|
1491
|
+
})
|
|
1492
|
+
)
|
|
1493
|
+
);
|
|
1494
|
+
var mcpMorphoBlueRepayInputSchema = withMultisignKeySourceRefine(
|
|
1495
|
+
zod.z.preprocess(
|
|
1496
|
+
preprocessMorphoBlueBorrowRepayInput,
|
|
1497
|
+
evmMultisignCommonInputSchema.extend({
|
|
1498
|
+
marketId: zod.z.string().min(1),
|
|
1499
|
+
loanToken: evmAddressSchema.describe("loanTokenAddress from fetch row"),
|
|
1500
|
+
amountHuman: zod.z.string().min(1)
|
|
1501
|
+
})
|
|
1502
|
+
)
|
|
1503
|
+
);
|
|
1004
1504
|
var mcpMorphoBlueCollateralWithdrawInputSchema = mcpMultisignInput({
|
|
1005
1505
|
marketId: zod.z.string().min(1),
|
|
1006
1506
|
amountHuman: zod.z.string().min(1),
|
|
@@ -1011,46 +1511,39 @@ var mcpMorphoMerklClaimInputSchema = mcpMultisignInput({
|
|
|
1011
1511
|
distributor: evmAddressSchema.optional(),
|
|
1012
1512
|
valueWei: zod.z.string().optional()
|
|
1013
1513
|
});
|
|
1014
|
-
var
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
chainId: zod.z.number().int().positive(),
|
|
1021
|
-
underlying: zod.z.string().trim().min(1).optional().describe("Deposit asset symbol (e.g. USDC) or ERC-20 address. Omit to search all listed vaults on the chain."),
|
|
1022
|
-
query: zod.z.string().trim().min(1).optional().describe("Case-insensitive filter on vault name, symbol, address, or underlying symbol (e.g. Steakhouse, bbqUSDC)."),
|
|
1023
|
-
limit: zod.z.number().int().min(1).max(200).optional().describe("Max rows (default 50).")
|
|
1514
|
+
var mcpEulerV2FetchLendVaultsInputSchema = zod.z.object({
|
|
1515
|
+
chainId: agentEvmChainIdSchema,
|
|
1516
|
+
underlyingAddress: evmAddressSchema.describe(
|
|
1517
|
+
"Underlying asset address from get_defi_protocol_supported_tokens."
|
|
1518
|
+
),
|
|
1519
|
+
limit: zod.z.number().int().min(1).max(100).optional().describe("Max vault rows (default 30).")
|
|
1024
1520
|
});
|
|
1025
|
-
var
|
|
1521
|
+
var mcpEulerV2FetchLendVaultsOutputSchema = zod.z.object({
|
|
1026
1522
|
vaults: zod.z.array(
|
|
1027
1523
|
zod.z.object({
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
vaultSymbol: zod.z.string(),
|
|
1524
|
+
evaultAddress: zod.z.string().describe("Copy as vault / evaultAddress for isolated lend multisign"),
|
|
1525
|
+
marketName: zod.z.string(),
|
|
1031
1526
|
underlyingAddress: zod.z.string(),
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
performanceFee: zod.z.string(),
|
|
1039
|
-
managementFee: zod.z.string().nullable(),
|
|
1040
|
-
totalDepositsUsd: zod.z.string(),
|
|
1041
|
-
liquidityUsd: zod.z.string(),
|
|
1042
|
-
exposure: zod.z.array(morphoExposureRowSchema)
|
|
1527
|
+
underlyingDecimals: zod.z.number().int(),
|
|
1528
|
+
supplyApyPercentLabel: zod.z.string(),
|
|
1529
|
+
borrowApyPercentLabel: zod.z.string(),
|
|
1530
|
+
availableLiquidityFormatted: zod.z.string(),
|
|
1531
|
+
totalSupplyFormatted: zod.z.string(),
|
|
1532
|
+
evcAddress: zod.z.string().nullable()
|
|
1043
1533
|
})
|
|
1044
1534
|
)
|
|
1045
1535
|
});
|
|
1046
|
-
function mcpGmxMultisignInput(fields) {
|
|
1047
|
-
|
|
1536
|
+
function mcpGmxMultisignInput(fields, preprocess) {
|
|
1537
|
+
const inner = evmMultisignCommonInputSchema.extend(fields);
|
|
1538
|
+
const shaped = preprocess ? zod.z.preprocess(preprocess, inner) : inner;
|
|
1539
|
+
return withMultisignKeySourceRefine(shaped);
|
|
1048
1540
|
}
|
|
1049
1541
|
var gmxDirectionSchema = zod.z.enum(["long", "short"]);
|
|
1050
1542
|
var gmxOrderTypeSchema = zod.z.enum(["market", "limit"]);
|
|
1051
|
-
var
|
|
1052
|
-
chainId:
|
|
1543
|
+
var gmxFetchChainInputSchema = zod.z.object({
|
|
1544
|
+
chainId: agentEvmChainIdSchema
|
|
1053
1545
|
});
|
|
1546
|
+
var mcpGmxFetchMarketsInputSchema = gmxFetchChainInputSchema;
|
|
1054
1547
|
var mcpGmxFetchMarketsOutputSchema = zod.z.object({
|
|
1055
1548
|
markets: zod.z.array(
|
|
1056
1549
|
zod.z.object({
|
|
@@ -1061,53 +1554,95 @@ var mcpGmxFetchMarketsOutputSchema = zod.z.object({
|
|
|
1061
1554
|
)
|
|
1062
1555
|
});
|
|
1063
1556
|
var mcpGmxFetchPositionsInputSchema = zod.z.object({
|
|
1064
|
-
chainId:
|
|
1557
|
+
chainId: agentEvmChainIdSchema,
|
|
1065
1558
|
executorAddress: evmAddressSchema
|
|
1066
1559
|
});
|
|
1067
1560
|
var mcpGmxFetchPositionsOutputSchema = zod.z.object({
|
|
1068
|
-
positions: zod.z.array(
|
|
1561
|
+
positions: zod.z.array(
|
|
1562
|
+
zod.z.object({
|
|
1563
|
+
key: zod.z.string(),
|
|
1564
|
+
symbol: zod.z.string().nullable().describe("GMX market symbol \u2014 pass to build_decrease as symbol"),
|
|
1565
|
+
indexName: zod.z.string(),
|
|
1566
|
+
isLong: zod.z.boolean(),
|
|
1567
|
+
direction: zod.z.enum(["long", "short"]).describe("Derived from isLong \u2014 pass to build_decrease"),
|
|
1568
|
+
sizeUsd: zod.z.string().nullable().describe("Copy as sizeUsdHuman for partial close"),
|
|
1569
|
+
collateralUsd: zod.z.string().nullable(),
|
|
1570
|
+
collateralSymbol: zod.z.string().nullable().describe("Copy as collateralToken"),
|
|
1571
|
+
entryPriceUsd: zod.z.string().nullable(),
|
|
1572
|
+
markPriceUsd: zod.z.string().nullable(),
|
|
1573
|
+
liquidationPriceUsd: zod.z.string().nullable(),
|
|
1574
|
+
leverageLabel: zod.z.string().nullable(),
|
|
1575
|
+
pnlUsd: zod.z.string().nullable()
|
|
1576
|
+
})
|
|
1577
|
+
)
|
|
1069
1578
|
});
|
|
1070
|
-
var
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
orderType: gmxOrderTypeSchema,
|
|
1074
|
-
sizeUsdHuman: zod.z.string().min(1),
|
|
1075
|
-
collateralToken: zod.z.string().min(1),
|
|
1076
|
-
collateralAmountHuman: zod.z.string().min(1),
|
|
1077
|
-
triggerPriceUsdHuman: zod.z.string().optional(),
|
|
1078
|
-
slippageBps: zod.z.number().int().nonnegative().optional(),
|
|
1079
|
-
executionFeeBufferBps: zod.z.number().int().nonnegative().optional()
|
|
1579
|
+
var mcpGmxFetchOrdersInputSchema = zod.z.object({
|
|
1580
|
+
chainId: agentEvmChainIdSchema,
|
|
1581
|
+
executorAddress: evmAddressSchema
|
|
1080
1582
|
});
|
|
1081
|
-
var
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
slippageBps: zod.z.number().int().nonnegative().optional(),
|
|
1091
|
-
executionFeeBufferBps: zod.z.number().int().nonnegative().optional()
|
|
1583
|
+
var mcpGmxFetchOrdersOutputSchema = zod.z.object({
|
|
1584
|
+
orders: zod.z.array(
|
|
1585
|
+
zod.z.object({
|
|
1586
|
+
orderId: zod.z.string().describe("Order key \u2014 pass to build_cancel_multisign as orderId"),
|
|
1587
|
+
isLong: zod.z.boolean().optional(),
|
|
1588
|
+
sizeDeltaUsd: zod.z.string().nullable().optional(),
|
|
1589
|
+
triggerPrice: zod.z.string().nullable().optional()
|
|
1590
|
+
})
|
|
1591
|
+
)
|
|
1092
1592
|
});
|
|
1593
|
+
var mcpGmxIncreaseInputSchema = mcpGmxMultisignInput(
|
|
1594
|
+
{
|
|
1595
|
+
symbol: zod.z.string().min(1).describe("Market symbol from ctm_gmx_fetch_markets"),
|
|
1596
|
+
direction: gmxDirectionSchema,
|
|
1597
|
+
orderType: gmxOrderTypeSchema,
|
|
1598
|
+
sizeUsdHuman: zod.z.string().min(1),
|
|
1599
|
+
collateralToken: zod.z.string().min(1),
|
|
1600
|
+
collateralAmountHuman: zod.z.string().min(1),
|
|
1601
|
+
triggerPriceUsdHuman: zod.z.string().optional(),
|
|
1602
|
+
slippageBps: zod.z.number().int().nonnegative().optional(),
|
|
1603
|
+
executionFeeBufferBps: zod.z.number().int().nonnegative().optional()
|
|
1604
|
+
},
|
|
1605
|
+
preprocessGmxIncreaseInput
|
|
1606
|
+
);
|
|
1607
|
+
var mcpGmxDecreaseInputSchema = mcpGmxMultisignInput(
|
|
1608
|
+
{
|
|
1609
|
+
symbol: zod.z.string().min(1).describe("symbol from ctm_gmx_fetch_positions or fetch_markets"),
|
|
1610
|
+
direction: gmxDirectionSchema.describe("direction from position row or isLong"),
|
|
1611
|
+
orderType: gmxOrderTypeSchema,
|
|
1612
|
+
sizeUsdHuman: zod.z.string().min(1).describe("sizeUsd from position row"),
|
|
1613
|
+
collateralToken: zod.z.string().min(1).describe("collateralSymbol from position row"),
|
|
1614
|
+
receiveToken: zod.z.string().optional(),
|
|
1615
|
+
triggerPriceUsdHuman: zod.z.string().optional(),
|
|
1616
|
+
keepLeverage: agentOptionalBooleanSchema(),
|
|
1617
|
+
slippageBps: zod.z.number().int().nonnegative().optional(),
|
|
1618
|
+
executionFeeBufferBps: zod.z.number().int().nonnegative().optional()
|
|
1619
|
+
},
|
|
1620
|
+
preprocessGmxDecreaseInput
|
|
1621
|
+
);
|
|
1093
1622
|
var mcpGmxCancelInputSchema = mcpGmxMultisignInput({
|
|
1094
|
-
orderId: zod.z.string().min(1)
|
|
1095
|
-
});
|
|
1096
|
-
var mcpGmxGmDepositInputSchema = mcpGmxMultisignInput({
|
|
1097
|
-
marketSymbol: zod.z.string().min(1),
|
|
1098
|
-
collateralToken: zod.z.string().min(1),
|
|
1099
|
-
collateralAmountHuman: zod.z.string().min(1),
|
|
1100
|
-
executionFeeBufferBps: zod.z.number().int().nonnegative().optional(),
|
|
1101
|
-
isNativeIn: zod.z.boolean().optional(),
|
|
1102
|
-
nativeWrapped: evmAddressSchema.optional()
|
|
1103
|
-
});
|
|
1104
|
-
var mcpGmxGmWithdrawInputSchema = mcpGmxMultisignInput({
|
|
1105
|
-
marketSymbol: zod.z.string().min(1),
|
|
1106
|
-
gmAmountHuman: zod.z.string().min(1),
|
|
1107
|
-
gmDecimals: zod.z.number().int().nonnegative().optional(),
|
|
1108
|
-
executionFeeBufferBps: zod.z.number().int().nonnegative().optional(),
|
|
1109
|
-
isNativeOut: zod.z.boolean().optional()
|
|
1623
|
+
orderId: zod.z.string().min(1).describe("orderId from ctm_gmx_fetch_orders")
|
|
1110
1624
|
});
|
|
1625
|
+
var mcpGmxGmDepositInputSchema = mcpGmxMultisignInput(
|
|
1626
|
+
{
|
|
1627
|
+
marketSymbol: zod.z.string().min(1).describe("symbol from ctm_gmx_fetch_gm_markets"),
|
|
1628
|
+
collateralToken: zod.z.string().min(1).describe("longTokenSymbol or shortTokenSymbol from GM market row"),
|
|
1629
|
+
collateralAmountHuman: zod.z.string().min(1),
|
|
1630
|
+
executionFeeBufferBps: zod.z.number().int().nonnegative().optional(),
|
|
1631
|
+
isNativeIn: agentOptionalBooleanSchema(),
|
|
1632
|
+
nativeWrapped: evmAddressSchema.optional()
|
|
1633
|
+
},
|
|
1634
|
+
preprocessGmxGmBuildInput
|
|
1635
|
+
);
|
|
1636
|
+
var mcpGmxGmWithdrawInputSchema = mcpGmxMultisignInput(
|
|
1637
|
+
{
|
|
1638
|
+
marketSymbol: zod.z.string().min(1).describe("symbol from ctm_gmx_fetch_gm_markets"),
|
|
1639
|
+
gmAmountHuman: zod.z.string().min(1),
|
|
1640
|
+
gmDecimals: zod.z.number().int().nonnegative().optional(),
|
|
1641
|
+
executionFeeBufferBps: zod.z.number().int().nonnegative().optional(),
|
|
1642
|
+
isNativeOut: agentOptionalBooleanSchema()
|
|
1643
|
+
},
|
|
1644
|
+
preprocessGmxGmBuildInput
|
|
1645
|
+
);
|
|
1111
1646
|
var mcpGmxStakeGmxInputSchema = mcpGmxMultisignInput({
|
|
1112
1647
|
amountHuman: zod.z.string().min(1),
|
|
1113
1648
|
gmxDecimals: zod.z.number().int().nonnegative().optional()
|
|
@@ -1116,9 +1651,7 @@ var mcpGmxUnstakeGmxInputSchema = mcpGmxMultisignInput({
|
|
|
1116
1651
|
amountHuman: zod.z.string().min(1),
|
|
1117
1652
|
gmxDecimals: zod.z.number().int().nonnegative().optional()
|
|
1118
1653
|
});
|
|
1119
|
-
var mcpGmxFetchGmMarketsInputSchema =
|
|
1120
|
-
chainId: zod.z.number().int().positive()
|
|
1121
|
-
});
|
|
1654
|
+
var mcpGmxFetchGmMarketsInputSchema = gmxFetchChainInputSchema;
|
|
1122
1655
|
var mcpGmxGmMarketApyRowSchema = zod.z.object({
|
|
1123
1656
|
symbol: zod.z.string(),
|
|
1124
1657
|
marketTokenAddress: zod.z.string(),
|
|
@@ -1132,9 +1665,7 @@ var mcpGmxGmMarketApyRowSchema = zod.z.object({
|
|
|
1132
1665
|
var mcpGmxFetchGmMarketsOutputSchema = zod.z.object({
|
|
1133
1666
|
markets: zod.z.array(mcpGmxGmMarketApyRowSchema)
|
|
1134
1667
|
});
|
|
1135
|
-
var mcpGmxFetchGmApyInputSchema =
|
|
1136
|
-
chainId: zod.z.number().int().positive()
|
|
1137
|
-
});
|
|
1668
|
+
var mcpGmxFetchGmApyInputSchema = gmxFetchChainInputSchema;
|
|
1138
1669
|
var mcpGmxFetchGmApyOutputSchema = zod.z.object({
|
|
1139
1670
|
markets: zod.z.array(
|
|
1140
1671
|
zod.z.object({
|
|
@@ -1150,7 +1681,7 @@ var mcpGmxFetchGmApyOutputSchema = zod.z.object({
|
|
|
1150
1681
|
)
|
|
1151
1682
|
});
|
|
1152
1683
|
var mcpGmxFetchStakingPowerInputSchema = zod.z.object({
|
|
1153
|
-
chainId:
|
|
1684
|
+
chainId: agentEvmChainIdSchema,
|
|
1154
1685
|
executorAddress: evmAddressSchema
|
|
1155
1686
|
});
|
|
1156
1687
|
var mcpGmxFetchStakingPowerOutputSchema = zod.z.object({
|
|
@@ -1166,7 +1697,7 @@ var gmxOhlcvCandleSchema = zod.z.object({
|
|
|
1166
1697
|
close: zod.z.string()
|
|
1167
1698
|
});
|
|
1168
1699
|
var mcpGmxFetchMarketPricesInputSchema = zod.z.object({
|
|
1169
|
-
chainId:
|
|
1700
|
+
chainId: agentEvmChainIdSchema,
|
|
1170
1701
|
symbol: zod.z.string().min(1),
|
|
1171
1702
|
collateralSymbol: zod.z.string().min(1)
|
|
1172
1703
|
});
|
|
@@ -1180,7 +1711,7 @@ var mcpGmxFetchMarketPricesOutputSchema = zod.z.object({
|
|
|
1180
1711
|
fetchedAtMs: zod.z.number()
|
|
1181
1712
|
});
|
|
1182
1713
|
var mcpGmxFetchOhlcvInputSchema = zod.z.object({
|
|
1183
|
-
chainId:
|
|
1714
|
+
chainId: agentEvmChainIdSchema,
|
|
1184
1715
|
symbol: zod.z.string().min(1),
|
|
1185
1716
|
timeframe: gmxOhlcvTimeframeSchema.optional(),
|
|
1186
1717
|
limit: zod.z.number().int().positive().max(500).optional(),
|
|
@@ -1191,8 +1722,10 @@ var mcpGmxFetchOhlcvOutputSchema = zod.z.object({
|
|
|
1191
1722
|
timeframe: gmxOhlcvTimeframeSchema,
|
|
1192
1723
|
candles: zod.z.array(gmxOhlcvCandleSchema)
|
|
1193
1724
|
});
|
|
1194
|
-
function mcpHyperliquidMultisignInput(fields) {
|
|
1195
|
-
|
|
1725
|
+
function mcpHyperliquidMultisignInput(fields, preprocess) {
|
|
1726
|
+
const inner = evmMultisignCommonInputSchema.extend(fields);
|
|
1727
|
+
const shaped = preprocess ? zod.z.preprocess(preprocess, inner) : inner;
|
|
1728
|
+
return withMultisignKeySourceRefine(shaped);
|
|
1196
1729
|
}
|
|
1197
1730
|
var hyperliquidTifSchema = zod.z.enum(["alo", "gtc", "ioc"]);
|
|
1198
1731
|
var hyperliquidOhlcvIntervalSchema = zod.z.enum([
|
|
@@ -1211,11 +1744,14 @@ var hyperliquidOhlcvIntervalSchema = zod.z.enum([
|
|
|
1211
1744
|
"1w",
|
|
1212
1745
|
"1M"
|
|
1213
1746
|
]);
|
|
1747
|
+
var hyperliquidFetchChainInputSchema = zod.z.object({
|
|
1748
|
+
chainId: agentEvmChainIdSchema
|
|
1749
|
+
});
|
|
1214
1750
|
var hyperliquidPositionRowSchema = zod.z.object({
|
|
1215
1751
|
key: zod.z.string(),
|
|
1216
1752
|
coin: zod.z.string(),
|
|
1217
1753
|
isLong: zod.z.boolean(),
|
|
1218
|
-
size: zod.z.string().nullable(),
|
|
1754
|
+
size: zod.z.string().nullable().describe("Copy as szHuman for build_close_multisign"),
|
|
1219
1755
|
entryPx: zod.z.string().nullable(),
|
|
1220
1756
|
positionValueUsd: zod.z.string().nullable(),
|
|
1221
1757
|
unrealizedPnlUsd: zod.z.string().nullable(),
|
|
@@ -1236,14 +1772,13 @@ var hyperliquidAccountSummarySchema = zod.z.object({
|
|
|
1236
1772
|
totalMarginUsedUsd: zod.z.string().nullable(),
|
|
1237
1773
|
withdrawableUsd: zod.z.string().nullable()
|
|
1238
1774
|
});
|
|
1239
|
-
var mcpHyperliquidFetchMarketsInputSchema =
|
|
1240
|
-
chainId: zod.z.number().int().positive(),
|
|
1775
|
+
var mcpHyperliquidFetchMarketsInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1241
1776
|
dex: zod.z.string().optional()
|
|
1242
1777
|
});
|
|
1243
1778
|
var mcpHyperliquidFetchMarketsOutputSchema = zod.z.object({
|
|
1244
1779
|
markets: zod.z.array(
|
|
1245
1780
|
zod.z.object({
|
|
1246
|
-
name: zod.z.string(),
|
|
1781
|
+
name: zod.z.string().describe("Perp coin name \u2014 alias for build limit order coin"),
|
|
1247
1782
|
asset: zod.z.number(),
|
|
1248
1783
|
szDecimals: zod.z.number(),
|
|
1249
1784
|
maxLeverage: zod.z.number(),
|
|
@@ -1258,8 +1793,7 @@ var mcpHyperliquidFetchMarketsOutputSchema = zod.z.object({
|
|
|
1258
1793
|
})
|
|
1259
1794
|
)
|
|
1260
1795
|
});
|
|
1261
|
-
var mcpHyperliquidSearchMarketsInputSchema =
|
|
1262
|
-
chainId: zod.z.number().int().positive(),
|
|
1796
|
+
var mcpHyperliquidSearchMarketsInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1263
1797
|
query: zod.z.string().min(1),
|
|
1264
1798
|
dex: zod.z.string().optional(),
|
|
1265
1799
|
limit: zod.z.number().int().positive().max(50).optional()
|
|
@@ -1282,8 +1816,7 @@ var mcpHyperliquidSearchMarketsOutputSchema = zod.z.object({
|
|
|
1282
1816
|
})
|
|
1283
1817
|
)
|
|
1284
1818
|
});
|
|
1285
|
-
var mcpHyperliquidFetchOpenContextInputSchema =
|
|
1286
|
-
chainId: zod.z.number().int().positive(),
|
|
1819
|
+
var mcpHyperliquidFetchOpenContextInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1287
1820
|
executorAddress: evmAddressSchema,
|
|
1288
1821
|
coin: zod.z.string().min(1),
|
|
1289
1822
|
dex: zod.z.string().optional()
|
|
@@ -1294,16 +1827,14 @@ var mcpHyperliquidFetchOpenContextOutputSchema = zod.z.object({
|
|
|
1294
1827
|
activeAsset: hyperliquidActiveAssetSchema
|
|
1295
1828
|
})
|
|
1296
1829
|
});
|
|
1297
|
-
var mcpHyperliquidFetchPositionsInputSchema =
|
|
1298
|
-
chainId: zod.z.number().int().positive(),
|
|
1830
|
+
var mcpHyperliquidFetchPositionsInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1299
1831
|
executorAddress: evmAddressSchema,
|
|
1300
1832
|
dex: zod.z.string().optional()
|
|
1301
1833
|
});
|
|
1302
1834
|
var mcpHyperliquidFetchPositionsOutputSchema = zod.z.object({
|
|
1303
1835
|
positions: zod.z.array(hyperliquidPositionRowSchema)
|
|
1304
1836
|
});
|
|
1305
|
-
var mcpHyperliquidFetchOpenOrdersInputSchema =
|
|
1306
|
-
chainId: zod.z.number().int().positive(),
|
|
1837
|
+
var mcpHyperliquidFetchOpenOrdersInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1307
1838
|
executorAddress: evmAddressSchema,
|
|
1308
1839
|
dex: zod.z.string().optional()
|
|
1309
1840
|
});
|
|
@@ -1314,18 +1845,16 @@ var mcpHyperliquidFetchOpenOrdersOutputSchema = zod.z.object({
|
|
|
1314
1845
|
side: zod.z.string(),
|
|
1315
1846
|
limitPx: zod.z.string(),
|
|
1316
1847
|
sz: zod.z.string(),
|
|
1317
|
-
oid: zod.z.number(),
|
|
1848
|
+
oid: zod.z.number().describe("Pass to build_cancel_multisign as oid"),
|
|
1318
1849
|
timestamp: zod.z.number(),
|
|
1319
1850
|
reduceOnly: zod.z.boolean().optional()
|
|
1320
1851
|
})
|
|
1321
1852
|
)
|
|
1322
1853
|
});
|
|
1323
|
-
var mcpHyperliquidFetchMarketSnapshotInputSchema =
|
|
1324
|
-
chainId: zod.z.number().int().positive(),
|
|
1854
|
+
var mcpHyperliquidFetchMarketSnapshotInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1325
1855
|
coin: zod.z.string().min(1),
|
|
1326
1856
|
interval: hyperliquidOhlcvIntervalSchema.optional(),
|
|
1327
1857
|
dex: zod.z.string().optional(),
|
|
1328
|
-
/** Recent OHLCV bars to return (default 48, max 200). Live price is always current. */
|
|
1329
1858
|
candleLimit: zod.z.number().int().positive().max(200).optional()
|
|
1330
1859
|
});
|
|
1331
1860
|
var hyperliquidOhlcvCandleSchema = zod.z.object({
|
|
@@ -1356,21 +1885,16 @@ var mcpHyperliquidFetchMarketSnapshotOutputSchema = zod.z.object({
|
|
|
1356
1885
|
candles: zod.z.array(hyperliquidOhlcvCandleSchema),
|
|
1357
1886
|
candleCount: zod.z.number()
|
|
1358
1887
|
}),
|
|
1359
|
-
resolvedCoin: zod.z.string(),
|
|
1888
|
+
resolvedCoin: zod.z.string().describe("Canonical coin \u2014 alias for build coin"),
|
|
1360
1889
|
dex: zod.z.string().nullable()
|
|
1361
1890
|
});
|
|
1362
|
-
var mcpHyperliquidFetchOhlcvInputSchema =
|
|
1363
|
-
chainId: zod.z.number().int().positive(),
|
|
1891
|
+
var mcpHyperliquidFetchOhlcvInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1364
1892
|
coin: zod.z.string().min(1),
|
|
1365
1893
|
interval: hyperliquidOhlcvIntervalSchema.optional(),
|
|
1366
1894
|
dex: zod.z.string().optional(),
|
|
1367
|
-
/** Calendar-day lookback ending now (e.g. 7 = last week). Preferred for agent requests. */
|
|
1368
1895
|
lookbackDays: zod.z.number().positive().max(90).optional(),
|
|
1369
|
-
/** Hour lookback ending now. Alternative to lookbackDays. */
|
|
1370
1896
|
lookbackHours: zod.z.number().positive().max(90 * 24).optional(),
|
|
1371
|
-
/** Explicit range start (ms since epoch). Use with endTimeMs. */
|
|
1372
1897
|
startTimeMs: zod.z.number().int().positive().optional(),
|
|
1373
|
-
/** Explicit range end (ms since epoch). Defaults to now. */
|
|
1374
1898
|
endTimeMs: zod.z.number().int().positive().optional()
|
|
1375
1899
|
});
|
|
1376
1900
|
var mcpHyperliquidFetchOhlcvOutputSchema = zod.z.object({
|
|
@@ -1389,8 +1913,7 @@ var mcpHyperliquidFetchOhlcvOutputSchema = zod.z.object({
|
|
|
1389
1913
|
resolvedCoin: zod.z.string(),
|
|
1390
1914
|
dex: zod.z.string().nullable()
|
|
1391
1915
|
});
|
|
1392
|
-
var mcpHyperliquidFetchUsdClassBalancesInputSchema =
|
|
1393
|
-
chainId: zod.z.number().int().positive(),
|
|
1916
|
+
var mcpHyperliquidFetchUsdClassBalancesInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1394
1917
|
executorAddress: evmAddressSchema
|
|
1395
1918
|
});
|
|
1396
1919
|
var mcpHyperliquidFetchUsdClassBalancesOutputSchema = zod.z.object({
|
|
@@ -1399,34 +1922,31 @@ var mcpHyperliquidFetchUsdClassBalancesOutputSchema = zod.z.object({
|
|
|
1399
1922
|
perpWithdrawable: zod.z.string()
|
|
1400
1923
|
})
|
|
1401
1924
|
});
|
|
1402
|
-
var mcpHyperliquidFetchVaultsInputSchema =
|
|
1403
|
-
chainId: zod.z.number().int().positive(),
|
|
1925
|
+
var mcpHyperliquidFetchVaultsInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1404
1926
|
executorAddress: evmAddressSchema.optional()
|
|
1405
1927
|
});
|
|
1406
1928
|
var mcpHyperliquidFetchVaultsOutputSchema = zod.z.object({
|
|
1407
1929
|
vaults: zod.z.array(
|
|
1408
1930
|
zod.z.object({
|
|
1409
1931
|
vaultAddress: zod.z.string(),
|
|
1410
|
-
name: zod.z.string(),
|
|
1932
|
+
name: zod.z.string().describe("Optional vaultName for purposeText on deposit"),
|
|
1411
1933
|
apr: zod.z.number().nullable(),
|
|
1412
1934
|
tvlUsd: zod.z.string().nullable()
|
|
1413
1935
|
})
|
|
1414
1936
|
)
|
|
1415
1937
|
});
|
|
1416
|
-
var mcpHyperliquidFetchUserVaultEquitiesInputSchema =
|
|
1417
|
-
chainId: zod.z.number().int().positive(),
|
|
1938
|
+
var mcpHyperliquidFetchUserVaultEquitiesInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1418
1939
|
executorAddress: evmAddressSchema
|
|
1419
1940
|
});
|
|
1420
1941
|
var mcpHyperliquidFetchUserVaultEquitiesOutputSchema = zod.z.object({
|
|
1421
1942
|
rows: zod.z.array(
|
|
1422
1943
|
zod.z.object({
|
|
1423
1944
|
vaultAddress: zod.z.string(),
|
|
1424
|
-
equity: zod.z.string()
|
|
1945
|
+
equity: zod.z.string().describe("Copy as usdHuman for build_vault_withdraw_multisign")
|
|
1425
1946
|
})
|
|
1426
1947
|
)
|
|
1427
1948
|
});
|
|
1428
|
-
var mcpHyperliquidFetchStakingSummaryInputSchema =
|
|
1429
|
-
chainId: zod.z.number().int().positive(),
|
|
1949
|
+
var mcpHyperliquidFetchStakingSummaryInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1430
1950
|
executorAddress: evmAddressSchema
|
|
1431
1951
|
});
|
|
1432
1952
|
var mcpHyperliquidFetchStakingSummaryOutputSchema = zod.z.object({
|
|
@@ -1435,53 +1955,68 @@ var mcpHyperliquidFetchStakingSummaryOutputSchema = zod.z.object({
|
|
|
1435
1955
|
undelegated: zod.z.string()
|
|
1436
1956
|
})
|
|
1437
1957
|
});
|
|
1438
|
-
var mcpHyperliquidFetchDelegationsInputSchema =
|
|
1439
|
-
chainId: zod.z.number().int().positive(),
|
|
1958
|
+
var mcpHyperliquidFetchDelegationsInputSchema = hyperliquidFetchChainInputSchema.extend({
|
|
1440
1959
|
executorAddress: evmAddressSchema
|
|
1441
1960
|
});
|
|
1442
1961
|
var mcpHyperliquidFetchDelegationsOutputSchema = zod.z.object({
|
|
1443
1962
|
delegations: zod.z.array(
|
|
1444
1963
|
zod.z.object({
|
|
1445
1964
|
validator: zod.z.string(),
|
|
1446
|
-
amount: zod.z.string()
|
|
1965
|
+
amount: zod.z.string().describe("Copy as hypeHuman for build_undelegate_multisign")
|
|
1447
1966
|
})
|
|
1448
1967
|
)
|
|
1449
1968
|
});
|
|
1450
|
-
var mcpHyperliquidLimitOrderInputSchema = mcpHyperliquidMultisignInput(
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1969
|
+
var mcpHyperliquidLimitOrderInputSchema = mcpHyperliquidMultisignInput(
|
|
1970
|
+
{
|
|
1971
|
+
coin: zod.z.string().min(1).describe("coin from fetch_markets (name) or search_markets"),
|
|
1972
|
+
isBuy: agentBooleanSchema(),
|
|
1973
|
+
limitPxHuman: zod.z.string().min(1).describe("limitPx or markPx from open_context"),
|
|
1974
|
+
szHuman: zod.z.string().min(1),
|
|
1975
|
+
marketKind: zod.z.enum(["perp", "spot"]).optional(),
|
|
1976
|
+
tif: hyperliquidTifSchema.optional(),
|
|
1977
|
+
dex: zod.z.string().optional()
|
|
1978
|
+
},
|
|
1979
|
+
preprocessHyperliquidLimitOrderInput
|
|
1980
|
+
);
|
|
1981
|
+
var mcpHyperliquidCloseInputSchema = mcpHyperliquidMultisignInput(
|
|
1982
|
+
{
|
|
1983
|
+
coin: zod.z.string().min(1),
|
|
1984
|
+
isLong: agentBooleanSchema(),
|
|
1985
|
+
limitPxHuman: zod.z.string().min(1),
|
|
1986
|
+
szHuman: zod.z.string().min(1).describe("size from fetch_positions"),
|
|
1987
|
+
dex: zod.z.string().optional(),
|
|
1988
|
+
tif: hyperliquidTifSchema.optional()
|
|
1989
|
+
},
|
|
1990
|
+
preprocessHyperliquidCloseInput
|
|
1991
|
+
);
|
|
1992
|
+
var mcpHyperliquidCancelInputSchema = mcpHyperliquidMultisignInput(
|
|
1993
|
+
{
|
|
1994
|
+
coin: zod.z.string().min(1),
|
|
1995
|
+
oid: zod.z.number().int().positive().describe("oid from fetch_open_orders"),
|
|
1996
|
+
marketKind: zod.z.enum(["perp", "spot"]).optional(),
|
|
1997
|
+
dex: zod.z.string().optional()
|
|
1998
|
+
},
|
|
1999
|
+
preprocessHyperliquidCoinInput
|
|
2000
|
+
);
|
|
1473
2001
|
var mcpHyperliquidUsdTransferInputSchema = mcpHyperliquidMultisignInput({
|
|
1474
2002
|
usdHuman: zod.z.string().min(1),
|
|
1475
|
-
toPerp:
|
|
1476
|
-
});
|
|
1477
|
-
var mcpHyperliquidVaultDepositInputSchema = mcpHyperliquidMultisignInput({
|
|
1478
|
-
vaultAddress: evmAddressSchema,
|
|
1479
|
-
usdHuman: zod.z.string().min(1)
|
|
1480
|
-
});
|
|
1481
|
-
var mcpHyperliquidVaultWithdrawInputSchema = mcpHyperliquidMultisignInput({
|
|
1482
|
-
vaultAddress: evmAddressSchema,
|
|
1483
|
-
usdHuman: zod.z.string().min(1)
|
|
2003
|
+
toPerp: agentBooleanSchema()
|
|
1484
2004
|
});
|
|
2005
|
+
var mcpHyperliquidVaultDepositInputSchema = mcpHyperliquidMultisignInput(
|
|
2006
|
+
{
|
|
2007
|
+
vaultAddress: evmAddressSchema.describe("vaultAddress from fetch_vaults"),
|
|
2008
|
+
usdHuman: zod.z.string().min(1),
|
|
2009
|
+
vaultName: zod.z.string().optional().describe("name from fetch_vaults row")
|
|
2010
|
+
},
|
|
2011
|
+
preprocessHyperliquidVaultDepositInput
|
|
2012
|
+
);
|
|
2013
|
+
var mcpHyperliquidVaultWithdrawInputSchema = mcpHyperliquidMultisignInput(
|
|
2014
|
+
{
|
|
2015
|
+
vaultAddress: evmAddressSchema,
|
|
2016
|
+
usdHuman: zod.z.string().min(1).describe("equity from fetch_user_vault_equities")
|
|
2017
|
+
},
|
|
2018
|
+
preprocessHyperliquidVaultWithdrawInput
|
|
2019
|
+
);
|
|
1485
2020
|
var mcpHyperliquidStakeInputSchema = mcpHyperliquidMultisignInput({
|
|
1486
2021
|
hypeHuman: zod.z.string().min(1)
|
|
1487
2022
|
});
|
|
@@ -1492,10 +2027,13 @@ var mcpHyperliquidDelegateInputSchema = mcpHyperliquidMultisignInput({
|
|
|
1492
2027
|
hypeHuman: zod.z.string().min(1),
|
|
1493
2028
|
validator: evmAddressSchema
|
|
1494
2029
|
});
|
|
1495
|
-
var mcpHyperliquidUndelegateInputSchema = mcpHyperliquidMultisignInput(
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
2030
|
+
var mcpHyperliquidUndelegateInputSchema = mcpHyperliquidMultisignInput(
|
|
2031
|
+
{
|
|
2032
|
+
hypeHuman: zod.z.string().min(1).describe("amount from fetch_delegations"),
|
|
2033
|
+
validator: evmAddressSchema
|
|
2034
|
+
},
|
|
2035
|
+
preprocessHyperliquidUndelegateInput
|
|
2036
|
+
);
|
|
1499
2037
|
|
|
1500
2038
|
// src/agent/mcpProtocolTools.ts
|
|
1501
2039
|
function defineProtocolMcpTool(def) {
|
|
@@ -1807,8 +2345,7 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1807
2345
|
prerequisites: [
|
|
1808
2346
|
"keyGenId",
|
|
1809
2347
|
"chainId",
|
|
1810
|
-
"vaultAddress from ctm_morpho_fetch_earn_vaults",
|
|
1811
|
-
"underlying",
|
|
2348
|
+
"vaultAddress + underlyingAddress from ctm_morpho_fetch_earn_vaults",
|
|
1812
2349
|
"amountHuman"
|
|
1813
2350
|
],
|
|
1814
2351
|
handler: { importPath: "protocols/evm/morpho", exportName: "buildEvmMultisignBodyMorphoVaultDepositBatch" },
|
|
@@ -2334,13 +2871,25 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
2334
2871
|
actionId: "gmx.fetch-positions",
|
|
2335
2872
|
protocolId: "gmx",
|
|
2336
2873
|
chainCategory: "evm",
|
|
2337
|
-
description: "Fetch open GMX perp positions
|
|
2874
|
+
description: "Fetch open GMX perp positions (symbol, direction, sizeUsd, collateralSymbol) for build_decrease. Read-only.",
|
|
2338
2875
|
prerequisites: ["chainId", "executorAddress (MPC ethereumaddress)"],
|
|
2339
2876
|
followUp: ["ctm_gmx_build_decrease_multisign"],
|
|
2340
2877
|
handler: { importPath: "protocols/evm/gmx", exportName: "gmxFetchPositionsForExecutor" },
|
|
2341
2878
|
inputZod: mcpGmxFetchPositionsInputSchema,
|
|
2342
2879
|
outputZod: mcpGmxFetchPositionsOutputSchema
|
|
2343
2880
|
}),
|
|
2881
|
+
defineMcpTool({
|
|
2882
|
+
name: "ctm_gmx_fetch_orders",
|
|
2883
|
+
actionId: "gmx.fetch-orders",
|
|
2884
|
+
protocolId: "gmx",
|
|
2885
|
+
chainCategory: "evm",
|
|
2886
|
+
description: "Fetch pending GMX orders (orderId) for build_cancel_multisign. Read-only.",
|
|
2887
|
+
prerequisites: ["chainId", "executorAddress"],
|
|
2888
|
+
followUp: ["ctm_gmx_build_cancel_multisign"],
|
|
2889
|
+
handler: { importPath: "protocols/evm/gmx", exportName: "gmxFetchOrdersSummary" },
|
|
2890
|
+
inputZod: mcpGmxFetchOrdersInputSchema,
|
|
2891
|
+
outputZod: mcpGmxFetchOrdersOutputSchema
|
|
2892
|
+
}),
|
|
2344
2893
|
defineMcpTool({
|
|
2345
2894
|
name: "ctm_gmx_fetch_market_prices",
|
|
2346
2895
|
actionId: "gmx.fetch-market-prices",
|
|
@@ -2545,6 +3094,34 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
2545
3094
|
inputZod: mcpHyperliquidFetchDelegationsInputSchema,
|
|
2546
3095
|
outputZod: mcpHyperliquidFetchDelegationsOutputSchema
|
|
2547
3096
|
}),
|
|
3097
|
+
defineMcpTool({
|
|
3098
|
+
name: "ctm_morpho_fetch_blue_markets",
|
|
3099
|
+
actionId: "morpho.fetch-blue-markets",
|
|
3100
|
+
protocolId: "morpho",
|
|
3101
|
+
chainCategory: "evm",
|
|
3102
|
+
description: "Morpho Blue borrow markets. Filter by collateral/loan asset; returns marketId and token addresses for blue multisign tools.",
|
|
3103
|
+
prerequisites: ["chainId"],
|
|
3104
|
+
followUp: [
|
|
3105
|
+
"ctm_morpho_build_blue_collateral_deposit_multisign",
|
|
3106
|
+
"ctm_morpho_build_blue_borrow_multisign",
|
|
3107
|
+
"ctm_morpho_build_blue_repay_multisign"
|
|
3108
|
+
],
|
|
3109
|
+
handler: { importPath: "protocols/evm/morpho", exportName: "morphoFetchBlueMarketsSummary" },
|
|
3110
|
+
inputZod: mcpMorphoFetchBlueMarketsInputSchema,
|
|
3111
|
+
outputZod: mcpMorphoFetchBlueMarketsOutputSchema
|
|
3112
|
+
}),
|
|
3113
|
+
defineMcpTool({
|
|
3114
|
+
name: "ctm_euler_v2_fetch_lend_vaults",
|
|
3115
|
+
actionId: "euler-v2.fetch-lend-vaults",
|
|
3116
|
+
protocolId: "euler-v2",
|
|
3117
|
+
chainCategory: "evm",
|
|
3118
|
+
description: "Euler v2 isolated lend vaults for an underlying asset. Returns evaultAddress for build_isolated_lend_multisign.",
|
|
3119
|
+
prerequisites: ["chainId", "underlyingAddress from get_defi_protocol_supported_tokens"],
|
|
3120
|
+
followUp: ["ctm_euler_v2_build_isolated_lend_multisign"],
|
|
3121
|
+
handler: { importPath: "protocols/evm/euler-v2", exportName: "eulerV2FetchLendVaultsSummary" },
|
|
3122
|
+
inputZod: mcpEulerV2FetchLendVaultsInputSchema,
|
|
3123
|
+
outputZod: mcpEulerV2FetchLendVaultsOutputSchema
|
|
3124
|
+
}),
|
|
2548
3125
|
defineMcpTool({
|
|
2549
3126
|
name: "ctm_morpho_fetch_earn_vaults",
|
|
2550
3127
|
actionId: "morpho.fetch-earn-vaults",
|
|
@@ -3921,6 +4498,8 @@ exports.mcpEthenaStakeInputSchema = mcpEthenaStakeInputSchema;
|
|
|
3921
4498
|
exports.mcpEulerV2BorrowRepayInputSchema = mcpEulerV2BorrowRepayInputSchema;
|
|
3922
4499
|
exports.mcpEulerV2CollateralDepositInputSchema = mcpEulerV2CollateralDepositInputSchema;
|
|
3923
4500
|
exports.mcpEulerV2CollateralWithdrawInputSchema = mcpEulerV2CollateralWithdrawInputSchema;
|
|
4501
|
+
exports.mcpEulerV2FetchLendVaultsInputSchema = mcpEulerV2FetchLendVaultsInputSchema;
|
|
4502
|
+
exports.mcpEulerV2FetchLendVaultsOutputSchema = mcpEulerV2FetchLendVaultsOutputSchema;
|
|
3924
4503
|
exports.mcpEulerV2IsolatedBorrowInputSchema = mcpEulerV2IsolatedBorrowInputSchema;
|
|
3925
4504
|
exports.mcpEulerV2IsolatedLendInputSchema = mcpEulerV2IsolatedLendInputSchema;
|
|
3926
4505
|
exports.mcpEulerV2VaultWithdrawInputSchema = mcpEulerV2VaultWithdrawInputSchema;
|
|
@@ -3936,6 +4515,8 @@ exports.mcpGmxFetchMarketsInputSchema = mcpGmxFetchMarketsInputSchema;
|
|
|
3936
4515
|
exports.mcpGmxFetchMarketsOutputSchema = mcpGmxFetchMarketsOutputSchema;
|
|
3937
4516
|
exports.mcpGmxFetchOhlcvInputSchema = mcpGmxFetchOhlcvInputSchema;
|
|
3938
4517
|
exports.mcpGmxFetchOhlcvOutputSchema = mcpGmxFetchOhlcvOutputSchema;
|
|
4518
|
+
exports.mcpGmxFetchOrdersInputSchema = mcpGmxFetchOrdersInputSchema;
|
|
4519
|
+
exports.mcpGmxFetchOrdersOutputSchema = mcpGmxFetchOrdersOutputSchema;
|
|
3939
4520
|
exports.mcpGmxFetchPositionsInputSchema = mcpGmxFetchPositionsInputSchema;
|
|
3940
4521
|
exports.mcpGmxFetchPositionsOutputSchema = mcpGmxFetchPositionsOutputSchema;
|
|
3941
4522
|
exports.mcpGmxFetchStakingPowerInputSchema = mcpGmxFetchStakingPowerInputSchema;
|
|
@@ -3991,6 +4572,8 @@ exports.mcpMorphoBlueBorrowInputSchema = mcpMorphoBlueBorrowInputSchema;
|
|
|
3991
4572
|
exports.mcpMorphoBlueCollateralDepositInputSchema = mcpMorphoBlueCollateralDepositInputSchema;
|
|
3992
4573
|
exports.mcpMorphoBlueCollateralWithdrawInputSchema = mcpMorphoBlueCollateralWithdrawInputSchema;
|
|
3993
4574
|
exports.mcpMorphoBlueRepayInputSchema = mcpMorphoBlueRepayInputSchema;
|
|
4575
|
+
exports.mcpMorphoFetchBlueMarketsInputSchema = mcpMorphoFetchBlueMarketsInputSchema;
|
|
4576
|
+
exports.mcpMorphoFetchBlueMarketsOutputSchema = mcpMorphoFetchBlueMarketsOutputSchema;
|
|
3994
4577
|
exports.mcpMorphoFetchEarnVaultsInputSchema = mcpMorphoFetchEarnVaultsInputSchema;
|
|
3995
4578
|
exports.mcpMorphoFetchEarnVaultsOutputSchema = mcpMorphoFetchEarnVaultsOutputSchema;
|
|
3996
4579
|
exports.mcpMorphoMerklClaimInputSchema = mcpMorphoMerklClaimInputSchema;
|
|
@@ -4035,6 +4618,8 @@ exports.mcpUniswapV4RegisterPositionFromMintTxOutputSchema = mcpUniswapV4Registe
|
|
|
4035
4618
|
exports.mcpUniswapV4RegisterPositionNftInputSchema = mcpUniswapV4RegisterPositionNftInputSchema;
|
|
4036
4619
|
exports.mcpUniswapV4RegisterPositionNftOutputSchema = mcpUniswapV4RegisterPositionNftOutputSchema;
|
|
4037
4620
|
exports.multisignOutputSchema = multisignOutputSchema;
|
|
4621
|
+
exports.parseAgentBoolean = parseAgentBoolean;
|
|
4622
|
+
exports.parseAgentEvmChainId = parseAgentEvmChainId;
|
|
4038
4623
|
exports.parseMcpToolInput = parseMcpToolInput;
|
|
4039
4624
|
exports.parseMcpToolOutput = parseMcpToolOutput;
|
|
4040
4625
|
exports.parseMultisignBuilderOutput = parseMultisignBuilderOutput;
|