@waku/rln 0.1.4-d27db21.0 → 0.1.4

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 (88) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/bundle/_virtual/index2.js +1 -1
  3. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/checksum.js +5 -5
  4. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/cipher.js +7 -7
  5. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/class.js +11 -11
  6. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/functional.js +11 -11
  7. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/index.js +6 -6
  8. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/kdf.js +9 -9
  9. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/password.js +2 -2
  10. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/schema-validation-generated.js +2 -2
  11. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/schema-validation.js +3 -3
  12. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/lib/types.js +1 -1
  13. package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/_assert.js +2 -2
  14. package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/_sha2.js +4 -4
  15. package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/_u64.js +2 -2
  16. package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/cryptoBrowser.js +2 -2
  17. package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/hmac.js +4 -4
  18. package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/pbkdf2.js +5 -5
  19. package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/scrypt.js +6 -6
  20. package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/sha256.js +4 -4
  21. package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/sha512.js +5 -5
  22. package/bundle/{packages/rln → node_modules/@chainsafe/bls-keystore}/node_modules/@noble/hashes/utils.js +3 -3
  23. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/aes.js +4 -4
  24. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/pbkdf2.js +8 -8
  25. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +4 -4
  26. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/scrypt.js +4 -4
  27. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/sha256.js +4 -4
  28. package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +8 -8
  29. package/bundle/node_modules/@ethersproject/abi/lib.esm/_version.js +1 -1
  30. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js +1 -1
  31. package/bundle/node_modules/@ethersproject/abi/lib.esm/interface.js +1 -1
  32. package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/_version.js +1 -1
  33. package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/index.js +1 -1
  34. package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/_version.js +1 -1
  35. package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/index.js +11 -11
  36. package/bundle/node_modules/@ethersproject/address/lib.esm/_version.js +1 -1
  37. package/bundle/node_modules/@ethersproject/bignumber/lib.esm/_version.js +1 -1
  38. package/bundle/node_modules/@ethersproject/bytes/lib.esm/_version.js +1 -1
  39. package/bundle/node_modules/@ethersproject/contracts/lib.esm/_version.js +1 -1
  40. package/bundle/node_modules/@ethersproject/contracts/lib.esm/index.js +8 -8
  41. package/bundle/node_modules/@ethersproject/hash/lib.esm/_version.js +1 -1
  42. package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js +2 -2
  43. package/bundle/node_modules/@ethersproject/hash/lib.esm/typed-data.js +2 -2
  44. package/bundle/node_modules/@ethersproject/keccak256/lib.esm/index.js +1 -1
  45. package/bundle/node_modules/@ethersproject/logger/lib.esm/_version.js +1 -1
  46. package/bundle/node_modules/@ethersproject/networks/lib.esm/_version.js +1 -1
  47. package/bundle/node_modules/@ethersproject/networks/lib.esm/index.js +19 -1
  48. package/bundle/node_modules/@ethersproject/properties/lib.esm/_version.js +1 -1
  49. package/bundle/node_modules/@ethersproject/properties/lib.esm/index.js +1 -1
  50. package/bundle/node_modules/@ethersproject/providers/lib.esm/_version.js +1 -1
  51. package/bundle/node_modules/@ethersproject/providers/lib.esm/base-provider.js +44 -44
  52. package/bundle/node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js +8 -8
  53. package/bundle/node_modules/@ethersproject/rlp/lib.esm/_version.js +1 -1
  54. package/bundle/node_modules/@ethersproject/signing-key/lib.esm/_version.js +1 -1
  55. package/bundle/node_modules/@ethersproject/signing-key/lib.esm/elliptic.js +58 -10
  56. package/bundle/node_modules/@ethersproject/strings/lib.esm/_version.js +1 -1
  57. package/bundle/node_modules/@ethersproject/transactions/lib.esm/_version.js +1 -1
  58. package/bundle/node_modules/@ethersproject/transactions/lib.esm/index.js +1 -1
  59. package/bundle/node_modules/@ethersproject/web/lib.esm/_version.js +1 -1
  60. package/bundle/node_modules/@ethersproject/web/lib.esm/geturl.js +1 -1
  61. package/bundle/node_modules/@ethersproject/web/lib.esm/index.js +2 -2
  62. package/bundle/node_modules/@multiformats/multiaddr/dist/src/multiaddr.js +1 -0
  63. package/bundle/node_modules/@noble/hashes/esm/sha3.js +1 -1
  64. package/bundle/node_modules/bn.js/lib/bn.js +1 -1
  65. package/bundle/node_modules/{@ethersproject/keccak256/node_modules/js-sha3 → js-sha3}/src/sha3.js +2 -2
  66. package/bundle/packages/core/dist/lib/connection_manager/connection_manager.js +6 -6
  67. package/bundle/packages/rln/dist/contract/constants.js +0 -1
  68. package/bundle/packages/rln/dist/contract/rln_contract.js +1 -1
  69. package/bundle/packages/rln/dist/keystore/cipher.js +3 -3
  70. package/bundle/packages/rln/dist/keystore/keystore.js +1 -1
  71. package/bundle/packages/rln/dist/rln.js +1 -1
  72. package/dist/.tsbuildinfo +1 -1
  73. package/package.json +91 -1
  74. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/index.js +0 -0
  75. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/md5.js +0 -0
  76. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/nil.js +0 -0
  77. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/parse.js +0 -0
  78. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/regex.js +0 -0
  79. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/rng.js +0 -0
  80. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/sha1.js +0 -0
  81. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/stringify.js +0 -0
  82. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v1.js +0 -0
  83. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v3.js +0 -0
  84. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v35.js +0 -0
  85. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v4.js +0 -0
  86. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/v5.js +0 -0
  87. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/validate.js +0 -0
  88. /package/bundle/{packages/rln/node_modules → node_modules}/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/version.js +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ ## [0.1.4](https://github.com/waku-org/js-waku/compare/rln-v0.1.3...rln-v0.1.4) (2025-03-24)
4
+
5
+
6
+ ### Features
7
+
8
+ * @waku/rln ([#2244](https://github.com/waku-org/js-waku/issues/2244)) ([0a0a92b](https://github.com/waku-org/js-waku/commit/0a0a92bccb02fdf9b927bee928b040ff5d624b67))
9
+ * **rln:** Migrate from v1 to v2, rate limiting, memberships, test coverage ([#2262](https://github.com/waku-org/js-waku/issues/2262)) ([6fc6bf3](https://github.com/waku-org/js-waku/commit/6fc6bf3916d6dad3d516a5769331245f1b6d55e8))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @waku/core bumped from ^0.0.33 to ^0.0.34
17
+ * @waku/utils bumped from ^0.0.21 to ^0.0.22
18
+ * devDependencies
19
+ * @waku/message-encryption bumped from ^0.0.31 to ^0.0.32
@@ -1,5 +1,5 @@
1
1
  import { getAugmentedNamespace } from './_commonjsHelpers.js';
2
- import * as index from '../packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/index.js';
2
+ import * as index from '../node_modules/@chainsafe/bls-keystore/node_modules/uuid/dist/esm-browser/index.js';
3
3
 
4
4
  var require$$0 = /*@__PURE__*/getAugmentedNamespace(index);
5
5
 
@@ -1,8 +1,8 @@
1
- import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
2
- import { __exports as checksum$1 } from '../../../../../../_virtual/checksum.js';
1
+ import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
2
+ import { __exports as checksum$1 } from '../../../../_virtual/checksum.js';
3
3
  import '../node_modules/ethereum-cryptography/sha256.js';
4
4
  import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
5
- import { __exports as sha256 } from '../../../../../../_virtual/sha256.js';
5
+ import { __exports as sha256 } from '../../../../_virtual/sha256.js';
6
6
 
7
7
  var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
8
8
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -14,7 +14,7 @@ var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisAr
14
14
  });
15
15
  };
16
16
  Object.defineProperty(checksum$1, "__esModule", { value: true });
17
- checksum$1.verifyChecksum = checksum$1.checksum = checksum$1.defaultSha256Module = undefined;
17
+ checksum$1.verifyChecksum = checksum$1.checksum = checksum$1.defaultSha256Module = void 0;
18
18
  const sha256_1 = sha256;
19
19
  const utils_1 = utilsExports;
20
20
  // default checksum configuration
@@ -38,7 +38,7 @@ function checksum(mod, key, ciphertext) {
38
38
  }
39
39
  checksum$1.checksum = checksum;
40
40
  function verifyChecksum(mod, key, ciphertext) {
41
- return __awaiter(this, undefined, undefined, function* () {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
42
  if (mod.function === "sha256") {
43
43
  return utils_1.equalsBytes(utils_1.hexToBytes(mod.message), sha256_1.sha256(checksumData(key, ciphertext)));
44
44
  }
@@ -1,10 +1,10 @@
1
- import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
2
- import { __exports as cipher } from '../../../../../../_virtual/cipher.js';
1
+ import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
2
+ import { __exports as cipher } from '../../../../_virtual/cipher.js';
3
3
  import '../node_modules/ethereum-cryptography/random.js';
4
4
  import '../node_modules/ethereum-cryptography/aes.js';
5
5
  import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
6
- import { __exports as random } from '../../../../../../_virtual/random.js';
7
- import { __exports as aes } from '../../../../../../_virtual/aes.js';
6
+ import { __exports as random } from '../../../../_virtual/random.js';
7
+ import { __exports as aes } from '../../../../_virtual/aes.js';
8
8
 
9
9
  var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
10
10
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -16,7 +16,7 @@ var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisAr
16
16
  });
17
17
  };
18
18
  Object.defineProperty(cipher, "__esModule", { value: true });
19
- var cipherDecrypt_1 = cipher.cipherDecrypt = cipher.cipherEncrypt = cipher.defaultAes128CtrModule = undefined;
19
+ var cipherDecrypt_1 = cipher.cipherDecrypt = cipher.cipherEncrypt = cipher.defaultAes128CtrModule = void 0;
20
20
  const random_1 = random;
21
21
  const aes_1 = aes;
22
22
  const utils_1 = utilsExports;
@@ -30,7 +30,7 @@ function defaultAes128CtrModule() {
30
30
  }
31
31
  cipher.defaultAes128CtrModule = defaultAes128CtrModule;
32
32
  function cipherEncrypt(mod, key, data) {
33
- return __awaiter(this, undefined, undefined, function* () {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
34
  if (mod.function === "aes-128-ctr") {
35
35
  try {
36
36
  return yield aes_1.encrypt(data, key, utils_1.hexToBytes(mod.params.iv), mod.function, false);
@@ -46,7 +46,7 @@ function cipherEncrypt(mod, key, data) {
46
46
  }
47
47
  cipher.cipherEncrypt = cipherEncrypt;
48
48
  function cipherDecrypt(mod, key) {
49
- return __awaiter(this, undefined, undefined, function* () {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
50
  if (mod.function === "aes-128-ctr") {
51
51
  try {
52
52
  return yield aes_1.decrypt(utils_1.hexToBytes(mod.message), key, utils_1.hexToBytes(mod.params.iv), mod.function, false);
@@ -1,15 +1,15 @@
1
- import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
2
- import { __exports as _class } from '../../../../../../_virtual/class.js';
1
+ import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
2
+ import { __exports as _class } from '../../../../_virtual/class.js';
3
3
  import './kdf.js';
4
4
  import './checksum.js';
5
5
  import './cipher.js';
6
6
  import './functional.js';
7
7
  import './schema-validation.js';
8
- import { __exports as kdf } from '../../../../../../_virtual/kdf.js';
9
- import { __exports as checksum } from '../../../../../../_virtual/checksum.js';
10
- import { __exports as cipher } from '../../../../../../_virtual/cipher.js';
11
- import { __exports as functional } from '../../../../../../_virtual/functional.js';
12
- import { __exports as schemaValidation } from '../../../../../../_virtual/schema-validation.js';
8
+ import { __exports as kdf } from '../../../../_virtual/kdf.js';
9
+ import { __exports as checksum } from '../../../../_virtual/checksum.js';
10
+ import { __exports as cipher } from '../../../../_virtual/cipher.js';
11
+ import { __exports as functional } from '../../../../_virtual/functional.js';
12
+ import { __exports as schemaValidation } from '../../../../_virtual/schema-validation.js';
13
13
 
14
14
  var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
15
15
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -21,7 +21,7 @@ var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisAr
21
21
  });
22
22
  };
23
23
  Object.defineProperty(_class, "__esModule", { value: true });
24
- _class.Keystore = undefined;
24
+ _class.Keystore = void 0;
25
25
  const kdf_1 = kdf;
26
26
  const checksum_1 = checksum;
27
27
  const cipher_1 = cipher;
@@ -47,7 +47,7 @@ class Keystore {
47
47
  * Create a new Keystore object
48
48
  */
49
49
  static create(password, secret, pubkey, path, description = null, kdfMod = kdf_1.defaultPbkdfModule(), checksumMod = checksum_1.defaultSha256Module(), cipherMod = cipher_1.defaultAes128CtrModule()) {
50
- return __awaiter(this, undefined, undefined, function* () {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
51
  const obj = yield functional_1.create(password, secret, pubkey, path, description, kdfMod, checksumMod, cipherMod);
52
52
  return new Keystore(obj);
53
53
  });
@@ -69,7 +69,7 @@ class Keystore {
69
69
  * Decrypt a keystore, returns the secret key or throws on invalid password
70
70
  */
71
71
  decrypt(password) {
72
- return __awaiter(this, undefined, undefined, function* () {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
73
  return functional_1.decrypt(this, password);
74
74
  });
75
75
  }
@@ -77,7 +77,7 @@ class Keystore {
77
77
  * Verify the password as correct or not
78
78
  */
79
79
  verifyPassword(password) {
80
- return __awaiter(this, undefined, undefined, function* () {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
81
  return functional_1.verifyPassword(this, password);
82
82
  });
83
83
  }
@@ -1,15 +1,15 @@
1
- import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
2
- import { __exports as functional } from '../../../../../../_virtual/functional.js';
3
- import require$$0 from '../../../../../../_virtual/index2.js';
1
+ import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
2
+ import { __exports as functional } from '../../../../_virtual/functional.js';
3
+ import require$$0 from '../../../../_virtual/index2.js';
4
4
  import './kdf.js';
5
5
  import './checksum.js';
6
6
  import './cipher.js';
7
7
  import './password.js';
8
8
  import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
9
- import { __exports as kdf } from '../../../../../../_virtual/kdf.js';
10
- import { __exports as checksum } from '../../../../../../_virtual/checksum.js';
11
- import { __exports as cipher } from '../../../../../../_virtual/cipher.js';
12
- import { __exports as password } from '../../../../../../_virtual/password.js';
9
+ import { __exports as kdf } from '../../../../_virtual/kdf.js';
10
+ import { __exports as checksum } from '../../../../_virtual/checksum.js';
11
+ import { __exports as cipher } from '../../../../_virtual/cipher.js';
12
+ import { __exports as password } from '../../../../_virtual/password.js';
13
13
 
14
14
  (function (exports) {
15
15
  var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -22,7 +22,7 @@ import { __exports as password } from '../../../../../../_virtual/password.js';
22
22
  });
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.decrypt = exports.verifyPassword = exports.create = exports.defaultAes128CtrModule = exports.defaultSha256Module = exports.defaultScryptModule = exports.defaultPbkdfModule = undefined;
25
+ exports.decrypt = exports.verifyPassword = exports.create = exports.defaultAes128CtrModule = exports.defaultSha256Module = exports.defaultScryptModule = exports.defaultPbkdfModule = void 0;
26
26
  const uuid_1 = require$$0;
27
27
  const kdf_1 = kdf;
28
28
  Object.defineProperty(exports, "defaultPbkdfModule", { enumerable: true, get: function () { return kdf_1.defaultPbkdfModule; } });
@@ -45,7 +45,7 @@ import { __exports as password } from '../../../../../../_virtual/password.js';
45
45
  * @param cipherMod cipher configuration module
46
46
  */
47
47
  function create(password, secret, pubkey, path, description = null, kdfMod = kdf_1.defaultPbkdfModule(), checksumMod = checksum_1.defaultSha256Module(), cipherMod = cipher_1.defaultAes128CtrModule()) {
48
- return __awaiter(this, undefined, undefined, function* () {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
49
  const encryptionKey = yield kdf_1.kdf(kdfMod, password_1.normalizePassword(password));
50
50
  const ciphertext = yield cipher_1.cipherEncrypt(cipherMod, encryptionKey.slice(0, 16), secret);
51
51
  return {
@@ -79,7 +79,7 @@ import { __exports as password } from '../../../../../../_virtual/password.js';
79
79
  * Verify the password of a keystore object
80
80
  */
81
81
  function verifyPassword(keystore, password) {
82
- return __awaiter(this, undefined, undefined, function* () {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
83
  const decryptionKey = yield kdf_1.kdf(keystore.crypto.kdf, password_1.normalizePassword(password));
84
84
  const ciphertext = utils_1.hexToBytes(keystore.crypto.cipher.message);
85
85
  return checksum_1.verifyChecksum(keystore.crypto.checksum, decryptionKey, ciphertext);
@@ -90,7 +90,7 @@ import { __exports as password } from '../../../../../../_virtual/password.js';
90
90
  * Decrypt a keystore, returns the secret key or throws on invalid password
91
91
  */
92
92
  function decrypt(keystore, password) {
93
- return __awaiter(this, undefined, undefined, function* () {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
94
  const decryptionKey = yield kdf_1.kdf(keystore.crypto.kdf, password_1.normalizePassword(password));
95
95
  const ciphertext = utils_1.hexToBytes(keystore.crypto.cipher.message);
96
96
  if (!(yield checksum_1.verifyChecksum(keystore.crypto.checksum, decryptionKey, ciphertext))) {
@@ -1,13 +1,13 @@
1
- import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
2
- import { __exports as lib } from '../../../../../../_virtual/index.js';
1
+ import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
2
+ import { __exports as lib } from '../../../../_virtual/index.js';
3
3
  import './types.js';
4
4
  import './functional.js';
5
5
  import './class.js';
6
6
  import './schema-validation.js';
7
- import { __exports as types } from '../../../../../../_virtual/types.js';
8
- import { __exports as functional } from '../../../../../../_virtual/functional.js';
9
- import { __exports as _class } from '../../../../../../_virtual/class.js';
10
- import { __exports as schemaValidation } from '../../../../../../_virtual/schema-validation.js';
7
+ import { __exports as types } from '../../../../_virtual/types.js';
8
+ import { __exports as functional } from '../../../../_virtual/functional.js';
9
+ import { __exports as _class } from '../../../../_virtual/class.js';
10
+ import { __exports as schemaValidation } from '../../../../_virtual/schema-validation.js';
11
11
 
12
12
  (function (exports) {
13
13
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -1,12 +1,12 @@
1
- import { commonjsGlobal } from '../../../../../../_virtual/_commonjsHelpers.js';
2
- import { __exports as kdf$1 } from '../../../../../../_virtual/kdf.js';
1
+ import { commonjsGlobal } from '../../../../_virtual/_commonjsHelpers.js';
2
+ import { __exports as kdf$1 } from '../../../../_virtual/kdf.js';
3
3
  import '../node_modules/ethereum-cryptography/random.js';
4
4
  import '../node_modules/ethereum-cryptography/pbkdf2.js';
5
5
  import '../node_modules/ethereum-cryptography/scrypt.js';
6
6
  import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
7
- import { __exports as random } from '../../../../../../_virtual/random.js';
8
- import { __exports as pbkdf2 } from '../../../../../../_virtual/pbkdf2.js';
9
- import { __exports as scrypt } from '../../../../../../_virtual/scrypt.js';
7
+ import { __exports as random } from '../../../../_virtual/random.js';
8
+ import { __exports as pbkdf2 } from '../../../../_virtual/pbkdf2.js';
9
+ import { __exports as scrypt } from '../../../../_virtual/scrypt.js';
10
10
 
11
11
  var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
12
12
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -18,7 +18,7 @@ var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisAr
18
18
  });
19
19
  };
20
20
  Object.defineProperty(kdf$1, "__esModule", { value: true });
21
- var kdf_2 = kdf$1.kdf = kdf$1.defaultScryptModule = kdf$1.defaultPbkdfModule = undefined;
21
+ var kdf_2 = kdf$1.kdf = kdf$1.defaultScryptModule = kdf$1.defaultPbkdfModule = void 0;
22
22
  const random_1 = random;
23
23
  const pbkdf2_1 = pbkdf2;
24
24
  const scrypt_1 = scrypt;
@@ -51,7 +51,7 @@ function defaultScryptModule() {
51
51
  kdf$1.defaultScryptModule = defaultScryptModule;
52
52
  // kdf operations
53
53
  function kdf(mod, password) {
54
- return __awaiter(this, undefined, undefined, function* () {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
55
  if (mod.function === "pbkdf2") {
56
56
  return yield doPbkdf2(mod.params, password);
57
57
  }
@@ -65,12 +65,12 @@ function kdf(mod, password) {
65
65
  }
66
66
  kdf_2 = kdf$1.kdf = kdf;
67
67
  function doPbkdf2(params, password) {
68
- return __awaiter(this, undefined, undefined, function* () {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
69
  return pbkdf2_1.pbkdf2(password, utils_1.hexToBytes(params.salt), params.c, params.dklen, params.prf.slice(5));
70
70
  });
71
71
  }
72
72
  function doScrypt(params, password) {
73
- return __awaiter(this, undefined, undefined, function* () {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
74
  return scrypt_1.scrypt(password, utils_1.hexToBytes(params.salt), params.n, params.p, params.r, params.dklen);
75
75
  });
76
76
  }
@@ -1,8 +1,8 @@
1
- import { __exports as password } from '../../../../../../_virtual/password.js';
1
+ import { __exports as password } from '../../../../_virtual/password.js';
2
2
  import { u as utilsExports } from '../node_modules/ethereum-cryptography/utils.js';
3
3
 
4
4
  Object.defineProperty(password, "__esModule", { value: true });
5
- var normalizePassword_1 = password.normalizePassword = undefined;
5
+ var normalizePassword_1 = password.normalizePassword = void 0;
6
6
  const utils_1 = utilsExports;
7
7
  function normalizePassword(password) {
8
8
  if (typeof password === "string") {
@@ -1,7 +1,7 @@
1
- import { __exports as schemaValidationGenerated } from '../../../../../../_virtual/schema-validation-generated.js';
1
+ import { __exports as schemaValidationGenerated } from '../../../../_virtual/schema-validation-generated.js';
2
2
 
3
3
  Object.defineProperty(schemaValidationGenerated, "__esModule", { value: true });
4
- schemaValidationGenerated.Keystore = undefined;
4
+ schemaValidationGenerated.Keystore = void 0;
5
5
  schemaValidationGenerated.Keystore = validate19;
6
6
  const pattern0 = new RegExp("^pbkdf2$", "u");
7
7
  const pattern1 = new RegExp("^hmac-sha256$", "u");
@@ -1,9 +1,9 @@
1
- import { __exports as schemaValidation } from '../../../../../../_virtual/schema-validation.js';
1
+ import { __exports as schemaValidation } from '../../../../_virtual/schema-validation.js';
2
2
  import './schema-validation-generated.js';
3
- import { __exports as schemaValidationGenerated } from '../../../../../../_virtual/schema-validation-generated.js';
3
+ import { __exports as schemaValidationGenerated } from '../../../../_virtual/schema-validation-generated.js';
4
4
 
5
5
  Object.defineProperty(schemaValidation, "__esModule", { value: true });
6
- schemaValidation.isValidKeystore = schemaValidation.validateKeystore = schemaValidation.schemaValidationErrors = undefined;
6
+ schemaValidation.isValidKeystore = schemaValidation.validateKeystore = schemaValidation.schemaValidationErrors = void 0;
7
7
  const schema_validation_generated_1 = schemaValidationGenerated;
8
8
  // Redeclare generated function with the proper type
9
9
  const _validateKeystore = schema_validation_generated_1.Keystore;
@@ -1,4 +1,4 @@
1
- import { __exports as types } from '../../../../../../_virtual/types.js';
1
+ import { __exports as types } from '../../../../_virtual/types.js';
2
2
 
3
3
  Object.defineProperty(types, "__esModule", { value: true });
4
4
 
@@ -1,7 +1,7 @@
1
- import { __exports as _assert } from '../../../../../_virtual/_assert.js';
1
+ import { __exports as _assert } from '../../../../../../_virtual/_assert.js';
2
2
 
3
3
  Object.defineProperty(_assert, "__esModule", { value: true });
4
- _assert.output = _assert.exists = _assert.hash = _assert.bytes = _assert.bool = _assert.number = undefined;
4
+ _assert.output = _assert.exists = _assert.hash = _assert.bytes = _assert.bool = _assert.number = void 0;
5
5
  function number(n) {
6
6
  if (!Number.isSafeInteger(n) || n < 0)
7
7
  throw new Error(`Wrong positive integer: ${n}`);
@@ -1,11 +1,11 @@
1
- import { __exports as _sha2 } from '../../../../../_virtual/_sha2.js';
1
+ import { __exports as _sha2 } from '../../../../../../_virtual/_sha2.js';
2
2
  import './_assert.js';
3
3
  import './utils.js';
4
- import { __exports as _assert } from '../../../../../_virtual/_assert.js';
5
- import { __exports as utils } from '../../../../../_virtual/utils.js';
4
+ import { __exports as utils } from '../../../../../../_virtual/utils.js';
5
+ import { __exports as _assert } from '../../../../../../_virtual/_assert.js';
6
6
 
7
7
  Object.defineProperty(_sha2, "__esModule", { value: true });
8
- _sha2.SHA2 = undefined;
8
+ _sha2.SHA2 = void 0;
9
9
  const _assert_js_1 = _assert;
10
10
  const utils_js_1 = utils;
11
11
  // Polyfill for Safari 14
@@ -1,8 +1,8 @@
1
- import { __exports as _u64 } from '../../../../../_virtual/_u64.js';
1
+ import { __exports as _u64 } from '../../../../../../_virtual/_u64.js';
2
2
 
3
3
  (function (exports) {
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.add = exports.toBig = exports.split = exports.fromBig = undefined;
5
+ exports.add = exports.toBig = exports.split = exports.fromBig = void 0;
6
6
  const U32_MASK64 = BigInt(2 ** 32 - 1);
7
7
  const _32n = BigInt(32);
8
8
  // We are not using BigUint64Array, because they are extremely slow as per 2022
@@ -1,7 +1,7 @@
1
- import { __exports as cryptoBrowser } from '../../../../../_virtual/cryptoBrowser.js';
1
+ import { __exports as cryptoBrowser } from '../../../../../../_virtual/cryptoBrowser.js';
2
2
 
3
3
  Object.defineProperty(cryptoBrowser, "__esModule", { value: true });
4
- cryptoBrowser.crypto = undefined;
4
+ cryptoBrowser.crypto = void 0;
5
5
  cryptoBrowser.crypto = {
6
6
  node: undefined,
7
7
  web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined,
@@ -1,12 +1,12 @@
1
- import { __exports as hmac } from '../../../../../_virtual/hmac.js';
1
+ import { __exports as hmac } from '../../../../../../_virtual/hmac.js';
2
2
  import './_assert.js';
3
3
  import './utils.js';
4
- import { __exports as _assert } from '../../../../../_virtual/_assert.js';
5
- import { __exports as utils } from '../../../../../_virtual/utils.js';
4
+ import { __exports as utils } from '../../../../../../_virtual/utils.js';
5
+ import { __exports as _assert } from '../../../../../../_virtual/_assert.js';
6
6
 
7
7
  (function (exports) {
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.hmac = undefined;
9
+ exports.hmac = void 0;
10
10
  const _assert_js_1 = _assert;
11
11
  const utils_js_1 = utils;
12
12
  // HMAC (RFC 2104)
@@ -1,13 +1,13 @@
1
- import { __exports as pbkdf2$1 } from '../../../../../_virtual/pbkdf22.js';
1
+ import { __exports as pbkdf2$1 } from '../../../../../../_virtual/pbkdf22.js';
2
2
  import './_assert.js';
3
3
  import './hmac.js';
4
4
  import './utils.js';
5
- import { __exports as utils } from '../../../../../_virtual/utils.js';
6
- import { __exports as _assert } from '../../../../../_virtual/_assert.js';
7
- import { __exports as hmac } from '../../../../../_virtual/hmac.js';
5
+ import { __exports as utils } from '../../../../../../_virtual/utils.js';
6
+ import { __exports as _assert } from '../../../../../../_virtual/_assert.js';
7
+ import { __exports as hmac } from '../../../../../../_virtual/hmac.js';
8
8
 
9
9
  Object.defineProperty(pbkdf2$1, "__esModule", { value: true });
10
- pbkdf2$1.pbkdf2Async = pbkdf2$1.pbkdf2 = undefined;
10
+ pbkdf2$1.pbkdf2Async = pbkdf2$1.pbkdf2 = void 0;
11
11
  const _assert_js_1 = _assert;
12
12
  const hmac_js_1 = hmac;
13
13
  const utils_js_1 = utils;
@@ -1,15 +1,15 @@
1
- import { __exports as scrypt$1 } from '../../../../../_virtual/scrypt2.js';
1
+ import { __exports as scrypt$1 } from '../../../../../../_virtual/scrypt2.js';
2
2
  import './_assert.js';
3
3
  import './sha256.js';
4
4
  import './pbkdf2.js';
5
5
  import './utils.js';
6
- import { __exports as utils } from '../../../../../_virtual/utils.js';
7
- import { __exports as _assert } from '../../../../../_virtual/_assert.js';
8
- import { __exports as sha256 } from '../../../../../_virtual/sha2562.js';
9
- import { __exports as pbkdf2 } from '../../../../../_virtual/pbkdf22.js';
6
+ import { __exports as utils } from '../../../../../../_virtual/utils.js';
7
+ import { __exports as _assert } from '../../../../../../_virtual/_assert.js';
8
+ import { __exports as pbkdf2 } from '../../../../../../_virtual/pbkdf22.js';
9
+ import { __exports as sha256 } from '../../../../../../_virtual/sha2562.js';
10
10
 
11
11
  Object.defineProperty(scrypt$1, "__esModule", { value: true });
12
- scrypt$1.scryptAsync = scrypt$1.scrypt = undefined;
12
+ scrypt$1.scryptAsync = scrypt$1.scrypt = void 0;
13
13
  const _assert_js_1 = _assert;
14
14
  const sha256_js_1 = sha256;
15
15
  const pbkdf2_js_1 = pbkdf2;
@@ -1,11 +1,11 @@
1
- import { __exports as sha256 } from '../../../../../_virtual/sha2562.js';
1
+ import { __exports as sha256 } from '../../../../../../_virtual/sha2562.js';
2
2
  import './_sha2.js';
3
3
  import './utils.js';
4
- import { __exports as _sha2 } from '../../../../../_virtual/_sha2.js';
5
- import { __exports as utils } from '../../../../../_virtual/utils.js';
4
+ import { __exports as _sha2 } from '../../../../../../_virtual/_sha2.js';
5
+ import { __exports as utils } from '../../../../../../_virtual/utils.js';
6
6
 
7
7
  Object.defineProperty(sha256, "__esModule", { value: true });
8
- sha256.sha224 = sha256.sha256 = undefined;
8
+ sha256.sha224 = sha256.sha256 = void 0;
9
9
  const _sha2_js_1 = _sha2;
10
10
  const utils_js_1 = utils;
11
11
  // Choice: a ? b : c
@@ -1,13 +1,13 @@
1
- import { __exports as sha512 } from '../../../../../_virtual/sha512.js';
1
+ import { __exports as sha512 } from '../../../../../../_virtual/sha512.js';
2
2
  import './_sha2.js';
3
3
  import './_u64.js';
4
4
  import './utils.js';
5
- import { __exports as _sha2 } from '../../../../../_virtual/_sha2.js';
6
- import { __exports as _u64 } from '../../../../../_virtual/_u64.js';
7
- import { __exports as utils } from '../../../../../_virtual/utils.js';
5
+ import { __exports as _u64 } from '../../../../../../_virtual/_u64.js';
6
+ import { __exports as _sha2 } from '../../../../../../_virtual/_sha2.js';
7
+ import { __exports as utils } from '../../../../../../_virtual/utils.js';
8
8
 
9
9
  Object.defineProperty(sha512, "__esModule", { value: true });
10
- sha512.sha384 = sha512.sha512_256 = sha512.sha512_224 = sha512.sha512 = sha512.SHA512 = undefined;
10
+ sha512.sha384 = sha512.sha512_256 = sha512.sha512_224 = sha512.sha512 = sha512.SHA512 = void 0;
11
11
  const _sha2_js_1 = _sha2;
12
12
  const _u64_js_1 = _u64;
13
13
  const utils_js_1 = utils;
@@ -1,11 +1,11 @@
1
- import { __exports as utils } from '../../../../../_virtual/utils.js';
1
+ import { __exports as utils } from '../../../../../../_virtual/utils.js';
2
2
  import './cryptoBrowser.js';
3
- import { __exports as cryptoBrowser } from '../../../../../_virtual/cryptoBrowser.js';
3
+ import { __exports as cryptoBrowser } from '../../../../../../_virtual/cryptoBrowser.js';
4
4
 
5
5
  (function (exports) {
6
6
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.randomBytes = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.isLE = exports.rotr = exports.createView = exports.u32 = exports.u8 = undefined;
8
+ exports.randomBytes = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.isLE = exports.rotr = exports.createView = exports.u32 = exports.u8 = void 0;
9
9
  // The import here is via the package name. This is to ensure
10
10
  // that exports mapping/resolution does fall into place.
11
11
  const crypto_1 = cryptoBrowser;
@@ -1,10 +1,10 @@
1
- import { __exports as aes } from '../../../../../../../_virtual/aes.js';
2
- import '../../../../@noble/hashes/cryptoBrowser.js';
1
+ import { __exports as aes } from '../../../../../_virtual/aes.js';
2
+ import '../@noble/hashes/cryptoBrowser.js';
3
3
  import { u as utilsExports } from './utils.js';
4
- import { __exports as cryptoBrowser } from '../../../../../../../_virtual/cryptoBrowser.js';
4
+ import { __exports as cryptoBrowser } from '../../../../../_virtual/cryptoBrowser.js';
5
5
 
6
6
  Object.defineProperty(aes, "__esModule", { value: true });
7
- aes.decrypt = aes.encrypt = undefined;
7
+ aes.decrypt = aes.encrypt = void 0;
8
8
  const crypto_1 = cryptoBrowser;
9
9
  const utils_1 = utilsExports;
10
10
  function validateOpt(key, iv, mode) {
@@ -1,14 +1,14 @@
1
- import { __exports as pbkdf2$1 } from '../../../../../../../_virtual/pbkdf2.js';
2
- import '../../../../@noble/hashes/pbkdf2.js';
3
- import '../../../../@noble/hashes/sha256.js';
4
- import '../../../../@noble/hashes/sha512.js';
1
+ import { __exports as pbkdf2$1 } from '../../../../../_virtual/pbkdf2.js';
2
+ import '../@noble/hashes/pbkdf2.js';
3
+ import '../@noble/hashes/sha256.js';
4
+ import '../@noble/hashes/sha512.js';
5
5
  import { u as utilsExports } from './utils.js';
6
- import { __exports as pbkdf2$2 } from '../../../../../../../_virtual/pbkdf22.js';
7
- import { __exports as sha256 } from '../../../../../../../_virtual/sha2562.js';
8
- import { __exports as sha512 } from '../../../../../../../_virtual/sha512.js';
6
+ import { __exports as pbkdf2$2 } from '../../../../../_virtual/pbkdf22.js';
7
+ import { __exports as sha256 } from '../../../../../_virtual/sha2562.js';
8
+ import { __exports as sha512 } from '../../../../../_virtual/sha512.js';
9
9
 
10
10
  Object.defineProperty(pbkdf2$1, "__esModule", { value: true });
11
- pbkdf2$1.pbkdf2Sync = pbkdf2$1.pbkdf2 = undefined;
11
+ pbkdf2$1.pbkdf2Sync = pbkdf2$1.pbkdf2 = void 0;
12
12
  const pbkdf2_1 = pbkdf2$2;
13
13
  const sha256_1 = sha256;
14
14
  const sha512_1 = sha512;
@@ -1,9 +1,9 @@
1
- import { __exports as random } from '../../../../../../../_virtual/random.js';
2
- import '../../../../@noble/hashes/utils.js';
3
- import { __exports as utils } from '../../../../../../../_virtual/utils.js';
1
+ import { __exports as random } from '../../../../../_virtual/random.js';
2
+ import '../@noble/hashes/utils.js';
3
+ import { __exports as utils } from '../../../../../_virtual/utils.js';
4
4
 
5
5
  Object.defineProperty(random, "__esModule", { value: true });
6
- random.getRandomBytes = random.getRandomBytesSync = undefined;
6
+ random.getRandomBytes = random.getRandomBytesSync = void 0;
7
7
  const utils_1 = utils;
8
8
  function getRandomBytesSync(bytes) {
9
9
  return (0, utils_1.randomBytes)(bytes);
@@ -1,10 +1,10 @@
1
- import { __exports as scrypt$1 } from '../../../../../../../_virtual/scrypt.js';
2
- import '../../../../@noble/hashes/scrypt.js';
1
+ import { __exports as scrypt$1 } from '../../../../../_virtual/scrypt.js';
2
+ import '../@noble/hashes/scrypt.js';
3
3
  import { u as utilsExports } from './utils.js';
4
- import { __exports as scrypt$2 } from '../../../../../../../_virtual/scrypt2.js';
4
+ import { __exports as scrypt$2 } from '../../../../../_virtual/scrypt2.js';
5
5
 
6
6
  Object.defineProperty(scrypt$1, "__esModule", { value: true });
7
- scrypt$1.scryptSync = scrypt$1.scrypt = undefined;
7
+ scrypt$1.scryptSync = scrypt$1.scrypt = void 0;
8
8
  const scrypt_1 = scrypt$2;
9
9
  const utils_1 = utilsExports;
10
10
  async function scrypt(password, salt, n, p, r, dkLen, onProgress) {
@@ -1,10 +1,10 @@
1
- import { __exports as sha256 } from '../../../../../../../_virtual/sha256.js';
2
- import '../../../../@noble/hashes/sha256.js';
1
+ import { __exports as sha256 } from '../../../../../_virtual/sha256.js';
2
+ import '../@noble/hashes/sha256.js';
3
3
  import { u as utilsExports } from './utils.js';
4
- import { __exports as sha256$1 } from '../../../../../../../_virtual/sha2562.js';
4
+ import { __exports as sha256$1 } from '../../../../../_virtual/sha2562.js';
5
5
 
6
6
  Object.defineProperty(sha256, "__esModule", { value: true });
7
- sha256.sha256 = undefined;
7
+ sha256.sha256 = void 0;
8
8
  const sha256_1 = sha256$1;
9
9
  const utils_1 = utilsExports;
10
10
  sha256.sha256 = (0, utils_1.wrapHash)(sha256_1.sha256);