quais 0.1.15 → 0.1.16

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.
package/dist/quais.esm.js CHANGED
@@ -18850,7 +18850,7 @@ class Formatter {
18850
18850
  value: this.bigNumber(etx.value),
18851
18851
  data: this.data(etx.input),
18852
18852
  to: this.address(etx.to),
18853
- accessList: Formatter.allowNull(this.accessList, null)(etx.accessList),
18853
+ accessList: Formatter.allowNull(this.accessList, null)(etx.accessList), // Add more detailed parsing if needed
18854
18854
  chainId: Number(etx.chainId),
18855
18855
  from: this.address(etx.sender),
18856
18856
  hash: this.hash(etx.hash)
@@ -18941,7 +18941,7 @@ class Formatter {
18941
18941
  }
18942
18942
  return hexZeroPad(value, 32);
18943
18943
  }
18944
- _block(value, format, context, simplify) {
18944
+ _block(value, format, simplify) {
18945
18945
  if (value.author != null && value.miner == null) {
18946
18946
  value.miner = value.author;
18947
18947
  }
@@ -18949,18 +18949,15 @@ class Formatter {
18949
18949
  const difficulty = (value._difficulty != null) ? value._difficulty : value.difficulty;
18950
18950
  const result = Formatter.check(format, value);
18951
18951
  result._difficulty = ((difficulty == null) ? null : difficulty);
18952
- if (context) {
18953
- return this.contextBlock(result, context, simplify);
18954
- }
18955
- return result;
18952
+ return this.contextBlock(result, simplify);
18956
18953
  }
18957
- block(value, context, simplify) {
18958
- return this._block(value, this.formats.block, context, simplify);
18954
+ block(value, simplify) {
18955
+ return this._block(value, this.formats.block, simplify);
18959
18956
  }
18960
18957
  blockWithTransactions(value) {
18961
18958
  return this._block(value, this.formats.blockWithTransactions);
18962
18959
  }
18963
- contextBlock(value, context, simplify = false) {
18960
+ contextBlock(value, simplify = false) {
18964
18961
  let contextBlock = {
18965
18962
  number: simplify ? value.number[2] : value.number,
18966
18963
  transactions: value.transactions,
@@ -20818,7 +20815,7 @@ class BaseProvider extends Provider {
20818
20815
  blockWithTxs.transactions = blockWithTxs.transactions.map((tx) => this._wrapTransaction(tx));
20819
20816
  return blockWithTxs;
20820
20817
  }
20821
- return this.formatter.block(block, this._context, simplify);
20818
+ return this.formatter.block(block, simplify);
20822
20819
  }), { oncePoll: this });
20823
20820
  });
20824
20821
  }
@@ -21544,7 +21541,7 @@ class JsonRpcProvider extends BaseProvider {
21544
21541
  }
21545
21542
  return this._eventLoopCache;
21546
21543
  }
21547
- constructor(url, network, context) {
21544
+ constructor(url, network) {
21548
21545
  let networkOrReady = network;
21549
21546
  // The network is unknown, query the JSON-RPC for it
21550
21547
  if (networkOrReady == null) {
@@ -21558,15 +21555,6 @@ class JsonRpcProvider extends BaseProvider {
21558
21555
  }, 0);
21559
21556
  });
21560
21557
  }
21561
- new Promise((resolve, reject) => {
21562
- setTimeout(() => {
21563
- this.detectContext().then((context) => {
21564
- resolve(context);
21565
- }, (error) => {
21566
- reject(error);
21567
- });
21568
- }, 0);
21569
- });
21570
21558
  super(networkOrReady);
21571
21559
  // Default URL
21572
21560
  if (!url) {
@@ -21626,24 +21614,6 @@ class JsonRpcProvider extends BaseProvider {
21626
21614
  });
21627
21615
  });
21628
21616
  }
21629
- detectContext() {
21630
- return __awaiter$a(this, void 0, void 0, function* () {
21631
- yield timer(0);
21632
- let location = null;
21633
- try {
21634
- location = yield this.send("quai_nodeLocation", []);
21635
- }
21636
- catch (error) {
21637
- }
21638
- if (location != null) {
21639
- this._context = location.length;
21640
- return this._context;
21641
- }
21642
- return logger$u.throwError("could not detect context", Logger.errors.NETWORK_ERROR, {
21643
- event: "noNetwork"
21644
- });
21645
- });
21646
- }
21647
21617
  getSigner(addressOrIndex) {
21648
21618
  return new JsonRpcSigner(_constructorGuard$4, this, addressOrIndex);
21649
21619
  }
@@ -22088,7 +22058,7 @@ class WebSocketProvider extends JsonRpcProvider {
22088
22058
  switch (event.type) {
22089
22059
  case "block":
22090
22060
  this._subscribe("block", ["newHeads"], (result) => {
22091
- const blockNumber = BigNumber.from(result.number).toNumber();
22061
+ const blockNumber = BigNumber.from(result.number[2]).toNumber();
22092
22062
  this._emitted.block = blockNumber;
22093
22063
  this.emit("block", blockNumber);
22094
22064
  });