@arcisprotocol/mcp 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-742DILRU.js → chunk-QTW7SBOQ.js} +15 -4
- package/dist/index.js +2 -4
- package/dist/remote.js +2 -4
- package/dist/server.js +1 -6
- package/package.json +1 -1
|
@@ -29,6 +29,8 @@ var VAULT_ABI = [
|
|
|
29
29
|
{ name: "exchangeRate", type: "function", inputs: [], outputs: [{ name: "", type: "uint256" }], stateMutability: "view" },
|
|
30
30
|
{ name: "depositCap", type: "function", inputs: [], outputs: [{ name: "", type: "uint256" }], stateMutability: "view" },
|
|
31
31
|
{ name: "remainingCapacity", type: "function", inputs: [], outputs: [{ name: "", type: "uint256" }], stateMutability: "view" },
|
|
32
|
+
{ name: "asset", type: "function", inputs: [], outputs: [{ name: "", type: "address" }], stateMutability: "view" },
|
|
33
|
+
{ name: "maxDeposit", type: "function", inputs: [{ name: "agent", type: "address" }], outputs: [{ name: "", type: "uint256" }], stateMutability: "view" },
|
|
32
34
|
{ name: "reserveBalance", type: "function", inputs: [], outputs: [{ name: "", type: "uint256" }], stateMutability: "view" },
|
|
33
35
|
{ name: "deployedBalance", type: "function", inputs: [], outputs: [{ name: "", type: "uint256" }], stateMutability: "view" },
|
|
34
36
|
{ name: "paused", type: "function", inputs: [], outputs: [{ name: "", type: "bool" }], stateMutability: "view" },
|
|
@@ -53,6 +55,15 @@ var fmtRate = (raw) => {
|
|
|
53
55
|
const n = Number(raw) / 1e18;
|
|
54
56
|
return n > 1e3 || n < 1e-4 ? "1.000000" : n.toFixed(6);
|
|
55
57
|
};
|
|
58
|
+
var writeRateLimit = /* @__PURE__ */ new Map();
|
|
59
|
+
var WRITE_COOLDOWN_MS = 6e4;
|
|
60
|
+
function checkRateLimit(key) {
|
|
61
|
+
const last = writeRateLimit.get(key) || 0;
|
|
62
|
+
const remaining = WRITE_COOLDOWN_MS - (Date.now() - last);
|
|
63
|
+
if (remaining > 0) return `Rate limited. Try again in ${Math.ceil(remaining / 1e3)}s.`;
|
|
64
|
+
writeRateLimit.set(key, Date.now());
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
56
67
|
var server = new MCPServer({
|
|
57
68
|
name: "arcis-protocol",
|
|
58
69
|
title: "Arcis Protocol",
|
|
@@ -264,6 +275,8 @@ server.tool(
|
|
|
264
275
|
},
|
|
265
276
|
async ({ amount, private_key }) => {
|
|
266
277
|
try {
|
|
278
|
+
const rateErr = checkRateLimit(private_key.slice(0, 10));
|
|
279
|
+
if (rateErr) return error(rateErr);
|
|
267
280
|
const amountRaw = BigInt(Math.floor(amount * 1e6));
|
|
268
281
|
const account = privateKeyToAccount(private_key);
|
|
269
282
|
const wallet = createWalletClient({ chain: baseSepolia, transport: http(), account });
|
|
@@ -319,6 +332,8 @@ server.tool(
|
|
|
319
332
|
},
|
|
320
333
|
async ({ shares, private_key, withdraw_all }) => {
|
|
321
334
|
try {
|
|
335
|
+
const rateErr = checkRateLimit(private_key.slice(0, 10));
|
|
336
|
+
if (rateErr) return error(rateErr);
|
|
322
337
|
const account = privateKeyToAccount(private_key);
|
|
323
338
|
const wallet = createWalletClient({ chain: baseSepolia, transport: http(), account });
|
|
324
339
|
let sharesRaw;
|
|
@@ -389,7 +404,3 @@ Three functions. Any agent framework.
|
|
|
389
404
|
- X: https://x.com/ArcisProtocol
|
|
390
405
|
`)
|
|
391
406
|
);
|
|
392
|
-
|
|
393
|
-
export {
|
|
394
|
-
server
|
|
395
|
-
};
|
package/dist/index.js
CHANGED
package/dist/remote.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
server
|
|
3
|
-
} from "./chunk-742DILRU.js";
|
|
1
|
+
import "./chunk-QTW7SBOQ.js";
|
|
4
2
|
|
|
5
3
|
// src/remote.ts
|
|
6
4
|
var PORT = parseInt(process.env.PORT || "3001");
|
|
7
|
-
|
|
5
|
+
(void 0).listen(PORT);
|
|
8
6
|
console.log(`Arcis MCP Server listening on http://localhost:${PORT}/mcp`);
|
package/dist/server.js
CHANGED