@exodus/headless 2.0.0-alpha.86 → 2.0.0-alpha.89

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,29 @@
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.89](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.87...@exodus/headless@2.0.0-alpha.89) (2023-07-25)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ - remote-config feature (#2899)
11
+
12
+ ### Features
13
+
14
+ - remote-config feature ([#2899](https://github.com/ExodusMovement/exodus-hydra/issues/2899)) ([fcbe873](https://github.com/ExodusMovement/exodus-hydra/commit/fcbe87358e6258205ce969336ec4ab19e62f3270))
15
+ - remote-config module ([#2888](https://github.com/ExodusMovement/exodus-hydra/issues/2888)) ([8056a8b](https://github.com/ExodusMovement/exodus-hydra/commit/8056a8bc4f6ac05b107077a6668f2bc3f2a3824f))
16
+
17
+ ## [2.0.0-alpha.88](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.87...@exodus/headless@2.0.0-alpha.88) (2023-07-25)
18
+
19
+ ### Features
20
+
21
+ - remote-config module ([#2888](https://github.com/ExodusMovement/exodus-hydra/issues/2888)) ([8056a8b](https://github.com/ExodusMovement/exodus-hydra/commit/8056a8bc4f6ac05b107077a6668f2bc3f2a3824f))
22
+
23
+ ## [2.0.0-alpha.87](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.86...@exodus/headless@2.0.0-alpha.87) (2023-07-25)
24
+
25
+ ### Features
26
+
27
+ - **headless:** use locale feature ([#2880](https://github.com/ExodusMovement/exodus-hydra/issues/2880)) ([7371aa4](https://github.com/ExodusMovement/exodus-hydra/commit/7371aa41e90f4150a448fc6ce8501033e6def193))
28
+
6
29
  ## [2.0.0-alpha.86](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.85...@exodus/headless@2.0.0-alpha.86) (2023-07-25)
7
30
 
8
31
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.86",
3
+ "version": "2.0.0-alpha.89",
4
4
  "description": "The platform-agnostic Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc.",
6
6
  "main": "src/index.js",
@@ -33,20 +33,21 @@
33
33
  "@exodus/balances": "^7.0.0",
34
34
  "@exodus/basic-utils": "^2.0.0",
35
35
  "@exodus/blockchain-metadata": "^9.0.0",
36
- "@exodus/config": "^7.0.0",
37
36
  "@exodus/dependency-injection": "^2.0.1",
38
37
  "@exodus/dependency-preprocessors": "^2.8.4",
39
38
  "@exodus/enabled-assets": "^7.0.0",
40
39
  "@exodus/exodus-pricing-client": "^1.2.0",
41
- "@exodus/feature-flags": "^3.0.0",
40
+ "@exodus/feature-flags": "^4.0.0",
42
41
  "@exodus/fee-monitors": "^1.0.0",
43
42
  "@exodus/fetch": "^1.2.1",
44
43
  "@exodus/fusion": "^6.0.0",
45
44
  "@exodus/geolocation": "^2.1.1",
46
45
  "@exodus/key-identifier-provider": "^1.1.3",
47
46
  "@exodus/keychain": "^4.1.0",
47
+ "@exodus/locale": "^1.1.0",
48
48
  "@exodus/module": "^1.0.0",
49
49
  "@exodus/rates-monitor": "^3.0.0",
50
+ "@exodus/remote-config": "^2.0.0",
50
51
  "@exodus/restore-progress-tracker": "^2.0.5",
51
52
  "@exodus/wallet": "^8.1.1",
52
53
  "@exodus/wallet-accounts": "^10.1.0",
@@ -90,5 +91,5 @@
90
91
  "nock": "^13.3.1",
91
92
  "p-defer": "^4.0.0"
92
93
  },
93
- "gitHead": "559c32a53b97cd79de5e2ff912c3e356ae6d85ac"
94
+ "gitHead": "682f76b6696234b7ea8264b3f57a9aa2c2060c1e"
94
95
  }
package/src/index.js CHANGED
@@ -7,7 +7,9 @@ import enabledAssets from '@exodus/enabled-assets'
7
7
  import featureFlags from '@exodus/feature-flags'
8
8
  import geolocation from '@exodus/geolocation'
9
9
  import keychain from '@exodus/keychain'
10
+ import locale from '@exodus/locale'
10
11
  import rates from '@exodus/rates-monitor'
12
+ import remoteConfig from '@exodus/remote-config'
11
13
  import restoreProgressTracker from '@exodus/restore-progress-tracker'
12
14
  import wallet from '@exodus/wallet'
13
15
  import walletAccounts from '@exodus/wallet-accounts'
@@ -16,9 +18,7 @@ import createApi from './api'
16
18
  import attachAtoms from './atoms/attach'
17
19
  import { atomsToAttach } from './constants'
18
20
  import fees from './features/fees'
19
- import locale from './features/locale'
20
21
  import pricing from './features/pricing'
21
- import remoteConfig from './features/remote-config'
22
22
  import createIOC from './ioc'
23
23
  import attachPlugins from './plugins/attach'
24
24
 
@@ -1,14 +0,0 @@
1
- const localeApi = ({ languageAtom, currencyAtom }) => ({
2
- locale: {
3
- setLanguage: (value) => languageAtom.set(value),
4
- setCurrency: (value) => currencyAtom.set(value),
5
- },
6
- })
7
-
8
- // eslint-disable-next-line @exodus/export-default/named
9
- export default {
10
- id: 'localeApi',
11
- type: 'api',
12
- factory: localeApi,
13
- dependencies: ['languageAtom', 'currencyAtom'],
14
- }
@@ -1,50 +0,0 @@
1
- import { createStorageAtomFactory } from '@exodus/atoms'
2
- import { createFusionAtom } from '@exodus/fusion/atoms'
3
-
4
- import localeApiDefinition from './api'
5
- import localePluginDefinition from './plugin'
6
-
7
- const locale = () => {
8
- return {
9
- id: 'locale',
10
- definitions: [
11
- {
12
- definition: {
13
- id: 'currencyAtom',
14
- type: 'atom',
15
- factory: ({ fusion, config }) =>
16
- createFusionAtom({
17
- fusion,
18
- path: `private.currency`,
19
- defaultValue: config.defaultValue,
20
- }),
21
- dependencies: ['fusion', 'config'],
22
- },
23
- },
24
- {
25
- definition: {
26
- id: 'languageAtom',
27
- type: 'atom',
28
- factory: ({ storage, config }) =>
29
- createStorageAtomFactory({ storage })({
30
- key: 'language',
31
- defaultValue: config.defaultValue,
32
- isSoleWriter: true,
33
- }),
34
- dependencies: ['storage', 'config'],
35
- },
36
- aliases: [
37
- {
38
- implementationId: 'unsafeStorage',
39
- interfaceId: 'storage',
40
- },
41
- ],
42
- storage: { namespace: 'locale' },
43
- },
44
- { definition: localePluginDefinition, writesAtoms: ['languageAtom'] },
45
- { definition: localeApiDefinition, writesAtoms: ['languageAtom', 'currencyAtom'] },
46
- ],
47
- }
48
- }
49
-
50
- export default locale
@@ -1,15 +0,0 @@
1
- const localePlugin = ({ languageAtom }) => {
2
- const onClear = async () => {
3
- await languageAtom.set(undefined)
4
- }
5
-
6
- return { onClear }
7
- }
8
-
9
- // eslint-disable-next-line @exodus/export-default/named
10
- export default {
11
- id: 'localeLifecyclePlugin',
12
- type: 'plugin',
13
- factory: localePlugin,
14
- dependencies: ['languageAtom'],
15
- }
@@ -1,14 +0,0 @@
1
- const createRemoteConfigApi = ({ remoteConfig }) => ({
2
- remoteConfig: {
3
- get: remoteConfig.get,
4
- getAll: remoteConfig.getAll,
5
- },
6
- })
7
-
8
- // eslint-disable-next-line @exodus/export-default/named
9
- export default {
10
- id: 'createRemoteConfigApi',
11
- type: 'api',
12
- factory: createRemoteConfigApi,
13
- dependencies: ['remoteConfig'],
14
- }
@@ -1,28 +0,0 @@
1
- import createRemoteConfig from '@exodus/config/remote'
2
- import EventEmitter from 'events/'
3
-
4
- import remoteConfigApiDefinition from './api'
5
- import remoteConfigPluginDefinition from './plugin'
6
-
7
- const remoteConfig = () => {
8
- return {
9
- id: 'remoteConfig',
10
- definitions: [
11
- {
12
- definition: {
13
- id: 'remoteConfig',
14
- type: 'module',
15
- factory: (deps) => {
16
- const eventEmitter = new EventEmitter().setMaxListeners(Number.POSITIVE_INFINITY)
17
- return createRemoteConfig({ eventEmitter, ...deps })
18
- },
19
- dependencies: ['fetch', 'freeze', 'config', 'logger'],
20
- },
21
- },
22
- { definition: remoteConfigPluginDefinition },
23
- { definition: remoteConfigApiDefinition },
24
- ],
25
- }
26
- }
27
-
28
- export default remoteConfig
@@ -1,21 +0,0 @@
1
- const remoteConfigLifecyclePlugin = ({ remoteConfig, port }) => {
2
- remoteConfig.on('sync', ({ current }) => port.emit('remote-config', current))
3
-
4
- const onStart = () => {
5
- remoteConfig.load()
6
- }
7
-
8
- const onUnlock = () => {
9
- remoteConfig.sync()
10
- }
11
-
12
- return { onUnlock, onStart }
13
- }
14
-
15
- // eslint-disable-next-line @exodus/export-default/named
16
- export default {
17
- id: 'remoteConfigLifecyclePlugin',
18
- type: 'plugin',
19
- factory: remoteConfigLifecyclePlugin,
20
- dependencies: ['remoteConfig', 'port'],
21
- }