@exodus/ethereum-lib 2.1.1 → 2.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-lib",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
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": "bd541d6d65566346f20e9217e8a0088d3c61e5c4"
28
+ "gitHead": "956ac273cee5a8979824a68127a6d400ac711e48"
29
29
  }
@@ -2,7 +2,7 @@ import { FeeData } from '@exodus/asset-lib'
2
2
 
3
3
  export default new FeeData(
4
4
  {
5
- gasPrice: '50 Gwei',
5
+ gasPrice: '75 Gwei',
6
6
  max: '250 Gwei',
7
7
  min: '1 Gwei',
8
8
  },
@@ -8,6 +8,27 @@ const BumpType = {
8
8
  RBF: 2,
9
9
  }
10
10
 
11
+ export function getPendingNonExchangeTxs(activeWalletAccount, getTxLog, getIsExchangeTx) {
12
+ // check if the tx log even has pending transactions
13
+ const result = isQueuedPendingTx(
14
+ { data: { nonce: Number.MAX_SAFE_INTEGER } },
15
+ activeWalletAccount,
16
+ getTxLog
17
+ )
18
+ if (!result) return []
19
+
20
+ const txLog = getTxLog('ethereum', activeWalletAccount)
21
+ const pendingNonExchangeTxs = []
22
+ for (let index = isQueuedPendingTx.minIndex; index < txLog.size; index++) {
23
+ const _tx = txLog.getAt(index)
24
+ if (_tx.pending && _tx.sent && !getIsExchangeTx(_tx.txId)) {
25
+ pendingNonExchangeTxs.push(_tx)
26
+ }
27
+ }
28
+
29
+ return pendingNonExchangeTxs
30
+ }
31
+
11
32
  function isQueuedPendingTx(tx, activeWalletAccount, getTxLog) {
12
33
  const txLog = getTxLog('ethereum', activeWalletAccount)
13
34
  if (!txLog || txLog.size === 0) return false
@@ -1,6 +1,7 @@
1
1
  export {
2
2
  default as getCanAccelerateTxFactory,
3
3
  calculateBumpedGasPrice,
4
+ getPendingNonExchangeTxs,
4
5
  } from './get-can-accelerate-tx-factory'
5
6
 
6
7
  export { default as getIsEnoughBalanceToAccelerateSelectorFactory } from './get-is-enough-balance-to-accelerate-factory'