@exodus/ethereum-api 8.37.0 → 8.38.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 +14 -0
- package/package.json +2 -4
- package/src/create-asset-utils.js +23 -2
- package/src/create-asset.js +11 -3
- package/src/get-balances.js +3 -1
- package/src/tx-send/nonce-utils.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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.38.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.37.0...@exodus/ethereum-api@8.38.0) (2025-06-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat: clarity basemainnet (#5876)
|
|
13
|
+
|
|
14
|
+
* feat: enable evm transaction privacy (#5869)
|
|
15
|
+
|
|
16
|
+
* feat: remove eth sepolia and goerli (#5885)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
6
20
|
## [8.37.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.36.0...@exodus/ethereum-api@8.37.0) (2025-06-12)
|
|
7
21
|
|
|
8
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.38.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",
|
|
@@ -52,8 +52,6 @@
|
|
|
52
52
|
"@exodus/assets-testing": "^1.0.0",
|
|
53
53
|
"@exodus/bsc-meta": "^2.1.2",
|
|
54
54
|
"@exodus/ethereumarbone-meta": "^2.0.3",
|
|
55
|
-
"@exodus/ethereumgoerli-meta": "^2.0.1",
|
|
56
|
-
"@exodus/ethereumsepolia-meta": "^2.0.1",
|
|
57
55
|
"@exodus/fantommainnet-meta": "^2.0.2",
|
|
58
56
|
"@exodus/rootstock-meta": "^2.0.3"
|
|
59
57
|
},
|
|
@@ -64,5 +62,5 @@
|
|
|
64
62
|
"type": "git",
|
|
65
63
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
66
64
|
},
|
|
67
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "7150173679bc6f43d40c151728ae5f910bc52d88"
|
|
68
66
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import assert from 'assert'
|
|
1
|
+
import assert from 'minimalistic-assert'
|
|
2
2
|
|
|
3
|
-
import { ValidMonitorTypes } from './exodus-eth-server/index.js'
|
|
3
|
+
import { createEvmServer, ValidMonitorTypes } from './exodus-eth-server/index.js'
|
|
4
4
|
|
|
5
5
|
// Determines the appropriate `monitorType`, `serverUrl` and `monitorInterval`
|
|
6
6
|
// to use for a given config.
|
|
@@ -53,3 +53,24 @@ export const resolveMonitorSettings = (
|
|
|
53
53
|
// Permit the `monitorType` and `serverUrl` to be overrided.
|
|
54
54
|
return { ...defaultResolution, monitorType: overrideMonitorType, serverUrl: overrideServerUrl }
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
export const createBroadcastTxFactory = ({ assetName, server, privacyRpcUrl }) => {
|
|
58
|
+
assert(server, 'expected server')
|
|
59
|
+
|
|
60
|
+
const defaultResult = {
|
|
61
|
+
broadcastTx: (...args) => server.sendRawTransaction(...args),
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!privacyRpcUrl) return defaultResult
|
|
65
|
+
|
|
66
|
+
const privacyServer = createEvmServer({
|
|
67
|
+
assetName,
|
|
68
|
+
serverUrl: privacyRpcUrl,
|
|
69
|
+
monitorType: 'no-history',
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
...defaultResult,
|
|
74
|
+
broadcastPrivateTx: (...args) => privacyServer.sendRawTransaction(...args),
|
|
75
|
+
}
|
|
76
|
+
}
|
package/src/create-asset.js
CHANGED
|
@@ -22,7 +22,7 @@ import assert from 'minimalistic-assert'
|
|
|
22
22
|
import ms from 'ms'
|
|
23
23
|
|
|
24
24
|
import { addressHasHistoryFactory } from './address-has-history.js'
|
|
25
|
-
import { resolveMonitorSettings } from './create-asset-utils.js'
|
|
25
|
+
import { createBroadcastTxFactory, resolveMonitorSettings } from './create-asset-utils.js'
|
|
26
26
|
import { createTokenFactory } from './create-token-factory.js'
|
|
27
27
|
import { createCustomFeesApi } from './custom-fees.js'
|
|
28
28
|
import { createEvmServer } from './exodus-eth-server/index.js'
|
|
@@ -108,6 +108,7 @@ export const createAssetFactory = ({
|
|
|
108
108
|
customTokens,
|
|
109
109
|
supportsCustomFees,
|
|
110
110
|
useAbsoluteBalanceAndNonce: overrideUseAbsoluteBalanceAndNonce,
|
|
111
|
+
privacyRpcUrl,
|
|
111
112
|
} = configWithOverrides
|
|
112
113
|
|
|
113
114
|
const asset = assets[base.name]
|
|
@@ -265,10 +266,15 @@ export const createAssetFactory = ({
|
|
|
265
266
|
? getL1GetFeeFactory({ asset, originalGetFee })
|
|
266
267
|
: originalGetFee
|
|
267
268
|
|
|
269
|
+
const { broadcastTx, broadcastPrivateTx } = createBroadcastTxFactory({
|
|
270
|
+
assetName: asset.name,
|
|
271
|
+
server,
|
|
272
|
+
privacyRpcUrl,
|
|
273
|
+
})
|
|
274
|
+
|
|
268
275
|
const api = {
|
|
269
|
-
getActivityTxs,
|
|
270
276
|
addressHasHistory,
|
|
271
|
-
broadcastTx
|
|
277
|
+
broadcastTx,
|
|
272
278
|
createAccountState: () => accountStateClass,
|
|
273
279
|
createFeeMonitor,
|
|
274
280
|
createHistoryMonitor,
|
|
@@ -277,6 +283,7 @@ export const createAssetFactory = ({
|
|
|
277
283
|
customFees: createCustomFeesApi({ baseAsset: asset }),
|
|
278
284
|
defaultAddressPath,
|
|
279
285
|
features,
|
|
286
|
+
getActivityTxs,
|
|
280
287
|
getBalances,
|
|
281
288
|
getBalanceForAddress: createGetBalanceForAddress({ asset, server }),
|
|
282
289
|
getConfirmationsNumber: () => confirmationsNumber,
|
|
@@ -318,6 +325,7 @@ export const createAssetFactory = ({
|
|
|
318
325
|
chainId,
|
|
319
326
|
monitorType,
|
|
320
327
|
estimateL1DataFee,
|
|
328
|
+
broadcastPrivateTx,
|
|
321
329
|
forceGasLimitEstimation,
|
|
322
330
|
server,
|
|
323
331
|
...(erc20FuelBuffer && { erc20FuelBuffer }),
|
package/src/get-balances.js
CHANGED
|
@@ -18,7 +18,9 @@ export const getAbsoluteBalance = ({ asset, txLog }) => {
|
|
|
18
18
|
let balance = asset.currency.ZERO
|
|
19
19
|
let hasAbsoluteBalance = false
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const reversedTxLog = txLog.reverse()
|
|
22
|
+
|
|
23
|
+
for (const tx of reversedTxLog) {
|
|
22
24
|
if (tx.data.balanceChange) {
|
|
23
25
|
hasAbsoluteBalance = true
|
|
24
26
|
balance = balance.add(asset.currency.baseUnit(tx.data.balanceChange.to))
|
|
@@ -28,7 +28,8 @@ export const resolveNonce = async ({
|
|
|
28
28
|
export const getNonceFromTxLog = ({ txLog, useAbsoluteNonce }) => {
|
|
29
29
|
let absoluteNonce = 0
|
|
30
30
|
if (useAbsoluteNonce) {
|
|
31
|
-
|
|
31
|
+
const reversedTxLog = txLog.reverse()
|
|
32
|
+
for (const tx of reversedTxLog) {
|
|
32
33
|
if (tx.data.nonceChange) {
|
|
33
34
|
absoluteNonce = parseInt(tx.data.nonceChange.to, 10)
|
|
34
35
|
break
|