@exodus/ethereum-lib 2.0.7 → 2.0.8
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-lib",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "Ethereum Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "Exodus Movement, Inc.",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@exodus/models": "^8.5.1"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "57d3639cc6539825c14e53ef6c299d79920f54d3"
|
|
29
29
|
}
|
|
@@ -10,17 +10,24 @@ const BumpType = {
|
|
|
10
10
|
|
|
11
11
|
function isQueuedPendingTx(tx, activeWalletAccount, getTxLog) {
|
|
12
12
|
const txLog = getTxLog('ethereum', activeWalletAccount)
|
|
13
|
-
if (
|
|
14
|
-
|
|
13
|
+
if (!txLog || txLog.size === 0) return false
|
|
14
|
+
|
|
15
|
+
const txAtMinIndex = txLog.getAt(isQueuedPendingTx.minIndex)
|
|
16
|
+
if (isQueuedPendingTx.minIndex >= 0 && txAtMinIndex && txAtMinIndex.pending) {
|
|
17
|
+
return tx.data && tx.data.nonce > txAtMinIndex.data.nonce
|
|
15
18
|
}
|
|
16
19
|
let minPendingNonce = Number.MAX_SAFE_INTEGER
|
|
17
20
|
for (let index = 0; index < txLog.size; index++) {
|
|
18
21
|
const _tx = txLog.getAt(index)
|
|
19
22
|
if (!_tx.pending) continue
|
|
23
|
+
|
|
24
|
+
const nonce = _tx.data && _tx.data.nonce
|
|
25
|
+
if (nonce === undefined) continue
|
|
26
|
+
|
|
20
27
|
// ignore nonce of a TX that just replaced an another tx
|
|
21
|
-
if (_tx.data
|
|
22
|
-
if (_tx.sent &&
|
|
23
|
-
minPendingNonce =
|
|
28
|
+
if (_tx.data.replacedTxId && Date.now() - _tx.date < MINUTE) continue
|
|
29
|
+
if (_tx.sent && nonce < minPendingNonce) {
|
|
30
|
+
minPendingNonce = nonce
|
|
24
31
|
isQueuedPendingTx.minIndex = index
|
|
25
32
|
}
|
|
26
33
|
}
|
|
@@ -72,8 +79,10 @@ export default (
|
|
|
72
79
|
const asset = assets[assetName]
|
|
73
80
|
if (!getIsRbfEnabled(assetName)) return BumpType.NONE
|
|
74
81
|
if (!['ETHEREUM_ERC20', 'ETHEREUM_LIKE'].includes(asset.assetType)) return BumpType.NONE
|
|
75
|
-
if (!tx.pending || !tx.sent || tx.exchange || !tx.data
|
|
76
|
-
|
|
82
|
+
if (!tx.pending || !tx.sent || tx.exchange || !tx.data || !tx.data.gasLimit)
|
|
83
|
+
return BumpType.NONE
|
|
84
|
+
const personalNote = getPersonalNoteByTxId(tx.txId)
|
|
85
|
+
if (personalNote && personalNote.dapp) return BumpType.NONE
|
|
77
86
|
if (isQueuedPendingTx(tx, activeWalletAccount, getTxLog)) return BumpType.NONE
|
|
78
87
|
|
|
79
88
|
const { gasPrice: currentGasPrice } = getFeeData(assetName)
|