@exodus/balances 11.0.1 → 11.0.3

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,18 @@
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
+ ## [11.0.3](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@11.0.2...@exodus/balances@11.0.3) (2023-10-20)
7
+
8
+ ### Bug Fixes
9
+
10
+ - import from atoms index ([#4508](https://github.com/ExodusMovement/exodus-hydra/issues/4508)) ([923fb99](https://github.com/ExodusMovement/exodus-hydra/commit/923fb992328b63e45401c78176b5a6ef7b666eee))
11
+
12
+ ## [11.0.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@11.0.1...@exodus/balances@11.0.2) (2023-09-07)
13
+
14
+ ### Bug Fixes
15
+
16
+ - ignore changes ([#3881](https://github.com/ExodusMovement/exodus-hydra/issues/3881)) ([7a8e069](https://github.com/ExodusMovement/exodus-hydra/commit/7a8e0695d2c20f76c7bc1d496bfea22c23256a5c))
17
+
6
18
  ## [11.0.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@11.0.0...@exodus/balances@11.0.1) (2023-09-06)
7
19
 
8
20
  ### Bug Fixes
@@ -4,15 +4,15 @@ const isUnconfirmedTx = (tx) => tx.pending && !tx.error
4
4
 
5
5
  const getTxSetBalance = (txSet) => txSet.getMutations().slice(-1)[0].balance
6
6
 
7
- const getUnconfirmedTotal = ({ assets, asset, txLog }) => {
7
+ const getUnconfirmedTotal = ({ asset, txLog }) => {
8
8
  const unconfirmedTxs = [...txLog].filter(isUnconfirmedTx)
9
9
  return unconfirmedTxs.length === 0
10
10
  ? asset.currency.ZERO
11
- : getTxSetBalance(TxSet.fromArray(unconfirmedTxs, { assets }))
11
+ : getTxSetBalance(TxSet.fromArray(unconfirmedTxs))
12
12
  }
13
13
 
14
- const getConfirmedBalance = ({ assets, asset, txLog, balance }) => {
15
- const unconfirmedTotal = getUnconfirmedTotal({ assets, asset, txLog })
14
+ const getConfirmedBalance = ({ asset, txLog, balance }) => {
15
+ const unconfirmedTotal = getUnconfirmedTotal({ asset, txLog })
16
16
  return balance.sub(unconfirmedTotal)
17
17
  }
18
18
 
package/module/index.js CHANGED
@@ -167,7 +167,6 @@ class Balances extends ExodusModule {
167
167
 
168
168
  if (balances.balance && this.#balanceFields.includes('confirmedBalance')) {
169
169
  balances.confirmedBalance = getConfirmedBalance({
170
- assets: this.#getAssets(),
171
170
  asset,
172
171
  txLog,
173
172
  balance: balances.balance,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/balances",
3
- "version": "11.0.1",
3
+ "version": "11.0.3",
4
4
  "description": "Tracks crypto balances across enabled wallet accounts.",
5
5
  "author": "Exodus Movement Inc.",
6
6
  "license": "UNLICENSED",
@@ -29,11 +29,11 @@
29
29
  "url": "https://github.com/ExodusMovement/exodus-hydra/issues?q=is%3Aissue+is%3Aopen+label%3Abalances"
30
30
  },
31
31
  "dependencies": {
32
- "@exodus/atoms": "^5.6.0",
32
+ "@exodus/atoms": "^5.7.3",
33
33
  "@exodus/basic-utils": "^2.1.0",
34
34
  "@exodus/currency": "^2.1.2",
35
35
  "@exodus/module": "^1.1.0",
36
- "@exodus/multi-account-redux": "^1.6.0",
36
+ "@exodus/multi-account-redux": "^2.0.0",
37
37
  "@exodus/typeforce": "^1.18.0",
38
38
  "lodash": "^4.17.21",
39
39
  "make-concurrent": "^4.0.0",
@@ -45,18 +45,18 @@
45
45
  "devDependencies": {
46
46
  "@exodus/assets": "^8.0.94",
47
47
  "@exodus/assets-base": "^8.1.10",
48
- "@exodus/assets-feature": "^1.5.0",
48
+ "@exodus/assets-feature": "^3.5.0",
49
49
  "@exodus/bitcoin-meta": "^1.0.1",
50
50
  "@exodus/blockchain-metadata": "^9.0.1",
51
51
  "@exodus/ethereum-meta": "^1.0.30",
52
- "@exodus/models": "^8.9.0",
52
+ "@exodus/models": "^10.1.0",
53
53
  "@exodus/redux-dependency-injection": "^3.0.0",
54
54
  "@exodus/storage-memory": "*",
55
- "@exodus/wallet-accounts": "^14.0.0",
55
+ "@exodus/wallet-accounts": "^14.1.0",
56
56
  "eslint": "^8.44.0",
57
57
  "events": "^3.3.0",
58
58
  "jest": "^29.1.2",
59
59
  "redux": "^4.2.1"
60
60
  },
61
- "gitHead": "dff17ef7b4c9f0335502b8dc7ad0cc59f6f4ac5a"
61
+ "gitHead": "18791c72d9be2a75aea6621a216c1aed819442ca"
62
62
  }
package/redux/index.js CHANGED
@@ -38,7 +38,8 @@ const balancesReduxDefinition = {
38
38
  initialState,
39
39
  eventReducers: {
40
40
  balances: (state, payload) => {
41
- if (payload.changes && Object.keys(payload.changes).length > 0) {
41
+ const ignoreChanges = state === initialState
42
+ if (!ignoreChanges && payload.changes && Object.keys(payload.changes).length > 0) {
42
43
  return mergeChanges(state, payload.changes)
43
44
  }
44
45