@exodus/ethereum-api 8.51.0 → 8.52.1

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.52.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.51.0...@exodus/ethereum-api@8.52.0) (2025-09-26)
7
+
8
+
9
+ ### Features
10
+
11
+
12
+ * feat(ethereum): use methodId in new staking txs shape (#6335)
13
+
14
+
15
+
6
16
  ## [8.51.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.50.1...@exodus/ethereum-api@8.51.0) (2025-09-25)
7
17
 
8
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "8.51.0",
3
+ "version": "8.52.1",
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",
@@ -28,7 +28,7 @@
28
28
  "@exodus/bip44-constants": "^195.0.0",
29
29
  "@exodus/crypto": "^1.0.0-rc.26",
30
30
  "@exodus/currency": "^6.0.1",
31
- "@exodus/ethereum-lib": "^5.17.0",
31
+ "@exodus/ethereum-lib": "^5.18.0",
32
32
  "@exodus/ethereum-meta": "^2.9.1",
33
33
  "@exodus/ethereumholesky-meta": "^2.0.5",
34
34
  "@exodus/ethereumjs": "^1.8.0",
@@ -51,7 +51,7 @@
51
51
  "ws": "^6.1.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@exodus/assets-testing": "^1.0.0",
54
+ "@exodus/assets-testing": "workspace:^",
55
55
  "@exodus/bsc-meta": "^2.5.1",
56
56
  "@exodus/errors": "^3.3.0",
57
57
  "@exodus/ethereumarbone-meta": "^2.1.2",
@@ -65,6 +65,5 @@
65
65
  "repository": {
66
66
  "type": "git",
67
67
  "url": "git+https://github.com/ExodusMovement/assets.git"
68
- },
69
- "gitHead": "a5a5ca09ab04597193c9243306a884df16bdab8b"
68
+ }
70
69
  }
package/src/tx-create.js CHANGED
@@ -271,7 +271,17 @@ export const createTxFactory = ({ chainId, assetClientInterface, useAbsoluteNonc
271
271
 
272
272
  const resolvedGasPrice = providedGasPrice ?? maybeGasPrice
273
273
 
274
- const txToAddress = isToken && !providedTxInput ? asset.contract.address : toAddress
274
+ // When sending a main asset, the transaction (tx) 'to' address is the receiver's address. No tx input is provided.
275
+ // When sending a token, the tx 'to' address is the asset.contract?.address. No tx input is provided; it's resolved locally.
276
+ // When DEX swapping a main asset, the exchange provides a txInput and a DEX address. Use the DEX address as the tx 'to' address.
277
+ // When DEX swapping a token, the exchange provides a txInput and a DEX address. Use the DEX address as the tx 'to' address.
278
+ // When CEX swapping a main asset, the exchange may provide a txInput and an address. Use this address as the tx 'to' address.
279
+ // When CEX swapping a token, the exchange may provide a txInput but not an address. In this case, the tx 'to' address is the token address.
280
+
281
+ const txToAddress =
282
+ isToken && !providedTxInput
283
+ ? asset.contract.address
284
+ : providedToAddress || asset.contract?.address || ARBITRARY_ADDRESS
275
285
 
276
286
  const isContractToAddress = await isContractAddressCached({ asset, address: txToAddress })
277
287
 
@@ -41,6 +41,7 @@ export const getOptimisticTxLogEffects = async ({
41
41
  toAddress,
42
42
  tipGasPrice: maybeTipGasPrice,
43
43
  walletAccount,
44
+ methodId,
44
45
  }) => {
45
46
  assert(isNumberUnit(amount), 'expected NumberUnit amount')
46
47
  assert(asset, 'expected asset')
@@ -89,6 +90,7 @@ export const getOptimisticTxLogEffects = async ({
89
90
  replacedTxId,
90
91
  nonce,
91
92
  ...(maybeTipGasPrice ? { tipGasPrice: maybeTipGasPrice.toBaseString() } : null),
93
+ ...(methodId ? { methodId } : null),
92
94
  },
93
95
  }
94
96
 
@@ -1,4 +1,5 @@
1
1
  import { normalizeTxId, parseUnsignedTx, updateNonce } from '@exodus/ethereum-lib'
2
+ import { bufferToHex } from '@exodus/ethereumjs/util'
2
3
  import assert from 'minimalistic-assert'
3
4
 
4
5
  import * as ErrorWrapper from '../error-wrapper.js'
@@ -49,6 +50,7 @@ const txSendFactory = ({ assetClientInterface, createTx }) => {
49
50
  const gasLimit = parsedTx.gasLimit
50
51
  const amount = parsedTx.amount
51
52
  const toAddress = parsedTx.to
53
+ const data = parsedTx.data
52
54
 
53
55
  // unknown data from buffer...
54
56
  const fromAddress = unsignedTx.txMeta.fromAddress
@@ -142,6 +144,8 @@ const txSendFactory = ({ assetClientInterface, createTx }) => {
142
144
  }
143
145
  }
144
146
 
147
+ const methodId = data ? bufferToHex(data).slice(0, 10) : undefined
148
+
145
149
  const { optimisticTxLogEffects } = await getOptimisticTxLogEffects({
146
150
  amount,
147
151
  asset,
@@ -154,6 +158,7 @@ const txSendFactory = ({ assetClientInterface, createTx }) => {
154
158
  toAddress,
155
159
  tipGasPrice,
156
160
  walletAccount,
161
+ methodId,
157
162
  })
158
163
 
159
164
  // NOTE: `optimisticTxLogEffects` **must** be written sequentially.