@exodus/headless 2.0.0-alpha.30 → 2.0.0-alpha.32

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,22 @@
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
+ ## [2.0.0-alpha.32](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.31...@exodus/headless@2.0.0-alpha.32) (2023-06-06)
7
+
8
+ ### Features
9
+
10
+ - add auto enable assets to headless ([#1803](https://github.com/ExodusMovement/exodus-hydra/issues/1803)) ([11996d9](https://github.com/ExodusMovement/exodus-hydra/commit/11996d9a9b23a5d2d1ec1aa30b5e41d05e66ed6a))
11
+
12
+ ## [2.0.0-alpha.31](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.30...@exodus/headless@2.0.0-alpha.31) (2023-06-05)
13
+
14
+ ### ⚠ BREAKING CHANGES
15
+
16
+ - reuse dependency preprocessor with clients (#1779)
17
+
18
+ ### Features
19
+
20
+ - reuse dependency preprocessor with clients ([#1779](https://github.com/ExodusMovement/exodus-hydra/issues/1779)) ([ac7a402](https://github.com/ExodusMovement/exodus-hydra/commit/ac7a40233a572d299ee033fd64225a3d9d6a8b98))
21
+
6
22
  ## [2.0.0-alpha.30](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.29...@exodus/headless@2.0.0-alpha.30) (2023-06-01)
7
23
 
8
24
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.30",
3
+ "version": "2.0.0-alpha.32",
4
4
  "description": "The headless Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc",
6
6
  "main": "src/index.js",
@@ -28,6 +28,7 @@
28
28
  "dependencies": {
29
29
  "@exodus/addresses-provider": "^3.0.2",
30
30
  "@exodus/atoms": "^3.5.3",
31
+ "@exodus/auto-enable-assets-plugin": "^4.0.1",
31
32
  "@exodus/available-assets": "^2.0.0",
32
33
  "@exodus/balances": "^6.0.0",
33
34
  "@exodus/basic-utils": "^2.0.0",
@@ -35,10 +36,10 @@
35
36
  "@exodus/config": "^7.0.0",
36
37
  "@exodus/connected-origins": "^1.1.2",
37
38
  "@exodus/crypto-news-monitor": "^2.0.0",
38
- "@exodus/dependency-injection": "^1.4.0",
39
- "@exodus/dependency-preprocessors": "^2.4.0",
39
+ "@exodus/dependency-injection": "^2.0.0",
40
+ "@exodus/dependency-preprocessors": "^2.6.0",
40
41
  "@exodus/enabled-assets": "^6.0.1",
41
- "@exodus/exodus-pricing-client": "^1.1.0",
42
+ "@exodus/exodus-pricing-client": "^1.2.0",
42
43
  "@exodus/feature-flags": "^2.0.1",
43
44
  "@exodus/fee-monitors": "^1.0.0",
44
45
  "@exodus/fetch": "^1.2.1",
@@ -83,5 +84,5 @@
83
84
  "nock": "^13.3.1",
84
85
  "p-defer": "^4.0.0"
85
86
  },
86
- "gitHead": "d2f34916f4466f83b89a06d52d14a7baf3178a34"
87
+ "gitHead": "06447c03ed8e81c77c76e6db74d84af228c1e803"
87
88
  }
@@ -0,0 +1,10 @@
1
+ import { createInMemoryAtom } from '@exodus/atoms'
2
+
3
+ const nonDustBalanceAssetNamesAtomDefinition = {
4
+ id: 'nonDustBalanceAssetNamesAtom',
5
+ type: 'atom',
6
+ factory: () => createInMemoryAtom({ defaultValue: [] }),
7
+ dependencies: [],
8
+ }
9
+
10
+ export default nonDustBalanceAssetNamesAtomDefinition
@@ -25,6 +25,7 @@ import {
25
25
  } from '@exodus/wallet-accounts/atoms'
26
26
 
27
27
  import baseAssetNamesToMonitorAtomDefinition from '../atoms/base-asset-names-to-monitor'
28
+ import nonDustBalanceAssetNamesAtomDefinition from '../atoms/non-dust-balance-asset-names-atom'
28
29
  import restoreAtomDefinition from '../atoms/restore'
29
30
  import { withType } from './utils'
30
31
 
@@ -48,6 +49,9 @@ const createAtomDependencies = () =>
48
49
  },
49
50
  { definition: enabledAssetsAtomDefinition },
50
51
  { definition: availableAssetNamesAtomDefinition },
52
+ {
53
+ definition: nonDustBalanceAssetNamesAtomDefinition,
54
+ },
51
55
  {
52
56
  definition: {
53
57
  id: 'pricingServerUrlAtom',
package/src/ioc.js CHANGED
@@ -4,6 +4,7 @@ import alias from '@exodus/dependency-preprocessors/src/preprocessors/alias'
4
4
  import logify from '@exodus/dependency-preprocessors/src/preprocessors/logify'
5
5
  import namespaceConfig from '@exodus/dependency-preprocessors/src/preprocessors/namespace-config'
6
6
  import namespaceStorage from '@exodus/dependency-preprocessors/src/preprocessors/namespace-storage'
7
+ import optional from '@exodus/dependency-preprocessors/src/preprocessors/optional'
7
8
  import readOnlyAtoms from '@exodus/dependency-preprocessors/src/preprocessors/read-only-atoms'
8
9
 
9
10
  import createDependencies from './dependencies'
@@ -12,8 +13,9 @@ const createIOC = ({ adapters, config }) => {
12
13
  const { createLogger } = adapters
13
14
  const { readOnlyAtoms: readOnlyAtomsConfig } = config.ioc ?? {}
14
15
 
15
- const logger = createLogger('exodus:ioc')
16
+ const ioc = createIocContainer({ logger: createLogger('exodus:ioc') })
16
17
  const dependencies = createDependencies({ adapters, config })
18
+
17
19
  const preprocessors = [
18
20
  logify({ createLogger }),
19
21
  namespaceConfig(),
@@ -25,13 +27,20 @@ const createIOC = ({ adapters, config }) => {
25
27
  warn: true,
26
28
  ...readOnlyAtomsConfig,
27
29
  }),
30
+ optional(),
28
31
  ]
29
- const definitions = preprocess({ dependencies, preprocessors })
30
- const ioc = createIocContainer({ logger })
31
32
 
32
- ioc.registerMultiple(definitions)
33
+ const registerMultiple = (dependencies) => {
34
+ ioc.registerMultiple(preprocess({ dependencies, preprocessors }))
35
+ }
36
+
37
+ const register = (dependency) => {
38
+ registerMultiple([dependency])
39
+ }
40
+
41
+ registerMultiple(dependencies)
33
42
 
34
- return ioc
43
+ return { ...ioc, register, registerMultiple }
35
44
  }
36
45
 
37
46
  export default createIOC
@@ -1,4 +1,6 @@
1
+ import autoEnableAssetsPlugin from '@exodus/auto-enable-assets-plugin'
2
+
1
3
  import logLifecyclePlugin from './log-lifecycle'
2
4
  import restorePlugin from './restore'
3
5
 
4
- export default [logLifecyclePlugin, restorePlugin]
6
+ export default [logLifecyclePlugin, restorePlugin, autoEnableAssetsPlugin]