@exodus/ethereum-api 8.9.3 → 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,15 @@
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
+
6
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)
7
16
 
8
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "8.9.3",
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": "719f0e01b420fdaa1722cc8b9df5c2d80763349a"
69
+ "gitHead": "6a06929513cb4fd53a70ceee6c58b69bd3cfb758"
70
70
  }
@@ -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 (['delegate', 'undelegate', 'claimUndelegate'].some((stakeTx) => tx.data?.[stakeTx])) return
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.toBaseString()
39
+ return txAmount.toDefaultString()
39
40
  }
40
41
  }
41
42