@exodus/ethereum-api 8.38.0 → 8.38.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 +10 -0
- package/package.json +2 -2
- package/src/tx-send/tx-send.js +22 -4
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.38.1](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.38.0...@exodus/ethereum-api@8.38.1) (2025-06-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: include l1 in fee (#5895)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## [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
17
|
|
|
8
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.38.
|
|
3
|
+
"version": "8.38.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",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"type": "git",
|
|
63
63
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "29460910f5183b5f2c5298f806e837050df0ecdf"
|
|
66
66
|
}
|
package/src/tx-send/tx-send.js
CHANGED
|
@@ -80,7 +80,7 @@ const txSendFactory = ({ assetClientInterface, createUnsignedTx, useAbsoluteBala
|
|
|
80
80
|
isSendAll,
|
|
81
81
|
isHardware,
|
|
82
82
|
} = options
|
|
83
|
-
let { txInput } = options // avoid let!
|
|
83
|
+
let { txInput, feeAmount: providedFeeAmount } = options // avoid let!
|
|
84
84
|
|
|
85
85
|
const feeOpts = {
|
|
86
86
|
gasPrice: options.gasPrice,
|
|
@@ -225,11 +225,10 @@ const txSendFactory = ({ assetClientInterface, createUnsignedTx, useAbsoluteBala
|
|
|
225
225
|
isSendAll,
|
|
226
226
|
createUnsignedTx,
|
|
227
227
|
feeData,
|
|
228
|
+
providedFeeAmount,
|
|
228
229
|
}
|
|
229
230
|
|
|
230
|
-
let { txId, rawTx, nonce, gasLimit, tipGasPrice,
|
|
231
|
-
|
|
232
|
-
const feeAmount = gasPrice.mul(gasLimit)
|
|
231
|
+
let { txId, rawTx, nonce, gasLimit, tipGasPrice, feeAmount } = await createTx(createTxParams)
|
|
233
232
|
|
|
234
233
|
try {
|
|
235
234
|
await baseAsset.api.broadcastTx(rawTx.toString('hex'))
|
|
@@ -378,6 +377,7 @@ const createTx = async ({
|
|
|
378
377
|
feeOpts,
|
|
379
378
|
createUnsignedTx,
|
|
380
379
|
feeData,
|
|
380
|
+
providedFeeAmount,
|
|
381
381
|
}) => {
|
|
382
382
|
assert(
|
|
383
383
|
nonce !== undefined && typeof nonce === 'number',
|
|
@@ -470,6 +470,23 @@ const createTx = async ({
|
|
|
470
470
|
|
|
471
471
|
unsignedTx.txMeta.eip1559Enabled = eip1559Enabled
|
|
472
472
|
|
|
473
|
+
const resolveFee = async () => {
|
|
474
|
+
if (providedFeeAmount) {
|
|
475
|
+
return providedFeeAmount
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
const optimismL1DataFee = asset.baseAsset.estimateL1DataFee
|
|
479
|
+
? await asset.baseAsset.estimateL1DataFee({
|
|
480
|
+
unsignedTx,
|
|
481
|
+
})
|
|
482
|
+
: undefined
|
|
483
|
+
|
|
484
|
+
const l1DataFee = optimismL1DataFee
|
|
485
|
+
? asset.baseAsset.currency.baseUnit(optimismL1DataFee)
|
|
486
|
+
: asset.baseAsset.currency.ZERO
|
|
487
|
+
return gasPrice.mul(gasLimit).add(l1DataFee)
|
|
488
|
+
}
|
|
489
|
+
|
|
473
490
|
const { txId, rawTx } = await assetClientInterface.signTransaction({
|
|
474
491
|
assetName: asset.baseAsset.name,
|
|
475
492
|
unsignedTx,
|
|
@@ -483,6 +500,7 @@ const createTx = async ({
|
|
|
483
500
|
gasLimit,
|
|
484
501
|
gasPrice,
|
|
485
502
|
tipGasPrice,
|
|
503
|
+
feeAmount: await resolveFee(),
|
|
486
504
|
}
|
|
487
505
|
}
|
|
488
506
|
|