@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.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/utils/decrypt.d.ts +2 -2
- package/dist/utils/decrypt.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/pkg/nodejs/vortex.js +1 -1
- package/src/pkg/web/vortex.js +1 -1
- package/src/pkg/web/vortex_bg.web.wasm +0 -0
- package/src/utils/decrypt.ts +4 -4
- /package/dist/{vortex_bg.wasm → vortex_bg.nodejs.wasm} +0 -0
- /package/{src/pkg/web/vortex_bg.wasm → dist/vortex_bg.web.wasm} +0 -0
- /package/src/pkg/nodejs/{vortex_bg.wasm → vortex_bg.nodejs.wasm} +0 -0
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,
|
|
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 =
|
|
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:
|
|
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]);
|