@exodus/ethereum-api 8.42.1 → 8.42.2

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.42.2](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.42.1...@exodus/ethereum-api@8.42.2) (2025-07-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+
12
+ * fix: use explicit events dep import in ethereum-api (#6052)
13
+
14
+
15
+
6
16
  ## [8.42.1](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.42.0...@exodus/ethereum-api@8.42.1) (2025-07-11)
7
17
 
8
18
  **Note:** Version bump only for package @exodus/ethereum-api
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "8.42.1",
3
+ "version": "8.42.2",
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",
@@ -63,5 +63,5 @@
63
63
  "type": "git",
64
64
  "url": "git+https://github.com/ExodusMovement/assets.git"
65
65
  },
66
- "gitHead": "439848922f4e7a525c4e2373c99daefd89da402b"
66
+ "gitHead": "b719d7ad24ba1be671d286e2859afc22ab3b7255"
67
67
  }
@@ -88,20 +88,49 @@ export const buildApproveTx = async ({
88
88
  })
89
89
  }
90
90
 
91
- const getLegacyApproveTxFromUnsignedTx = ({ baseAsset, unsignedTx }) => ({
92
- asset: baseAsset.name,
93
- receiver: {
94
- address: unsignedTx.txData.to,
95
- amount: buffer2currency({ asset: baseAsset, value: unsignedTx.txData.value }),
96
- },
97
- txInput: unsignedTx.txData.data,
98
- gasPrice: buffer2currency({ asset: baseAsset, value: unsignedTx.txData.gasPrice }),
99
- tipGasPrice: unsignedTx.txData.tipGasPrice
100
- ? buffer2currency({ asset: baseAsset, value: unsignedTx.txData.tipGasPrice })
101
- : undefined,
102
- gasLimit: bufferToInt(unsignedTx.txData.gasLimit),
103
- fromAddress: unsignedTx.txMeta.fromAddress,
104
- })
91
+ // @temporary
92
+ // @deprecated use buildApproveTx instead
93
+ export const buildLegacyApproveTx = async ({
94
+ spenderAddress,
95
+ asset,
96
+ feeData,
97
+ fromAddress,
98
+ approveAmount,
99
+ gasLimit,
100
+ txInput,
101
+ nonce,
102
+ walletAccount,
103
+ }) => {
104
+ const unsignedTx = await buildApproveTx({
105
+ spenderAddress,
106
+ asset,
107
+ feeData,
108
+ fromAddress,
109
+ approveAmount,
110
+ gasLimit,
111
+ txInput,
112
+ nonce,
113
+ walletAccount,
114
+ })
115
+
116
+ const baseAsset = asset.baseAsset
117
+
118
+ return {
119
+ asset: baseAsset.name,
120
+ receiver: {
121
+ address: unsignedTx.txData.to,
122
+ amount: buffer2currency({ asset: baseAsset, value: unsignedTx.txData.value }),
123
+ },
124
+ txInput: unsignedTx.txData.data,
125
+ gasPrice: buffer2currency({ asset: baseAsset, value: unsignedTx.txData.gasPrice }),
126
+ tipGasPrice: unsignedTx.txData.tipGasPrice
127
+ ? buffer2currency({ asset: baseAsset, value: unsignedTx.txData.tipGasPrice })
128
+ : undefined,
129
+ gasLimit: bufferToInt(unsignedTx.txData.gasLimit),
130
+ fromAddress: unsignedTx.txMeta.fromAddress,
131
+ silent: true,
132
+ }
133
+ }
105
134
 
106
135
  // @deprecated use buildApproveTx instead
107
136
  export const createApprove =
@@ -118,6 +147,27 @@ export const createApprove =
118
147
  walletAccount,
119
148
  ...extras
120
149
  }) => {
150
+ if (!assetClientInterface) {
151
+ const approveTx = await buildLegacyApproveTx({
152
+ spenderAddress,
153
+ asset,
154
+ feeData,
155
+ fromAddress,
156
+ approveAmount,
157
+ gasLimit,
158
+ txInput,
159
+ nonce,
160
+ walletAccount,
161
+ })
162
+
163
+ const txData = await sendTx({ walletAccount, ...approveTx, ...extras })
164
+
165
+ if (!txData || !txData.txId)
166
+ throw new Error(`Failed to approve ${asset.displayTicker} - ${spenderAddress}`)
167
+
168
+ return txData
169
+ }
170
+
121
171
  const unsignedTx = await buildApproveTx({
122
172
  spenderAddress,
123
173
  asset,
@@ -130,16 +180,6 @@ export const createApprove =
130
180
  walletAccount,
131
181
  })
132
182
 
133
- if (!assetClientInterface) {
134
- const approveTx = getLegacyApproveTxFromUnsignedTx({ baseAsset: asset.baseAsset, unsignedTx })
135
- const txData = await sendTx({ walletAccount, ...approveTx, silent: true, ...extras })
136
-
137
- if (!txData || !txData.txId)
138
- throw new Error(`Failed to approve ${asset.displayTicker} - ${spenderAddress}`)
139
-
140
- return txData
141
- }
142
-
143
183
  const { txId, rawTx } = await assetClientInterface.signTransaction({
144
184
  assetName: asset.baseAsset.name,
145
185
  unsignedTx,
@@ -1,6 +1,6 @@
1
1
  import { bufferToHex } from '@exodus/ethereumjs/util'
2
2
  import SolidityContract from '@exodus/solidity-contract'
3
- import EventEmitter from 'events'
3
+ import EventEmitter from 'events/events.js'
4
4
  import lodash from 'lodash'
5
5
 
6
6
  import { fromHexToString } from '../number-utils.js'
@@ -1,6 +1,6 @@
1
1
  import { bufferToHex } from '@exodus/ethereumjs/util'
2
2
  import SolidityContract from '@exodus/solidity-contract'
3
- import EventEmitter from 'events'
3
+ import EventEmitter from 'events/events.js'
4
4
  import io from 'socket.io-client'
5
5
 
6
6
  import { fromHexToString } from '../number-utils.js'
package/src/index.js CHANGED
@@ -62,6 +62,7 @@ export {
62
62
  getSpendingAllowance,
63
63
  isSpendingApprovalRequired,
64
64
  buildApproveTx,
65
+ buildLegacyApproveTx,
65
66
  createApprove,
66
67
  createApproveSpendingTokens,
67
68
  APPROVAL_GAS_LIMIT,