@exodus/balances 13.2.3 → 13.3.0

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.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.2.3...@exodus/balances@13.3.0) (2024-08-21)
7
+
8
+ ### Features
9
+
10
+ - convert balances to valid ESM ([#8590](https://github.com/ExodusMovement/exodus-hydra/issues/8590)) ([e64fc29](https://github.com/ExodusMovement/exodus-hydra/commit/e64fc290dd7b3cea7adb41fe2b41084a83980a6b))
11
+
6
12
  ## [13.2.3](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.2.2...@exodus/balances@13.2.3) (2024-07-25)
7
13
 
8
14
  ### Bug Fixes
@@ -1,5 +1,7 @@
1
1
  import { compute, createStorageAtomFactory } from '@exodus/atoms'
2
- import { flatMap, map } from 'lodash'
2
+ import lodash from 'lodash'
3
+
4
+ const { flatMap, map } = lodash
3
5
 
4
6
  // balancesAtom schema: { balances: { [walletAccount]: { [assetName]: { balance: NumberUnit } } } } }
5
7
 
package/atoms/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import createAssetNamesWithBalanceAtom from './asset-names-with-balance'
2
- import createAssetsWithBalanceCountAtom from './assets-with-balance-count'
3
- import createBalancesAtom from './balances'
4
- import createFundedWalletAccountsAtom from './funded-wallet-accounts'
5
- import createHasBalanceAtom from './has-balance'
1
+ import createAssetNamesWithBalanceAtom from './asset-names-with-balance.js'
2
+ import createAssetsWithBalanceCountAtom from './assets-with-balance-count.js'
3
+ import createBalancesAtom from './balances.js'
4
+ import createFundedWalletAccountsAtom from './funded-wallet-accounts.js'
5
+ import createHasBalanceAtom from './has-balance.js'
6
6
 
7
7
  export const balancesAtomDefinition = {
8
8
  id: 'balancesAtom',
package/index.js CHANGED
@@ -1,15 +1,18 @@
1
- import balancesDefinition from './module'
1
+ import balancesDefinition from './module/index.js'
2
2
  import {
3
3
  balancesAtomDefinition,
4
4
  hasBalanceAtomDefinition,
5
5
  fundedWalletAccountsAtomDefinition,
6
6
  assetsWithBalanceCountAtomDefinition,
7
7
  assetNamesWithBalanceAtomDefinition,
8
- } from './atoms'
9
- import balancesReportDefinition from './report'
10
- import { balancesLifecyclePluginDefinition, balancesAnalyticsPluginDefinition } from './plugins'
8
+ } from './atoms/index.js'
9
+ import balancesReportDefinition from './report/index.js'
10
+ import {
11
+ balancesLifecyclePluginDefinition,
12
+ balancesAnalyticsPluginDefinition,
13
+ } from './plugins/index.js'
11
14
  import typeforce from '@exodus/typeforce'
12
- import defaultConfig from './default-config'
15
+ import defaultConfig from './default-config.js'
13
16
 
14
17
  const balances = (walletConfig) => {
15
18
  const config = {
package/module/index.js CHANGED
@@ -1,11 +1,13 @@
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
- import { cloneDeepWith, isEmpty, merge, zipObject } from 'lodash'
4
+ import lodash from 'lodash'
5
5
  import { difference, flattenToPaths, pick, set } from '@exodus/basic-utils'
6
6
  import makeConcurrent from 'make-concurrent'
7
- import { processAssetBalances, validateBalances } from './balances-utils'
8
- import defaultConfig from '../default-config'
7
+ import { processAssetBalances, validateBalances } from './balances-utils.js'
8
+ import defaultConfig from '../default-config.js'
9
+
10
+ const { cloneDeepWith, isEmpty, merge, zipObject } = lodash
9
11
 
10
12
  const cloneBalances = (balances) =>
11
13
  cloneDeepWith(balances, (val) => {
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@exodus/balances",
3
- "version": "13.2.3",
3
+ "version": "13.3.0",
4
4
  "description": "Tracks crypto balances across enabled wallet accounts.",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "license": "UNLICENSED",
7
7
  "scripts": {
8
- "test": "run -T exodus-test --jest --esbuild",
8
+ "test": "run -T exodus-test --jest",
9
9
  "lint": "run -T eslint . --ignore-path ../../.gitignore",
10
10
  "lint:fix": "yarn lint --fix",
11
11
  "format": "run -T prettier --write \"**/*.{json,md,yaml}\" --log-level warn",
12
12
  "format:check": "run -T prettier --check \"**/*.{json,md,yaml}\" --log-level warn"
13
13
  },
14
+ "type": "module",
14
15
  "main": "index.js",
15
16
  "files": [
16
17
  "module",
@@ -33,13 +34,13 @@
33
34
  },
34
35
  "dependencies": {
35
36
  "@exodus/atoms": "^8.0.0",
36
- "@exodus/basic-utils": "^2.5.1",
37
- "@exodus/core-selectors": "^1.5.0",
38
- "@exodus/currency": "^2.1.2",
39
- "@exodus/models": "^10.1.0",
40
- "@exodus/module": "^1.1.0",
37
+ "@exodus/basic-utils": "^3.0.1",
38
+ "@exodus/core-selectors": "^3.0.0",
39
+ "@exodus/currency": "^5.0.2",
40
+ "@exodus/models": "^12.0.1",
41
+ "@exodus/module": "^1.3.0",
41
42
  "@exodus/multi-account-redux": "^2.0.1",
42
- "@exodus/redux-dependency-injection": "^3.0.0",
43
+ "@exodus/redux-dependency-injection": "^4.0.0",
43
44
  "@exodus/typeforce": "^1.18.0",
44
45
  "lodash": "^4.17.21",
45
46
  "make-concurrent": "^4.0.0",
@@ -49,19 +50,19 @@
49
50
  "@exodus/blockchain-metadata": "^9.0.1"
50
51
  },
51
52
  "devDependencies": {
52
- "@exodus/assets": "^8.0.94",
53
- "@exodus/assets-base": "^8.1.10",
54
- "@exodus/assets-feature": "^5.8.2",
55
- "@exodus/available-assets": "^8.4.0",
56
- "@exodus/bitcoin-meta": "^1.0.1",
57
- "@exodus/blockchain-metadata": "^9.0.1",
58
- "@exodus/ethereum-meta": "^1.0.30",
59
- "@exodus/fee-data-monitors": "^4.2.1",
53
+ "@exodus/assets": "^11.0.0",
54
+ "@exodus/assets-base": "^10.0.0",
55
+ "@exodus/assets-feature": "^5.11.0",
56
+ "@exodus/available-assets": "^8.4.1",
57
+ "@exodus/bitcoin-meta": "^2.0.0",
58
+ "@exodus/blockchain-metadata": "^15.4.0",
59
+ "@exodus/ethereum-meta": "^2.0.0",
60
+ "@exodus/fee-data-monitors": "^4.3.0",
60
61
  "@exodus/redux-dependency-injection": "workspace:^",
61
62
  "@exodus/storage-memory": "*",
62
- "@exodus/wallet-accounts": "^16.8.2",
63
+ "@exodus/wallet-accounts": "^16.10.0",
63
64
  "events": "^3.3.0",
64
65
  "redux": "^4.2.1"
65
66
  },
66
- "gitHead": "3995391eb48639b2d60ced5224a6a8f4902a2466"
67
+ "gitHead": "bd60146adb05b9a3fe6bd4b3e4dc4d13642a8023"
67
68
  }
package/plugins/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import createBalancesAnalyticsPlugin from './analytics'
2
- import createBalancesLifecyclePlugin from './lifecycle'
1
+ import createBalancesAnalyticsPlugin from './analytics.js'
2
+ import createBalancesLifecyclePlugin from './lifecycle.js'
3
3
 
4
4
  export const balancesLifecyclePluginDefinition = {
5
5
  id: 'balancesLifecyclePlugin',
package/redux/index.js CHANGED
@@ -1,10 +1,12 @@
1
- import id from './id'
2
- import initialState from './initial-state'
3
- import selectorDefinitions from './selectors'
1
+ import id from './id.js'
2
+ import initialState from './initial-state.js'
3
+ import selectorDefinitions from './selectors/index.js'
4
4
  import { mapValues } from '@exodus/basic-utils'
5
- import { merge } from 'lodash'
6
- import helper from './multi-account-helper'
7
- import { setAccounts } from '@exodus/multi-account-redux/src/common'
5
+ import lodash from 'lodash'
6
+ import helper from './multi-account-helper.js'
7
+ import { setAccounts } from '@exodus/multi-account-redux/src/common.js'
8
+
9
+ const { merge } = lodash
8
10
 
9
11
  const mergeChanges = (balancesState, changesByWalletAccount) => {
10
12
  return {
@@ -1,4 +1,4 @@
1
- import helper from './multi-account-helper'
1
+ import helper from './multi-account-helper.js'
2
2
 
3
3
  const initialState = {
4
4
  hasBalance: false,
@@ -1,5 +1,5 @@
1
1
  import { createReduxModuleHelper } from '@exodus/multi-account-redux'
2
- import id from './id'
2
+ import id from './id.js'
3
3
 
4
4
  const helper = createReduxModuleHelper({
5
5
  slice: id,
@@ -1,7 +1,9 @@
1
- import { memoize } from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
2
2
  import { MY_STATE } from '@exodus/redux-dependency-injection'
3
3
  import { createSelector } from 'reselect'
4
4
 
5
+ const { memoize } = lodash
6
+
5
7
  const createBalanceSelectorFactory = ({ field, id }) => {
6
8
  const selectorFactory = (selfSelector) =>
7
9
  memoize(
@@ -1,7 +1,9 @@
1
- import { memoize } from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
2
2
  import { createSelector } from 'reselect'
3
3
  import { isNumberUnit } from '@exodus/currency'
4
4
 
5
+ const { memoize } = lodash
6
+
5
7
  const selectorFactory = (getFeeDataSelector, assetsSelector) =>
6
8
  memoize((assetName) =>
7
9
  createSelector(getFeeDataSelector, assetsSelector, (getFeeData, assets) => {
@@ -1,5 +1,5 @@
1
1
  import { createSelector } from 'reselect'
2
- import { memoizeByAssetSource } from '@exodus/core-selectors/utils/memoize'
2
+ import { memoizeByAssetSource } from '@exodus/core-selectors/utils/memoize.js'
3
3
 
4
4
  /**
5
5
  * Checks if a wallet account has "relative" tokens of the supplied asset (excluding itself):
@@ -1,6 +1,8 @@
1
- import { memoize } from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
2
2
  import { createSelector } from 'reselect'
3
- import { getUnconfirmedBalance } from './get-unconfirmed-balance'
3
+ import { getUnconfirmedBalance } from './get-unconfirmed-balance.js'
4
+
5
+ const { memoize } = lodash
4
6
 
5
7
  const selectorFactory = (assetsSelector, createAssetSourceSelector) =>
6
8
  memoize(
@@ -1,5 +1,7 @@
1
- import { memoize } from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
2
- import defaultConfig from '../../default-config'
1
+ import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
2
+ import defaultConfig from '../../default-config.js'
3
+
4
+ const { memoize } = lodash
3
5
 
4
6
  const { balanceFields } = defaultConfig
5
7
 
@@ -1,4 +1,6 @@
1
- import { memoize } 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
+
3
+ const { memoize } = lodash // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
2
4
 
3
5
  const createResultFunction = (field) => (getBalanceForField) =>
4
6
  memoize(
@@ -1,7 +1,9 @@
1
- import { memoize } from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
2
2
  import { createSelector } from 'reselect'
3
3
  import { MY_STATE } from '@exodus/redux-dependency-injection'
4
4
 
5
+ const { memoize } = lodash
6
+
5
7
  const selectorFactory = (selfSelector) =>
6
8
  createSelector(selfSelector, (balances) =>
7
9
  memoize(
@@ -1,6 +1,8 @@
1
- import { memoize } from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
1
+ import lodash from 'lodash' // eslint-disable-line @exodus/restricted-imports/prefer-basic-utils -- TODO: fix next time we touch this file
2
2
  import { createSelector } from 'reselect'
3
3
 
4
+ const { memoize } = lodash
5
+
4
6
  export const getUnconfirmedBalance = ({ asset, txs }) => {
5
7
  let result = asset.currency.ZERO
6
8
 
@@ -1,10 +1,10 @@
1
- import byAssetSelectorDefinition from './by-asset'
2
- import createUnconfirmedBalanceSelectorDefinition from './create-unconfirmed-balance'
3
- import getBalanceForFieldSelectorDefinition from './get-balance-for-field'
4
- import getBalanceSelectors from './get-balance-selectors'
5
- import getBalancesSelectorDefinition from './get-balances'
6
- import createBalancesSelectors from './create-balance-selectors'
7
- import getUnconfirmedBalanceSelectorDefinition from './get-unconfirmed-balance'
1
+ import byAssetSelectorDefinition from './by-asset.js'
2
+ import createUnconfirmedBalanceSelectorDefinition from './create-unconfirmed-balance.js'
3
+ import getBalanceForFieldSelectorDefinition from './get-balance-for-field.js'
4
+ import getBalanceSelectors from './get-balance-selectors.js'
5
+ import getBalancesSelectorDefinition from './get-balances.js'
6
+ import createBalancesSelectors from './create-balance-selectors.js'
7
+ import getUnconfirmedBalanceSelectorDefinition from './get-unconfirmed-balance.js'
8
8
  import createFuelThresholdSelectorDefinition from './create-fuel-threshold.js'
9
9
  import createRequiresFuelThresholdSelectorDefinition from './create-requires-fuel-threshold.js'
10
10