@interest-protocol/vortex-sdk 1.0.0 → 2.0.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/dist/index.mjs CHANGED
@@ -39371,7 +39371,7 @@ function requireVortex () {
39371
39371
  table.set(offset + 2, true);
39372
39372
  table.set(offset + 3, false);
39373
39373
  };
39374
- const wasmPath = `${__dirname}/vortex_bg.wasm`;
39374
+ const wasmPath = `${__dirname}/vortex_bg.nodejs.wasm`;
39375
39375
  const wasmBytes = require$$0.readFileSync(wasmPath);
39376
39376
  const wasmModule = new WebAssembly.Module(wasmBytes);
39377
39377
  const wasm = (exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports);
@@ -39573,19 +39573,19 @@ const verify = (proof) => {
39573
39573
  throw new Error('Unsupported environment');
39574
39574
  };
39575
39575
 
39576
- const getUnspentUtxos = async ({ commitmentEvents, senderVortexKeypair, vortex, }) => {
39576
+ const getUnspentUtxos = async ({ commitmentEvents, vortexKeypair, vortex, }) => {
39577
39577
  const commitments = parseNewCommitmentEvent(commitmentEvents);
39578
39578
  const allUtxos = [];
39579
39579
  commitments.forEach((commitment) => {
39580
39580
  try {
39581
- const utxo = senderVortexKeypair.decryptUtxo(commitment.encryptedOutput);
39581
+ const utxo = vortexKeypair.decryptUtxo(commitment.encryptedOutput);
39582
39582
  allUtxos.push(utxo);
39583
39583
  }
39584
39584
  catch {
39585
39585
  // Do nothing
39586
39586
  }
39587
39587
  });
39588
- const utxos = allUtxos.map((utxo) => new Utxo({ ...utxo, keypair: senderVortexKeypair }));
39588
+ const utxos = allUtxos.map((utxo) => new Utxo({ ...utxo, keypair: vortexKeypair }));
39589
39589
  const nullifiers = utxos.map((utxo) => utxo.nullifier());
39590
39590
  const isNullifierSpentArray = await vortex.areNullifiersSpent(nullifiers);
39591
39591
  const unspentUtxos = utxos.filter((_, index) => !isNullifierSpentArray[index]);