@exodus/headless 2.0.0-alpha.2 → 2.0.0-alpha.21

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.
@@ -17,23 +17,25 @@ const IMPORT_FLAG = 'importFlag'
17
17
  // Set as true on import method is called, and set to false after restore is completed
18
18
  const RESTORE_FLAG = 'restoreFlag'
19
19
 
20
- const HOOKS = Object.freeze({
21
- lock: 'lock',
22
- unlock: 'unlock',
23
- clear: 'clear',
24
- import: 'import',
25
- migrate: 'migrate',
26
- start: 'start',
27
- load: 'load',
28
- unload: 'unload',
29
- create: 'create',
30
- backup: 'backup',
31
- restore: 'restore',
32
- 'restore-completed': 'restore-completed',
33
- 'assets-synced': 'assets-synced',
34
- 'change-passphrase': 'change-passphrase',
20
+ const Hook = Object.freeze({
21
+ Lock: 'lock',
22
+ Unlock: 'unlock',
23
+ Clear: 'clear',
24
+ Import: 'import',
25
+ Migrate: 'migrate',
26
+ Start: 'start',
27
+ Load: 'load',
28
+ Unload: 'unload',
29
+ Create: 'create',
30
+ Backup: 'backup',
31
+ Restore: 'restore',
32
+ RestoreCompleted: 'restore-completed',
33
+ AssetsSynced: 'assets-synced',
34
+ ChangePassphrase: 'change-passphrase',
35
35
  })
36
36
 
37
+ const HOOKS = new Set(Object.values(Hook))
38
+
37
39
  class Application extends ExodusModule {
38
40
  #hooks = {}
39
41
  #wallet = null
@@ -50,6 +52,7 @@ class Application extends ExodusModule {
50
52
  this.#storage = unsafeStorage.namespace('flags')
51
53
 
52
54
  this.#applicationStarted = new Promise((resolve) => (this.#resolveStart = resolve))
55
+ this.setMaxListeners(Number.POSITIVE_INFINITY)
53
56
  }
54
57
 
55
58
  start = async () => {
@@ -63,12 +66,17 @@ class Application extends ExodusModule {
63
66
  if (isDeleting || isImporting) {
64
67
  await this.#storage.batchDelete([DELETE_FLAG, IMPORT_FLAG])
65
68
  await this.#passphraseCache.clear()
66
- await this.fire(HOOKS.clear)
67
69
  }
68
70
 
69
- if (isImporting) await this.fire(HOOKS.import)
71
+ const walletExists = await this.#wallet.exists()
72
+
73
+ if (isImporting || !walletExists) {
74
+ await this.fire(Hook.Clear)
75
+ }
70
76
 
71
- await this.fire(HOOKS.start)
77
+ if (isImporting) await this.fire(Hook.Import)
78
+
79
+ await this.fire(Hook.Start)
72
80
  await this.#autoUnlock()
73
81
 
74
82
  const locked = await this.#wallet.isLocked()
@@ -88,7 +96,7 @@ class Application extends ExodusModule {
88
96
  this.isRestoring(),
89
97
  ])
90
98
 
91
- await this.fire(HOOKS.load, {
99
+ await this.fire(Hook.Load, {
92
100
  walletExists,
93
101
  hasPassphraseSet,
94
102
  isLocked,
@@ -99,11 +107,11 @@ class Application extends ExodusModule {
99
107
  unload = async () => {
100
108
  await this.#applicationStarted
101
109
  await this.#passphraseCache.scheduleClear()
102
- await this.fire(HOOKS.unload)
110
+ await this.fire(Hook.Unload)
103
111
  }
104
112
 
105
113
  hook = (hookName, listener) => {
106
- assert(HOOKS[hookName], `no such hook: ${hookName}`)
114
+ assert(HOOKS.has(hookName), `no such hook: ${hookName}`)
107
115
 
108
116
  if (!this.#hooks[hookName]) {
109
117
  this.#hooks[hookName] = []
@@ -113,7 +121,7 @@ class Application extends ExodusModule {
113
121
  }
114
122
 
115
123
  fire = async (hookName, params) => {
116
- assert(HOOKS[hookName], `no such hook: ${hookName}`)
124
+ assert(HOOKS.has(hookName), `no such hook: ${hookName}`)
117
125
  this._logger.debug('firing hooks', hookName)
118
126
 
119
127
  const hooks = this.#hooks[hookName] || []
@@ -131,7 +139,7 @@ class Application extends ExodusModule {
131
139
  await this.#applicationStarted
132
140
  await this.#wallet.create(opts)
133
141
 
134
- await this.fire(HOOKS.create, { hasPassphraseSet: !!opts?.passphrase })
142
+ await this.fire(Hook.Create, { hasPassphraseSet: !!opts?.passphrase })
135
143
  }
136
144
 
137
145
  import = async (opts) => {
@@ -141,26 +149,28 @@ class Application extends ExodusModule {
141
149
 
142
150
  await this.#applicationStarted
143
151
 
144
- if (await this.#wallet.exists()) {
145
- await this.#wallet.import(opts)
152
+ const walletExists = await this.#wallet.exists()
153
+
154
+ const { forceRestart, ...wallet } = opts
155
+
156
+ await this.#wallet.import(wallet)
157
+
158
+ if (forceRestart || walletExists) {
146
159
  await this.#storage.set(IMPORT_FLAG, true)
147
160
 
148
161
  this.emit('restart', { reason: 'import' })
162
+ } else {
163
+ await this.fire(Hook.Import)
149
164
 
150
- return
165
+ this._logger.log('wallet imported')
151
166
  }
152
-
153
- await this.#wallet.import(opts)
154
- await this.fire(HOOKS.import)
155
-
156
- this._logger.log('wallet imported')
157
167
  }
158
168
 
159
169
  getMnemonic = async (opts) => this.#wallet.getMnemonic(opts)
160
170
 
161
171
  setBackedUp = async () => {
162
172
  await this.#wallet.setBackedUp()
163
- await this.fire(HOOKS.backup)
173
+ await this.fire(Hook.Backup)
164
174
  }
165
175
 
166
176
  lock = async (opts) => {
@@ -169,7 +179,7 @@ class Application extends ExodusModule {
169
179
  await this.#applicationStarted
170
180
  await this.#wallet.lock(opts)
171
181
  await this.#passphraseCache.clear()
172
- await this.fire(HOOKS.lock)
182
+ await this.fire(Hook.Lock)
173
183
 
174
184
  this._logger.log('locked')
175
185
  }
@@ -178,13 +188,13 @@ class Application extends ExodusModule {
178
188
  const isRestoring = await this.isRestoring()
179
189
 
180
190
  if (isRestoring) {
181
- await this.fire(HOOKS.restore)
191
+ await this.fire(Hook.Restore)
182
192
  await this.#storage.delete(RESTORE_FLAG)
183
193
  await this.setBackedUp()
184
- await this.fire(HOOKS['restore-completed'])
194
+ await this.fire(Hook.RestoreCompleted)
185
195
  }
186
196
 
187
- this.fire(HOOKS['assets-synced'])
197
+ this.fire(Hook.AssetsSynced)
188
198
  }
189
199
 
190
200
  #autoUnlock = async () => {
@@ -197,7 +207,7 @@ class Application extends ExodusModule {
197
207
  this._logger.log('unlocking with cache')
198
208
 
199
209
  await this.#wallet.unlock({ passphrase })
200
- await this.fire(HOOKS.unlock)
210
+ await this.fire(Hook.Unlock)
201
211
 
202
212
  this.#restoreIfNeeded()
203
213
 
@@ -213,8 +223,8 @@ class Application extends ExodusModule {
213
223
  await this.#applicationStarted
214
224
  await this.#wallet.unlock({ passphrase })
215
225
 
216
- await this.fire(HOOKS.migrate)
217
- await this.fire(HOOKS.unlock)
226
+ await this.fire(Hook.Migrate)
227
+ await this.fire(Hook.Unlock)
218
228
 
219
229
  this.#restoreIfNeeded()
220
230
 
@@ -229,7 +239,7 @@ class Application extends ExodusModule {
229
239
  await this.#applicationStarted
230
240
  await this.#wallet.changePassphrase({ currentPassphrase, newPassphrase })
231
241
  await this.#passphraseCache.set(newPassphrase)
232
- await this.fire(HOOKS['change-passphrase'])
242
+ await this.fire(Hook.ChangePassphrase)
233
243
 
234
244
  this._logger.log('passphrase changed')
235
245
  }
@@ -0,0 +1,40 @@
1
+ const emitAtomValue = async (opts) => {
2
+ const { port, atomId, atom } = opts
3
+ const value = 'value' in opts ? opts.value : await atom.get()
4
+ port.emit(atomId, value)
5
+ }
6
+
7
+ export const emitFromAtoms = ({ atoms, port }) =>
8
+ Object.entries(atoms).forEach(async ([atomId, atom]) => emitAtomValue({ port, atomId, atom }))
9
+
10
+ const attachAtom = ({ port, application, logger, atom, atomId, lifecycleEvents }) => {
11
+ let loaded = false
12
+
13
+ lifecycleEvents.forEach((event) =>
14
+ application.on(event, async () => {
15
+ loaded = true
16
+ await emitAtomValue({ port, atomId, atom })
17
+ })
18
+ )
19
+
20
+ application.on('clear', async () => {
21
+ try {
22
+ await atom?.set(undefined)
23
+ } catch (error) {
24
+ logger.debug('failed to clear atom', error)
25
+ // noop. atom might not support set
26
+ }
27
+ })
28
+
29
+ atom.observe((value) => {
30
+ if (loaded) emitAtomValue({ port, atomId, atom, value })
31
+ })
32
+ }
33
+
34
+ const attachAtoms = ({ port, application, logger, atoms, lifecycleEvents = ['start'] }) => {
35
+ for (const [atomId, atom] of Object.entries(atoms)) {
36
+ attachAtom({ port, application, logger, atom, atomId, lifecycleEvents })
37
+ }
38
+ }
39
+
40
+ export default attachAtoms
@@ -0,0 +1,12 @@
1
+ export const atomsToAttach = [
2
+ 'availableAssetNamesAtom',
3
+ 'balancesAtom',
4
+ 'currencyAtom',
5
+ 'enabledWalletAccountsAtom',
6
+ 'featureFlagsAtom',
7
+ 'geolocationAtom',
8
+ 'kycAtom',
9
+ 'languageAtom',
10
+ 'referralsAtom',
11
+ 'walletAccountsAtom',
12
+ ]
@@ -0,0 +1,25 @@
1
+ import {
2
+ featureFlagAtomsDefinition,
3
+ remoteConfigFeatureFlagAtomsDefinition,
4
+ } from '@exodus/feature-flags/atoms'
5
+
6
+ import { withType } from './utils'
7
+
8
+ const createAtomCollectionDependencies = () =>
9
+ [
10
+ {
11
+ definition: remoteConfigFeatureFlagAtomsDefinition,
12
+ },
13
+ {
14
+ definition: featureFlagAtomsDefinition,
15
+ storage: { namespace: 'featureFlags' },
16
+ aliases: [
17
+ {
18
+ implementationId: 'unsafeStorage',
19
+ interfaceId: 'storage',
20
+ },
21
+ ],
22
+ },
23
+ ].map(withType('atom-collection'))
24
+
25
+ export default createAtomCollectionDependencies
@@ -1,5 +1,26 @@
1
- import { createInMemoryAtom } from '@exodus/atoms'
1
+ import {
2
+ createInMemoryAtom,
3
+ createRemoteConfigAtomFactory,
4
+ createStorageAtomFactory,
5
+ createFusionAtomFactory,
6
+ } from '@exodus/atoms'
7
+ import {
8
+ walletAccountsAtomDefinition,
9
+ enabledWalletAccountsAtomDefinition,
10
+ } from '@exodus/wallet-accounts/atoms'
11
+ import {
12
+ enabledAndDisabledAssetsAtomDefinition,
13
+ enabledAssetsAtomDefinition,
14
+ } from '@exodus/enabled-assets/atoms'
15
+ import { availableAssetNamesAtomDefinition } from '@exodus/available-assets/atoms'
16
+ import { ratesAtomDefinition } from '@exodus/rates-monitor/atoms'
17
+ import { balancesAtomDefinition } from '@exodus/balances/atoms'
18
+ import { featureFlagsAtomDefinition } from '@exodus/feature-flags/atoms'
19
+ import { kycAtomDefinition } from '@exodus/kyc/atoms'
20
+ import { referralsAtomDefinition } from '@exodus/referrals/atoms'
21
+
2
22
  import { withType } from './utils'
23
+ import { geolocationAtomDefinition } from '@exodus/geolocation/atoms'
3
24
 
4
25
  const createAtomDependencies = () =>
5
26
  [
@@ -10,6 +31,109 @@ const createAtomDependencies = () =>
10
31
  dependencies: [],
11
32
  },
12
33
  },
34
+ {
35
+ definition: walletAccountsAtomDefinition,
36
+ storage: { namespace: 'walletAccounts' },
37
+ },
38
+ { definition: enabledWalletAccountsAtomDefinition },
39
+ {
40
+ definition: enabledAndDisabledAssetsAtomDefinition,
41
+ storage: { namespace: 'enabledAssets' },
42
+ },
43
+ { definition: enabledAssetsAtomDefinition },
44
+ { definition: availableAssetNamesAtomDefinition },
45
+ {
46
+ definition: {
47
+ id: 'pricingServerUrlAtom',
48
+ factory: ({ config, remoteConfig }) =>
49
+ createRemoteConfigAtomFactory({ remoteConfig })({
50
+ path: config.pricingServerPath,
51
+ defaultValue: config.defaultPricingServerUrl,
52
+ }),
53
+ dependencies: ['config', 'remoteConfig'],
54
+ },
55
+ },
56
+ {
57
+ definition: {
58
+ id: 'languageAtom',
59
+ factory: ({ storage, config }) =>
60
+ createStorageAtomFactory({ storage })({
61
+ key: 'language',
62
+ defaultValue: config.defaultValue,
63
+ isSoleWriter: true,
64
+ }),
65
+ dependencies: ['storage', 'config'],
66
+ },
67
+ aliases: [
68
+ {
69
+ implementationId: 'unsafeStorage',
70
+ interfaceId: 'storage',
71
+ },
72
+ ],
73
+ storage: { namespace: 'locale' },
74
+ },
75
+ {
76
+ definition: {
77
+ id: 'currencyAtom',
78
+ factory: ({ fusion, config }) =>
79
+ createFusionAtomFactory({ fusion })({
80
+ path: `private.currency`,
81
+ defaultValue: config.defaultValue,
82
+ }),
83
+ dependencies: ['fusion', 'config'],
84
+ },
85
+ },
86
+ // TODO: move to @exodus/market-history
87
+ {
88
+ definition: {
89
+ id: 'marketHistoryClearCacheAtom',
90
+ factory: ({ config }) => createInMemoryAtom(config),
91
+ dependencies: ['config'],
92
+ },
93
+ },
94
+ // TODO: move to @exodus/market-history
95
+ {
96
+ definition: {
97
+ id: 'remoteConfigClearMarketHistoryCacheAtom',
98
+ factory: ({ config, remoteConfig }) =>
99
+ createRemoteConfigAtomFactory({ remoteConfig })(config),
100
+ dependencies: ['config', 'remoteConfig'],
101
+ },
102
+ },
103
+ // TODO: move to @exodus/market-history
104
+ {
105
+ definition: {
106
+ id: 'marketHistoryRefreshIntervalAtom',
107
+ factory: ({ config, remoteConfig }) =>
108
+ createRemoteConfigAtomFactory({ remoteConfig })(config),
109
+ dependencies: ['config', 'remoteConfig'],
110
+ },
111
+ },
112
+ {
113
+ definition: {
114
+ id: 'mockConfigAtom',
115
+ factory: ({ storage }) =>
116
+ createStorageAtomFactory({ storage })({
117
+ key: 'mockConfig',
118
+ defaultValue: {},
119
+ isSoleWriter: true,
120
+ }),
121
+ dependencies: ['storage'],
122
+ },
123
+ storage: { namespace: 'mockConfig' },
124
+ aliases: [
125
+ {
126
+ implementationId: 'unsafeStorage',
127
+ interfaceId: 'storage',
128
+ },
129
+ ],
130
+ },
131
+ { definition: balancesAtomDefinition },
132
+ { definition: ratesAtomDefinition },
133
+ { definition: geolocationAtomDefinition },
134
+ { definition: featureFlagsAtomDefinition },
135
+ { definition: kycAtomDefinition },
136
+ { definition: referralsAtomDefinition },
13
137
  ].map(withType('atom'))
14
138
 
15
139
  export default createAtomDependencies
@@ -6,8 +6,11 @@ import assert from 'minimalistic-assert'
6
6
  import createConfigDependencies from './configs'
7
7
  import createAdapterDependencies from './adapters'
8
8
  import createAtomDependencies from './atoms'
9
+ import createAtomCollectionDependencies from './atom-collections'
9
10
  import createModuleDependencies from './modules'
11
+ import createMonitorDependencies from './monitors'
10
12
  import { wrapConstant } from './utils'
13
+ import createPluginDependencies from './plugins'
11
14
 
12
15
  const adapterKeys = [
13
16
  // ...
@@ -16,6 +19,9 @@ const adapterKeys = [
16
19
  'legacyPrivToPub',
17
20
  'seedStorage',
18
21
  'unsafeStorage',
22
+ 'fusion',
23
+ 'fetch',
24
+ 'freeze',
19
25
  ]
20
26
 
21
27
  const createDependencies = ({ adapters, config }) => {
@@ -29,15 +35,24 @@ const createDependencies = ({ adapters, config }) => {
29
35
 
30
36
  const modules = createModuleDependencies({ adapters, config })
31
37
 
38
+ const monitors = createMonitorDependencies({ adapters, config })
39
+
32
40
  const atoms = createAtomDependencies({ adapters, config })
33
41
 
42
+ const atomCollections = createAtomCollectionDependencies({ adapters, config })
43
+
34
44
  const adaptersTree = createAdapterDependencies({ adapters, config })
35
45
 
46
+ const plugins = createPluginDependencies()
47
+
36
48
  return []
37
49
  .concat(adaptersTree)
38
50
  .concat(configs)
39
51
  .concat(modules)
52
+ .concat(monitors)
40
53
  .concat(atoms)
54
+ .concat(atomCollections)
55
+ .concat(plugins)
41
56
  .concat(wrapConstant({ id: 'logger', type: 'module', value: logger }))
42
57
  }
43
58
 
@@ -1,12 +1,27 @@
1
- import { createKeychain } from '@exodus/keychain'
1
+ import EventEmitter from 'events/'
2
+ import createRemoteConfig from '@exodus/config/remote'
3
+ import keychainDefinition from '@exodus/keychain/module'
2
4
  import walletDefinition from '@exodus/wallet/module'
5
+ import walletAccountsDefinition from '@exodus/wallet-accounts/module'
6
+ import blockchainMetadataDefinition from '@exodus/blockchain-metadata/module'
7
+ import enabledAssetsModuleDefinition from '@exodus/enabled-assets/module'
8
+ import availableAssetsModuleDefinition from '@exodus/available-assets/module'
3
9
  import createKeyIdentifierProvider from '@exodus/key-identifier-provider'
4
10
  import walletCompatibilityModesDefinition from '@exodus/wallet-compatibility-modes/module'
11
+ import balancesDefinition from '@exodus/balances/module'
12
+ import featureFlagsDefinition from '@exodus/feature-flags/module'
13
+ import createAddressesProvider from '@exodus/addresses-provider'
14
+ import createMockableAddressesProvider from '@exodus/addresses-provider/mock'
15
+ import createInMemoryAddressCache from '@exodus/addresses-provider/address-cache-memory'
16
+ import createExodusPricingClient from '@exodus/exodus-pricing-client'
17
+ import kycDefinition from '@exodus/kyc/module'
18
+ import referralsDefinition from '@exodus/referrals/module'
5
19
 
6
20
  import createApplication from '../application'
7
21
  import { withType } from './utils'
22
+ import unlockEncryptedStorageDefinition from '../unlock-encrypted-storage'
8
23
 
9
- const createModuleDependencies = () =>
24
+ const createModuleDependencies = ({ config }) =>
10
25
  [
11
26
  {
12
27
  definition: {
@@ -23,18 +38,94 @@ const createModuleDependencies = () =>
23
38
  },
24
39
  },
25
40
  {
26
- definition: {
27
- id: 'keychain',
28
- factory: createKeychain,
29
- dependencies: ['legacyPrivToPub'],
30
- },
41
+ definition: keychainDefinition,
31
42
  },
32
43
  {
33
44
  definition: walletDefinition,
45
+ writesAtoms: ['lockedAtom'],
34
46
  },
35
47
  {
36
48
  definition: walletCompatibilityModesDefinition,
37
49
  },
50
+ { definition: unlockEncryptedStorageDefinition },
51
+ { definition: walletAccountsDefinition, writesAtoms: ['walletAccountsAtom'] },
52
+ {
53
+ definition: blockchainMetadataDefinition,
54
+ storage: { namespace: ['blockchain', 'v1'] },
55
+ },
56
+ { definition: enabledAssetsModuleDefinition, writesAtoms: ['enabledAndDisabledAssetsAtom'] },
57
+ {
58
+ definition: {
59
+ id: 'remoteConfig',
60
+ factory: (deps) => {
61
+ const eventEmitter = new EventEmitter().setMaxListeners(Number.POSITIVE_INFINITY)
62
+ return createRemoteConfig({ eventEmitter, ...deps })
63
+ },
64
+ dependencies: ['fetch', 'freeze', 'config', 'logger'],
65
+ },
66
+ },
67
+ { definition: availableAssetsModuleDefinition, writesAtoms: ['availableAssetNamesAtom'] },
68
+ {
69
+ definition: {
70
+ id: 'pricingClient',
71
+ factory: createExodusPricingClient,
72
+ dependencies: ['fetch', 'pricingServerUrlAtom'],
73
+ },
74
+ },
75
+ { definition: balancesDefinition, writesAtoms: ['balancesAtom'] },
76
+ {
77
+ definition: featureFlagsDefinition,
78
+ writesAtoms: ['featureFlagAtoms'],
79
+ },
80
+ {
81
+ definition: {
82
+ id: 'addressCache',
83
+ factory: createInMemoryAddressCache,
84
+ },
85
+ },
86
+ config.addressesProvider?.mockAddresses
87
+ ? {
88
+ definition: {
89
+ id: 'addressesProvider',
90
+ factory: createMockableAddressesProvider,
91
+ dependencies: [
92
+ 'assetsModule',
93
+ 'keychain',
94
+ 'keyIdentifierProvider',
95
+ 'blockchainMetadata',
96
+ 'addressCache',
97
+ 'mockConfigAtom',
98
+ ],
99
+ },
100
+ }
101
+ : {
102
+ definition: {
103
+ id: 'addressesProvider',
104
+ factory: createAddressesProvider,
105
+ dependencies: [
106
+ 'assetsModule',
107
+ 'keychain',
108
+ 'keyIdentifierProvider',
109
+ 'blockchainMetadata',
110
+ 'addressCache',
111
+ ],
112
+ },
113
+ },
114
+ {
115
+ definition: kycDefinition,
116
+ writesAtoms: ['kycAtom'],
117
+ },
118
+ {
119
+ definition: referralsDefinition,
120
+ storage: { namespace: 'referrals' },
121
+ writesAtoms: ['referralsAtom'],
122
+ aliases: [
123
+ {
124
+ implementationId: 'unsafeStorage',
125
+ interfaceId: 'storage',
126
+ },
127
+ ],
128
+ },
38
129
  ].map(withType('module'))
39
130
 
40
131
  export default createModuleDependencies
@@ -0,0 +1,35 @@
1
+ import marketHistoryMonitorDefinition from '@exodus/market-history/module'
2
+ import ratesMonitorDefinition from '@exodus/rates-monitor/module'
3
+
4
+ import { withType } from './utils'
5
+ import geolocationMonitorDefinition from '@exodus/geolocation/monitor'
6
+
7
+ const createMonitorDependencies = () =>
8
+ [
9
+ { definition: geolocationMonitorDefinition },
10
+ {
11
+ definition: marketHistoryMonitorDefinition,
12
+ storage: { namespace: 'marketHistory' },
13
+ aliases: [
14
+ {
15
+ implementationId: 'unsafeStorage',
16
+ interfaceId: 'storage',
17
+ },
18
+ {
19
+ implementationId: 'marketHistoryClearCacheAtom',
20
+ interfaceId: 'clearCacheAtom',
21
+ },
22
+ {
23
+ implementationId: 'remoteConfigClearMarketHistoryCacheAtom',
24
+ interfaceId: 'remoteConfigClearCacheAtom',
25
+ },
26
+ {
27
+ implementationId: 'marketHistoryRefreshIntervalAtom',
28
+ interfaceId: 'remoteConfigRefreshIntervalAtom',
29
+ },
30
+ ],
31
+ },
32
+ { definition: ratesMonitorDefinition, writesAtoms: ['ratesAtom'] },
33
+ ].map(withType('monitor'))
34
+
35
+ export default createMonitorDependencies
@@ -0,0 +1,7 @@
1
+ import plugins from '../plugins'
2
+ import { withType } from './utils'
3
+
4
+ const createPluginDependencies = () =>
5
+ plugins.map((definition) => ({ definition })).map(withType('plugin'))
6
+
7
+ export default createPluginDependencies