@waku/rln 0.1.4-d27db21.0 → 0.1.5-76f86de.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +5 -0
  3. package/bundle/index.js +1 -1
  4. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js +1 -1
  5. package/bundle/node_modules/@ethersproject/abi/lib.esm/interface.js +1 -1
  6. package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/index.js +1 -1
  7. package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/index.js +11 -11
  8. package/bundle/node_modules/@ethersproject/bytes/lib.esm/_version.js +1 -1
  9. package/bundle/node_modules/@ethersproject/contracts/lib.esm/index.js +7 -7
  10. package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js +2 -2
  11. package/bundle/node_modules/@ethersproject/hash/lib.esm/typed-data.js +2 -2
  12. package/bundle/node_modules/@ethersproject/keccak256/node_modules/js-sha3/src/sha3.js +1 -1
  13. package/bundle/node_modules/@ethersproject/logger/lib.esm/_version.js +1 -1
  14. package/bundle/node_modules/@ethersproject/properties/lib.esm/index.js +1 -1
  15. package/bundle/node_modules/@ethersproject/providers/lib.esm/base-provider.js +44 -44
  16. package/bundle/node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js +8 -8
  17. package/bundle/node_modules/@ethersproject/rlp/lib.esm/_version.js +1 -1
  18. package/bundle/node_modules/@ethersproject/transactions/lib.esm/index.js +1 -1
  19. package/bundle/node_modules/@ethersproject/web/lib.esm/geturl.js +1 -1
  20. package/bundle/node_modules/@ethersproject/web/lib.esm/index.js +2 -2
  21. package/bundle/node_modules/@multiformats/multiaddr/dist/src/multiaddr.js +1 -0
  22. package/bundle/node_modules/@noble/hashes/esm/sha3.js +1 -1
  23. package/bundle/node_modules/bn.js/lib/bn.js +1 -1
  24. package/bundle/packages/core/dist/lib/connection_manager/connection_manager.js +6 -6
  25. package/bundle/packages/rln/dist/contract/abi.js +502 -248
  26. package/bundle/packages/rln/dist/contract/constants.js +4 -5
  27. package/bundle/packages/rln/dist/contract/rln_contract.js +121 -37
  28. package/bundle/packages/rln/dist/keystore/keystore.js +2 -1
  29. package/bundle/packages/rln/dist/rln.js +4 -4
  30. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/checksum.js +2 -2
  31. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/cipher.js +3 -3
  32. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/class.js +4 -4
  33. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/functional.js +4 -4
  34. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/kdf.js +4 -4
  35. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/password.js +1 -1
  36. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation-generated.js +1 -1
  37. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation.js +1 -1
  38. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/aes.js +1 -1
  39. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/pbkdf2.js +1 -1
  40. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +1 -1
  41. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/scrypt.js +1 -1
  42. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/sha256.js +1 -1
  43. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +1 -1
  44. package/bundle/packages/rln/node_modules/@noble/hashes/_assert.js +1 -1
  45. package/bundle/packages/rln/node_modules/@noble/hashes/_sha2.js +2 -2
  46. package/bundle/packages/rln/node_modules/@noble/hashes/_u64.js +1 -1
  47. package/bundle/packages/rln/node_modules/@noble/hashes/cryptoBrowser.js +1 -1
  48. package/bundle/packages/rln/node_modules/@noble/hashes/hmac.js +2 -2
  49. package/bundle/packages/rln/node_modules/@noble/hashes/pbkdf2.js +1 -1
  50. package/bundle/packages/rln/node_modules/@noble/hashes/scrypt.js +2 -2
  51. package/bundle/packages/rln/node_modules/@noble/hashes/sha256.js +1 -1
  52. package/bundle/packages/rln/node_modules/@noble/hashes/sha512.js +2 -2
  53. package/bundle/packages/rln/node_modules/@noble/hashes/utils.js +1 -1
  54. package/dist/.tsbuildinfo +1 -1
  55. package/dist/codec.test-utils.d.ts +36 -0
  56. package/dist/codec.test-utils.js +56 -0
  57. package/dist/codec.test-utils.js.map +1 -0
  58. package/dist/contract/abi.d.ts +21 -17
  59. package/dist/contract/abi.js +502 -248
  60. package/dist/contract/abi.js.map +1 -1
  61. package/dist/contract/constants.d.ts +22 -18
  62. package/dist/contract/constants.js +3 -3
  63. package/dist/contract/constants.js.map +1 -1
  64. package/dist/contract/rln_contract.d.ts +10 -3
  65. package/dist/contract/rln_contract.js +120 -36
  66. package/dist/contract/rln_contract.js.map +1 -1
  67. package/dist/contract/test-setup.d.ts +26 -0
  68. package/dist/contract/test-setup.js +56 -0
  69. package/dist/contract/test-setup.js.map +1 -0
  70. package/dist/contract/test-utils.d.ts +39 -0
  71. package/dist/contract/test-utils.js +118 -0
  72. package/dist/contract/test-utils.js.map +1 -0
  73. package/dist/index.d.ts +3 -2
  74. package/dist/index.js +2 -2
  75. package/dist/index.js.map +1 -1
  76. package/dist/keystore/keystore.js +2 -1
  77. package/dist/keystore/keystore.js.map +1 -1
  78. package/dist/keystore/types.d.ts +1 -0
  79. package/dist/rln.d.ts +1 -1
  80. package/dist/rln.js +4 -4
  81. package/dist/rln.js.map +1 -1
  82. package/package.json +1 -1
  83. package/src/codec.test-utils.ts +80 -0
  84. package/src/contract/abi.ts +502 -248
  85. package/src/contract/constants.ts +3 -3
  86. package/src/contract/rln_contract.ts +158 -46
  87. package/src/contract/test-setup.ts +86 -0
  88. package/src/contract/test-utils.ts +179 -0
  89. package/src/index.ts +13 -2
  90. package/src/keystore/keystore.ts +2 -1
  91. package/src/keystore/types.ts +1 -0
  92. package/src/rln.ts +5 -5
@@ -203,7 +203,7 @@ class JsonRpcSigner extends Signer {
203
203
  transaction.gasLimit = this.provider.estimateGas(estimate);
204
204
  }
205
205
  if (transaction.to != null) {
206
- transaction.to = Promise.resolve(transaction.to).then((to) => __awaiter(this, undefined, undefined, function* () {
206
+ transaction.to = Promise.resolve(transaction.to).then((to) => __awaiter(this, void 0, void 0, function* () {
207
207
  if (to == null) {
208
208
  return null;
209
209
  }
@@ -246,7 +246,7 @@ class JsonRpcSigner extends Signer {
246
246
  });
247
247
  }
248
248
  sendTransaction(transaction) {
249
- return __awaiter(this, undefined, undefined, function* () {
249
+ return __awaiter(this, void 0, void 0, function* () {
250
250
  // This cannot be mined any earlier than any recent block
251
251
  const blockNumber = yield this.provider._getInternalBlockNumber(100 + 2 * this.provider.pollingInterval);
252
252
  // Send the transaction
@@ -270,7 +270,7 @@ class JsonRpcSigner extends Signer {
270
270
  });
271
271
  }
272
272
  signMessage(message) {
273
- return __awaiter(this, undefined, undefined, function* () {
273
+ return __awaiter(this, void 0, void 0, function* () {
274
274
  const data = ((typeof (message) === "string") ? toUtf8Bytes(message) : message);
275
275
  const address = yield this.getAddress();
276
276
  try {
@@ -289,7 +289,7 @@ class JsonRpcSigner extends Signer {
289
289
  });
290
290
  }
291
291
  _legacySignMessage(message) {
292
- return __awaiter(this, undefined, undefined, function* () {
292
+ return __awaiter(this, void 0, void 0, function* () {
293
293
  const data = ((typeof (message) === "string") ? toUtf8Bytes(message) : message);
294
294
  const address = yield this.getAddress();
295
295
  try {
@@ -309,7 +309,7 @@ class JsonRpcSigner extends Signer {
309
309
  });
310
310
  }
311
311
  _signTypedData(domain, types, value) {
312
- return __awaiter(this, undefined, undefined, function* () {
312
+ return __awaiter(this, void 0, void 0, function* () {
313
313
  // Populate any ENS names (in-place)
314
314
  const populated = yield TypedDataEncoder.resolveNames(domain, types, value, (name) => {
315
315
  return this.provider.resolveName(name);
@@ -334,7 +334,7 @@ class JsonRpcSigner extends Signer {
334
334
  });
335
335
  }
336
336
  unlock(password) {
337
- return __awaiter(this, undefined, undefined, function* () {
337
+ return __awaiter(this, void 0, void 0, function* () {
338
338
  const provider = this.provider;
339
339
  const address = yield this.getAddress();
340
340
  return provider.send("personal_unlockAccount", [address.toLowerCase(), password, null]);
@@ -414,7 +414,7 @@ class JsonRpcProvider extends BaseProvider {
414
414
  return this._cache["detectNetwork"];
415
415
  }
416
416
  _uncachedDetectNetwork() {
417
- return __awaiter(this, undefined, undefined, function* () {
417
+ return __awaiter(this, void 0, void 0, function* () {
418
418
  yield timer(0);
419
419
  let chainId = null;
420
420
  try {
@@ -544,7 +544,7 @@ class JsonRpcProvider extends BaseProvider {
544
544
  return null;
545
545
  }
546
546
  perform(method, params) {
547
- return __awaiter(this, undefined, undefined, function* () {
547
+ return __awaiter(this, void 0, void 0, function* () {
548
548
  // Legacy networks do not like the type field being passed along (which
549
549
  // is fair), so we delete type if it is 0 and a non-EIP-1559 network
550
550
  if (method === "call" || method === "estimateGas") {
@@ -1,3 +1,3 @@
1
- const version = "rlp/5.7.0";
1
+ const version = "rlp/5.8.0";
2
2
 
3
3
  export { version };
@@ -1,5 +1,5 @@
1
1
  import { getAddress } from '../../address/lib.esm/index.js';
2
- import { hexDataLength, arrayify, hexlify, hexZeroPad, hexDataSlice, splitSignature, stripZeros, hexConcat } from '../../bytes/lib.esm/index.js';
2
+ import { hexDataLength, arrayify, hexZeroPad, hexlify, hexDataSlice, splitSignature, stripZeros, hexConcat } from '../../bytes/lib.esm/index.js';
3
3
  import { keccak256 } from '../../keccak256/lib.esm/index.js';
4
4
  import { decode, encode } from '../../rlp/lib.esm/index.js';
5
5
  import { recoverPublicKey, computePublicKey } from '../../signing-key/lib.esm/index.js';
@@ -10,7 +10,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
10
10
  });
11
11
  };
12
12
  function getUrl(href, options) {
13
- return __awaiter(this, undefined, undefined, function* () {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
14
  if (options == null) {
15
15
  options = {};
16
16
  }
@@ -173,7 +173,7 @@ function _fetchData(connection, body, processFunc) {
173
173
  return { promise, cancel };
174
174
  })();
175
175
  const runningFetch = (function () {
176
- return __awaiter(this, undefined, undefined, function* () {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
177
  for (let attempt = 0; attempt < attemptLimit; attempt++) {
178
178
  let response = null;
179
179
  try {
@@ -236,7 +236,7 @@ function _fetchData(connection, body, processFunc) {
236
236
  url: url
237
237
  });
238
238
  }
239
- {
239
+ if (processFunc) {
240
240
  try {
241
241
  const result = yield processFunc(body, response);
242
242
  runningTimeout.cancel();
@@ -12,6 +12,7 @@ import '../../../../multiformats/dist/src/codecs/json.js';
12
12
  import './convert.js';
13
13
  import { getProtocol } from './protocols-table.js';
14
14
 
15
+ /* eslint-disable complexity */
15
16
  [
16
17
  getProtocol('dns').code,
17
18
  getProtocol('dns4').code,
@@ -1,5 +1,5 @@
1
1
  import { anumber, aexists, abytes, aoutput } from './_assert.js';
2
- import { split, rotlBH, rotlSH, rotlBL, rotlSL } from './_u64.js';
2
+ import { rotlSH, rotlSL, rotlBH, rotlBL, split } from './_u64.js';
3
3
  import { wrapConstructor, Hash, u32, isLE, byteSwap32, toBytes } from './utils.js';
4
4
 
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { commonjsGlobal, getDefaultExportFromCjs } from '../../../_virtual/_commonjsHelpers.js';
1
+ import { getDefaultExportFromCjs, commonjsGlobal } from '../../../_virtual/_commonjsHelpers.js';
2
2
  import { __module as bn } from '../../../_virtual/bn.js';
3
3
  import require$$0 from '../../../_virtual/__node-resolve_empty.js';
4
4
 
@@ -1,9 +1,3 @@
1
- import '../../../../../node_modules/@multiformats/multiaddr/dist/src/multiaddr.js';
2
- import '../../../../../node_modules/@multiformats/multiaddr/dist/src/protocols-table.js';
3
- import '../../../../../node_modules/@multiformats/multiaddr/dist/src/convert.js';
4
- import '../../../../interfaces/dist/protocols.js';
5
- import '../../../../interfaces/dist/connection_manager.js';
6
- import '../../../../interfaces/dist/health_indicator.js';
7
1
  import '../../../../../node_modules/multiformats/dist/src/bases/base10.js';
8
2
  import '../../../../../node_modules/multiformats/dist/src/bases/base16.js';
9
3
  import '../../../../../node_modules/multiformats/dist/src/bases/base2.js';
@@ -15,6 +9,12 @@ import '../../../../../node_modules/multiformats/dist/src/bases/base64.js';
15
9
  import '../../../../../node_modules/multiformats/dist/src/bases/base8.js';
16
10
  import '../../../../../node_modules/multiformats/dist/src/bases/identity.js';
17
11
  import '../../../../../node_modules/multiformats/dist/src/codecs/json.js';
12
+ import '../../../../../node_modules/@multiformats/multiaddr/dist/src/convert.js';
13
+ import '../../../../../node_modules/@multiformats/multiaddr/dist/src/protocols-table.js';
14
+ import '../../../../../node_modules/@multiformats/multiaddr/dist/src/multiaddr.js';
15
+ import '../../../../interfaces/dist/protocols.js';
16
+ import '../../../../interfaces/dist/connection_manager.js';
17
+ import '../../../../interfaces/dist/health_indicator.js';
18
18
  import { Logger } from '../../../../utils/dist/logger/index.js';
19
19
  import './keep_alive_manager.js';
20
20