@iam-protocol/pulse-sdk 0.3.7 → 0.3.8
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 +18 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/pulse.ts +19 -7
package/package.json
CHANGED
package/src/pulse.ts
CHANGED
|
@@ -169,13 +169,25 @@ async function processSensorData(
|
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
172
|
+
try {
|
|
173
|
+
const { proof, publicSignals } = await generateProof(
|
|
174
|
+
circuitInput,
|
|
175
|
+
wasmPath,
|
|
176
|
+
zkeyPath
|
|
177
|
+
);
|
|
178
|
+
solanaProof = serializeProof(proof, publicSignals);
|
|
179
|
+
} catch (proofErr: any) {
|
|
180
|
+
// Include diagnostics in error for mobile debugging (no devtools)
|
|
181
|
+
const audioNZ = features.slice(0, 44).filter((v) => v !== 0).length;
|
|
182
|
+
const motionNZ = features.slice(44, 98).filter((v) => v !== 0).length;
|
|
183
|
+
const touchNZ = features.slice(98, 134).filter((v) => v !== 0).length;
|
|
184
|
+
return {
|
|
185
|
+
success: false,
|
|
186
|
+
commitment: tbh.commitmentBytes,
|
|
187
|
+
isFirstVerification: false,
|
|
188
|
+
error: `Proof failed (distance=${distance}, audio=${audioNZ}/44, motion=${motionNZ}/54, touch=${touchNZ}/36): ${proofErr?.message ?? proofErr}`,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
179
191
|
}
|
|
180
192
|
|
|
181
193
|
// Submit
|