@exodus/balances 13.5.4 → 13.6.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.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.5.4...@exodus/balances@13.6.0) (2025-01-21)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- feat: createBalances selector (#11171)
|
|
11
|
+
|
|
6
12
|
## [13.5.4](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.5.3...@exodus/balances@13.5.4) (2025-01-17)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/balances",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.6.0",
|
|
4
4
|
"description": "Tracks crypto balances across enabled wallet accounts.",
|
|
5
5
|
"author": "Exodus Movement, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "ddeec2f9272f5959099ae94596ef2c5cf3f15558"
|
|
69
69
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import lodash from 'lodash'
|
|
2
|
+
import { createSelector } from 'reselect'
|
|
3
|
+
import { MY_STATE } from '@exodus/redux-dependency-injection'
|
|
4
|
+
|
|
5
|
+
const { memoize } = lodash // eslint-disable-line @exodus/basic-utils/prefer-basic-utils
|
|
6
|
+
|
|
7
|
+
const selectorFactory = (selfSelector) =>
|
|
8
|
+
memoize(
|
|
9
|
+
({ assetName, walletAccount }) =>
|
|
10
|
+
createSelector(selfSelector, (balances) => balances[walletAccount]?.data[assetName]),
|
|
11
|
+
({ assetName, walletAccount }) => [assetName, walletAccount].join('-')
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
const createBalancesSelectorDefinition = {
|
|
15
|
+
id: 'createBalances',
|
|
16
|
+
selectorFactory,
|
|
17
|
+
dependencies: [{ selector: MY_STATE }],
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default createBalancesSelectorDefinition
|
package/redux/selectors/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import byAssetSelectorDefinition from './by-asset.js'
|
|
|
2
2
|
import createUnconfirmedBalanceSelectorDefinition from './create-unconfirmed-balance.js'
|
|
3
3
|
import getBalanceForFieldSelectorDefinition from './get-balance-for-field.js'
|
|
4
4
|
import getBalanceSelectors from './get-balance-selectors.js'
|
|
5
|
+
import createBalancesSelectorDefinition from './create-balances.js'
|
|
5
6
|
import getBalancesSelectorDefinition from './get-balances.js'
|
|
6
7
|
import createBalancesSelectors from './create-balance-selectors.js'
|
|
7
8
|
import getUnconfirmedBalanceSelectorDefinition from './get-unconfirmed-balance.js'
|
|
@@ -14,6 +15,7 @@ export default [
|
|
|
14
15
|
getBalanceForFieldSelectorDefinition,
|
|
15
16
|
...getBalanceSelectors,
|
|
16
17
|
...createBalancesSelectors,
|
|
18
|
+
createBalancesSelectorDefinition,
|
|
17
19
|
getBalancesSelectorDefinition,
|
|
18
20
|
getUnconfirmedBalanceSelectorDefinition,
|
|
19
21
|
createFuelThresholdSelectorDefinition,
|