@0xbow/privacy-pools-core-sdk 0.0.0-c42a71a2 → 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-DhYhkEA3.js → fetchArtifacts.esm-Bx-wAcix.js} +2 -2
  2. package/dist/esm/{fetchArtifacts.esm-DhYhkEA3.js.map → fetchArtifacts.esm-Bx-wAcix.js.map} +1 -1
  3. package/dist/esm/{fetchArtifacts.node-CvSWmq-f.js → fetchArtifacts.node-hJM5tGnz.js} +2 -2
  4. package/dist/esm/{fetchArtifacts.node-CvSWmq-f.js.map → fetchArtifacts.node-hJM5tGnz.js.map} +1 -1
  5. package/dist/esm/{index-HhkFti3z.js → index-DKBVXntl.js} +30 -39
  6. package/dist/esm/{index-HhkFti3z.js.map → index-DKBVXntl.js.map} +1 -1
  7. package/dist/esm/index.mjs +1 -1
  8. package/dist/node/{fetchArtifacts.esm-C4C6mPVK.js → fetchArtifacts.esm-DMpHpySp.js} +2 -2
  9. package/dist/node/{fetchArtifacts.esm-C4C6mPVK.js.map → fetchArtifacts.esm-DMpHpySp.js.map} +1 -1
  10. package/dist/node/{fetchArtifacts.node-BCa5ObHc.js → fetchArtifacts.node-DhSwIt3O.js} +2 -2
  11. package/dist/node/{fetchArtifacts.node-BCa5ObHc.js.map → fetchArtifacts.node-DhSwIt3O.js.map} +1 -1
  12. package/dist/node/{index-CQTq1Q2D.js → index-Q1Q7Va3Q.js} +30 -39
  13. package/dist/node/{index-CQTq1Q2D.js.map → index-Q1Q7Va3Q.js.map} +1 -1
  14. package/dist/node/index.mjs +1 -1
  15. package/dist/types/{fetchArtifacts.esm-B54Vuvv1.js → fetchArtifacts.esm-BmDEMaUO.js} +1 -1
  16. package/dist/types/{fetchArtifacts.node-BGA9yrtX.js → fetchArtifacts.node-ClHhvnhY.js} +1 -1
  17. package/dist/types/{index-DQegbXMy.js → index-BITDYIPX.js} +29 -38
  18. package/dist/types/index.js +1 -1
  19. package/package.json +1 -1
  20. package/src/core/account.service.ts +27 -26
@@ -1,4 +1,4 @@
1
- import { F as FetchArtifact } from './index-HhkFti3z.js';
1
+ import { F as FetchArtifact } from './index-DKBVXntl.js';
2
2
  import 'viem/accounts';
3
3
  import 'buffer';
4
4
  import 'assert';
@@ -15,4 +15,4 @@ async function fetchVersionedArtifact(artifactUrl) {
15
15
  }
16
16
 
17
17
  export { fetchVersionedArtifact };
18
- //# sourceMappingURL=fetchArtifacts.esm-DhYhkEA3.js.map
18
+ //# sourceMappingURL=fetchArtifacts.esm-Bx-wAcix.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchArtifacts.esm-DhYhkEA3.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-Bx-wAcix.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-HhkFti3z.js';
1
+ import { F as FetchArtifact } from './index-DKBVXntl.js';
2
2
  import 'viem/accounts';
3
3
  import 'buffer';
4
4
  import 'assert';
@@ -28,4 +28,4 @@ async function fetchVersionedArtifact(artifactUrl) {
28
28
  }
29
29
 
30
30
  export { fetchVersionedArtifact };
31
- //# sourceMappingURL=fetchArtifacts.node-CvSWmq-f.js.map
31
+ //# sourceMappingURL=fetchArtifacts.node-hJM5tGnz.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchArtifacts.node-CvSWmq-f.js","sources":["../../src/circuits/fetchArtifacts.node.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAEO,eAAe,sBAAsB,CAC1C,WAAgB,EAAA;AAEhB,IAAA,IAAI;QACF,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,IAAI,CAAC,EAAE,OAAO;QACvC,MAAM,WAAW,GAAoB,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACnE,YAAA,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,KAAI;gBAC9C,IAAI,GAAG,EAAE;oBACP,MAAM,CAAC,GAAG,CAAC;;qBACN;oBACL,OAAO,CAAC,IAAI,CAAC;;AAEjB,aAAC,CAAC;AACJ,SAAC,CAAC;AACF,QAAA,MAAM,GAAG,GAAG,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;;;;"}
1
+ {"version":3,"file":"fetchArtifacts.node-hJM5tGnz.js","sources":["../../src/circuits/fetchArtifacts.node.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAEO,eAAe,sBAAsB,CAC1C,WAAgB,EAAA;AAEhB,IAAA,IAAI;QACF,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,IAAI,CAAC,EAAE,OAAO;QACvC,MAAM,WAAW,GAAoB,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACnE,YAAA,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,KAAI;gBAC9C,IAAI,GAAG,EAAE;oBACP,MAAM,CAAC,GAAG,CAAC;;qBACN;oBACL,OAAO,CAAC,IAAI,CAAC;;AAEjB,aAAC,CAAC;AACJ,SAAC,CAAC;AACF,QAAA,MAAM,GAAG,GAAG,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;;;;"}
@@ -15061,19 +15061,10 @@ var __setModuleDefault = Object.create ? (function(o, v) {
15061
15061
  o["default"] = v;
15062
15062
  };
15063
15063
 
15064
- var ownKeys = function(o) {
15065
- ownKeys = Object.getOwnPropertyNames || function (o) {
15066
- var ar = [];
15067
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
15068
- return ar;
15069
- };
15070
- return ownKeys(o);
15071
- };
15072
-
15073
15064
  function __importStar(mod) {
15074
15065
  if (mod && mod.__esModule) return mod;
15075
15066
  var result = {};
15076
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
15067
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
15077
15068
  __setModuleDefault(result, mod);
15078
15069
  return result;
15079
15070
  }
@@ -15155,25 +15146,12 @@ function __disposeResources(env) {
15155
15146
  return next();
15156
15147
  }
15157
15148
 
15158
- function __rewriteRelativeImportExtension(path, preserveJsx) {
15159
- if (typeof path === "string" && /^\.\.?\//.test(path)) {
15160
- return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
15161
- return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
15162
- });
15163
- }
15164
- return path;
15165
- }
15166
-
15167
15149
  var tslib_es6 = {
15168
15150
  __extends: __extends,
15169
15151
  __assign: __assign,
15170
15152
  __rest: __rest,
15171
15153
  __decorate: __decorate,
15172
15154
  __param: __param,
15173
- __esDecorate: __esDecorate,
15174
- __runInitializers: __runInitializers,
15175
- __propKey: __propKey,
15176
- __setFunctionName: __setFunctionName,
15177
15155
  __metadata: __metadata,
15178
15156
  __awaiter: __awaiter,
15179
15157
  __generator: __generator,
@@ -15196,7 +15174,6 @@ var tslib_es6 = {
15196
15174
  __classPrivateFieldIn: __classPrivateFieldIn,
15197
15175
  __addDisposableResource: __addDisposableResource,
15198
15176
  __disposeResources: __disposeResources,
15199
- __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
15200
15177
  };
15201
15178
 
15202
15179
  var tslib_es6$1 = /*#__PURE__*/Object.freeze({
@@ -15226,7 +15203,6 @@ var tslib_es6$1 = /*#__PURE__*/Object.freeze({
15226
15203
  __propKey: __propKey,
15227
15204
  __read: __read,
15228
15205
  __rest: __rest,
15229
- __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
15230
15206
  __runInitializers: __runInitializers,
15231
15207
  __setFunctionName: __setFunctionName,
15232
15208
  __spread: __spread,
@@ -45096,9 +45072,9 @@ var hashingExports = requireHashing();
45096
45072
 
45097
45073
  /**
45098
45074
  * @module @zk-kit/utils
45099
- * @version 1.2.1
45075
+ * @version 1.4.1
45100
45076
  * @file Essential zero-knowledge utility library for JavaScript developers.
45101
- * @copyright Ethereum Foundation 2024
45077
+ * @copyright Ethereum Foundation 2025
45102
45078
  * @license MIT
45103
45079
  * @see [Github]{@link https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/utils}
45104
45080
  */
@@ -45148,9 +45124,9 @@ function isArray(value) {
45148
45124
 
45149
45125
  /**
45150
45126
  * @module @zk-kit/utils
45151
- * @version 1.2.1
45127
+ * @version 1.4.1
45152
45128
  * @file Essential zero-knowledge utility library for JavaScript developers.
45153
- * @copyright Ethereum Foundation 2024
45129
+ * @copyright Ethereum Foundation 2025
45154
45130
  * @license MIT
45155
45131
  * @see [Github]{@link https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/utils}
45156
45132
  */
@@ -45217,9 +45193,9 @@ function requireArray(parameterValue, parameterName) {
45217
45193
 
45218
45194
  /**
45219
45195
  * @module @zk-kit/lean-imt
45220
- * @version 2.2.2
45196
+ * @version 2.2.4
45221
45197
  * @file Lean Incremental Merkle tree implementation in TypeScript.
45222
- * @copyright Ethereum Foundation 2024
45198
+ * @copyright Ethereum Foundation 2025
45223
45199
  * @license MIT
45224
45200
  * @see [Github]{@link https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/lean-imt}
45225
45201
  */
@@ -45350,7 +45326,7 @@ class LeanIMT {
45350
45326
  throw new Error("There are no leaves to add");
45351
45327
  }
45352
45328
  let startIndex = this.size >> 1;
45353
- this._nodes[0].push(...leaves);
45329
+ this._nodes[0] = this._nodes[0].concat(leaves);
45354
45330
  // Calculate how many tree levels will need to be added
45355
45331
  // using the number of leaves.
45356
45332
  const numberOfNewLevels = Math.ceil(Math.log2(this.size)) - this.depth;
@@ -45481,7 +45457,12 @@ class LeanIMT {
45481
45457
  }
45482
45458
  // The index might be different from the original index of the leaf, since
45483
45459
  // in some cases some siblings are not included (as explained above).
45484
- return { root: this.root, leaf, index: Number.parseInt(path.reverse().join(""), 2), siblings };
45460
+ return {
45461
+ root: this.root,
45462
+ leaf,
45463
+ index: path.length === 0 ? 0 : Number.parseInt(path.reverse().join(""), 2),
45464
+ siblings
45465
+ };
45485
45466
  }
45486
45467
  /**
45487
45468
  * It verifies a {@link LeanIMTMerkleProof} to confirm that a leaf indeed
@@ -45822,10 +45803,10 @@ const circuitToAsset = {
45822
45803
 
45823
45804
  async function importFetchVersionedArtifact(isBrowser) {
45824
45805
  if (isBrowser) {
45825
- return import('./fetchArtifacts.esm-DhYhkEA3.js');
45806
+ return import('./fetchArtifacts.esm-Bx-wAcix.js');
45826
45807
  }
45827
45808
  else {
45828
- return import('./fetchArtifacts.node-CvSWmq-f.js');
45809
+ return import('./fetchArtifacts.node-hJM5tGnz.js');
45829
45810
  }
45830
45811
  }
45831
45812
 
@@ -69396,7 +69377,7 @@ class AccountService {
69396
69377
  */
69397
69378
  constructor(dataService, config) {
69398
69379
  this.dataService = dataService;
69399
- this.logger = new Logger({ prefix: "Account" });
69380
+ this.logger = new Logger({ prefix: "Account", level: LogLevel.DEBUG });
69400
69381
  if ("mnemonic" in config) {
69401
69382
  this.account = this._initializeAccount(config.mnemonic);
69402
69383
  }
@@ -69611,6 +69592,12 @@ class AccountService {
69611
69592
  addPoolAccount(scope, value, nullifier, secret, label, blockNumber, txHash) {
69612
69593
  const precommitment = this._hashPrecommitment(nullifier, secret);
69613
69594
  const commitment = this._hashCommitment(value, label, precommitment);
69595
+ this.logger.debug(`Commitment calculation details`, {
69596
+ value,
69597
+ label,
69598
+ precommitment,
69599
+ commitment,
69600
+ });
69614
69601
  const newAccount = {
69615
69602
  label,
69616
69603
  deposit: {
@@ -69730,7 +69717,11 @@ class AccountService {
69730
69717
  });
69731
69718
  const depositMap = new Map();
69732
69719
  for (const event of depositEvents) {
69733
- depositMap.set(event.precommitment, event);
69720
+ const existingEvent = depositMap.get(event.precommitment);
69721
+ // If no existing event, or current event is older (earlier block), use current event
69722
+ if (!existingEvent || event.blockNumber < existingEvent.blockNumber) {
69723
+ depositMap.set(event.precommitment, event);
69724
+ }
69734
69725
  }
69735
69726
  return depositMap;
69736
69727
  }
@@ -69832,7 +69823,7 @@ class AccountService {
69832
69823
  *
69833
69824
  */
69834
69825
  _processDepositEvents(scope, depositEvents) {
69835
- const MAX_CONSECUTIVE_MISSES = 10; // Large enough to avoid and tx failures
69826
+ const MAX_CONSECUTIVE_MISSES = 10; // Large enough to avoid tx failures
69836
69827
  const foundIndices = new Set();
69837
69828
  let consecutiveMisses = 0;
69838
69829
  for (let index = BigInt(0);; index++) {
@@ -70361,4 +70352,4 @@ class DataService {
70361
70352
  }
70362
70353
 
70363
70354
  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 };
70364
- //# sourceMappingURL=index-HhkFti3z.js.map
70355
+ //# sourceMappingURL=index-DKBVXntl.js.map