@umbra-privacy/sdk 2.1.0 → 2.1.1

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.cjs CHANGED
@@ -1200,6 +1200,7 @@ function getClaimableUtxoScannerFunction(args, deps) {
1200
1200
  error instanceof Error ? error : void 0
1201
1201
  );
1202
1202
  }
1203
+ const treeUtxos = [];
1203
1204
  for (const [, utxo] of result.items) {
1204
1205
  if (utxo.treeIndex !== treeIndex) {
1205
1206
  continue;
@@ -1207,12 +1208,14 @@ function getClaimableUtxoScannerFunction(args, deps) {
1207
1208
  if (lastSeenInsertionIndex === null || utxo.insertionIndex > lastSeenInsertionIndex) {
1208
1209
  lastSeenInsertionIndex = utxo.insertionIndex;
1209
1210
  }
1210
- const decrypted = await tryDecryptUtxo(
1211
- utxo,
1212
- clientX25519PrivateKey,
1213
- aesDecryptor,
1214
- x25519GetSharedSecret
1215
- );
1211
+ treeUtxos.push(utxo);
1212
+ }
1213
+ const decryptedResults = await Promise.all(
1214
+ treeUtxos.map(
1215
+ (utxo) => tryDecryptUtxo(utxo, clientX25519PrivateKey, aesDecryptor, x25519GetSharedSecret)
1216
+ )
1217
+ );
1218
+ for (const decrypted of decryptedResults) {
1216
1219
  if (decrypted !== null) {
1217
1220
  allDecrypted.push(decrypted);
1218
1221
  }