@escro/mcp 0.1.5 → 0.1.6
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/env.cjs +2 -1
- package/dist/env.cjs.map +1 -1
- package/dist/index.cjs +304 -15
- package/dist/index.cjs.map +1 -1
- package/dist/server.cjs +304 -15
- package/dist/server.cjs.map +1 -1
- package/dist/tools.cjs +24 -3
- package/dist/tools.cjs.map +1 -1
- package/package.json +3 -3
- package/types/server.d.ts +1 -1
- package/types/tools.d.ts +6 -1
package/dist/tools.cjs
CHANGED
|
@@ -3401,6 +3401,7 @@ function ownedAccount(at, owner, data, programId) {
|
|
|
3401
3401
|
throw err;
|
|
3402
3402
|
}
|
|
3403
3403
|
}
|
|
3404
|
+
var U64_MAX = 2n ** 64n - 1n;
|
|
3404
3405
|
function readAccount(address, owner, data, programId, cluster) {
|
|
3405
3406
|
const at = address.toBase58();
|
|
3406
3407
|
const decoded2 = ownedAccount(at, owner, data, programId);
|
|
@@ -4686,7 +4687,7 @@ function sha256Hex8(content) {
|
|
|
4686
4687
|
return (0, import_crypto2.createHash)("sha256").update(content).digest("hex");
|
|
4687
4688
|
}
|
|
4688
4689
|
var ZKML_DEMO_MODEL_COMMITMENT = sha256Hex8("zkml-demo-classifier-v1");
|
|
4689
|
-
var
|
|
4690
|
+
var U64_MAX2 = 2n ** 64n - 1n;
|
|
4690
4691
|
var ED25519_L = 2n ** 252n + 27742317777372353535851937790883648493n;
|
|
4691
4692
|
|
|
4692
4693
|
// ../shared/dist/index.js
|
|
@@ -4845,8 +4846,20 @@ var createEscrowSchema = {
|
|
|
4845
4846
|
"An https: link where the buyer serves the TaskSpec, for the worker to read and check against the escrow's spec hash. Public: every escrow read serves it."
|
|
4846
4847
|
)
|
|
4847
4848
|
};
|
|
4849
|
+
var acceptedRow = {
|
|
4850
|
+
maker: import_zod.z.string().superRefine(refinePublicKey).describe("The row's maker, the buyer's wallet"),
|
|
4851
|
+
amount: import_zod.z.string().regex(/^[1-9][0-9]{0,19}$/, "amount must be the row's micro-USDC amount, a decimal string").describe("The row's amount, micro-USDC as a decimal string"),
|
|
4852
|
+
taskSpecHash: import_zod.z.string().regex(
|
|
4853
|
+
/^(?:ipfs:\/\/)?[0-9a-f]{64}$/,
|
|
4854
|
+
"taskSpecHash must be the row's 64-hex hash, bare or ipfs://"
|
|
4855
|
+
).describe("The row's taskSpecHash"),
|
|
4856
|
+
deadline: import_zod.z.number().int().positive().describe("The row's deadline, Unix seconds")
|
|
4857
|
+
};
|
|
4848
4858
|
var claimTaskSchema = {
|
|
4849
|
-
address: import_zod.z.string().superRefine(refinePublicKey).describe("Base-58 escrow PDA address")
|
|
4859
|
+
address: import_zod.z.string().superRefine(refinePublicKey).describe("Base-58 escrow PDA address"),
|
|
4860
|
+
accepted: import_zod.z.object(acceptedRow).optional().describe(
|
|
4861
|
+
"The maker, amount, taskSpecHash and deadline of the escrow as you read it; the claim is refused if the escrow is not that one"
|
|
4862
|
+
)
|
|
4850
4863
|
};
|
|
4851
4864
|
var submitDeliverableSchema = {
|
|
4852
4865
|
address: import_zod.z.string().superRefine(refinePublicKey).describe("Base-58 escrow PDA address"),
|
|
@@ -5117,7 +5130,15 @@ function makeWriteHandlers(escro, options = {}) {
|
|
|
5117
5130
|
}
|
|
5118
5131
|
},
|
|
5119
5132
|
claim_task: async (args) => {
|
|
5120
|
-
const
|
|
5133
|
+
const { accepted } = args;
|
|
5134
|
+
const signature = accepted === void 0 ? await escro.claimTask(args.address) : await escro.claimTask(args.address, {
|
|
5135
|
+
accepted: {
|
|
5136
|
+
buyer: accepted.maker,
|
|
5137
|
+
amountUsdc: accepted.amount,
|
|
5138
|
+
specHash: accepted.taskSpecHash,
|
|
5139
|
+
deadline: accepted.deadline
|
|
5140
|
+
}
|
|
5141
|
+
});
|
|
5121
5142
|
return ok({ signature });
|
|
5122
5143
|
},
|
|
5123
5144
|
submit_deliverable: async (args) => {
|