@exodus/ethereum-api 10.3.2 → 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,24 @@
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
+
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)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **ethereum-api,tron-api:** don't stop history for token transfers another account signed ([#9177](https://github.com/ExodusMovement/assets/issues/9177)) ([253bd30](https://github.com/ExodusMovement/assets/commit/253bd30a1e389d41e6019b7916fb2f74030d7dde))
21
+
22
+
23
+
6
24
  ## [10.3.2](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@10.3.1...@exodus/ethereum-api@10.3.2) (2026-11-03)
7
25
 
8
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "10.3.2",
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": "ab69a5303646598fb7eef0979680c88dc58cf50c"
68
+ "gitHead": "1fd2892211fff5bd625be197de9533daa746cd67"
69
69
  }
@@ -7,10 +7,19 @@ export async function fetchAuthenticatedTransaction({
7
7
  address,
8
8
  server = baseAsset.server,
9
9
  missingTransactionMessage = 'Signed transaction is required',
10
+ acceptOtherSender = false,
10
11
  }) {
11
12
  assert(typeof address === 'string', 'Wallet address is required for authentication')
12
13
  const transaction = await server.getTransactionByHash(txId)
13
14
  assert(transaction, missingTransactionMessage)
15
+ if (
16
+ acceptOtherSender &&
17
+ typeof transaction.from === 'string' &&
18
+ transaction.from.toLowerCase() !== address.toLowerCase()
19
+ ) {
20
+ return transaction
21
+ }
22
+
14
23
  assert(
15
24
  verifyTransactionSignature({
16
25
  transaction,
@@ -48,7 +48,9 @@ export class AuthenticatedEthereumMonitor extends BaseMonitor {
48
48
  txId: params.tx.txId,
49
49
  address,
50
50
  server: this.server,
51
+ acceptOtherSender: await this.#isToken(params.assetName),
51
52
  })
53
+ if (transaction.from.toLowerCase() !== address.toLowerCase()) return true
52
54
  const tx = params.tx
53
55
  // Bind the fields used by acceleration even for entries already in the log.
54
56
  // Token destinations/amounts describe effects rather than the outer envelope;
@@ -82,4 +84,10 @@ export class AuthenticatedEthereumMonitor extends BaseMonitor {
82
84
  }
83
85
  return true
84
86
  }
87
+
88
+ async #isToken(assetName) {
89
+ if (!assetName || assetName === this.asset.name) return false
90
+ const assets = await this.aci.getAssetsForNetwork({ baseAssetName: this.asset.name })
91
+ return assets?.[assetName]?.baseAsset?.name === this.asset.name
92
+ }
85
93
  }
@@ -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
  }