cascrow-mcp 1.1.2 → 1.1.4
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/index.js +38 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -155,6 +155,10 @@ const TOOLS = [
|
|
|
155
155
|
type: "number",
|
|
156
156
|
description: "Days from now until deadline (e.g. 7)",
|
|
157
157
|
},
|
|
158
|
+
amountUSD: {
|
|
159
|
+
type: "number",
|
|
160
|
+
description: "Optional RLUSD amount to lock in escrow (e.g. 1.0). Omit or set to 0 for verification-only.",
|
|
161
|
+
},
|
|
158
162
|
},
|
|
159
163
|
},
|
|
160
164
|
},
|
|
@@ -175,6 +179,24 @@ const TOOLS = [
|
|
|
175
179
|
},
|
|
176
180
|
},
|
|
177
181
|
},
|
|
182
|
+
{
|
|
183
|
+
name: "cascrow_escrow_fund",
|
|
184
|
+
description:
|
|
185
|
+
"Fund a milestone with REAL on-chain RLUSD escrow using the agent's own EVM private key. " +
|
|
186
|
+
"This does a real approve + fundMilestone transaction on the XRPL EVM Sidechain — " +
|
|
187
|
+
"funds are locked in the smart contract and released automatically after AI verification. " +
|
|
188
|
+
"Use this instead of cascrow_fund_milestone when you want real escrow (not just verification).",
|
|
189
|
+
inputSchema: {
|
|
190
|
+
type: "object",
|
|
191
|
+
required: ["contractId", "agentPrivateKey", "amountUSD"],
|
|
192
|
+
properties: {
|
|
193
|
+
contractId: { type: "string", description: "The contract ID to fund" },
|
|
194
|
+
agentPrivateKey: { type: "string", description: "The agent's EVM private key (hex, 0x-prefixed). The agent's wallet must hold enough RLUSD." },
|
|
195
|
+
amountUSD: { type: "number", description: "Amount in USD to lock in escrow (e.g. 1.0)" },
|
|
196
|
+
milestoneId: { type: "string", description: "Optional specific milestone ID. If omitted, funds the first available milestone." },
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
},
|
|
178
200
|
{
|
|
179
201
|
name: "cascrow_submit_proof",
|
|
180
202
|
description:
|
|
@@ -291,7 +313,7 @@ async function handleCreateContract({ milestones }) {
|
|
|
291
313
|
const payload = {
|
|
292
314
|
milestones: milestones.map((m) => ({
|
|
293
315
|
title: `${m.title} — ${m.description}`,
|
|
294
|
-
amountUSD:
|
|
316
|
+
amountUSD: m.amountUSD ?? 0,
|
|
295
317
|
cancelAfter: deadline(m.deadlineDays ?? 7),
|
|
296
318
|
})),
|
|
297
319
|
};
|
|
@@ -319,6 +341,18 @@ async function handleFundMilestone({ contractId, milestoneId }) {
|
|
|
319
341
|
};
|
|
320
342
|
}
|
|
321
343
|
|
|
344
|
+
async function handleEscrowFund({ contractId, agentPrivateKey, amountUSD, milestoneId }) {
|
|
345
|
+
const data = await apiPost("/api/agent/escrow-fund", { contractId, agentPrivateKey, amountUSD, milestoneId });
|
|
346
|
+
return {
|
|
347
|
+
milestoneId: data.milestoneId,
|
|
348
|
+
contractId: data.contractId,
|
|
349
|
+
txHash: data.txHash,
|
|
350
|
+
amountUSD: data.amountUSD,
|
|
351
|
+
status: data.status,
|
|
352
|
+
message: `✅ Real escrow funded on-chain. ${data.amountUSD} RLUSD locked in smart contract. TX: ${data.txHash}`,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
322
356
|
async function handleSubmitProof({ milestoneId, proof, filename }) {
|
|
323
357
|
const data = await uploadProof(
|
|
324
358
|
milestoneId,
|
|
@@ -434,6 +468,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
434
468
|
case "cascrow_fund_milestone":
|
|
435
469
|
result = await handleFundMilestone(args);
|
|
436
470
|
break;
|
|
471
|
+
case "cascrow_escrow_fund":
|
|
472
|
+
result = await handleEscrowFund(args);
|
|
473
|
+
break;
|
|
437
474
|
case "cascrow_submit_proof":
|
|
438
475
|
result = await handleSubmitProof(args);
|
|
439
476
|
break;
|