@exodus/available-assets 5.0.0 → 5.1.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
+ ## [5.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/available-assets@5.0.0...@exodus/available-assets@5.1.0) (2023-08-25)
7
+
8
+ ### Features
9
+
10
+ - add combined selectors to available-assets ([#3546](https://github.com/ExodusMovement/exodus-hydra/issues/3546)) ([0ed95c1](https://github.com/ExodusMovement/exodus-hydra/commit/0ed95c138add72efb920f1d4d8b4605c4a7aedc1))
11
+
6
12
  ## [5.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/available-assets@4.1.0...@exodus/available-assets@5.0.0) (2023-08-25)
7
13
 
8
14
  ### ⚠ BREAKING CHANGES
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/available-assets",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Tracks supported/available assets, i.e. assets that the user can potentially enable via the UI",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Exodus Movement Inc.",
@@ -31,14 +31,17 @@
31
31
  "dependencies": {
32
32
  "@exodus/atoms": "^5.5.0",
33
33
  "@exodus/basic-utils": "^2.0.0",
34
+ "@exodus/core-selectors": "^1.5.0",
34
35
  "@exodus/module": "^1.1.0",
35
36
  "lodash": "^4.17.21",
36
37
  "make-concurrent": "^5.3.0",
37
38
  "reselect": "^4.1.8"
38
39
  },
39
40
  "devDependencies": {
41
+ "@exodus/assets": "^8.0.95",
40
42
  "@exodus/assets-base": "^8.1.10",
41
43
  "@exodus/assets-feature": "^1.3.0",
44
+ "@exodus/combined-assets-meta": "^1.2.6-alpha-1",
42
45
  "@exodus/enabled-assets": "^6.0.2",
43
46
  "@exodus/redux-dependency-injection": "^2.0.1",
44
47
  "eslint": "^8.44.0",
@@ -46,5 +49,5 @@
46
49
  "jest-when": "^3.6.0",
47
50
  "redux": "^4.2.1"
48
51
  },
49
- "gitHead": "c675747e01ce376e8b590d72b4f6d97c5f8a6c6a"
52
+ "gitHead": "bb8d559d9cc997cd5cb46cf351f1f89efa4f76e5"
50
53
  }
@@ -0,0 +1,14 @@
1
+ import { createWithParentCombinedNetworkAssetsSelector } from '@exodus/core-selectors/assets/networks'
2
+
3
+ const selectorFactory = (allAvailableAssetsSelector) =>
4
+ createWithParentCombinedNetworkAssetsSelector({
5
+ allAssetsSelector: allAvailableAssetsSelector,
6
+ })
7
+
8
+ const allWithParentCombinedNetworkSelectorDefinition = {
9
+ id: 'allWithParentCombinedNetwork',
10
+ selectorFactory,
11
+ dependencies: [{ selector: 'all' }],
12
+ }
13
+
14
+ export default allWithParentCombinedNetworkSelectorDefinition
@@ -0,0 +1,14 @@
1
+ import { createWithoutParentCombinedNetworkAssetsSelector } from '@exodus/core-selectors/assets/networks'
2
+
3
+ const selectorFactory = (allAvailableAssetsSelector) =>
4
+ createWithoutParentCombinedNetworkAssetsSelector({
5
+ allAssetsSelector: allAvailableAssetsSelector,
6
+ })
7
+
8
+ const allWithoutParentCombinedNetworkSelectorDefinition = {
9
+ id: 'allWithoutParentCombinedNetwork',
10
+ selectorFactory,
11
+ dependencies: [{ selector: 'all' }],
12
+ }
13
+
14
+ export default allWithoutParentCombinedNetworkSelectorDefinition
@@ -0,0 +1,14 @@
1
+ import { createCreateCombinedAssetChildrenNamesSelector } from '@exodus/core-selectors/assets/networks'
2
+
3
+ const selectorFactory = (allAvailableAssetsSelector) =>
4
+ createCreateCombinedAssetChildrenNamesSelector({
5
+ allAssetsSelector: allAvailableAssetsSelector,
6
+ })
7
+
8
+ const getCombinedChildrenNamesSelectorDefinition = {
9
+ id: 'getCombinedChildrenNames',
10
+ selectorFactory,
11
+ dependencies: [{ selector: 'all' }],
12
+ }
13
+
14
+ export default getCombinedChildrenNamesSelectorDefinition
@@ -0,0 +1,14 @@
1
+ import { createGetCombinedAssetFallbackSelector } from '@exodus/core-selectors/assets/networks'
2
+
3
+ const selectorFactory = (allAvailableAssetsSelector) =>
4
+ createGetCombinedAssetFallbackSelector({
5
+ allAssetsSelector: allAvailableAssetsSelector,
6
+ })
7
+
8
+ const getCombinedFallbackSelectorDefinition = {
9
+ id: 'getCombinedFallback',
10
+ selectorFactory,
11
+ dependencies: [{ selector: 'all' }],
12
+ }
13
+
14
+ export default getCombinedFallbackSelectorDefinition
@@ -0,0 +1,14 @@
1
+ import { createGetHasAssetsOnOtherChainsSelector } from '@exodus/core-selectors/assets/networks'
2
+
3
+ const selectorFactory = (allAvailableAssetsSelector) =>
4
+ createGetHasAssetsOnOtherChainsSelector({
5
+ allAssetsSelector: allAvailableAssetsSelector,
6
+ })
7
+
8
+ const getHasAssetsOnOtherChainsSelectorDefinition = {
9
+ id: 'getHasAssetsOnOtherChains',
10
+ selectorFactory,
11
+ dependencies: [{ selector: 'all' }],
12
+ }
13
+
14
+ export default getHasAssetsOnOtherChainsSelectorDefinition
@@ -0,0 +1,15 @@
1
+ import { memoize } from 'lodash'
2
+ import { createSelector } from 'reselect'
3
+
4
+ const selectorFactory = (allAvailableAssetsSelector) =>
5
+ createSelector(allAvailableAssetsSelector, (allAvailableAssets) =>
6
+ memoize((assetName) => allAvailableAssets[assetName])
7
+ )
8
+
9
+ const getSelectorDefinition = {
10
+ id: 'get',
11
+ selectorFactory,
12
+ dependencies: [{ selector: 'all' }],
13
+ }
14
+
15
+ export default getSelectorDefinition
@@ -1,8 +1,20 @@
1
1
  import allSelectorDefinition from './all'
2
2
  import allForNetworkSelectorDefinition from './all-for-network'
3
+ import allWithParentCombinedNetworkSelectorDefinition from './all-with-parent-combined-network'
4
+ import allWithoutParentCombinedNetworkSelectorDefinition from './all-without-parent-combined-network'
5
+ import getCombinedChildrenNamesSelectorDefinition from './get-combined-children-names'
6
+ import getCombinedFallbackSelectorDefinition from './get-combined-fallback'
7
+ import getHasAssetsOnOtherChainsSelectorDefinition from './get-has-assets-on-other-chains'
8
+ import getSelectorDefinition from './get'
3
9
 
4
10
  export default [
5
11
  //
6
12
  allSelectorDefinition,
7
13
  allForNetworkSelectorDefinition,
14
+ allWithParentCombinedNetworkSelectorDefinition,
15
+ allWithoutParentCombinedNetworkSelectorDefinition,
16
+ getCombinedChildrenNamesSelectorDefinition,
17
+ getCombinedFallbackSelectorDefinition,
18
+ getHasAssetsOnOtherChainsSelectorDefinition,
19
+ getSelectorDefinition,
8
20
  ]