@waku/rln 0.1.4-d27db21.0 → 0.1.5-053bb95.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 (138) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +5 -0
  3. package/bundle/_virtual/utils.js +2 -2
  4. package/bundle/_virtual/utils2.js +2 -2
  5. package/bundle/index.js +3 -1
  6. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js +1 -1
  7. package/bundle/node_modules/@ethersproject/abi/lib.esm/interface.js +1 -1
  8. package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/index.js +1 -1
  9. package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/index.js +11 -11
  10. package/bundle/node_modules/@ethersproject/bytes/lib.esm/_version.js +1 -1
  11. package/bundle/node_modules/@ethersproject/contracts/lib.esm/index.js +7 -7
  12. package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js +2 -2
  13. package/bundle/node_modules/@ethersproject/hash/lib.esm/typed-data.js +2 -2
  14. package/bundle/node_modules/@ethersproject/keccak256/node_modules/js-sha3/src/sha3.js +1 -1
  15. package/bundle/node_modules/@ethersproject/logger/lib.esm/_version.js +1 -1
  16. package/bundle/node_modules/@ethersproject/properties/lib.esm/index.js +1 -1
  17. package/bundle/node_modules/@ethersproject/providers/lib.esm/base-provider.js +44 -44
  18. package/bundle/node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js +8 -8
  19. package/bundle/node_modules/@ethersproject/rlp/lib.esm/_version.js +1 -1
  20. package/bundle/node_modules/@ethersproject/transactions/lib.esm/index.js +1 -1
  21. package/bundle/node_modules/@ethersproject/web/lib.esm/geturl.js +1 -1
  22. package/bundle/node_modules/@ethersproject/web/lib.esm/index.js +2 -2
  23. package/bundle/node_modules/@multiformats/multiaddr/dist/src/multiaddr.js +1 -0
  24. package/bundle/node_modules/@noble/hashes/esm/sha3.js +1 -1
  25. package/bundle/node_modules/bn.js/lib/bn.js +1 -1
  26. package/bundle/packages/core/dist/lib/connection_manager/connection_manager.js +6 -6
  27. package/bundle/packages/rln/dist/contract/abi.js +502 -248
  28. package/bundle/packages/rln/dist/contract/constants.js +5 -9
  29. package/bundle/packages/rln/dist/contract/errors.js +62 -0
  30. package/bundle/packages/rln/dist/contract/rln_base_contract.js +347 -0
  31. package/bundle/packages/rln/dist/contract/rln_contract.js +81 -392
  32. package/bundle/packages/rln/dist/contract/types.js +9 -0
  33. package/bundle/packages/rln/dist/create.js +1 -1
  34. package/bundle/packages/rln/dist/credentials_manager.js +215 -0
  35. package/bundle/packages/rln/dist/identity.js +8 -0
  36. package/bundle/packages/rln/dist/keystore/keystore.js +20 -28
  37. package/bundle/packages/rln/dist/rln.js +56 -166
  38. package/bundle/packages/rln/dist/zerokit.js +5 -5
  39. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/checksum.js +2 -2
  40. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/cipher.js +3 -3
  41. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/class.js +4 -4
  42. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/functional.js +4 -4
  43. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/kdf.js +4 -4
  44. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/password.js +1 -1
  45. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation-generated.js +1 -1
  46. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/lib/schema-validation.js +1 -1
  47. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/aes.js +1 -1
  48. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/pbkdf2.js +1 -1
  49. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +2 -2
  50. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/scrypt.js +1 -1
  51. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/sha256.js +1 -1
  52. package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +3 -3
  53. package/bundle/packages/rln/node_modules/@noble/hashes/_assert.js +1 -1
  54. package/bundle/packages/rln/node_modules/@noble/hashes/_sha2.js +2 -2
  55. package/bundle/packages/rln/node_modules/@noble/hashes/_u64.js +1 -1
  56. package/bundle/packages/rln/node_modules/@noble/hashes/cryptoBrowser.js +1 -1
  57. package/bundle/packages/rln/node_modules/@noble/hashes/esm/_assert.js +43 -0
  58. package/bundle/packages/rln/node_modules/@noble/hashes/esm/_sha2.js +116 -0
  59. package/bundle/packages/rln/node_modules/@noble/hashes/esm/hmac.js +79 -0
  60. package/bundle/packages/rln/node_modules/@noble/hashes/esm/sha256.js +126 -0
  61. package/bundle/packages/rln/node_modules/@noble/hashes/esm/utils.js +43 -0
  62. package/bundle/packages/rln/node_modules/@noble/hashes/hmac.js +2 -2
  63. package/bundle/packages/rln/node_modules/@noble/hashes/pbkdf2.js +2 -2
  64. package/bundle/packages/rln/node_modules/@noble/hashes/scrypt.js +3 -3
  65. package/bundle/packages/rln/node_modules/@noble/hashes/sha256.js +2 -2
  66. package/bundle/packages/rln/node_modules/@noble/hashes/sha512.js +3 -3
  67. package/bundle/packages/rln/node_modules/@noble/hashes/utils.js +2 -2
  68. package/dist/.tsbuildinfo +1 -1
  69. package/dist/codec.test-utils.d.ts +36 -0
  70. package/dist/codec.test-utils.js +56 -0
  71. package/dist/codec.test-utils.js.map +1 -0
  72. package/dist/contract/abi.d.ts +21 -17
  73. package/dist/contract/abi.js +502 -248
  74. package/dist/contract/abi.js.map +1 -1
  75. package/dist/contract/constants.d.ts +23 -19
  76. package/dist/contract/constants.js +3 -3
  77. package/dist/contract/constants.js.map +1 -1
  78. package/dist/contract/errors.d.ts +30 -0
  79. package/dist/contract/errors.js +61 -0
  80. package/dist/contract/errors.js.map +1 -0
  81. package/dist/contract/rln_base_contract.d.ts +88 -0
  82. package/dist/contract/rln_base_contract.js +330 -0
  83. package/dist/contract/rln_base_contract.js.map +1 -0
  84. package/dist/contract/rln_contract.d.ts +19 -109
  85. package/dist/contract/rln_contract.js +80 -390
  86. package/dist/contract/rln_contract.js.map +1 -1
  87. package/dist/contract/test-setup.d.ts +26 -0
  88. package/dist/contract/test-setup.js +56 -0
  89. package/dist/contract/test-setup.js.map +1 -0
  90. package/dist/contract/test-utils.d.ts +39 -0
  91. package/dist/contract/test-utils.js +118 -0
  92. package/dist/contract/test-utils.js.map +1 -0
  93. package/dist/contract/types.d.ts +40 -0
  94. package/dist/contract/types.js +8 -0
  95. package/dist/contract/types.js.map +1 -0
  96. package/dist/create.js +1 -1
  97. package/dist/create.js.map +1 -1
  98. package/dist/credentials_manager.d.ts +44 -0
  99. package/dist/credentials_manager.js +197 -0
  100. package/dist/credentials_manager.js.map +1 -0
  101. package/dist/identity.d.ts +1 -0
  102. package/dist/identity.js +8 -0
  103. package/dist/identity.js.map +1 -1
  104. package/dist/index.d.ts +5 -2
  105. package/dist/index.js +4 -2
  106. package/dist/index.js.map +1 -1
  107. package/dist/keystore/keystore.d.ts +0 -1
  108. package/dist/keystore/keystore.js +20 -28
  109. package/dist/keystore/keystore.js.map +1 -1
  110. package/dist/keystore/types.d.ts +2 -1
  111. package/dist/rln.d.ts +9 -52
  112. package/dist/rln.js +54 -163
  113. package/dist/rln.js.map +1 -1
  114. package/dist/types.d.ts +27 -0
  115. package/dist/types.js +2 -0
  116. package/dist/types.js.map +1 -0
  117. package/dist/zerokit.d.ts +3 -3
  118. package/dist/zerokit.js +5 -5
  119. package/dist/zerokit.js.map +1 -1
  120. package/package.json +1 -1
  121. package/src/codec.test-utils.ts +80 -0
  122. package/src/contract/abi.ts +502 -248
  123. package/src/contract/constants.ts +3 -3
  124. package/src/contract/errors.ts +75 -0
  125. package/src/contract/rln_base_contract.ts +500 -0
  126. package/src/contract/rln_contract.ts +102 -619
  127. package/src/contract/test-setup.ts +86 -0
  128. package/src/contract/test-utils.ts +179 -0
  129. package/src/contract/types.ts +48 -0
  130. package/src/create.ts +1 -1
  131. package/src/credentials_manager.ts +282 -0
  132. package/src/identity.ts +9 -0
  133. package/src/index.ts +17 -2
  134. package/src/keystore/keystore.ts +32 -46
  135. package/src/keystore/types.ts +2 -1
  136. package/src/rln.ts +67 -258
  137. package/src/types.ts +31 -0
  138. package/src/zerokit.ts +3 -3
@@ -284,7 +284,7 @@ class Resolver {
284
284
  return this._supportsEip2544;
285
285
  }
286
286
  _fetch(selector, parameters) {
287
- return __awaiter(this, undefined, undefined, function* () {
287
+ return __awaiter(this, void 0, void 0, function* () {
288
288
  // e.g. keccak256("addr(bytes32,uint256)")
289
289
  const tx = {
290
290
  to: this.address,
@@ -319,7 +319,7 @@ class Resolver {
319
319
  });
320
320
  }
321
321
  _fetchBytes(selector, parameters) {
322
- return __awaiter(this, undefined, undefined, function* () {
322
+ return __awaiter(this, void 0, void 0, function* () {
323
323
  const result = yield this._fetch(selector, parameters);
324
324
  if (result != null) {
325
325
  return _parseBytes(result, 0);
@@ -380,7 +380,7 @@ class Resolver {
380
380
  return null;
381
381
  }
382
382
  getAddress(coinType) {
383
- return __awaiter(this, undefined, undefined, function* () {
383
+ return __awaiter(this, void 0, void 0, function* () {
384
384
  if (coinType == null) {
385
385
  coinType = 60;
386
386
  }
@@ -421,7 +421,7 @@ class Resolver {
421
421
  });
422
422
  }
423
423
  getAvatar() {
424
- return __awaiter(this, undefined, undefined, function* () {
424
+ return __awaiter(this, void 0, void 0, function* () {
425
425
  const linkage = [{ type: "name", content: this.name }];
426
426
  try {
427
427
  // test data for ricmoo.eth
@@ -534,7 +534,7 @@ class Resolver {
534
534
  });
535
535
  }
536
536
  getContentHash() {
537
- return __awaiter(this, undefined, undefined, function* () {
537
+ return __awaiter(this, void 0, void 0, function* () {
538
538
  // keccak256("contenthash()")
539
539
  const hexBytes = yield this._fetchBytes("0xbc1c58d1");
540
540
  // No contenthash
@@ -580,7 +580,7 @@ class Resolver {
580
580
  });
581
581
  }
582
582
  getText(key) {
583
- return __awaiter(this, undefined, undefined, function* () {
583
+ return __awaiter(this, void 0, void 0, function* () {
584
584
  // The key encoded as parameter to fetchBytes
585
585
  let keyBytes = toUtf8Bytes(key);
586
586
  // The nodehash consumes the first slot, so the string pointer targets
@@ -648,7 +648,7 @@ class BaseProvider extends Provider {
648
648
  this._fastQueryDate = 0;
649
649
  }
650
650
  _ready() {
651
- return __awaiter(this, undefined, undefined, function* () {
651
+ return __awaiter(this, void 0, void 0, function* () {
652
652
  if (this._network == null) {
653
653
  let network = null;
654
654
  if (this._networkPromise) {
@@ -708,7 +708,7 @@ class BaseProvider extends Provider {
708
708
  return getNetwork((network == null) ? "homestead" : network);
709
709
  }
710
710
  ccipReadFetch(tx, calldata, urls) {
711
- return __awaiter(this, undefined, undefined, function* () {
711
+ return __awaiter(this, void 0, void 0, function* () {
712
712
  if (this.disableCcipRead || urls.length === 0) {
713
713
  return null;
714
714
  }
@@ -744,7 +744,7 @@ class BaseProvider extends Provider {
744
744
  // Fetches the blockNumber, but will reuse any result that is less
745
745
  // than maxAge old or has been requested since the last request
746
746
  _getInternalBlockNumber(maxAge) {
747
- return __awaiter(this, undefined, undefined, function* () {
747
+ return __awaiter(this, void 0, void 0, function* () {
748
748
  yield this._ready();
749
749
  // Allowing stale data up to maxAge old
750
750
  if (maxAge > 0) {
@@ -805,7 +805,7 @@ class BaseProvider extends Provider {
805
805
  });
806
806
  }
807
807
  poll() {
808
- return __awaiter(this, undefined, undefined, function* () {
808
+ return __awaiter(this, void 0, void 0, function* () {
809
809
  const pollId = nextPollId++;
810
810
  // Track all running promises, so we can trigger a post-poll once they are complete
811
811
  const runners = [];
@@ -961,14 +961,14 @@ class BaseProvider extends Provider {
961
961
  // This method should query the network if the underlying network
962
962
  // can change, such as when connected to a JSON-RPC backend
963
963
  detectNetwork() {
964
- return __awaiter(this, undefined, undefined, function* () {
964
+ return __awaiter(this, void 0, void 0, function* () {
965
965
  return logger.throwError("provider does not support network detection", Logger.errors.UNSUPPORTED_OPERATION, {
966
966
  operation: "provider.detectNetwork"
967
967
  });
968
968
  });
969
969
  }
970
970
  getNetwork() {
971
- return __awaiter(this, undefined, undefined, function* () {
971
+ return __awaiter(this, void 0, void 0, function* () {
972
972
  const network = yield this._ready();
973
973
  // Make sure we are still connected to the same network; this is
974
974
  // only an external call for backends which can have the underlying
@@ -1080,12 +1080,12 @@ class BaseProvider extends Provider {
1080
1080
  }
1081
1081
  }
1082
1082
  waitForTransaction(transactionHash, confirmations, timeout) {
1083
- return __awaiter(this, undefined, undefined, function* () {
1083
+ return __awaiter(this, void 0, void 0, function* () {
1084
1084
  return this._waitForTransaction(transactionHash, (confirmations == null) ? 1 : confirmations, timeout || 0, null);
1085
1085
  });
1086
1086
  }
1087
1087
  _waitForTransaction(transactionHash, confirmations, timeout, replaceable) {
1088
- return __awaiter(this, undefined, undefined, function* () {
1088
+ return __awaiter(this, void 0, void 0, function* () {
1089
1089
  const receipt = yield this.getTransactionReceipt(transactionHash);
1090
1090
  // Receipt is already good
1091
1091
  if ((receipt ? receipt.confirmations : 0) >= confirmations) {
@@ -1117,7 +1117,7 @@ class BaseProvider extends Provider {
1117
1117
  if (replaceable) {
1118
1118
  let lastBlockNumber = replaceable.startBlock;
1119
1119
  let scannedBlock = null;
1120
- const replaceHandler = (blockNumber) => __awaiter(this, undefined, undefined, function* () {
1120
+ const replaceHandler = (blockNumber) => __awaiter(this, void 0, void 0, function* () {
1121
1121
  if (done) {
1122
1122
  return;
1123
1123
  }
@@ -1125,7 +1125,7 @@ class BaseProvider extends Provider {
1125
1125
  // we will trade off a little bit of latency for more consistent
1126
1126
  // results and fewer JSON-RPC calls
1127
1127
  yield stall(1000);
1128
- this.getTransactionCount(replaceable.from).then((nonce) => __awaiter(this, undefined, undefined, function* () {
1128
+ this.getTransactionCount(replaceable.from).then((nonce) => __awaiter(this, void 0, void 0, function* () {
1129
1129
  if (done) {
1130
1130
  return;
1131
1131
  }
@@ -1229,12 +1229,12 @@ class BaseProvider extends Provider {
1229
1229
  });
1230
1230
  }
1231
1231
  getBlockNumber() {
1232
- return __awaiter(this, undefined, undefined, function* () {
1232
+ return __awaiter(this, void 0, void 0, function* () {
1233
1233
  return this._getInternalBlockNumber(0);
1234
1234
  });
1235
1235
  }
1236
1236
  getGasPrice() {
1237
- return __awaiter(this, undefined, undefined, function* () {
1237
+ return __awaiter(this, void 0, void 0, function* () {
1238
1238
  yield this.getNetwork();
1239
1239
  const result = yield this.perform("getGasPrice", {});
1240
1240
  try {
@@ -1249,7 +1249,7 @@ class BaseProvider extends Provider {
1249
1249
  });
1250
1250
  }
1251
1251
  getBalance(addressOrName, blockTag) {
1252
- return __awaiter(this, undefined, undefined, function* () {
1252
+ return __awaiter(this, void 0, void 0, function* () {
1253
1253
  yield this.getNetwork();
1254
1254
  const params = yield resolveProperties({
1255
1255
  address: this._getAddress(addressOrName),
@@ -1268,7 +1268,7 @@ class BaseProvider extends Provider {
1268
1268
  });
1269
1269
  }
1270
1270
  getTransactionCount(addressOrName, blockTag) {
1271
- return __awaiter(this, undefined, undefined, function* () {
1271
+ return __awaiter(this, void 0, void 0, function* () {
1272
1272
  yield this.getNetwork();
1273
1273
  const params = yield resolveProperties({
1274
1274
  address: this._getAddress(addressOrName),
@@ -1287,7 +1287,7 @@ class BaseProvider extends Provider {
1287
1287
  });
1288
1288
  }
1289
1289
  getCode(addressOrName, blockTag) {
1290
- return __awaiter(this, undefined, undefined, function* () {
1290
+ return __awaiter(this, void 0, void 0, function* () {
1291
1291
  yield this.getNetwork();
1292
1292
  const params = yield resolveProperties({
1293
1293
  address: this._getAddress(addressOrName),
@@ -1306,7 +1306,7 @@ class BaseProvider extends Provider {
1306
1306
  });
1307
1307
  }
1308
1308
  getStorageAt(addressOrName, position, blockTag) {
1309
- return __awaiter(this, undefined, undefined, function* () {
1309
+ return __awaiter(this, void 0, void 0, function* () {
1310
1310
  yield this.getNetwork();
1311
1311
  const params = yield resolveProperties({
1312
1312
  address: this._getAddress(addressOrName),
@@ -1335,7 +1335,7 @@ class BaseProvider extends Provider {
1335
1335
  if (hash != null && tx.hash !== hash) {
1336
1336
  logger.throwError("Transaction hash mismatch from Provider.sendTransaction.", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
1337
1337
  }
1338
- result.wait = (confirms, timeout) => __awaiter(this, undefined, undefined, function* () {
1338
+ result.wait = (confirms, timeout) => __awaiter(this, void 0, void 0, function* () {
1339
1339
  if (confirms == null) {
1340
1340
  confirms = 1;
1341
1341
  }
@@ -1372,7 +1372,7 @@ class BaseProvider extends Provider {
1372
1372
  return result;
1373
1373
  }
1374
1374
  sendTransaction(signedTransaction) {
1375
- return __awaiter(this, undefined, undefined, function* () {
1375
+ return __awaiter(this, void 0, void 0, function* () {
1376
1376
  yield this.getNetwork();
1377
1377
  const hexTx = yield Promise.resolve(signedTransaction).then(t => hexlify(t));
1378
1378
  const tx = this.formatter.transaction(signedTransaction);
@@ -1392,7 +1392,7 @@ class BaseProvider extends Provider {
1392
1392
  });
1393
1393
  }
1394
1394
  _getTransactionRequest(transaction) {
1395
- return __awaiter(this, undefined, undefined, function* () {
1395
+ return __awaiter(this, void 0, void 0, function* () {
1396
1396
  const values = yield transaction;
1397
1397
  const tx = {};
1398
1398
  ["from", "to"].forEach((key) => {
@@ -1426,7 +1426,7 @@ class BaseProvider extends Provider {
1426
1426
  });
1427
1427
  }
1428
1428
  _getFilter(filter) {
1429
- return __awaiter(this, undefined, undefined, function* () {
1429
+ return __awaiter(this, void 0, void 0, function* () {
1430
1430
  filter = yield filter;
1431
1431
  const result = {};
1432
1432
  if (filter.address != null) {
@@ -1448,7 +1448,7 @@ class BaseProvider extends Provider {
1448
1448
  });
1449
1449
  }
1450
1450
  _call(transaction, blockTag, attempt) {
1451
- return __awaiter(this, undefined, undefined, function* () {
1451
+ return __awaiter(this, void 0, void 0, function* () {
1452
1452
  if (attempt >= MAX_CCIP_REDIRECTS) {
1453
1453
  logger.throwError("CCIP read exceeded maximum redirections", Logger.errors.SERVER_ERROR, {
1454
1454
  redirects: attempt, transaction
@@ -1530,7 +1530,7 @@ class BaseProvider extends Provider {
1530
1530
  });
1531
1531
  }
1532
1532
  call(transaction, blockTag) {
1533
- return __awaiter(this, undefined, undefined, function* () {
1533
+ return __awaiter(this, void 0, void 0, function* () {
1534
1534
  yield this.getNetwork();
1535
1535
  const resolved = yield resolveProperties({
1536
1536
  transaction: this._getTransactionRequest(transaction),
@@ -1541,7 +1541,7 @@ class BaseProvider extends Provider {
1541
1541
  });
1542
1542
  }
1543
1543
  estimateGas(transaction) {
1544
- return __awaiter(this, undefined, undefined, function* () {
1544
+ return __awaiter(this, void 0, void 0, function* () {
1545
1545
  yield this.getNetwork();
1546
1546
  const params = yield resolveProperties({
1547
1547
  transaction: this._getTransactionRequest(transaction)
@@ -1559,7 +1559,7 @@ class BaseProvider extends Provider {
1559
1559
  });
1560
1560
  }
1561
1561
  _getAddress(addressOrName) {
1562
- return __awaiter(this, undefined, undefined, function* () {
1562
+ return __awaiter(this, void 0, void 0, function* () {
1563
1563
  addressOrName = yield addressOrName;
1564
1564
  if (typeof (addressOrName) !== "string") {
1565
1565
  logger.throwArgumentError("invalid address or ENS name", "name", addressOrName);
@@ -1574,7 +1574,7 @@ class BaseProvider extends Provider {
1574
1574
  });
1575
1575
  }
1576
1576
  _getBlock(blockHashOrBlockTag, includeTransactions) {
1577
- return __awaiter(this, undefined, undefined, function* () {
1577
+ return __awaiter(this, void 0, void 0, function* () {
1578
1578
  yield this.getNetwork();
1579
1579
  blockHashOrBlockTag = yield blockHashOrBlockTag;
1580
1580
  // If blockTag is a number (not "latest", etc), this is the block number
@@ -1596,7 +1596,7 @@ class BaseProvider extends Provider {
1596
1596
  logger.throwArgumentError("invalid block hash or block tag", "blockHashOrBlockTag", blockHashOrBlockTag);
1597
1597
  }
1598
1598
  }
1599
- return poll(() => __awaiter(this, undefined, undefined, function* () {
1599
+ return poll(() => __awaiter(this, void 0, void 0, function* () {
1600
1600
  const block = yield this.perform("getBlock", params);
1601
1601
  // Block was not found
1602
1602
  if (block == null) {
@@ -1652,11 +1652,11 @@ class BaseProvider extends Provider {
1652
1652
  return (this._getBlock(blockHashOrBlockTag, true));
1653
1653
  }
1654
1654
  getTransaction(transactionHash) {
1655
- return __awaiter(this, undefined, undefined, function* () {
1655
+ return __awaiter(this, void 0, void 0, function* () {
1656
1656
  yield this.getNetwork();
1657
1657
  transactionHash = yield transactionHash;
1658
1658
  const params = { transactionHash: this.formatter.hash(transactionHash, true) };
1659
- return poll(() => __awaiter(this, undefined, undefined, function* () {
1659
+ return poll(() => __awaiter(this, void 0, void 0, function* () {
1660
1660
  const result = yield this.perform("getTransaction", params);
1661
1661
  if (result == null) {
1662
1662
  if (this._emitted["t:" + transactionHash] == null) {
@@ -1682,11 +1682,11 @@ class BaseProvider extends Provider {
1682
1682
  });
1683
1683
  }
1684
1684
  getTransactionReceipt(transactionHash) {
1685
- return __awaiter(this, undefined, undefined, function* () {
1685
+ return __awaiter(this, void 0, void 0, function* () {
1686
1686
  yield this.getNetwork();
1687
1687
  transactionHash = yield transactionHash;
1688
1688
  const params = { transactionHash: this.formatter.hash(transactionHash, true) };
1689
- return poll(() => __awaiter(this, undefined, undefined, function* () {
1689
+ return poll(() => __awaiter(this, void 0, void 0, function* () {
1690
1690
  const result = yield this.perform("getTransactionReceipt", params);
1691
1691
  if (result == null) {
1692
1692
  if (this._emitted["t:" + transactionHash] == null) {
@@ -1716,7 +1716,7 @@ class BaseProvider extends Provider {
1716
1716
  });
1717
1717
  }
1718
1718
  getLogs(filter) {
1719
- return __awaiter(this, undefined, undefined, function* () {
1719
+ return __awaiter(this, void 0, void 0, function* () {
1720
1720
  yield this.getNetwork();
1721
1721
  const params = yield resolveProperties({ filter: this._getFilter(filter) });
1722
1722
  const logs = yield this.perform("getLogs", params);
@@ -1729,13 +1729,13 @@ class BaseProvider extends Provider {
1729
1729
  });
1730
1730
  }
1731
1731
  getEtherPrice() {
1732
- return __awaiter(this, undefined, undefined, function* () {
1732
+ return __awaiter(this, void 0, void 0, function* () {
1733
1733
  yield this.getNetwork();
1734
1734
  return this.perform("getEtherPrice", {});
1735
1735
  });
1736
1736
  }
1737
1737
  _getBlockTag(blockTag) {
1738
- return __awaiter(this, undefined, undefined, function* () {
1738
+ return __awaiter(this, void 0, void 0, function* () {
1739
1739
  blockTag = yield blockTag;
1740
1740
  if (typeof (blockTag) === "number" && blockTag < 0) {
1741
1741
  if (blockTag % 1) {
@@ -1752,7 +1752,7 @@ class BaseProvider extends Provider {
1752
1752
  });
1753
1753
  }
1754
1754
  getResolver(name) {
1755
- return __awaiter(this, undefined, undefined, function* () {
1755
+ return __awaiter(this, void 0, void 0, function* () {
1756
1756
  let currentName = name;
1757
1757
  while (true) {
1758
1758
  if (currentName === "" || currentName === ".") {
@@ -1780,7 +1780,7 @@ class BaseProvider extends Provider {
1780
1780
  });
1781
1781
  }
1782
1782
  _getResolver(name, operation) {
1783
- return __awaiter(this, undefined, undefined, function* () {
1783
+ return __awaiter(this, void 0, void 0, function* () {
1784
1784
  if (operation == null) {
1785
1785
  operation = "ENS";
1786
1786
  }
@@ -1804,7 +1804,7 @@ class BaseProvider extends Provider {
1804
1804
  });
1805
1805
  }
1806
1806
  resolveName(name) {
1807
- return __awaiter(this, undefined, undefined, function* () {
1807
+ return __awaiter(this, void 0, void 0, function* () {
1808
1808
  name = yield name;
1809
1809
  // If it is already an address, nothing to resolve
1810
1810
  try {
@@ -1828,7 +1828,7 @@ class BaseProvider extends Provider {
1828
1828
  });
1829
1829
  }
1830
1830
  lookupAddress(address) {
1831
- return __awaiter(this, undefined, undefined, function* () {
1831
+ return __awaiter(this, void 0, void 0, function* () {
1832
1832
  address = yield address;
1833
1833
  address = this.formatter.address(address);
1834
1834
  const node = address.substring(2).toLowerCase() + ".addr.reverse";
@@ -1849,7 +1849,7 @@ class BaseProvider extends Provider {
1849
1849
  });
1850
1850
  }
1851
1851
  getAvatar(nameOrAddress) {
1852
- return __awaiter(this, undefined, undefined, function* () {
1852
+ return __awaiter(this, void 0, void 0, function* () {
1853
1853
  let resolver = null;
1854
1854
  if (isHexString(nameOrAddress)) {
1855
1855
  // Address; reverse lookup
@@ -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