xoonya 1.9.0 → 1.10.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/README.md +1 -0
- package/package.json +1 -1
- package/proof_sdk.js +23 -0
- package/server.js +11 -0
package/README.md
CHANGED
|
@@ -130,6 +130,7 @@ Primary proof-model routes:
|
|
|
130
130
|
- `POST /v1/proof-center/transaction-handoff/run`
|
|
131
131
|
- `GET /v1/proof-center/result-package-handoff`
|
|
132
132
|
- `GET /v1/proof-center/result-package-handoff/summary`
|
|
133
|
+
- `POST /v1/proof-center/result-package-handoff/review`
|
|
133
134
|
- `POST /v1/proof-center/result-package-handoff/run`
|
|
134
135
|
- `POST /v1/events/canonicalize`
|
|
135
136
|
- `POST /v1/events/hash`
|
package/package.json
CHANGED
package/proof_sdk.js
CHANGED
|
@@ -1299,6 +1299,28 @@ function summarizeInteractionResultPackageHandoff(bundle) {
|
|
|
1299
1299
|
};
|
|
1300
1300
|
}
|
|
1301
1301
|
|
|
1302
|
+
function reviewInteractionResultPackageHandoff(input) {
|
|
1303
|
+
const handoff = canonicalizeInteractionResultPackageHandoff(input);
|
|
1304
|
+
return {
|
|
1305
|
+
ok: true,
|
|
1306
|
+
handoff_kind: "interaction_result_package",
|
|
1307
|
+
handoff,
|
|
1308
|
+
accepted: true,
|
|
1309
|
+
required_field_count: 5,
|
|
1310
|
+
optional_present_count: [
|
|
1311
|
+
handoff.committed_ref,
|
|
1312
|
+
handoff.precommit_pack_ref,
|
|
1313
|
+
handoff.payment_protocol,
|
|
1314
|
+
handoff.settlement_mode,
|
|
1315
|
+
handoff.treasury_destination_id,
|
|
1316
|
+
...(Array.isArray(handoff.task_refs) ? handoff.task_refs : []),
|
|
1317
|
+
...(Array.isArray(handoff.seam_layers) ? handoff.seam_layers : [])
|
|
1318
|
+
].filter(Boolean).length,
|
|
1319
|
+
recommended_loop: "default.proof.bundle.loop",
|
|
1320
|
+
next_surface: "/v1/proof-center/result-package-handoff/run"
|
|
1321
|
+
};
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1302
1324
|
function runDefaultProofLoop(loopRef, input) {
|
|
1303
1325
|
const loop = getDefaultProofLoop(loopRef);
|
|
1304
1326
|
if (!loop) {
|
|
@@ -1353,6 +1375,7 @@ module.exports = {
|
|
|
1353
1375
|
getDefaultProofLoop,
|
|
1354
1376
|
canonicalizeTransactionProofHandoff,
|
|
1355
1377
|
runDefaultProofLoop,
|
|
1378
|
+
reviewInteractionResultPackageHandoff,
|
|
1356
1379
|
runInteractionResultPackageHandoff,
|
|
1357
1380
|
runInteractionSpineProofHandoff,
|
|
1358
1381
|
runTransactionProofHandoff,
|
package/server.js
CHANGED
|
@@ -182,6 +182,17 @@ async function routeRequest(req, res) {
|
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review') {
|
|
186
|
+
try {
|
|
187
|
+
const body = await readJsonBody(req);
|
|
188
|
+
const result = proofSdk.reviewInteractionResultPackageHandoff(body);
|
|
189
|
+
sendJson(res, 200, result);
|
|
190
|
+
} catch (error) {
|
|
191
|
+
sendJson(res, 400, { ok: false, reason: error.message });
|
|
192
|
+
}
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
185
196
|
if (req.method === 'POST' && url.pathname === '/v1/receipts/verify') {
|
|
186
197
|
try {
|
|
187
198
|
const body = await readJsonBody(req);
|