@0xbow/privacy-pools-core-sdk 0.0.0-c42a71a3 → 0.0.0-e101aa

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.
Files changed (20) hide show
  1. package/dist/esm/{fetchArtifacts.esm-DhinGr0a.js → fetchArtifacts.esm-Bx-wAcix.js} +2 -2
  2. package/dist/esm/{fetchArtifacts.esm-DhinGr0a.js.map → fetchArtifacts.esm-Bx-wAcix.js.map} +1 -1
  3. package/dist/esm/{fetchArtifacts.node-BarT-ack.js → fetchArtifacts.node-hJM5tGnz.js} +2 -2
  4. package/dist/esm/{fetchArtifacts.node-BarT-ack.js.map → fetchArtifacts.node-hJM5tGnz.js.map} +1 -1
  5. package/dist/esm/{index-ynv4K_cq.js → index-DKBVXntl.js} +29 -38
  6. package/dist/esm/{index-ynv4K_cq.js.map → index-DKBVXntl.js.map} +1 -1
  7. package/dist/esm/index.mjs +1 -1
  8. package/dist/node/{fetchArtifacts.esm-aY2Tx1qe.js → fetchArtifacts.esm-DMpHpySp.js} +2 -2
  9. package/dist/node/{fetchArtifacts.esm-aY2Tx1qe.js.map → fetchArtifacts.esm-DMpHpySp.js.map} +1 -1
  10. package/dist/node/{fetchArtifacts.node-CF90z74C.js → fetchArtifacts.node-DhSwIt3O.js} +2 -2
  11. package/dist/node/{fetchArtifacts.node-CF90z74C.js.map → fetchArtifacts.node-DhSwIt3O.js.map} +1 -1
  12. package/dist/node/{index-BgfrdIiJ.js → index-Q1Q7Va3Q.js} +29 -38
  13. package/dist/node/{index-BgfrdIiJ.js.map → index-Q1Q7Va3Q.js.map} +1 -1
  14. package/dist/node/index.mjs +1 -1
  15. package/dist/types/{fetchArtifacts.esm-s8imnxFN.js → fetchArtifacts.esm-BmDEMaUO.js} +1 -1
  16. package/dist/types/{fetchArtifacts.node-BwpGMlwi.js → fetchArtifacts.node-ClHhvnhY.js} +1 -1
  17. package/dist/types/{index-BZkN1dA8.js → index-BITDYIPX.js} +28 -37
  18. package/dist/types/index.js +1 -1
  19. package/package.json +1 -1
  20. package/src/core/account.service.ts +26 -26
@@ -1,4 +1,4 @@
1
- export { n as AccountError, A as AccountService, B as BlockchainProvider, o as CircuitName, j as Circuits, C as CommitmentService, m as ContractError, k as ContractInteractionsService, D as DataService, E as ErrorCode, I as InvalidRpcUrl, P as PrivacyPoolSDK, l as ProofError, S as SDKError, W as WithdrawalService, e as bigintToHash, f as bigintToHex, i as calculateContext, a as generateDepositSecrets, g as generateMasterKeys, d as generateMerkleProof, b as generateWithdrawalSecrets, c as getCommitment, h as hashPrecommitment } from './index-ynv4K_cq.js';
1
+ export { n as AccountError, A as AccountService, B as BlockchainProvider, o as CircuitName, j as Circuits, C as CommitmentService, m as ContractError, k as ContractInteractionsService, D as DataService, E as ErrorCode, I as InvalidRpcUrl, P as PrivacyPoolSDK, l as ProofError, S as SDKError, W as WithdrawalService, e as bigintToHash, f as bigintToHex, i as calculateContext, a as generateDepositSecrets, g as generateMasterKeys, d as generateMerkleProof, b as generateWithdrawalSecrets, c as getCommitment, h as hashPrecommitment } from './index-DKBVXntl.js';
2
2
  import 'viem/accounts';
3
3
  import 'buffer';
4
4
  import 'assert';
@@ -1,4 +1,4 @@
1
- import { F as FetchArtifact } from './index-BgfrdIiJ.js';
1
+ import { F as FetchArtifact } from './index-Q1Q7Va3Q.js';
2
2
  import 'viem/accounts';
3
3
  import 'buffer';
4
4
  import 'http';
@@ -32,4 +32,4 @@ async function fetchVersionedArtifact(artifactUrl) {
32
32
  }
33
33
 
34
34
  export { fetchVersionedArtifact };
35
- //# sourceMappingURL=fetchArtifacts.esm-aY2Tx1qe.js.map
35
+ //# sourceMappingURL=fetchArtifacts.esm-DMpHpySp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchArtifacts.esm-aY2Tx1qe.js","sources":["../../src/circuits/fetchArtifacts.esm.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEO,eAAe,sBAAsB,CAC1C,WAAgB,EAAA;AAEhB,IAAA,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC;AACpC,IAAA,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;AACtB,QAAA,MAAM,IAAI,aAAa,CAAC,WAAW,CAAC;;AAEtC,IAAA,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE;AACpC,IAAA,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC;AAC7B;;;;"}
1
+ {"version":3,"file":"fetchArtifacts.esm-DMpHpySp.js","sources":["../../src/circuits/fetchArtifacts.esm.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEO,eAAe,sBAAsB,CAC1C,WAAgB,EAAA;AAEhB,IAAA,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC;AACpC,IAAA,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;AACtB,QAAA,MAAM,IAAI,aAAa,CAAC,WAAW,CAAC;;AAEtC,IAAA,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE;AACpC,IAAA,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC;AAC7B;;;;"}
@@ -1,4 +1,4 @@
1
- import { F as FetchArtifact } from './index-BgfrdIiJ.js';
1
+ import { F as FetchArtifact } from './index-Q1Q7Va3Q.js';
2
2
  import 'viem/accounts';
3
3
  import 'buffer';
4
4
  import 'http';
@@ -45,4 +45,4 @@ async function fetchVersionedArtifact(artifactUrl) {
45
45
  }
46
46
 
47
47
  export { fetchVersionedArtifact };
48
- //# sourceMappingURL=fetchArtifacts.node-CF90z74C.js.map
48
+ //# sourceMappingURL=fetchArtifacts.node-DhSwIt3O.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchArtifacts.node-CF90z74C.js","sources":["../../src/circuits/fetchArtifacts.node.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;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AAG,MAAM,WAAW;AAC7B,QAAA,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC;;IAC1B,OAAO,KAAK,EAAE;AACd,QAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACpB,QAAA,MAAM,IAAI,aAAa,CAAC,WAAW,CAAC;;AAExC;;;;"}
@@ -15082,19 +15082,10 @@ var __setModuleDefault = Object.create ? (function(o, v) {
15082
15082
  o["default"] = v;
15083
15083
  };
15084
15084
 
15085
- var ownKeys = function(o) {
15086
- ownKeys = Object.getOwnPropertyNames || function (o) {
15087
- var ar = [];
15088
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
15089
- return ar;
15090
- };
15091
- return ownKeys(o);
15092
- };
15093
-
15094
15085
  function __importStar(mod) {
15095
15086
  if (mod && mod.__esModule) return mod;
15096
15087
  var result = {};
15097
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
15088
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
15098
15089
  __setModuleDefault(result, mod);
15099
15090
  return result;
15100
15091
  }
@@ -15176,25 +15167,12 @@ function __disposeResources(env) {
15176
15167
  return next();
15177
15168
  }
15178
15169
 
15179
- function __rewriteRelativeImportExtension(path, preserveJsx) {
15180
- if (typeof path === "string" && /^\.\.?\//.test(path)) {
15181
- return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
15182
- return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
15183
- });
15184
- }
15185
- return path;
15186
- }
15187
-
15188
15170
  var tslib_es6 = {
15189
15171
  __extends: __extends,
15190
15172
  __assign: __assign,
15191
15173
  __rest: __rest,
15192
15174
  __decorate: __decorate,
15193
15175
  __param: __param,
15194
- __esDecorate: __esDecorate,
15195
- __runInitializers: __runInitializers,
15196
- __propKey: __propKey,
15197
- __setFunctionName: __setFunctionName,
15198
15176
  __metadata: __metadata,
15199
15177
  __awaiter: __awaiter,
15200
15178
  __generator: __generator,
@@ -15217,7 +15195,6 @@ var tslib_es6 = {
15217
15195
  __classPrivateFieldIn: __classPrivateFieldIn,
15218
15196
  __addDisposableResource: __addDisposableResource,
15219
15197
  __disposeResources: __disposeResources,
15220
- __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
15221
15198
  };
15222
15199
 
15223
15200
  var tslib_es6$1 = /*#__PURE__*/Object.freeze({
@@ -15247,7 +15224,6 @@ var tslib_es6$1 = /*#__PURE__*/Object.freeze({
15247
15224
  __propKey: __propKey,
15248
15225
  __read: __read,
15249
15226
  __rest: __rest,
15250
- __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
15251
15227
  __runInitializers: __runInitializers,
15252
15228
  __setFunctionName: __setFunctionName,
15253
15229
  __spread: __spread,
@@ -50363,9 +50339,9 @@ var hashingExports = requireHashing();
50363
50339
 
50364
50340
  /**
50365
50341
  * @module @zk-kit/utils
50366
- * @version 1.2.1
50342
+ * @version 1.4.1
50367
50343
  * @file Essential zero-knowledge utility library for JavaScript developers.
50368
- * @copyright Ethereum Foundation 2024
50344
+ * @copyright Ethereum Foundation 2025
50369
50345
  * @license MIT
50370
50346
  * @see [Github]{@link https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/utils}
50371
50347
  */
@@ -50415,9 +50391,9 @@ function isArray(value) {
50415
50391
 
50416
50392
  /**
50417
50393
  * @module @zk-kit/utils
50418
- * @version 1.2.1
50394
+ * @version 1.4.1
50419
50395
  * @file Essential zero-knowledge utility library for JavaScript developers.
50420
- * @copyright Ethereum Foundation 2024
50396
+ * @copyright Ethereum Foundation 2025
50421
50397
  * @license MIT
50422
50398
  * @see [Github]{@link https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/utils}
50423
50399
  */
@@ -50484,9 +50460,9 @@ function requireArray(parameterValue, parameterName) {
50484
50460
 
50485
50461
  /**
50486
50462
  * @module @zk-kit/lean-imt
50487
- * @version 2.2.2
50463
+ * @version 2.2.4
50488
50464
  * @file Lean Incremental Merkle tree implementation in TypeScript.
50489
- * @copyright Ethereum Foundation 2024
50465
+ * @copyright Ethereum Foundation 2025
50490
50466
  * @license MIT
50491
50467
  * @see [Github]{@link https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/lean-imt}
50492
50468
  */
@@ -50617,7 +50593,7 @@ class LeanIMT {
50617
50593
  throw new Error("There are no leaves to add");
50618
50594
  }
50619
50595
  let startIndex = this.size >> 1;
50620
- this._nodes[0].push(...leaves);
50596
+ this._nodes[0] = this._nodes[0].concat(leaves);
50621
50597
  // Calculate how many tree levels will need to be added
50622
50598
  // using the number of leaves.
50623
50599
  const numberOfNewLevels = Math.ceil(Math.log2(this.size)) - this.depth;
@@ -50748,7 +50724,12 @@ class LeanIMT {
50748
50724
  }
50749
50725
  // The index might be different from the original index of the leaf, since
50750
50726
  // in some cases some siblings are not included (as explained above).
50751
- return { root: this.root, leaf, index: Number.parseInt(path.reverse().join(""), 2), siblings };
50727
+ return {
50728
+ root: this.root,
50729
+ leaf,
50730
+ index: path.length === 0 ? 0 : Number.parseInt(path.reverse().join(""), 2),
50731
+ siblings
50732
+ };
50752
50733
  }
50753
50734
  /**
50754
50735
  * It verifies a {@link LeanIMTMerkleProof} to confirm that a leaf indeed
@@ -51089,10 +51070,10 @@ const circuitToAsset = {
51089
51070
 
51090
51071
  async function importFetchVersionedArtifact(isBrowser) {
51091
51072
  if (isBrowser) {
51092
- return import('./fetchArtifacts.esm-aY2Tx1qe.js');
51073
+ return import('./fetchArtifacts.esm-DMpHpySp.js');
51093
51074
  }
51094
51075
  else {
51095
- return import('./fetchArtifacts.node-CF90z74C.js');
51076
+ return import('./fetchArtifacts.node-DhSwIt3O.js');
51096
51077
  }
51097
51078
  }
51098
51079
 
@@ -76661,6 +76642,12 @@ class AccountService {
76661
76642
  addPoolAccount(scope, value, nullifier, secret, label, blockNumber, txHash) {
76662
76643
  const precommitment = this._hashPrecommitment(nullifier, secret);
76663
76644
  const commitment = this._hashCommitment(value, label, precommitment);
76645
+ this.logger.debug(`Commitment calculation details`, {
76646
+ value,
76647
+ label,
76648
+ precommitment,
76649
+ commitment,
76650
+ });
76664
76651
  const newAccount = {
76665
76652
  label,
76666
76653
  deposit: {
@@ -76780,7 +76767,11 @@ class AccountService {
76780
76767
  });
76781
76768
  const depositMap = new Map();
76782
76769
  for (const event of depositEvents) {
76783
- depositMap.set(event.precommitment, event);
76770
+ const existingEvent = depositMap.get(event.precommitment);
76771
+ // If no existing event, or current event is older (earlier block), use current event
76772
+ if (!existingEvent || event.blockNumber < existingEvent.blockNumber) {
76773
+ depositMap.set(event.precommitment, event);
76774
+ }
76784
76775
  }
76785
76776
  return depositMap;
76786
76777
  }
@@ -76882,7 +76873,7 @@ class AccountService {
76882
76873
  *
76883
76874
  */
76884
76875
  _processDepositEvents(scope, depositEvents) {
76885
- const MAX_CONSECUTIVE_MISSES = 10; // Large enough to avoid and tx failures
76876
+ const MAX_CONSECUTIVE_MISSES = 10; // Large enough to avoid tx failures
76886
76877
  const foundIndices = new Set();
76887
76878
  let consecutiveMisses = 0;
76888
76879
  for (let index = BigInt(0);; index++) {
@@ -77411,4 +77402,4 @@ class DataService {
77411
77402
  }
77412
77403
 
77413
77404
  export { AccountService as A, BlockchainProvider as B, CommitmentService as C, DataService as D, ErrorCode as E, FetchArtifact as F, InvalidRpcUrl as I, PrivacyPoolSDK as P, SDKError as S, WithdrawalService as W, generateDepositSecrets as a, generateWithdrawalSecrets as b, getCommitment as c, generateMerkleProof as d, bigintToHash as e, bigintToHex as f, generateMasterKeys as g, hashPrecommitment as h, calculateContext as i, Circuits as j, ContractInteractionsService as k, ProofError as l, ContractError as m, AccountError as n, CircuitName as o };
77414
- //# sourceMappingURL=index-BgfrdIiJ.js.map
77405
+ //# sourceMappingURL=index-Q1Q7Va3Q.js.map