@interest-protocol/vortex-sdk 1.0.0 → 1.1.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 +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- 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 +3 -3
- package/src/utils/decrypt.ts +4 -4
package/dist/index.mjs
CHANGED
|
@@ -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]);
|