@exodus/balances 13.3.1 → 13.3.2

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,12 @@
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
+ ## [13.3.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.3.1...@exodus/balances@13.3.2) (2024-09-13)
7
+
8
+ ### Bug Fixes
9
+
10
+ - log instead of throwing ([#9147](https://github.com/ExodusMovement/exodus-hydra/issues/9147)) ([499f002](https://github.com/ExodusMovement/exodus-hydra/commit/499f002ddb2d35fab3d7b18b59cac07476ea6ee0))
11
+
6
12
  ## [13.3.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.3.0...@exodus/balances@13.3.1) (2024-09-09)
7
13
 
8
14
  **Note:** Version bump only for package @exodus/balances
@@ -1,5 +1,4 @@
1
1
  import { compute, createStorageAtomFactory } from '@exodus/atoms'
2
- // eslint-disable-next-line @exodus/restricted-imports/prefer-basic-utils
3
2
  import lodash from 'lodash'
4
3
 
5
4
  const { flatMap, map } = lodash
package/module/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { isNumberUnit } from '@exodus/currency'
2
2
  import { TxSet } from '@exodus/models'
3
3
  import ExodusModule from '@exodus/module' // eslint-disable-line import/no-deprecated
4
- // eslint-disable-next-line @exodus/restricted-imports/prefer-basic-utils
5
4
  import lodash from 'lodash'
6
5
  import { difference, flattenToPaths, pick, set } from '@exodus/basic-utils'
7
6
  import makeConcurrent from 'make-concurrent'
@@ -70,14 +69,14 @@ class Balances extends ExodusModule {
70
69
 
71
70
  // sanitize args in case someone passes something sensitive, e.g. getBalance({ walletAccount, mnemonic })
72
71
  // when only `{ walletAccount }` is expected
73
- const captureErrors =
72
+ const reportAndSwallowErrors =
74
73
  ({ fn, name, sanitizeArgs = () => {} }) =>
75
74
  async (...args) => {
76
75
  try {
77
76
  return await fn(...args)
78
77
  } catch (error) {
79
78
  this.emit('error', { fn: name, error, args: sanitizeArgs(...args) })
80
- throw error
79
+ this._logger.error(error)
81
80
  }
82
81
  }
83
82
 
@@ -86,13 +85,13 @@ class Balances extends ExodusModule {
86
85
  this.#handleTxLogUpdate = shareQueue(this.#handleTxLogUpdate)
87
86
  this.#recompute = shareQueue(this.#recompute)
88
87
  this.#onAssetsChanged = shareQueue(this.#onAssetsChanged)
89
- this.#getBalancesForAssetSource = captureErrors({
88
+ this.#getBalancesForAssetSource = reportAndSwallowErrors({
90
89
  fn: this.#getBalancesForAssetSource,
91
90
  name: 'getBalancesForAssetSource',
92
91
  sanitizeArgs: ({ walletAccount, assetName }) => ({ walletAccount, assetName }),
93
92
  })
94
93
 
95
- this.#setWalletAccounts = captureErrors({
94
+ this.#setWalletAccounts = reportAndSwallowErrors({
96
95
  fn: this.#setWalletAccounts,
97
96
  name: 'setWalletAccounts',
98
97
  sanitizeArgs: (walletAccounts) => walletAccounts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/balances",
3
- "version": "13.3.1",
3
+ "version": "13.3.2",
4
4
  "description": "Tracks crypto balances across enabled wallet accounts.",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "license": "UNLICENSED",
@@ -64,5 +64,5 @@
64
64
  "events": "^3.3.0",
65
65
  "redux": "^4.2.1"
66
66
  },
67
- "gitHead": "d64de7579b06afe91fbded3d1f7eb29950f82e5a"
67
+ "gitHead": "de12d93c6e9cea90a07137a932dccd255226d92f"
68
68
  }
package/redux/index.js CHANGED
@@ -2,7 +2,6 @@ import id from './id.js'
2
2
  import initialState from './initial-state.js'
3
3
  import selectorDefinitions from './selectors/index.js'
4
4
  import { mapValues } from '@exodus/basic-utils'
5
- // eslint-disable-next-line @exodus/restricted-imports/prefer-basic-utils
6
5
  import lodash from 'lodash'
7
6
  import helper from './multi-account-helper.js'
8
7
  import { setAccounts } from '@exodus/multi-account-redux/src/common.js'
@@ -1,8 +1,8 @@
1
- import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash'
2
2
  import { MY_STATE } from '@exodus/redux-dependency-injection'
3
3
  import { createSelector } from 'reselect'
4
4
 
5
- const { memoize } = lodash
5
+ const { memoize } = lodash // eslint-disable-line @exodus/basic-utils/prefer-basic-utils
6
6
 
7
7
  const createBalanceSelectorFactory = ({ field, id }) => {
8
8
  const selectorFactory = (selfSelector) =>
@@ -1,8 +1,8 @@
1
- import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash'
2
2
  import { createSelector } from 'reselect'
3
3
  import { isNumberUnit } from '@exodus/currency'
4
4
 
5
- const { memoize } = lodash
5
+ const { memoize } = lodash // eslint-disable-line @exodus/basic-utils/prefer-basic-utils
6
6
 
7
7
  const selectorFactory = (getFeeDataSelector, assetsSelector) =>
8
8
  memoize((assetName) =>
@@ -1,8 +1,8 @@
1
- import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash'
2
2
  import { createSelector } from 'reselect'
3
3
  import { getUnconfirmedBalance } from './get-unconfirmed-balance.js'
4
4
 
5
- const { memoize } = lodash
5
+ const { memoize } = lodash // eslint-disable-line @exodus/basic-utils/prefer-basic-utils
6
6
 
7
7
  const selectorFactory = (assetsSelector, createAssetSourceSelector) =>
8
8
  memoize(
@@ -1,7 +1,7 @@
1
- import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash'
2
2
  import defaultConfig from '../../default-config.js'
3
3
 
4
- const { memoize } = lodash
4
+ const { memoize } = lodash // eslint-disable-line @exodus/basic-utils/prefer-basic-utils
5
5
 
6
6
  const { balanceFields } = defaultConfig
7
7
 
@@ -1,7 +1,6 @@
1
- // eslint-disable-next-line @exodus/restricted-imports/prefer-basic-utils
2
1
  import lodash from 'lodash'
3
2
 
4
- const { memoize } = lodash
3
+ const { memoize } = lodash // eslint-disable-line @exodus/basic-utils/prefer-basic-utils
5
4
 
6
5
  const createResultFunction = (field) => (getBalanceForField) =>
7
6
  memoize(
@@ -1,8 +1,8 @@
1
- import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash'
2
2
  import { createSelector } from 'reselect'
3
3
  import { MY_STATE } from '@exodus/redux-dependency-injection'
4
4
 
5
- const { memoize } = lodash
5
+ const { memoize } = lodash // eslint-disable-line @exodus/basic-utils/prefer-basic-utils
6
6
 
7
7
  const selectorFactory = (selfSelector) =>
8
8
  createSelector(selfSelector, (balances) =>
@@ -1,7 +1,7 @@
1
- import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash'
2
2
  import { createSelector } from 'reselect'
3
3
 
4
- const { memoize } = lodash
4
+ const { memoize } = lodash // eslint-disable-line @exodus/basic-utils/prefer-basic-utils
5
5
 
6
6
  export const getUnconfirmedBalance = ({ asset, txs }) => {
7
7
  let result = asset.currency.ZERO