@smithii_io/mixoor 0.0.7 → 0.0.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/src/index.js CHANGED
@@ -5,8 +5,10 @@ var circomlibjs = require('circomlibjs');
5
5
  var fs = require('fs');
6
6
  var path = require('path');
7
7
  var snarkjs = require('snarkjs');
8
+ var url = require('url');
8
9
  var crypto = require('crypto');
9
10
 
11
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
10
12
  function _interopNamespace(e) {
11
13
  if (e && e.__esModule) return e;
12
14
  var n = Object.create(null);
@@ -1189,6 +1191,8 @@ async function generateProof(input) {
1189
1191
  pathIndices: input.pathIndices,
1190
1192
  amount: BigInt(input.amount).toString()
1191
1193
  };
1194
+ const __filename = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)));
1195
+ const __dirname = path__namespace.dirname(__filename);
1192
1196
  const packageRoot = path__namespace.join(__dirname, "../..");
1193
1197
  const wasmPath = path__namespace.join(
1194
1198
  packageRoot,
@@ -1198,11 +1202,7 @@ async function generateProof(input) {
1198
1202
  const { proof, publicSignals } = await snarkjs.groth16.fullProve(
1199
1203
  circuitInputs,
1200
1204
  wasmPath,
1201
- zkeyPath,
1202
- void 0,
1203
- void 0,
1204
- { singleThread: true }
1205
- // ! does this impact performance
1205
+ zkeyPath
1206
1206
  );
1207
1207
  const vKeyPath = path__namespace.join(packageRoot, "circuits/verification_key.json");
1208
1208
  const isValid = await snarkjs.groth16.verify(