@exodus/ethereum-api 10.3.3 → 10.3.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.3.4](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@10.3.3...@exodus/ethereum-api@10.3.4) (2026-11-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ethereum-api:** open the gas-price socket only while a wallet account syncs the network ([#9223](https://github.com/ExodusMovement/assets/issues/9223)) ([3564b70](https://github.com/ExodusMovement/assets/commit/3564b707b543596dd9e484da4a882585f9a311b3))
12
+
13
+
14
+
6
15
  ## [10.3.3](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@10.3.2...@exodus/ethereum-api@10.3.3) (2026-11-04)
7
16
 
8
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "10.3.3",
3
+ "version": "10.3.4",
4
4
  "description": "Transaction monitors, fee monitors, RPC with the blockchain node, and other networking code for Ethereum and EVM-based blockchains",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -65,5 +65,5 @@
65
65
  "type": "git",
66
66
  "url": "git+https://github.com/ExodusMovement/assets.git"
67
67
  },
68
- "gitHead": "a219ccf5bd243722ab92020f7f61fa77eced5250"
68
+ "gitHead": "1fd2892211fff5bd625be197de9533daa746cd67"
69
69
  }
@@ -27,6 +27,8 @@ import {
27
27
  const { isEmpty } = lodash
28
28
 
29
29
  export class ClarityMonitor extends AuthenticatedEthereumMonitor {
30
+ #hasWalletAccounts = false
31
+
30
32
  constructor({
31
33
  server,
32
34
  config,
@@ -49,6 +51,9 @@ export class ClarityMonitor extends AuthenticatedEthereumMonitor {
49
51
  getTxLog: (...args) => this.aci.getTxLog(...args),
50
52
  })
51
53
  this.addHook('before-start', (...args) => this.beforeStart(...args))
54
+ this.addHook('before-tick-multiple-wallet-accounts', ({ walletAccounts }) =>
55
+ this.#updateFeeSocket(walletAccounts)
56
+ )
52
57
  this.addHook('after-stop', (...args) => this.afterStop(...args))
53
58
  }
54
59
 
@@ -67,7 +72,7 @@ export class ClarityMonitor extends AuthenticatedEthereumMonitor {
67
72
 
68
73
  this.server.setURI(uri)
69
74
  this.subscribeWalletAddresses()
70
- if (this.config.GAS_PRICE_FROM_WEBSOCKET) {
75
+ if (this.config.GAS_PRICE_FROM_WEBSOCKET && this.#hasWalletAccounts) {
71
76
  this.server.connectFee()
72
77
  }
73
78
  }
@@ -508,15 +513,13 @@ export class ClarityMonitor extends AuthenticatedEthereumMonitor {
508
513
 
509
514
  async beforeStart() {
510
515
  this.listenToServerEvents()
511
- if (this.config.GAS_PRICE_FROM_WEBSOCKET) {
512
- this.server.connectFee()
513
- }
514
-
516
+ // The fee socket opens on the first tick that finds a wallet account; see #updateFeeSocket.
515
517
  return this.subscribeWalletAddresses()
516
518
  }
517
519
 
518
520
  async afterStop() {
519
521
  this.server.dispose()
522
+ this.#hasWalletAccounts = false
520
523
  }
521
524
 
522
525
  isTipSync({ derivedData, refresh }) {
@@ -534,4 +537,20 @@ export class ClarityMonitor extends AuthenticatedEthereumMonitor {
534
537
  this.server.on('transaction', (...args) => this.onTransaction(...args))
535
538
  this.server.on('feeUpdated', (...args) => this.onFeeUpdated(...args))
536
539
  }
540
+
541
+ // A monitor can run with no wallet account on its network, such as Polygon before Predictions
542
+ // creates its account, so the gas-price socket stays closed until a tick finds one.
543
+ #updateFeeSocket(walletAccounts) {
544
+ if (!this.config.GAS_PRICE_FROM_WEBSOCKET) return
545
+
546
+ const hasWalletAccounts = walletAccounts.length > 0
547
+ if (hasWalletAccounts === this.#hasWalletAccounts) return
548
+
549
+ this.#hasWalletAccounts = hasWalletAccounts
550
+ if (hasWalletAccounts) {
551
+ this.server.connectFee()
552
+ } else {
553
+ this.server.disconnectFee()
554
+ }
555
+ }
537
556
  }