@shroud-fi/mcp-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +130 -0
- package/dist/cjs/auth.d.ts +41 -0
- package/dist/cjs/auth.d.ts.map +1 -0
- package/dist/cjs/auth.js +103 -0
- package/dist/cjs/auth.js.map +1 -0
- package/dist/cjs/bin/http.d.ts +7 -0
- package/dist/cjs/bin/http.d.ts.map +1 -0
- package/dist/cjs/bin/http.js +24 -0
- package/dist/cjs/bin/http.js.map +1 -0
- package/dist/cjs/bin/stdio.d.ts +9 -0
- package/dist/cjs/bin/stdio.d.ts.map +1 -0
- package/dist/cjs/bin/stdio.js +15 -0
- package/dist/cjs/bin/stdio.js.map +1 -0
- package/dist/cjs/config.d.ts +22 -0
- package/dist/cjs/config.d.ts.map +1 -0
- package/dist/cjs/config.js +180 -0
- package/dist/cjs/config.js.map +1 -0
- package/dist/cjs/constants.d.ts +29 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +35 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/errors.d.ts +43 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +72 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/http.d.ts +32 -0
- package/dist/cjs/http.d.ts.map +1 -0
- package/dist/cjs/http.js +180 -0
- package/dist/cjs/http.js.map +1 -0
- package/dist/cjs/index.d.ts +19 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +40 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/server.d.ts +14 -0
- package/dist/cjs/server.d.ts.map +1 -0
- package/dist/cjs/server.js +92 -0
- package/dist/cjs/server.js.map +1 -0
- package/dist/cjs/stdio.d.ts +9 -0
- package/dist/cjs/stdio.d.ts.map +1 -0
- package/dist/cjs/stdio.js +21 -0
- package/dist/cjs/stdio.js.map +1 -0
- package/dist/cjs/tools/balance.d.ts +9 -0
- package/dist/cjs/tools/balance.d.ts.map +1 -0
- package/dist/cjs/tools/balance.js +61 -0
- package/dist/cjs/tools/balance.js.map +1 -0
- package/dist/cjs/tools/index.d.ts +17 -0
- package/dist/cjs/tools/index.d.ts.map +1 -0
- package/dist/cjs/tools/index.js +40 -0
- package/dist/cjs/tools/index.js.map +1 -0
- package/dist/cjs/tools/receive.d.ts +13 -0
- package/dist/cjs/tools/receive.d.ts.map +1 -0
- package/dist/cjs/tools/receive.js +100 -0
- package/dist/cjs/tools/receive.js.map +1 -0
- package/dist/cjs/tools/register.d.ts +9 -0
- package/dist/cjs/tools/register.d.ts.map +1 -0
- package/dist/cjs/tools/register.js +36 -0
- package/dist/cjs/tools/register.js.map +1 -0
- package/dist/cjs/tools/schema.d.ts +18 -0
- package/dist/cjs/tools/schema.d.ts.map +1 -0
- package/dist/cjs/tools/schema.js +25 -0
- package/dist/cjs/tools/schema.js.map +1 -0
- package/dist/cjs/tools/send-to-wallet.d.ts +9 -0
- package/dist/cjs/tools/send-to-wallet.d.ts.map +1 -0
- package/dist/cjs/tools/send-to-wallet.js +60 -0
- package/dist/cjs/tools/send-to-wallet.js.map +1 -0
- package/dist/cjs/tools/send.d.ts +9 -0
- package/dist/cjs/tools/send.d.ts.map +1 -0
- package/dist/cjs/tools/send.js +68 -0
- package/dist/cjs/tools/send.js.map +1 -0
- package/dist/cjs/tools/status.d.ts +6 -0
- package/dist/cjs/tools/status.d.ts.map +1 -0
- package/dist/cjs/tools/status.js +39 -0
- package/dist/cjs/tools/status.js.map +1 -0
- package/dist/cjs/tools/sweep.d.ts +14 -0
- package/dist/cjs/tools/sweep.d.ts.map +1 -0
- package/dist/cjs/tools/sweep.js +119 -0
- package/dist/cjs/tools/sweep.js.map +1 -0
- package/dist/cjs/tools/x402-pay.d.ts +14 -0
- package/dist/cjs/tools/x402-pay.d.ts.map +1 -0
- package/dist/cjs/tools/x402-pay.js +78 -0
- package/dist/cjs/tools/x402-pay.js.map +1 -0
- package/dist/cjs/tools/x402-serve.d.ts +17 -0
- package/dist/cjs/tools/x402-serve.d.ts.map +1 -0
- package/dist/cjs/tools/x402-serve.js +133 -0
- package/dist/cjs/tools/x402-serve.js.map +1 -0
- package/dist/cjs/types.d.ts +66 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +6 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/auth.d.ts +41 -0
- package/dist/esm/auth.d.ts.map +1 -0
- package/dist/esm/auth.js +99 -0
- package/dist/esm/auth.js.map +1 -0
- package/dist/esm/bin/http.d.ts +7 -0
- package/dist/esm/bin/http.d.ts.map +1 -0
- package/dist/esm/bin/http.js +22 -0
- package/dist/esm/bin/http.js.map +1 -0
- package/dist/esm/bin/stdio.d.ts +9 -0
- package/dist/esm/bin/stdio.d.ts.map +1 -0
- package/dist/esm/bin/stdio.js +13 -0
- package/dist/esm/bin/stdio.js.map +1 -0
- package/dist/esm/config.d.ts +22 -0
- package/dist/esm/config.d.ts.map +1 -0
- package/dist/esm/config.js +175 -0
- package/dist/esm/config.js.map +1 -0
- package/dist/esm/constants.d.ts +29 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +32 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/errors.d.ts +43 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +61 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/http.d.ts +32 -0
- package/dist/esm/http.d.ts.map +1 -0
- package/dist/esm/http.js +177 -0
- package/dist/esm/http.js.map +1 -0
- package/dist/esm/index.d.ts +19 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/server.d.ts +14 -0
- package/dist/esm/server.d.ts.map +1 -0
- package/dist/esm/server.js +89 -0
- package/dist/esm/server.js.map +1 -0
- package/dist/esm/stdio.d.ts +9 -0
- package/dist/esm/stdio.d.ts.map +1 -0
- package/dist/esm/stdio.js +18 -0
- package/dist/esm/stdio.js.map +1 -0
- package/dist/esm/tools/balance.d.ts +9 -0
- package/dist/esm/tools/balance.d.ts.map +1 -0
- package/dist/esm/tools/balance.js +58 -0
- package/dist/esm/tools/balance.js.map +1 -0
- package/dist/esm/tools/index.d.ts +17 -0
- package/dist/esm/tools/index.d.ts.map +1 -0
- package/dist/esm/tools/index.js +28 -0
- package/dist/esm/tools/index.js.map +1 -0
- package/dist/esm/tools/receive.d.ts +13 -0
- package/dist/esm/tools/receive.d.ts.map +1 -0
- package/dist/esm/tools/receive.js +97 -0
- package/dist/esm/tools/receive.js.map +1 -0
- package/dist/esm/tools/register.d.ts +9 -0
- package/dist/esm/tools/register.d.ts.map +1 -0
- package/dist/esm/tools/register.js +33 -0
- package/dist/esm/tools/register.js.map +1 -0
- package/dist/esm/tools/schema.d.ts +18 -0
- package/dist/esm/tools/schema.d.ts.map +1 -0
- package/dist/esm/tools/schema.js +21 -0
- package/dist/esm/tools/schema.js.map +1 -0
- package/dist/esm/tools/send-to-wallet.d.ts +9 -0
- package/dist/esm/tools/send-to-wallet.d.ts.map +1 -0
- package/dist/esm/tools/send-to-wallet.js +57 -0
- package/dist/esm/tools/send-to-wallet.js.map +1 -0
- package/dist/esm/tools/send.d.ts +9 -0
- package/dist/esm/tools/send.d.ts.map +1 -0
- package/dist/esm/tools/send.js +65 -0
- package/dist/esm/tools/send.js.map +1 -0
- package/dist/esm/tools/status.d.ts +6 -0
- package/dist/esm/tools/status.d.ts.map +1 -0
- package/dist/esm/tools/status.js +36 -0
- package/dist/esm/tools/status.js.map +1 -0
- package/dist/esm/tools/sweep.d.ts +14 -0
- package/dist/esm/tools/sweep.d.ts.map +1 -0
- package/dist/esm/tools/sweep.js +116 -0
- package/dist/esm/tools/sweep.js.map +1 -0
- package/dist/esm/tools/x402-pay.d.ts +14 -0
- package/dist/esm/tools/x402-pay.d.ts.map +1 -0
- package/dist/esm/tools/x402-pay.js +75 -0
- package/dist/esm/tools/x402-pay.js.map +1 -0
- package/dist/esm/tools/x402-serve.d.ts +17 -0
- package/dist/esm/tools/x402-serve.d.ts.map +1 -0
- package/dist/esm/tools/x402-serve.js +130 -0
- package/dist/esm/tools/x402-serve.js.map +1 -0
- package/dist/esm/types.d.ts +66 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +5 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* shroud_balance — read ETH and (optionally) ERC-20 balance for a wallet.
|
|
4
|
+
*
|
|
5
|
+
* Defaults to the agent's operator wallet. Pass `address` to query a different
|
|
6
|
+
* one (e.g. a stealth address whose private key was just recovered).
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.shroudBalanceTool = void 0;
|
|
10
|
+
const zod_1 = require("zod");
|
|
11
|
+
const transport_1 = require("@shroud-fi/transport");
|
|
12
|
+
const errors_js_1 = require("../errors.js");
|
|
13
|
+
const schema_js_1 = require("./schema.js");
|
|
14
|
+
const ArgsSchema = zod_1.z
|
|
15
|
+
.object({
|
|
16
|
+
address: schema_js_1.AddressSchema.optional(),
|
|
17
|
+
token: schema_js_1.AddressSchema.optional(),
|
|
18
|
+
})
|
|
19
|
+
.strict();
|
|
20
|
+
exports.shroudBalanceTool = {
|
|
21
|
+
name: 'shroud_balance',
|
|
22
|
+
description: 'Read the ETH balance and (optionally) a single ERC-20 balance for a wallet. Defaults to the operator wallet. Returns wei-denominated strings.',
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
properties: {
|
|
27
|
+
address: { type: 'string', pattern: '^0x[0-9a-fA-F]{40}$' },
|
|
28
|
+
token: { type: 'string', pattern: '^0x[0-9a-fA-F]{40}$' },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
async handler(ctx, raw) {
|
|
32
|
+
const parsed = ArgsSchema.safeParse(raw ?? {});
|
|
33
|
+
if (!parsed.success) {
|
|
34
|
+
throw new errors_js_1.McpInvalidArgsError();
|
|
35
|
+
}
|
|
36
|
+
const target = (parsed.data.address ?? ctx.walletAddress);
|
|
37
|
+
if (target === undefined) {
|
|
38
|
+
throw new errors_js_1.McpInvalidArgsError();
|
|
39
|
+
}
|
|
40
|
+
const ethBal = await ctx.transport.publicClient.getBalance({
|
|
41
|
+
address: target,
|
|
42
|
+
});
|
|
43
|
+
const out = {
|
|
44
|
+
ok: true,
|
|
45
|
+
address: target,
|
|
46
|
+
ethWei: ethBal.toString(),
|
|
47
|
+
};
|
|
48
|
+
if (parsed.data.token !== undefined) {
|
|
49
|
+
const tokenBal = (await ctx.transport.publicClient.readContract({
|
|
50
|
+
address: parsed.data.token,
|
|
51
|
+
abi: transport_1.ERC20Abi,
|
|
52
|
+
functionName: 'balanceOf',
|
|
53
|
+
args: [target],
|
|
54
|
+
}));
|
|
55
|
+
out.token = parsed.data.token;
|
|
56
|
+
out.tokenBaseUnits = tokenBal.toString();
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=balance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance.js","sourceRoot":"","sources":["../../../src/tools/balance.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAAwB;AACxB,oDAAgD;AAEhD,4CAAmD;AACnD,2CAA4C;AAE5C,MAAM,UAAU,GAAG,OAAC;KACjB,MAAM,CAAC;IACN,OAAO,EAAE,yBAAa,CAAC,QAAQ,EAAE;IACjC,KAAK,EAAE,yBA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AI,CAAC,KAAsB;gBAC3C,GAAG,EAAE,oBAAQ;gBACb,YAAY,EAAE,WAAW;gBACzB,IAAI,EAAE,CAAC,MAAM,CAAC;aACf,CAAC,CAAW,CAAC;YACd,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAC9B,GAAG,CAAC,cAAc,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAC3C,CAAC;QACD,OAAO,GAAoB,CAAC;IAC9B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool registry. Add new tools here so both stdio + http transports pick them up.
|
|
3
|
+
*/
|
|
4
|
+
import type { McpTool } from '../types.js';
|
|
5
|
+
import { shroudRegisterTool } from './register.js';
|
|
6
|
+
import { shroudSendTool } from './send.js';
|
|
7
|
+
import { shroudSendToWalletTool } from './send-to-wallet.js';
|
|
8
|
+
import { shroudReceiveTool } from './receive.js';
|
|
9
|
+
import { shroudSweepTool } from './sweep.js';
|
|
10
|
+
import { shroudBalanceTool } from './balance.js';
|
|
11
|
+
import { shroudStatusTool } from './status.js';
|
|
12
|
+
import { shroudX402PayTool } from './x402-pay.js';
|
|
13
|
+
import { shroudX402ServeTool } from './x402-serve.js';
|
|
14
|
+
export declare const ALL_TOOLS: readonly McpTool[];
|
|
15
|
+
export declare function findTool(name: string): McpTool | undefined;
|
|
16
|
+
export { shroudRegisterTool, shroudSendTool, shroudSendToWalletTool, shroudReceiveTool, shroudSweepTool, shroudBalanceTool, shroudStatusTool, shroudX402PayTool, shroudX402ServeTool, };
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,SAAS,EAAE,SAAS,OAAO,EAUvC,CAAC;AAEF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE1D;AAED,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,GACpB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tool registry. Add new tools here so both stdio + http transports pick them up.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.shroudX402ServeTool = exports.shroudX402PayTool = exports.shroudStatusTool = exports.shroudBalanceTool = exports.shroudSweepTool = exports.shroudReceiveTool = exports.shroudSendToWalletTool = exports.shroudSendTool = exports.shroudRegisterTool = exports.ALL_TOOLS = void 0;
|
|
7
|
+
exports.findTool = findTool;
|
|
8
|
+
const register_js_1 = require("./register.js");
|
|
9
|
+
Object.defineProperty(exports, "shroudRegisterTool", { enumerable: true, get: function () { return register_js_1.shroudRegisterTool; } });
|
|
10
|
+
const send_js_1 = require("./send.js");
|
|
11
|
+
Object.defineProperty(exports, "shroudSendTool", { enumerable: true, get: function () { return send_js_1.shroudSendTool; } });
|
|
12
|
+
const send_to_wallet_js_1 = require("./send-to-wallet.js");
|
|
13
|
+
Object.defineProperty(exports, "shroudSendToWalletTool", { enumerable: true, get: function () { return send_to_wallet_js_1.shroudSendToWalletTool; } });
|
|
14
|
+
const receive_js_1 = require("./receive.js");
|
|
15
|
+
Object.defineProperty(exports, "shroudReceiveTool", { enumerable: true, get: function () { return receive_js_1.shroudReceiveTool; } });
|
|
16
|
+
const sweep_js_1 = require("./sweep.js");
|
|
17
|
+
Object.defineProperty(exports, "shroudSweepTool", { enumerable: true, get: function () { return sweep_js_1.shroudSweepTool; } });
|
|
18
|
+
const balance_js_1 = require("./balance.js");
|
|
19
|
+
Object.defineProperty(exports, "shroudBalanceTool", { enumerable: true, get: function () { return balance_js_1.shroudBalanceTool; } });
|
|
20
|
+
const status_js_1 = require("./status.js");
|
|
21
|
+
Object.defineProperty(exports, "shroudStatusTool", { enumerable: true, get: function () { return status_js_1.shroudStatusTool; } });
|
|
22
|
+
const x402_pay_js_1 = require("./x402-pay.js");
|
|
23
|
+
Object.defineProperty(exports, "shroudX402PayTool", { enumerable: true, get: function () { return x402_pay_js_1.shroudX402PayTool; } });
|
|
24
|
+
const x402_serve_js_1 = require("./x402-serve.js");
|
|
25
|
+
Object.defineProperty(exports, "shroudX402ServeTool", { enumerable: true, get: function () { return x402_serve_js_1.shroudX402ServeTool; } });
|
|
26
|
+
exports.ALL_TOOLS = [
|
|
27
|
+
register_js_1.shroudRegisterTool,
|
|
28
|
+
send_js_1.shroudSendTool,
|
|
29
|
+
send_to_wallet_js_1.shroudSendToWalletTool,
|
|
30
|
+
receive_js_1.shroudReceiveTool,
|
|
31
|
+
sweep_js_1.shroudSweepTool,
|
|
32
|
+
balance_js_1.shroudBalanceTool,
|
|
33
|
+
status_js_1.shroudStatusTool,
|
|
34
|
+
x402_pay_js_1.shroudX402PayTool,
|
|
35
|
+
x402_serve_js_1.shroudX402ServeTool,
|
|
36
|
+
];
|
|
37
|
+
function findTool(name) {
|
|
38
|
+
return exports.ALL_TOOLS.find((t) => t.name === name);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAyBH,4BAEC;AAxBD,+CAAmD;AA2BjD,mGA3BO,gCAAkB,OA2BP;AA1BpB,uCAA2C;AA2BzC,+FA3BO,wBAAc,OA2BP;AA1BhB,2DAA6D;AA2B3D,uGA3BO,0CAAsB,OA2BP;AA1BxB,6CAAiD;AA2B/C,kGA3BO,8BAAiB,OA2BP;AA1BnB,yCAA6C;AA2B3C,gGA3BO,0BAAe,OA2BP;AA1BjB,6CAAiD;AA2B/C,kGA3BO,8BAAiB,OA2BP;AA1BnB,2CAA+C;AA2B7C,iGA3BO,4BAAgB,OA2BP;AA1BlB,+CAAkD;AA2BhD,kGA3BO,+BAAiB,OA2BP;AA1BnB,mDAAsD;AA2BpD,oGA3BO,mCAAmB,OA2BP;AAzBR,QAAA,SAAS,GAAuB;IAC3C,gCAAkB;IAClB,wBAAc;IACd,0CAAsB;IACtB,8BAAiB;IACjB,0BAAe;IACf,8BAAiB;IACjB,4BAAgB;IAChB,+BAAiB;IACjB,mCAAmB;CACpB,CAAC;AAEF,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,iBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* shroud_receive — scan a block range for incoming stealth payments to the
|
|
3
|
+
* configured agent. Stateless: caller supplies fromBlock + toBlock; server
|
|
4
|
+
* returns every detection in that window.
|
|
5
|
+
*
|
|
6
|
+
* Privacy: stealthPrivateKey is exposed in the response because the caller is
|
|
7
|
+
* the same operator that holds the spending key in the server process — the
|
|
8
|
+
* key was derived from their own seed. The MCP transport must be local stdio
|
|
9
|
+
* or authenticated HTTP (EIP-191) to keep this safe. See HTTP transport gate.
|
|
10
|
+
*/
|
|
11
|
+
import type { McpTool } from '../types.js';
|
|
12
|
+
export declare const shroudReceiveTool: McpTool;
|
|
13
|
+
//# sourceMappingURL=receive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receive.d.ts","sourceRoot":"","sources":["../../../src/tools/receive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AAc1D,eAAO,MAAM,iBAAiB,EAAE,OA4E/B,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* shroud_receive — scan a block range for incoming stealth payments to the
|
|
4
|
+
* configured agent. Stateless: caller supplies fromBlock + toBlock; server
|
|
5
|
+
* returns every detection in that window.
|
|
6
|
+
*
|
|
7
|
+
* Privacy: stealthPrivateKey is exposed in the response because the caller is
|
|
8
|
+
* the same operator that holds the spending key in the server process — the
|
|
9
|
+
* key was derived from their own seed. The MCP transport must be local stdio
|
|
10
|
+
* or authenticated HTTP (EIP-191) to keep this safe. See HTTP transport gate.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.shroudReceiveTool = void 0;
|
|
14
|
+
const zod_1 = require("zod");
|
|
15
|
+
const scanning_1 = require("@shroud-fi/scanning");
|
|
16
|
+
const errors_js_1 = require("../errors.js");
|
|
17
|
+
const schema_js_1 = require("./schema.js");
|
|
18
|
+
const ArgsSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
fromBlock: schema_js_1.Uint256StringSchema,
|
|
21
|
+
toBlock: zod_1.z.union([schema_js_1.Uint256StringSchema, zod_1.z.literal('latest')]).optional(),
|
|
22
|
+
finality: zod_1.z.enum(['unsafe', 'safe', 'finalized']).optional(),
|
|
23
|
+
/** Hard cap on detections returned in a single call. Defaults to 100. */
|
|
24
|
+
limit: zod_1.z.number().int().positive().max(1000).optional(),
|
|
25
|
+
})
|
|
26
|
+
.strict();
|
|
27
|
+
exports.shroudReceiveTool = {
|
|
28
|
+
name: 'shroud_receive',
|
|
29
|
+
description: 'Scan a block range for incoming stealth payments to the agent. Returns the list of detections (each includes stealthAddress, ephemeralPubKey, stealthPrivateKey, txHash, blockNumber). Stateless: caller drives the cursor by passing fromBlock + toBlock.',
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
additionalProperties: false,
|
|
33
|
+
properties: {
|
|
34
|
+
fromBlock: { type: 'string', pattern: '^\\d+$' },
|
|
35
|
+
toBlock: { oneOf: [{ type: 'string', pattern: '^\\d+$' }, { const: 'latest' }] },
|
|
36
|
+
finality: { type: 'string', enum: ['unsafe', 'safe', 'finalized'] },
|
|
37
|
+
limit: { type: 'integer', minimum: 1, maximum: 1000 },
|
|
38
|
+
},
|
|
39
|
+
required: ['fromBlock'],
|
|
40
|
+
},
|
|
41
|
+
async handler(ctx, raw) {
|
|
42
|
+
const parsed = ArgsSchema.safeParse(raw);
|
|
43
|
+
if (!parsed.success) {
|
|
44
|
+
throw new errors_js_1.McpInvalidArgsError();
|
|
45
|
+
}
|
|
46
|
+
const { fromBlock, toBlock, finality, limit } = parsed.data;
|
|
47
|
+
const fromB = (0, schema_js_1.toBigInt)(fromBlock);
|
|
48
|
+
let toB;
|
|
49
|
+
if (toBlock === undefined || toBlock === 'latest') {
|
|
50
|
+
const tag = finality === 'finalized'
|
|
51
|
+
? 'finalized'
|
|
52
|
+
: finality === 'safe'
|
|
53
|
+
? 'safe'
|
|
54
|
+
: 'latest';
|
|
55
|
+
const block = await ctx.transport.publicClient.getBlock({ blockTag: tag });
|
|
56
|
+
toB = block.number ?? fromB;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
toB = (0, schema_js_1.toBigInt)(toBlock);
|
|
60
|
+
}
|
|
61
|
+
if (toB < fromB) {
|
|
62
|
+
return { ok: true, fromBlock: fromB.toString(), toBlock: toB.toString(), detections: [] };
|
|
63
|
+
}
|
|
64
|
+
const scanner = (0, scanning_1.createScanner)({
|
|
65
|
+
transport: ctx.transport,
|
|
66
|
+
scanningKey: ctx.agent.identity.keys.scanningKey,
|
|
67
|
+
spendingKey: ctx.agent.identity.keys.spendingKey,
|
|
68
|
+
startBlock: fromB,
|
|
69
|
+
...(finality !== undefined ? { finality } : {}),
|
|
70
|
+
});
|
|
71
|
+
const out = [];
|
|
72
|
+
const cap = limit ?? 100;
|
|
73
|
+
try {
|
|
74
|
+
for await (const d of scanner.scanRange(fromB, toB)) {
|
|
75
|
+
out.push({
|
|
76
|
+
stealthAddress: d.stealthAddress,
|
|
77
|
+
ephemeralPubKey: d.ephemeralPubKey,
|
|
78
|
+
stealthPrivateKey: d.stealthPrivateKey,
|
|
79
|
+
txHash: d.txHash,
|
|
80
|
+
blockNumber: d.blockNumber.toString(),
|
|
81
|
+
blockHash: d.blockHash,
|
|
82
|
+
logIndex: d.logIndex,
|
|
83
|
+
finality: d.finality,
|
|
84
|
+
});
|
|
85
|
+
if (out.length >= cap)
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
scanner.close();
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
ok: true,
|
|
94
|
+
fromBlock: fromB.toString(),
|
|
95
|
+
toBlock: toB.toString(),
|
|
96
|
+
detections: out,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=receive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/tools/receive.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,6BA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idempotent. Returns `{ registered: false }` if the wallet already has an
|
|
5
|
+
* on-chain entry.
|
|
6
|
+
*/
|
|
7
|
+
import type { McpTool } from '../types.js';
|
|
8
|
+
export declare const shroudRegisterTool: McpTool;
|
|
9
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/tools/register.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AAK1D,eAAO,MAAM,kBAAkB,EAAE,OAuBhC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* shroud_register — publish the agent's stealth meta-address into ERC-6538.
|
|
4
|
+
*
|
|
5
|
+
* Idempotent. Returns `{ registered: false }` if the wallet already has an
|
|
6
|
+
* on-chain entry.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.shroudRegisterTool = void 0;
|
|
10
|
+
const zod_1 = require("zod");
|
|
11
|
+
const errors_js_1 = require("../errors.js");
|
|
12
|
+
const ArgsSchema = zod_1.z.object({}).strict();
|
|
13
|
+
exports.shroudRegisterTool = {
|
|
14
|
+
name: 'shroud_register',
|
|
15
|
+
description: 'Publish the agent stealth meta-address into ERC-6538. Idempotent — no-op when already registered. Returns the registration tx hash on first call.',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
additionalProperties: false,
|
|
19
|
+
properties: {},
|
|
20
|
+
required: [],
|
|
21
|
+
},
|
|
22
|
+
async handler(ctx, raw) {
|
|
23
|
+
const parsed = ArgsSchema.safeParse(raw ?? {});
|
|
24
|
+
if (!parsed.success) {
|
|
25
|
+
throw new errors_js_1.McpInvalidArgsError();
|
|
26
|
+
}
|
|
27
|
+
const result = await ctx.agent.ensureRegistered();
|
|
28
|
+
return {
|
|
29
|
+
ok: true,
|
|
30
|
+
registered: result.registered,
|
|
31
|
+
...(result.txHash !== undefined ? { txHash: result.txHash } : {}),
|
|
32
|
+
metaAddress: ctx.agent.metaAddressEncoded,
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/tools/register.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAAwB;AAExB,4CAAmD;AAEnD,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAE5B,QAAA,kBAAkB,GAAY;IACzC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,mJAAmJ;IACrJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG;QACpB,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,+BAAmB,EAAE,CAAC;QAClC,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAClD,OAAO;YACL,EAAE,EAAE,IAAI;YACR,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,kBAAkB;SAC1C,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared zod schemas + helpers for tool argument validation.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/** 0x-prefixed lowercase EVM address (case preserved by viem checks). */
|
|
6
|
+
export declare const AddressSchema: z.ZodString;
|
|
7
|
+
/** Asset descriptor used by send tools: 'ETH' or token address. */
|
|
8
|
+
export declare const AssetSchema: z.ZodUnion<[z.ZodLiteral<"ETH">, z.ZodObject<{
|
|
9
|
+
token: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
token: string;
|
|
12
|
+
}, {
|
|
13
|
+
token: string;
|
|
14
|
+
}>]>;
|
|
15
|
+
/** Positive integer string that parses to bigint. */
|
|
16
|
+
export declare const Uint256StringSchema: z.ZodString;
|
|
17
|
+
export declare function toBigInt(v: string): bigint;
|
|
18
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/tools/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yEAAyE;AACzE,eAAO,MAAM,aAAa,aAEyC,CAAC;AAEpE,mEAAmE;AACnE,eAAO,MAAM,WAAW;;;;;;IAGtB,CAAC;AAEH,qDAAqD;AACrD,eAAO,MAAM,mBAAmB,aAEc,CAAC;AAE/C,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared zod schemas + helpers for tool argument validation.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Uint256StringSchema = exports.AssetSchema = exports.AddressSchema = void 0;
|
|
7
|
+
exports.toBigInt = toBigInt;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
/** 0x-prefixed lowercase EVM address (case preserved by viem checks). */
|
|
10
|
+
exports.AddressSchema = zod_1.z
|
|
11
|
+
.string()
|
|
12
|
+
.regex(/^0x[0-9a-fA-F]{40}$/, '0x-prefixed 20-byte hex required');
|
|
13
|
+
/** Asset descriptor used by send tools: 'ETH' or token address. */
|
|
14
|
+
exports.AssetSchema = zod_1.z.union([
|
|
15
|
+
zod_1.z.literal('ETH'),
|
|
16
|
+
zod_1.z.object({ token: exports.AddressSchema }),
|
|
17
|
+
]);
|
|
18
|
+
/** Positive integer string that parses to bigint. */
|
|
19
|
+
exports.Uint256StringSchema = zod_1.z
|
|
20
|
+
.string()
|
|
21
|
+
.regex(/^\d+$/, 'positive integer required');
|
|
22
|
+
function toBigInt(v) {
|
|
23
|
+
return BigInt(v);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/tools/schema.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAoBH,4BAEC;AApBD,6BAAwB;AAExB,yEAAyE;AAC5D,QAAA,aAAa,GAAG,OAAC;KAC3B,MAAM,EAAE;KACR,KAAK,CAAC,qBAAqB,EAAE,kCAAkC,CAAC,CAAC;AAEpE,mEAAmE;AACtD,QAAA,WAAW,GAAG,OAAC,CAAC,KAAK,CAAC;IACjC,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAChB,OAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,qBAAa,EAAE,CAAC;CACnC,CAAC,CAAC;AAEH,qDAAqD;AACxC,QAAA,mBAAmB,GAAG,OAAC;KACjC,MAAM,EAAE;KACR,KAAK,CAAC,OAAO,EAAE,2BAA2B,CAAC,CAAC;AAE/C,SAAgB,QAAQ,CAAC,CAAS;IAChC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* shroud_send_to_wallet — pay a recipient by their plain EVM wallet address.
|
|
3
|
+
*
|
|
4
|
+
* The SDK does the ERC-6538 lookup + meta-address decode + stealth derivation.
|
|
5
|
+
* Caller never sees a meta-address.
|
|
6
|
+
*/
|
|
7
|
+
import type { McpTool } from '../types.js';
|
|
8
|
+
export declare const shroudSendToWalletTool: McpTool;
|
|
9
|
+
//# sourceMappingURL=send-to-wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-to-wallet.d.ts","sourceRoot":"","sources":["../../../src/tools/send-to-wallet.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AAiB1D,eAAO,MAAM,sBAAsB,EAAE,OA4CpC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* shroud_send_to_wallet — pay a recipient by their plain EVM wallet address.
|
|
4
|
+
*
|
|
5
|
+
* The SDK does the ERC-6538 lookup + meta-address decode + stealth derivation.
|
|
6
|
+
* Caller never sees a meta-address.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.shroudSendToWalletTool = void 0;
|
|
10
|
+
const zod_1 = require("zod");
|
|
11
|
+
const errors_js_1 = require("../errors.js");
|
|
12
|
+
const schema_js_1 = require("./schema.js");
|
|
13
|
+
const ArgsSchema = zod_1.z
|
|
14
|
+
.object({
|
|
15
|
+
recipient: schema_js_1.AddressSchema,
|
|
16
|
+
asset: schema_js_1.AssetSchema,
|
|
17
|
+
amount: schema_js_1.Uint256StringSchema,
|
|
18
|
+
})
|
|
19
|
+
.strict();
|
|
20
|
+
exports.shroudSendToWalletTool = {
|
|
21
|
+
name: 'shroud_send_to_wallet',
|
|
22
|
+
description: 'Send ETH or an ERC-20 token to a recipient identified by their plain wallet address. The SDK looks up their ERC-6538 stealth meta-address and derives a one-time stealth address automatically. Throws RecipientNotOnboardedError if the wallet has not registered.',
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
properties: {
|
|
27
|
+
recipient: { type: 'string', pattern: '^0x[0-9a-fA-F]{40}$' },
|
|
28
|
+
asset: {
|
|
29
|
+
oneOf: [
|
|
30
|
+
{ type: 'string', enum: ['ETH'] },
|
|
31
|
+
{
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: { token: { type: 'string', pattern: '^0x[0-9a-fA-F]{40}$' } },
|
|
34
|
+
required: ['token'],
|
|
35
|
+
additionalProperties: false,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
amount: { type: 'string', pattern: '^\\d+$' },
|
|
40
|
+
},
|
|
41
|
+
required: ['recipient', 'asset', 'amount'],
|
|
42
|
+
},
|
|
43
|
+
async handler(ctx, raw) {
|
|
44
|
+
const parsed = ArgsSchema.safeParse(raw);
|
|
45
|
+
if (!parsed.success) {
|
|
46
|
+
throw new errors_js_1.McpInvalidArgsError();
|
|
47
|
+
}
|
|
48
|
+
const { recipient, asset, amount } = parsed.data;
|
|
49
|
+
const assetArg = asset === 'ETH' ? 'ETH' : { token: asset.token };
|
|
50
|
+
const receipt = await ctx.agent.sendToWallet(recipient, assetArg, (0, schema_js_1.toBigInt)(amount));
|
|
51
|
+
return {
|
|
52
|
+
ok: true,
|
|
53
|
+
txHash: receipt.txHash,
|
|
54
|
+
stealthAddress: receipt.stealthAddress,
|
|
55
|
+
ephemeralPubKey: receipt.ephemeralPubKey,
|
|
56
|
+
viewTag: receipt.viewTag,
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=send-to-wallet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;QACjD,MAAM,QAAQ,GAAG,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAsB,EAAE,CAAC;QACnF,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,YAAY,CAC1C,SAA0B,EAC1B,QAAQ,EACR,IAAA,oBAAQ,EAAC,MAAM,CAAC,CACjB,CAAC;QACF,OAAO;YACL,EAAE,EAAE,IAAI;YACR,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* shroud_send — send to a stealth meta-address (the privacy-native form).
|
|
3
|
+
*
|
|
4
|
+
* Uses agent.send (ETH) or agent.sendERC20 (token). Recipient is the encoded
|
|
5
|
+
* meta-address string `st:base:0x…`.
|
|
6
|
+
*/
|
|
7
|
+
import type { McpTool } from '../types.js';
|
|
8
|
+
export declare const shroudSendTool: McpTool;
|
|
9
|
+
//# sourceMappingURL=send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/tools/send.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AAY1D,eAAO,MAAM,cAAc,EAAE,OAoD5B,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* shroud_send — send to a stealth meta-address (the privacy-native form).
|
|
4
|
+
*
|
|
5
|
+
* Uses agent.send (ETH) or agent.sendERC20 (token). Recipient is the encoded
|
|
6
|
+
* meta-address string `st:base:0x…`.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.shroudSendTool = void 0;
|
|
10
|
+
const zod_1 = require("zod");
|
|
11
|
+
const errors_js_1 = require("../errors.js");
|
|
12
|
+
const schema_js_1 = require("./schema.js");
|
|
13
|
+
const ArgsSchema = zod_1.z
|
|
14
|
+
.object({
|
|
15
|
+
to: zod_1.z.string().min(1),
|
|
16
|
+
asset: schema_js_1.AssetSchema,
|
|
17
|
+
amount: schema_js_1.Uint256StringSchema,
|
|
18
|
+
})
|
|
19
|
+
.strict();
|
|
20
|
+
exports.shroudSendTool = {
|
|
21
|
+
name: 'shroud_send',
|
|
22
|
+
description: 'Send ETH or an ERC-20 token to a stealth meta-address. `to` is the encoded `st:base:0x…` string. `asset` is "ETH" or { token: 0x… }. `amount` is a base-units string.',
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
properties: {
|
|
27
|
+
to: { type: 'string', description: 'Encoded stealth meta-address' },
|
|
28
|
+
asset: {
|
|
29
|
+
oneOf: [
|
|
30
|
+
{ type: 'string', enum: ['ETH'] },
|
|
31
|
+
{
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: { token: { type: 'string', pattern: '^0x[0-9a-fA-F]{40}$' } },
|
|
34
|
+
required: ['token'],
|
|
35
|
+
additionalProperties: false,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
amount: { type: 'string', pattern: '^\\d+$', description: 'Base-units integer' },
|
|
40
|
+
},
|
|
41
|
+
required: ['to', 'asset', 'amount'],
|
|
42
|
+
},
|
|
43
|
+
async handler(ctx, raw) {
|
|
44
|
+
const parsed = ArgsSchema.safeParse(raw);
|
|
45
|
+
if (!parsed.success) {
|
|
46
|
+
throw new errors_js_1.McpInvalidArgsError();
|
|
47
|
+
}
|
|
48
|
+
const { to, asset, amount } = parsed.data;
|
|
49
|
+
const amountWei = (0, schema_js_1.toBigInt)(amount);
|
|
50
|
+
let receipt;
|
|
51
|
+
if (asset === 'ETH') {
|
|
52
|
+
receipt = await ctx.agent.send(to, amountWei);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// Validate the token address shape before dispatch.
|
|
56
|
+
schema_js_1.AddressSchema.parse(asset.token);
|
|
57
|
+
receipt = await ctx.agent.sendERC20(to, asset.token, amountWei);
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
ok: true,
|
|
61
|
+
txHash: receipt.txHash,
|
|
62
|
+
stealthAddress: receipt.stealthAddress,
|
|
63
|
+
ephemeralPubKey: receipt.ephemeralPubKey,
|
|
64
|
+
viewTag: receipt.viewTag,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/tools/send.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAAwB;AAExB,4CAAmD;AACnD,2CAAwF;AAExF,MAAM,UAAU,GAAG,OAAC;KACjB,MAAM,CAAC;IACN,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,KAAK,EAAE,uBAAW;IAClB,MAAM,EAAE,+BAAmB;CAC5B,CAAC;KACD,MAAM,EAAE,CAAC;AAEC,QAAA,cAAc,GAAY;IACrC,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,uKAAuK;IACzK,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,UAAU,EAAE;YACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;YACnE,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,EAAE,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MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/tools/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AAK1D,eAAO,MAAM,gBAAgB,EAAE,OA6B9B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* shroud_status — read-only snapshot of agent + chain + on-chain registration.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.shroudStatusTool = void 0;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const errors_js_1 = require("../errors.js");
|
|
9
|
+
const ArgsSchema = zod_1.z.object({}).strict();
|
|
10
|
+
exports.shroudStatusTool = {
|
|
11
|
+
name: 'shroud_status',
|
|
12
|
+
description: 'Snapshot of the running agent: operator wallet, meta-address, chain id, current block, on-chain registration state, and stealth contract address.',
|
|
13
|
+
inputSchema: {
|
|
14
|
+
type: 'object',
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
properties: {},
|
|
17
|
+
required: [],
|
|
18
|
+
},
|
|
19
|
+
async handler(ctx, raw) {
|
|
20
|
+
const parsed = ArgsSchema.safeParse(raw ?? {});
|
|
21
|
+
if (!parsed.success) {
|
|
22
|
+
throw new errors_js_1.McpInvalidArgsError();
|
|
23
|
+
}
|
|
24
|
+
const latest = await ctx.transport.publicClient.getBlock({
|
|
25
|
+
blockTag: 'latest',
|
|
26
|
+
});
|
|
27
|
+
const registered = await ctx.agent.isRegistered();
|
|
28
|
+
return {
|
|
29
|
+
ok: true,
|
|
30
|
+
chainId: ctx.chainId,
|
|
31
|
+
walletAddress: ctx.walletAddress ?? null,
|
|
32
|
+
metaAddress: ctx.agent.metaAddressEncoded,
|
|
33
|
+
stealthContract: ctx.agent.stealthContract,
|
|
34
|
+
latestBlock: (latest.number ?? 0n).toString(),
|
|
35
|
+
registered,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/tools/status.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,6BAAwB;AAExB,4CAAmD;AAEnD,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAE5B,QAAA,gBAAgB,GAAY;IACvC,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,mJAAmJ;IACrJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG;QACpB,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,+BAAmB,EAAE,CAAC;QAClC,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC;YACvD,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QAClD,OAAO;YACL,EAAE,EAAE,IAAI;YACR,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,aAAa,EAAE,GAAG,CAAC,aAAa,IAAI,IAAI;YACxC,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,kBAAkB;YACzC,eAAe,EAAE,GAAG,CAAC,KAAK,CAAC,eAAe;YAC1C,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE;YAC7C,UAAU;SACX,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* shroud_sweep — sweep a previously-detected stealth address to a destination.
|
|
3
|
+
*
|
|
4
|
+
* Caller passes the detection bundle returned by shroud_receive (stealth
|
|
5
|
+
* address + stealth private key + ephemeral pub key + tx coords). We
|
|
6
|
+
* reconstruct a minimal DetectedPayment and dispatch to agent.sweep.
|
|
7
|
+
*
|
|
8
|
+
* Optional flags:
|
|
9
|
+
* - viaRelayer + token → Gelato ERC-20 gasless sweep
|
|
10
|
+
* - viaRelayer (ETH) → EIP-7702 ETH gasless sweep (requires selfHostEndpoint)
|
|
11
|
+
*/
|
|
12
|
+
import type { McpTool } from '../types.js';
|
|
13
|
+
export declare const shroudSweepTool: McpTool;
|
|
14
|
+
//# sourceMappingURL=sweep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweep.d.ts","sourceRoot":"","sources":["../../../src/tools/sweep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AA0B1D,eAAO,MAAM,eAAe,EAAE,OAoF7B,CAAC"}
|