@exodus/ethereum-lib 4.2.5 → 4.2.7

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": "4.2.5",
3
+ "version": "4.2.7",
4
4
  "description": "Ethereum Library",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -13,16 +13,21 @@
13
13
  "publishConfig": {
14
14
  "access": "restricted"
15
15
  },
16
+ "scripts": {
17
+ "test": "run -T jest",
18
+ "lint": "run -T eslint src",
19
+ "lint:fix": "yarn lint --fix"
20
+ },
16
21
  "dependencies": {
17
22
  "@exodus/asset-lib": "^3.7.1",
18
- "@exodus/assets": "^9.1.0",
19
23
  "@exodus/aurora-meta": "^1.0.3",
20
24
  "@exodus/avalanchec-meta": "^1.0.4",
21
25
  "@exodus/basemainnet-meta": "^1.0.6",
22
26
  "@exodus/basic-utils": "^0.7.0",
23
27
  "@exodus/bsc-meta": "^1.1.2",
24
28
  "@exodus/cronos-meta": "^1.0.5",
25
- "@exodus/ethereum-meta": "^1.1.3",
29
+ "@exodus/currency": "^2.3.2",
30
+ "@exodus/ethereum-meta": "^1.2.0",
26
31
  "@exodus/ethereumarbnova-meta": "^1.0.2",
27
32
  "@exodus/ethereumarbone-meta": "^1.1.5",
28
33
  "@exodus/ethereumclassic-meta": "^1.0.1",
@@ -32,6 +37,7 @@
32
37
  "@exodus/ethereumjs-tx": "^3.3.0-exodus.6",
33
38
  "@exodus/ethereumjs-util": "^7.1.0-exodus.6",
34
39
  "@exodus/fantommainnet-meta": "^1.0.5",
40
+ "@exodus/flare-meta": "^1.0.4",
35
41
  "@exodus/harmonymainnet-meta": "^1.0.0",
36
42
  "@exodus/key-utils": "^3.1.0",
37
43
  "@exodus/matic-meta": "^1.2.0",
@@ -40,10 +46,15 @@
40
46
  "@exodus/rootstock-meta": "^1.0.5",
41
47
  "@exodus/solidity-contract": "^1.1.3",
42
48
  "base-x": "^3.0.2",
49
+ "ethjs-util": "0.1.6",
43
50
  "lodash": "^4.17.15",
44
51
  "minimalistic-assert": "^1.0.1",
45
52
  "ms": "^2.1.1",
46
53
  "reselect": "~3.0.1"
47
54
  },
48
- "gitHead": "6fa73dbdd4ae4ff56f19a7a2854f439deaf99a13"
55
+ "devDependencies": {
56
+ "@exodus/assets": "9.1.0",
57
+ "@exodus/assets-base": "^8.1.14"
58
+ },
59
+ "gitHead": "fc74398662718e696baca062122c3e6908672504"
49
60
  }
@@ -6,6 +6,8 @@ const ethStakeAccountState = ({ currency }) => ({
6
6
  delegatedBalance: currency.ZERO,
7
7
  rewardsBalance: currency.ZERO,
8
8
  unclaimedUndelegatedBalance: currency.ZERO,
9
+ totalRewardsReceived: currency.ZERO,
10
+ lastStakingTxProcessed: '',
9
11
  })
10
12
 
11
13
  const assetStakingData = {
@@ -12,9 +12,17 @@ export const getEthereumBalances = ({ asset, liquidBalance, accountState }) => {
12
12
  ['staking', asset.name, 'unclaimedUndelegatedBalance'],
13
13
  asset.currency.ZERO
14
14
  )
15
- const totalBalance = liquidBalance.add(delegatedBalance).add(undelegatedBalance)
15
+ const rewardsReceived = get(
16
+ accountState,
17
+ ['staking', asset.name, 'totalRewardsReceived'],
18
+ asset.currency.ZERO
19
+ )
20
+ const totalBalance = liquidBalance
21
+ .add(delegatedBalance)
22
+ .add(undelegatedBalance)
23
+ .add(rewardsReceived)
16
24
  return {
17
25
  balance: totalBalance,
18
- liquidBalance,
26
+ liquidBalance: liquidBalance.add(rewardsReceived),
19
27
  }
20
28
  }
@@ -55,7 +55,7 @@ export function buffer2currency({ asset, value }) {
55
55
  export function currency2buffer(value) {
56
56
  const b10Value = value.toBaseString()
57
57
 
58
- // Desktop: const hexValue = value.toBase()._number.toString(16)
58
+ // Desktop: const hexValue = new BN(value.toBaseString()).toString(16)
59
59
  const hexValue = base16.encode(base10.decode(b10Value))
60
60
 
61
61
  if (hexValue.includes('.')) {