@exodus/headless 2.0.0-alpha.80 → 2.0.0-alpha.81

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.80",
3
+ "version": "2.0.0-alpha.81",
4
4
  "description": "The platform-agnostic Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc.",
6
6
  "main": "src/index.js",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@exodus/address-provider": "^6.0.0",
30
- "@exodus/atoms": "^5.2.2",
30
+ "@exodus/atoms": "^5.2.3",
31
31
  "@exodus/auto-enable-assets-plugin": "^4.0.1",
32
32
  "@exodus/available-assets": "^2.0.2",
33
33
  "@exodus/balances": "^7.0.0",
@@ -35,7 +35,7 @@
35
35
  "@exodus/blockchain-metadata": "^9.0.0",
36
36
  "@exodus/config": "^7.0.0",
37
37
  "@exodus/dependency-injection": "^2.0.1",
38
- "@exodus/dependency-preprocessors": "^2.8.2",
38
+ "@exodus/dependency-preprocessors": "^2.8.4",
39
39
  "@exodus/enabled-assets": "^6.0.2",
40
40
  "@exodus/exodus-pricing-client": "^1.2.0",
41
41
  "@exodus/feature-flags": "^3.0.0",
@@ -90,5 +90,5 @@
90
90
  "nock": "^13.3.1",
91
91
  "p-defer": "^4.0.0"
92
92
  },
93
- "gitHead": "b4a1dded47c5fd28312d954d77a1ef9fb6177dbd"
93
+ "gitHead": "6d6d294bc19df3f2b7e67096547012f9eb3cabd7"
94
94
  }
@@ -7,24 +7,22 @@ const emitAtomValue = async (opts) => {
7
7
  export const emitFromAtoms = ({ atoms, port }) =>
8
8
  Object.entries(atoms).forEach(async ([atomId, atom]) => emitAtomValue({ port, atomId, atom }))
9
9
 
10
- const attachAtom = ({ port, application, logger, atom, atomId, lifecycleEvents }) => {
10
+ const attachAtom = ({ port, application, atom, atomId }) => {
11
11
  let loaded = false
12
12
 
13
- lifecycleEvents.forEach((event) =>
14
- application.on(event, async () => {
15
- loaded = true
16
- await emitAtomValue({ port, atomId, atom })
17
- })
18
- )
13
+ application.on('load', async () => {
14
+ loaded = true
15
+ await emitAtomValue({ port, atomId, atom })
16
+ })
19
17
 
20
18
  atom.observe((value) => {
21
19
  if (loaded) emitAtomValue({ port, atomId, atom, value })
22
20
  })
23
21
  }
24
22
 
25
- const attachAtoms = ({ port, application, logger, atoms, lifecycleEvents = ['start'] }) => {
23
+ const attachAtoms = ({ port, application, atoms }) => {
26
24
  for (const [atomId, atom] of Object.entries(atoms)) {
27
- attachAtom({ port, application, logger, atom, atomId, lifecycleEvents })
25
+ attachAtom({ port, application, atom, atomId })
28
26
  }
29
27
  }
30
28
 
package/src/index.js CHANGED
@@ -25,7 +25,6 @@ import attachPlugins from './plugins/attach'
25
25
 
26
26
  const createExodus = ({ adapters, config, port }) => {
27
27
  const ioc = createIOC({ adapters, config })
28
- const { headless: headlessConfig } = config
29
28
 
30
29
  ioc.use(wallet())
31
30
  ioc.use(keychain(config.keychain))
@@ -103,9 +102,7 @@ const createExodus = ({ adapters, config, port }) => {
103
102
  attachAtoms({
104
103
  port,
105
104
  application,
106
- logger: ioc.get('createLogger')('attachAtoms'),
107
105
  atoms: pick(ioc.getByType('atom'), atomsToAttach),
108
- lifecycleEvents: headlessConfig?.attachAtomsLifecycleEvents,
109
106
  })
110
107
 
111
108
  attachPlugins({