@iam-protocol/pulse-sdk 0.3.7 → 0.3.9
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/index.js +22 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/pulse.ts +24 -7
package/dist/index.js
CHANGED
|
@@ -1517,12 +1517,28 @@ async function processSensorData(sensorData, config, wallet, connection) {
|
|
|
1517
1517
|
error: "wasmUrl and zkeyUrl must be configured for re-verification proof generation"
|
|
1518
1518
|
};
|
|
1519
1519
|
}
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1520
|
+
try {
|
|
1521
|
+
const { proof, publicSignals } = await generateProof(
|
|
1522
|
+
circuitInput,
|
|
1523
|
+
wasmPath,
|
|
1524
|
+
zkeyPath
|
|
1525
|
+
);
|
|
1526
|
+
solanaProof = serializeProof(proof, publicSignals);
|
|
1527
|
+
} catch (proofErr) {
|
|
1528
|
+
const audioNZ = features.slice(0, 44).filter((v) => v !== 0).length;
|
|
1529
|
+
const motionNZ = features.slice(44, 98).filter((v) => v !== 0).length;
|
|
1530
|
+
const touchNZ = features.slice(98, 134).filter((v) => v !== 0).length;
|
|
1531
|
+
const rawAudio = sensorData.audio?.samples.length ?? 0;
|
|
1532
|
+
const rawMotion = sensorData.motion.length;
|
|
1533
|
+
const rawTouch = sensorData.touch.length;
|
|
1534
|
+
const sig = features.slice(0, 3).map((v) => v.toFixed(4)).join(",");
|
|
1535
|
+
return {
|
|
1536
|
+
success: false,
|
|
1537
|
+
commitment: tbh.commitmentBytes,
|
|
1538
|
+
isFirstVerification: false,
|
|
1539
|
+
error: `Proof failed (dist=${distance}, feat=${audioNZ}/${motionNZ}/${touchNZ}, raw=${rawAudio}/${rawMotion}/${rawTouch}, sig=${sig}): ${proofErr?.message ?? proofErr}`
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1526
1542
|
}
|
|
1527
1543
|
let submission;
|
|
1528
1544
|
if (wallet && connection) {
|