@exodus/ethereum-api 8.9.2 → 8.9.4
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,24 @@
|
|
|
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.9.4](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.9.3...@exodus/ethereum-api@8.9.4) (2024-07-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ethereum:** matic staking tx processing ([#2771](https://github.com/ExodusMovement/assets/issues/2771)) ([4caee9f](https://github.com/ExodusMovement/assets/commit/4caee9feb13d0c30d2f995abe2a974838893150d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [8.9.3](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.9.2...@exodus/ethereum-api@8.9.3) (2024-07-09)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* use proxied balance ([#2637](https://github.com/ExodusMovement/assets/issues/2637)) ([639ee0f](https://github.com/ExodusMovement/assets/commit/639ee0f55bc53a9e31c553865902ca3f0ad0f0b8))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [8.9.2](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.9.1...@exodus/ethereum-api@8.9.2) (2024-07-03)
|
|
7
25
|
|
|
8
26
|
### Code Refactoring
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.9.
|
|
3
|
+
"version": "8.9.4",
|
|
4
4
|
"description": "Ethereum Api",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"type": "git",
|
|
67
67
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "6a06929513cb4fd53a70ceee6c58b69bd3cfb758"
|
|
70
70
|
}
|
|
@@ -4,7 +4,7 @@ export const createGetBalanceForAddress = ({ asset, server }) => {
|
|
|
4
4
|
assert(asset, 'asset is required')
|
|
5
5
|
assert(server, 'server is required')
|
|
6
6
|
return async (address) => {
|
|
7
|
-
const balance = await server.
|
|
7
|
+
const balance = await server.getBalanceProxied(address)
|
|
8
8
|
if (typeof balance === 'string') {
|
|
9
9
|
// hex-response from eth_getBalance node
|
|
10
10
|
return asset.currency.baseUnit(balance)
|
|
@@ -4,13 +4,11 @@ import {
|
|
|
4
4
|
isEthereumUndelegate,
|
|
5
5
|
isEthereumUndelegatePending,
|
|
6
6
|
} from '../staking/ethereum/staking-utils'
|
|
7
|
-
|
|
8
7
|
import { isPolygonClaimUndelegate, isPolygonDelegate, isPolygonUndelegate } from '../staking/matic'
|
|
9
|
-
|
|
10
8
|
import {
|
|
11
|
-
decodePolygonStakingTxInputAmount,
|
|
12
|
-
decodeEthLikeStakingTxInputAmount,
|
|
13
9
|
calculateRewardsFromStakeTx,
|
|
10
|
+
decodeEthLikeStakingTxInputAmount,
|
|
11
|
+
decodePolygonStakingTxInputAmount,
|
|
14
12
|
} from './utils.js'
|
|
15
13
|
|
|
16
14
|
const getEthereumStakingTxData = ({ tx, currency }) => {
|
|
@@ -53,7 +51,11 @@ const getEthereumStakingTxData = ({ tx, currency }) => {
|
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
const getPolygonStakingTxData = ({ tx, currency }) => {
|
|
56
|
-
if (
|
|
54
|
+
if (
|
|
55
|
+
['delegate', 'undelegate', 'claimUndelegate'].some((stakeTx) => tx.data?.[stakeTx]) &&
|
|
56
|
+
tx.coinAmount.isZero
|
|
57
|
+
)
|
|
58
|
+
return
|
|
57
59
|
|
|
58
60
|
const txAmount = tx.coinAmount.toDefaultString()
|
|
59
61
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { EthereumStaking, isEthereumStakingTx, MaticStakingApi } from '../staking'
|
|
2
1
|
import { asset as ethereum } from '@exodus/ethereum-meta'
|
|
3
2
|
import { asset as ethereumholesky } from '@exodus/ethereumholesky-meta'
|
|
4
3
|
|
|
4
|
+
import { EthereumStaking, isEthereumStakingTx, MaticStakingApi } from '../staking'
|
|
5
|
+
|
|
5
6
|
const polygonStakingApi = new MaticStakingApi()
|
|
6
7
|
const ethereumStakingApi = new EthereumStaking(ethereum)
|
|
7
8
|
const ethereumHoleskyStakingApi = new EthereumStaking(ethereumholesky)
|
|
@@ -35,7 +36,7 @@ export const calculateRewardsFromStakeTx = ({ tx, currency }) => {
|
|
|
35
36
|
if (stakeTxContainsReward) {
|
|
36
37
|
const txAmount = stakedAmount.sub(tx.coinAmount.abs()).abs()
|
|
37
38
|
// eslint-disable-next-line @exodus/mutable/no-param-reassign-prop-only -- TODO: Fix this the next time the file is edited.
|
|
38
|
-
return txAmount.
|
|
39
|
+
return txAmount.toDefaultString()
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|