@exodus/ethereum-api 8.63.0 → 8.64.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
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
+ ## [8.64.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.63.0...@exodus/ethereum-api@8.64.0) (2026-01-14)
7
+
8
+
9
+ ### Features
10
+
11
+
12
+ * feat: EIP delegation status on all monitors (#7193)
13
+
14
+
15
+
6
16
  ## [8.63.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.62.4...@exodus/ethereum-api@8.63.0) (2026-01-14)
7
17
 
8
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "8.63.0",
3
+ "version": "8.64.0",
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",
@@ -29,7 +29,7 @@
29
29
  "@exodus/bip44-constants": "^195.0.0",
30
30
  "@exodus/crypto": "^1.0.0-rc.26",
31
31
  "@exodus/currency": "^6.0.1",
32
- "@exodus/ethereum-lib": "^5.20.2",
32
+ "@exodus/ethereum-lib": "^5.21.0",
33
33
  "@exodus/ethereum-meta": "^2.9.1",
34
34
  "@exodus/ethereumholesky-meta": "^2.0.5",
35
35
  "@exodus/ethereumjs": "^1.8.0",
@@ -67,5 +67,5 @@
67
67
  "type": "git",
68
68
  "url": "git+https://github.com/ExodusMovement/assets.git"
69
69
  },
70
- "gitHead": "db8bd0629b287cd2031a12ff2a3fed3fc765bbab"
70
+ "gitHead": "11f40d9da07e1e70a4e07f94defa3042c6fb21cc"
71
71
  }
@@ -303,7 +303,7 @@ export const createAssetFactory = ({
303
303
  broadcastPrivateBundle,
304
304
  broadcastPrivateTx,
305
305
  forceGasLimitEstimation,
306
- getEIP7702Delegation: (addr) => getEIP7702Delegation({ asset: base, address: addr }),
306
+ getEIP7702Delegation: (addr) => getEIP7702Delegation({ address: addr, server }),
307
307
  getNonce,
308
308
  privacyServer,
309
309
  server,
@@ -180,8 +180,7 @@ export const getERC20Params = async ({ asset, address, paramNames = DEFAULT_PARA
180
180
  return response
181
181
  }
182
182
 
183
- export async function getEIP7702Delegation({ asset, address }) {
184
- const server = getServer(asset)
183
+ export async function getEIP7702Delegation({ address, server }) {
185
184
  const code = await server.getCode(address)
186
185
 
187
186
  // No code at all
@@ -10,6 +10,7 @@ import {
10
10
  checkPendingTransactions,
11
11
  excludeUnchangedTokenBalances,
12
12
  getAllLogItemsByAsset,
13
+ getCurrentEIP7702Delegation,
13
14
  getDeriveDataNeededForTick,
14
15
  getDeriveTransactionsToCheck,
15
16
  } from './monitor-utils/index.js'
@@ -199,6 +200,13 @@ export class ClarityMonitorV2 extends BaseMonitor {
199
200
  ourWalletAddress: derivedData.ourWalletAddress,
200
201
  })
201
202
 
203
+ const eip7702Delegation = await getCurrentEIP7702Delegation({
204
+ server: this.server,
205
+ address: derivedData.ourWalletAddress,
206
+ currentDelegation: derivedData.currentAccountState?.eip7702Delegation,
207
+ logger: this.logger,
208
+ })
209
+
202
210
  const batch = this.aci.createOperationsBatch()
203
211
 
204
212
  this.aci.removeTxLogBatch({
@@ -218,7 +226,11 @@ export class ClarityMonitorV2 extends BaseMonitor {
218
226
  })
219
227
  }
220
228
 
221
- const newData = { ...accountState }
229
+ // All updates must go through newData (accountState param is only used for mem merging)
230
+ const newData = {
231
+ ...accountState,
232
+ ...(eip7702Delegation && { eip7702Delegation }),
233
+ }
222
234
 
223
235
  if (cursor) {
224
236
  newData.clarityCursor = cursor
@@ -10,6 +10,7 @@ import {
10
10
  checkPendingTransactions,
11
11
  excludeUnchangedTokenBalances,
12
12
  getAllLogItemsByAsset,
13
+ getCurrentEIP7702Delegation,
13
14
  getDeriveDataNeededForTick,
14
15
  getDeriveTransactionsToCheck,
15
16
  } from './monitor-utils/index.js'
@@ -159,6 +160,13 @@ export class ClarityMonitor extends BaseMonitor {
159
160
  ourWalletAddress: derivedData.ourWalletAddress,
160
161
  })
161
162
 
163
+ const eip7702Delegation = await getCurrentEIP7702Delegation({
164
+ server: this.server,
165
+ address: derivedData.ourWalletAddress,
166
+ currentDelegation: derivedData.currentAccountState?.eip7702Delegation,
167
+ logger: this.logger,
168
+ })
169
+
162
170
  const batch = this.aci.createOperationsBatch()
163
171
 
164
172
  this.aci.removeTxLogBatch({
@@ -178,11 +186,18 @@ export class ClarityMonitor extends BaseMonitor {
178
186
  })
179
187
  }
180
188
 
189
+ // All updates must go through newData (accountState param is only used for mem merging)
190
+ const newData = {
191
+ ...accountState,
192
+ clarityCursor: response.cursor,
193
+ ...(eip7702Delegation && { eip7702Delegation }),
194
+ }
195
+
181
196
  this.aci.updateAccountStateBatch({
182
197
  assetName,
183
198
  walletAccount,
184
199
  accountState,
185
- newData: { clarityCursor: response.cursor, ...accountState },
200
+ newData,
186
201
  batch,
187
202
  })
188
203
 
@@ -7,6 +7,7 @@ import { fromHexToString } from '../number-utils.js'
7
7
  import { UNCONFIRMED_TX_LIMIT } from './monitor-utils/get-derive-transactions-to-check.js'
8
8
  import {
9
9
  excludeUnchangedTokenBalances,
10
+ getCurrentEIP7702Delegation,
10
11
  getDeriveDataNeededForTick,
11
12
  getDeriveTransactionsToCheck,
12
13
  } from './monitor-utils/index.js'
@@ -186,7 +187,20 @@ export class EthereumNoHistoryMonitor extends BaseMonitor {
186
187
  ourWalletAddress,
187
188
  })
188
189
 
189
- await this.updateAccountState({ newData: { ...accountState }, walletAccount })
190
+ const eip7702Delegation = await getCurrentEIP7702Delegation({
191
+ server: this.server,
192
+ address: ourWalletAddress,
193
+ currentDelegation: currentAccountState?.eip7702Delegation,
194
+ logger: this.logger,
195
+ })
196
+
197
+ // All updates must go through newData (accountState param is only used for mem merging)
198
+ const newData = {
199
+ ...accountState,
200
+ ...(eip7702Delegation && { eip7702Delegation }),
201
+ }
202
+
203
+ await this.updateAccountState({ accountState, newData, walletAccount })
190
204
 
191
205
  await this.removeFromTxLog(txsToRemove)
192
206
  await this.updateTxLogByAsset({ logItemsByAsset, walletAccount, refresh })
@@ -0,0 +1,39 @@
1
+ import { getEIP7702Delegation } from '../../eth-like-util.js'
2
+
3
+ /**
4
+ * Checks if the address has an EIP-7702 delegation and returns the delegation state.
5
+ * Returns the new state if changed, or the current state if unchanged.
6
+ * On error, returns the current state to preserve existing data.
7
+ *
8
+ * @param {Object} params
9
+ * @param {Object} params.server - The server instance to use for getCode
10
+ * @param {string} params.address - The wallet address to check
11
+ * @param {Object} [params.currentDelegation] - The current delegation state from accountState
12
+ * @param {Object} [params.logger] - Optional logger for warnings
13
+ * @returns {Promise<Object|undefined>} The delegation state to use
14
+ */
15
+ export async function getCurrentEIP7702Delegation({ server, address, currentDelegation, logger }) {
16
+ try {
17
+ const result = await getEIP7702Delegation({ address, server })
18
+
19
+ // Return new state if changed
20
+ if (
21
+ currentDelegation?.isDelegated !== result.isDelegated ||
22
+ currentDelegation?.delegatedAddress !== result.delegatedAddress
23
+ ) {
24
+ return {
25
+ isDelegated: result.isDelegated,
26
+ delegatedAddress: result.delegatedAddress,
27
+ }
28
+ }
29
+ } catch (error) {
30
+ if (logger) {
31
+ logger.warn('Failed to check EIP-7702 delegation:', error)
32
+ }
33
+ }
34
+
35
+ // Return current state if unchanged or on error
36
+ return currentDelegation
37
+ }
38
+
39
+ export default getCurrentEIP7702Delegation
@@ -5,4 +5,5 @@ export { default as getLogItemsFromServerTx } from './get-log-items-from-server-
5
5
  export { default as getHistoryFromServer } from './get-history-from-server.js'
6
6
  export { default as checkPendingTransactions } from './check-pending-transactions.js'
7
7
  export { default as getDeriveTransactionsToCheck } from './get-derive-transactions-to-check.js'
8
+ export { default as getCurrentEIP7702Delegation } from './get-current-eip7702-delegation.js'
8
9
  export * from './exclude-unchanged-token-balances.js'