@exodus/ethereum-api 8.45.4 → 8.45.6
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 +20 -0
- package/package.json +10 -10
- package/src/create-asset-plugin-factory.js +0 -1
- package/src/create-asset.js +2 -8
- package/src/gas-estimation.js +14 -6
- package/src/get-fee.js +4 -3
- package/src/tx-create.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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.45.6](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.45.5...@exodus/ethereum-api@8.45.6) (2025-08-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: remove meta boilerplate (#6305)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [8.45.5](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.45.4...@exodus/ethereum-api@8.45.5) (2025-08-19)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* fix: remove unused isExchange (#6301)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [8.45.4](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.45.3...@exodus/ethereum-api@8.45.4) (2025-08-13)
|
|
7
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.45.
|
|
3
|
+
"version": "8.45.6",
|
|
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",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"lint:fix": "yarn lint --fix"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@exodus/asset": "^2.0.
|
|
24
|
+
"@exodus/asset": "^2.0.4",
|
|
25
25
|
"@exodus/asset-lib": "^5.3.0",
|
|
26
26
|
"@exodus/assets": "^11.4.0",
|
|
27
27
|
"@exodus/basic-utils": "^3.0.1",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@exodus/crypto": "^1.0.0-rc.13",
|
|
30
30
|
"@exodus/currency": "^6.0.1",
|
|
31
31
|
"@exodus/ethereum-lib": "^5.17.0",
|
|
32
|
-
"@exodus/ethereum-meta": "^2.9.
|
|
33
|
-
"@exodus/ethereumholesky-meta": "^2.0.
|
|
32
|
+
"@exodus/ethereum-meta": "^2.9.1",
|
|
33
|
+
"@exodus/ethereumholesky-meta": "^2.0.5",
|
|
34
34
|
"@exodus/ethereumjs": "^1.0.0",
|
|
35
35
|
"@exodus/fetch": "^1.3.0",
|
|
36
36
|
"@exodus/models": "^12.13.0",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@exodus/assets-testing": "^1.0.0",
|
|
53
|
-
"@exodus/bsc-meta": "^2.1
|
|
54
|
-
"@exodus/ethereumarbone-meta": "^2.
|
|
55
|
-
"@exodus/fantommainnet-meta": "^2.0.
|
|
56
|
-
"@exodus/matic-meta": "^2.2.
|
|
57
|
-
"@exodus/rootstock-meta": "^2.0.
|
|
53
|
+
"@exodus/bsc-meta": "^2.5.1",
|
|
54
|
+
"@exodus/ethereumarbone-meta": "^2.1.2",
|
|
55
|
+
"@exodus/fantommainnet-meta": "^2.0.5",
|
|
56
|
+
"@exodus/matic-meta": "^2.2.7",
|
|
57
|
+
"@exodus/rootstock-meta": "^2.0.5"
|
|
58
58
|
},
|
|
59
59
|
"bugs": {
|
|
60
60
|
"url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Aethereum-api"
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"type": "git",
|
|
64
64
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "41fe883d14291bfb6b73b37b617ce2f7fa914edb"
|
|
67
67
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -128,10 +128,6 @@ export const createAssetFactory = ({
|
|
|
128
128
|
|
|
129
129
|
const server = createEvmServer({ assetName: asset.name, serverUrl, monitorType })
|
|
130
130
|
|
|
131
|
-
const gasLimit = 21e3 // 21 KGas, enough only for sending ether to normal address
|
|
132
|
-
|
|
133
|
-
const contractGasLimit = 1e6 // used when estimateGas fail
|
|
134
|
-
|
|
135
131
|
const address = {
|
|
136
132
|
validate: validateFactory({ chainId, useEip1191ChainIdChecksum }),
|
|
137
133
|
hasChecksum,
|
|
@@ -237,7 +233,7 @@ export const createAssetFactory = ({
|
|
|
237
233
|
? estimateL1DataFeeFactory({ l1GasOracleAddress, server })
|
|
238
234
|
: undefined
|
|
239
235
|
|
|
240
|
-
const originalGetFee = getFeeFactory(
|
|
236
|
+
const originalGetFee = getFeeFactory()
|
|
241
237
|
|
|
242
238
|
const getFee = l1GasOracleAddress
|
|
243
239
|
? getL1GetFeeFactory({ asset, originalGetFee })
|
|
@@ -262,7 +258,7 @@ export const createAssetFactory = ({
|
|
|
262
258
|
getBalanceForAddress: createGetBalanceForAddress({ asset, server }),
|
|
263
259
|
getConfirmationsNumber: () => confirmationsNumber,
|
|
264
260
|
getDefaultAddressPath: () => defaultAddressPath,
|
|
265
|
-
getFeeAsync: getFeeAsyncFactory({ assetClientInterface,
|
|
261
|
+
getFeeAsync: getFeeAsyncFactory({ assetClientInterface, createTx }),
|
|
266
262
|
getFee,
|
|
267
263
|
getFeeData: () => feeData,
|
|
268
264
|
getKeyIdentifier: createGetKeyIdentifier({
|
|
@@ -289,8 +285,6 @@ export const createAssetFactory = ({
|
|
|
289
285
|
|
|
290
286
|
const fullAsset = {
|
|
291
287
|
...asset,
|
|
292
|
-
gasLimit,
|
|
293
|
-
contractGasLimit,
|
|
294
288
|
bip44,
|
|
295
289
|
keys,
|
|
296
290
|
address,
|
package/src/gas-estimation.js
CHANGED
|
@@ -9,6 +9,8 @@ export const DEFAULT_GAS_LIMIT_MULTIPLIER = 1.29
|
|
|
9
9
|
const GAS_PER_NON_ZERO_BYTE = 16
|
|
10
10
|
|
|
11
11
|
export const DEFAULT_CONTRACT_GAS_LIMIT = 1e6
|
|
12
|
+
export const DEFAULT_TOKEN_GAS_LIMIT = 120e3
|
|
13
|
+
export const DEFAULT_GAS_LIMIT = 21_000
|
|
12
14
|
|
|
13
15
|
// HACK: If a recipient address is not defined, we usually fall back to
|
|
14
16
|
// default address so gas estimation can still complete successfully
|
|
@@ -107,6 +109,14 @@ export function resolveDefaultTxInput({ asset, toAddress, amount }) {
|
|
|
107
109
|
: '0x'
|
|
108
110
|
}
|
|
109
111
|
|
|
112
|
+
export const defaultGasLimit = ({ asset, txInput }) => {
|
|
113
|
+
const isToken = isEthereumLikeToken(asset)
|
|
114
|
+
return (
|
|
115
|
+
(isToken ? DEFAULT_TOKEN_GAS_LIMIT : DEFAULT_GAS_LIMIT) +
|
|
116
|
+
GAS_PER_NON_ZERO_BYTE * toBuffer(txInput).length
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
110
120
|
export async function fetchGasLimit({
|
|
111
121
|
asset,
|
|
112
122
|
feeData,
|
|
@@ -128,13 +138,12 @@ export async function fetchGasLimit({
|
|
|
128
138
|
const toAddress = providedToAddress ?? ARBITRARY_ADDRESS
|
|
129
139
|
const txInput = providedTxInput || resolveDefaultTxInput({ asset, toAddress, amount })
|
|
130
140
|
|
|
131
|
-
const
|
|
141
|
+
const isToken = isEthereumLikeToken(asset)
|
|
132
142
|
|
|
133
143
|
const isContract = await isContractAddressCached({ asset, address: toAddress })
|
|
134
144
|
|
|
135
|
-
const isToken = isEthereumLikeToken(asset)
|
|
136
145
|
if (!isToken && !isContract && !asset.forceGasLimitEstimation) {
|
|
137
|
-
return defaultGasLimit()
|
|
146
|
+
return defaultGasLimit({ asset, txInput })
|
|
138
147
|
}
|
|
139
148
|
|
|
140
149
|
const gasLimitMultiplier = await resolveGasLimitMultiplier({
|
|
@@ -173,10 +182,9 @@ export async function fetchGasLimit({
|
|
|
173
182
|
console.error('fetchGasLimit error', err)
|
|
174
183
|
|
|
175
184
|
// fallback value for contract case
|
|
176
|
-
if (isContract) return
|
|
185
|
+
if (isContract) return DEFAULT_CONTRACT_GAS_LIMIT
|
|
177
186
|
|
|
178
|
-
|
|
179
|
-
return defaultGasLimit()
|
|
187
|
+
return defaultGasLimit({ asset, txInput })
|
|
180
188
|
}
|
|
181
189
|
}
|
|
182
190
|
|
package/src/get-fee.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
getNormalizedFeeDataForCustomFee,
|
|
6
6
|
resolveGasPrice,
|
|
7
7
|
} from './fee-utils.js'
|
|
8
|
+
import { defaultGasLimit } from './gas-estimation.js'
|
|
8
9
|
|
|
9
10
|
// Move to meta?
|
|
10
11
|
const taxes = {
|
|
@@ -40,8 +41,8 @@ export const getFeeFactoryGasPrices = ({ customFee, feeData }) => {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
export const getFeeFactory =
|
|
43
|
-
(
|
|
44
|
-
({ asset, feeData, customFee, gasLimit: providedGasLimit, amount }) => {
|
|
44
|
+
() =>
|
|
45
|
+
({ asset, feeData, customFee, txInput, gasLimit: providedGasLimit, amount }) => {
|
|
45
46
|
const {
|
|
46
47
|
feeData: { tipGasPrice, eip1559Enabled },
|
|
47
48
|
gasPrice,
|
|
@@ -50,7 +51,7 @@ export const getFeeFactory =
|
|
|
50
51
|
feeData,
|
|
51
52
|
})
|
|
52
53
|
|
|
53
|
-
const gasLimit = providedGasLimit
|
|
54
|
+
const gasLimit = providedGasLimit ?? defaultGasLimit({ asset, txInput })
|
|
54
55
|
|
|
55
56
|
// When explicitly opting into EIP-1559 transactions,
|
|
56
57
|
// lock in the `tipGasPrice` we used to compute the fees.
|
package/src/tx-create.js
CHANGED