@exodus/ethereum-api 8.61.3 → 8.62.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.62.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.61.3...@exodus/ethereum-api@8.62.0) (2025-12-22)
7
+
8
+
9
+ ### Features
10
+
11
+
12
+ * feat: Add EIP-7702 delegation detection (#7141)
13
+
14
+
15
+
6
16
  ## [8.61.3](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.61.2...@exodus/ethereum-api@8.61.3) (2025-12-17)
7
17
 
8
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "8.61.3",
3
+ "version": "8.62.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",
@@ -67,5 +67,5 @@
67
67
  "type": "git",
68
68
  "url": "git+https://github.com/ExodusMovement/assets.git"
69
69
  },
70
- "gitHead": "8c3e94c96818b1ce8ce10cb75da29db2c9fe9ab9"
70
+ "gitHead": "5702f44af435bd6781879ba3e9b2f28fba655c6c"
71
71
  }
@@ -29,6 +29,7 @@ import {
29
29
  } from './create-asset-utils.js'
30
30
  import { createTokenFactory } from './create-token-factory.js'
31
31
  import { createCustomFeesApi } from './custom-fees.js'
32
+ import { getEIP7702Delegation } from './eth-like-util.js'
32
33
  import { createEvmServer } from './exodus-eth-server/index.js'
33
34
  import { createFeeData } from './fee-data/index.js'
34
35
  import { createGetBalanceForAddress } from './get-balance-for-address.js'
@@ -302,6 +303,7 @@ export const createAssetFactory = ({
302
303
  broadcastPrivateBundle,
303
304
  broadcastPrivateTx,
304
305
  forceGasLimitEstimation,
306
+ getEIP7702Delegation: (addr) => getEIP7702Delegation({ asset: base, address: addr }),
305
307
  getNonce,
306
308
  privacyServer,
307
309
  server,
@@ -10,6 +10,8 @@ import { fromHexToString } from './number-utils.js'
10
10
  export const FORWARDER_CONTRACT_CODE =
11
11
  '0x5836818037808036817364b29dc43e817817cf77468c8dda63d98ce08fb25af43d91908282803e602b57fd5bf3'
12
12
 
13
+ export const EIP7702_DELEGATION_DESIGNATOR = '0xef0100'
14
+
13
15
  // @Deprecated
14
16
  export async function isContract(baseAssetName, address) {
15
17
  return getServerByName(baseAssetName).isContract(address)
@@ -177,3 +179,28 @@ export const getERC20Params = async ({ asset, address, paramNames = DEFAULT_PARA
177
179
 
178
180
  return response
179
181
  }
182
+
183
+ export async function getEIP7702Delegation({ asset, address }) {
184
+ const server = getServer(asset)
185
+ const code = await server.getCode(address)
186
+
187
+ // No code at all
188
+ if (!code || code === '0x' || code === '0x0') {
189
+ return { isDelegated: false, delegatedAddress: null }
190
+ }
191
+
192
+ // EIP-7702 delegation code must be exactly 23 bytes (46 hex chars + "0x" prefix = 48 chars)
193
+ // Format: 0xef0100 (3 bytes) + address (20 bytes)
194
+ if (code.length !== 48) {
195
+ return { isDelegated: false, delegatedAddress: null }
196
+ }
197
+
198
+ // Check for EIP-7702 delegation designator prefix
199
+ if (!code.toLowerCase().startsWith(EIP7702_DELEGATION_DESIGNATOR)) {
200
+ return { isDelegated: false, delegatedAddress: null }
201
+ }
202
+
203
+ // Extract the 20-byte delegated address
204
+ const delegatedAddress = '0x' + code.slice(8, 48)
205
+ return { isDelegated: true, delegatedAddress }
206
+ }
package/src/index.js CHANGED
@@ -18,6 +18,7 @@ export {
18
18
  getTransaction,
19
19
  getIsForwarderContract,
20
20
  getERC20Params,
21
+ getEIP7702Delegation,
21
22
  } from './eth-like-util.js'
22
23
 
23
24
  export {