@exodus/ethereum-lib 4.2.6 → 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.
|
|
3
|
+
"version": "4.2.7",
|
|
4
4
|
"description": "Ethereum Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"@exodus/assets": "9.1.0",
|
|
57
57
|
"@exodus/assets-base": "^8.1.14"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "fc74398662718e696baca062122c3e6908672504"
|
|
60
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
|
|
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
|
}
|
package/src/utils/index.js
CHANGED
|
@@ -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.
|
|
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('.')) {
|