@exodus/ethereum-api 8.28.0 → 8.28.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
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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.28.1](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.28.0...@exodus/ethereum-api@8.28.1) (2025-02-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: add ETH stakeable property (#4917)
|
|
13
|
+
|
|
14
|
+
* fix: add optional chaining to tx references (#4948)
|
|
15
|
+
|
|
16
|
+
* fix: ETH activity txs field (#4915)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
6
20
|
## [8.28.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.27.0...@exodus/ethereum-api@8.28.0) (2025-01-23)
|
|
7
21
|
|
|
8
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.28.
|
|
3
|
+
"version": "8.28.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",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"type": "git",
|
|
65
65
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "7f03ce2fb4a9fe95064a14b6b9be8fdceb4dcda6"
|
|
68
68
|
}
|
package/src/get-balances.js
CHANGED
|
@@ -110,10 +110,13 @@ export const getBalancesFactory = ({ monitorType, config = Object.create(null) }
|
|
|
110
110
|
total = spendable.add(staked).add(staking).add(unstaking).add(unstaked)
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
const stakeable = spendable
|
|
114
|
+
|
|
113
115
|
return {
|
|
114
116
|
// new
|
|
115
117
|
spendable,
|
|
116
118
|
total,
|
|
119
|
+
stakeable,
|
|
117
120
|
staked,
|
|
118
121
|
staking,
|
|
119
122
|
unstaking,
|
|
@@ -15,10 +15,10 @@ export const isPolygonTx = ({ coinName }) => coinName === 'polygon'
|
|
|
15
15
|
export const isPolygonDelegate = (tx) =>
|
|
16
16
|
isPolygonTx(tx) && tx.to === STAKING_MANAGER_CONTRACT && tx.data?.methodId === DELEGATE
|
|
17
17
|
export const isPolygonUndelegate = (tx) =>
|
|
18
|
-
isPolygonTx(tx) && tx.from[0] === STAKING_MANAGER_CONTRACT && tx.data?.methodId === UNDELEGATE
|
|
18
|
+
isPolygonTx(tx) && tx.from?.[0] === STAKING_MANAGER_CONTRACT && tx.data?.methodId === UNDELEGATE
|
|
19
19
|
export const isPolygonReward = (tx) =>
|
|
20
|
-
isPolygonTx(tx) && tx.from[0] === STAKING_MANAGER_CONTRACT && tx.data?.methodId === CLAIM_REWARD
|
|
20
|
+
isPolygonTx(tx) && tx.from?.[0] === STAKING_MANAGER_CONTRACT && tx.data?.methodId === CLAIM_REWARD
|
|
21
21
|
export const isPolygonClaimUndelegate = (tx) =>
|
|
22
22
|
isPolygonTx(tx) &&
|
|
23
|
-
tx.from[0] === STAKING_MANAGER_CONTRACT &&
|
|
23
|
+
tx.from?.[0] === STAKING_MANAGER_CONTRACT &&
|
|
24
24
|
tx.data?.methodId === CLAIM_UNDELEGATE_BALANCE
|
|
@@ -21,16 +21,16 @@ export const decodePolygonStakingTxInputAmount = (tx) => {
|
|
|
21
21
|
|
|
22
22
|
export const calculateRewardsFromStakeTx = ({ tx, currency }) => {
|
|
23
23
|
const stakedAmount = currency.baseUnit(decodePolygonStakingTxInputAmount(tx))
|
|
24
|
-
const {
|
|
24
|
+
const { rewards } = tx.data
|
|
25
25
|
// stake tx might have rewards in it,
|
|
26
26
|
// i.e: https://etherscan.io/tx/0x0a81d266109034a3a70c6f1b9601c105d8caebbd0de652a0619344f9559ae4fa
|
|
27
27
|
// thus reward = txInputAmount(amount to stake) - tx.coinAmount
|
|
28
28
|
// tx.coinAmount is already computed from monitor; incoming - outgoing ERC20 token txs
|
|
29
29
|
const stakeTxContainsReward = !stakedAmount.equals(tx.coinAmount.abs())
|
|
30
30
|
|
|
31
|
-
if (
|
|
31
|
+
if (rewards) {
|
|
32
32
|
// cache rewards
|
|
33
|
-
return currency.baseUnit(
|
|
33
|
+
return currency.baseUnit(rewards)
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
if (stakeTxContainsReward) {
|