@exodus/headless 2.0.0-alpha.47 → 2.0.0-alpha.48

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
+ ## [2.0.0-alpha.48](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.47...@exodus/headless@2.0.0-alpha.48) (2023-06-20)
7
+
8
+ ### Bug Fixes
9
+
10
+ - declare atoms in writesAtoms ([#2006](https://github.com/ExodusMovement/exodus-hydra/issues/2006)) ([02b7227](https://github.com/ExodusMovement/exodus-hydra/commit/02b72271116b4e3b034b7f889b0dc333fda17413))
11
+
6
12
  ## [2.0.0-alpha.47](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.46...@exodus/headless@2.0.0-alpha.47) (2023-06-18)
7
13
 
8
14
  ### Features
package/README.md CHANGED
@@ -15,6 +15,7 @@ The headless Exodus wallet SDK
15
15
 
16
16
  ```js
17
17
  import createExodus from '@exodus/headless'
18
+ import referrals from '@exodus/headless/src/modules/referrals'
18
19
  import Emitter from '@exodus/wild-emitter'
19
20
 
20
21
  // 1. Create port. Acts as an event bus between headless wallet and client
@@ -25,10 +26,10 @@ const adapters = {}
25
26
  const config = {}
26
27
 
27
28
  // 3. Create Exodus container
28
- const container = createExodus({ port, adapters, config })
29
+ const exodusContainer = createExodus({ port, adapters, config })
29
30
 
30
31
  // 4. Register external modules. Does not support overriding modules at the moment.
31
- container.register({
32
+ exodusContainer.register({
32
33
  definition: {
33
34
  id: 'remoteConfig',
34
35
  factory: createRemoteConfig,
@@ -36,14 +37,22 @@ container.register({
36
37
  },
37
38
  })
38
39
 
40
+ // see an example feature definition:
41
+ // https://github.com/ExodusMovement/exodus-hydra/blob/2e8d63426421ffcbec84a9b6fbc83eb913b47eba/modules/headless/src/modules/geolocation/index.js
42
+ exodusContainer.use(referrals())
43
+ exodusContainer.use(myCustomFeature({ id: 'myCustomFeature', ... }))
44
+
39
45
  // 5. Resolve exodus instance
40
- const exodus = container.resolve()
46
+ const exodus = exodusContainer.resolve()
41
47
 
42
48
  // 6. Start exodus instance
43
49
  await exodus.wallet.start()
44
50
 
45
51
  // 7. Use it!
46
52
  await exodus.wallet.create({ passphrase: 'my-super-secure-passphrase' })
53
+
54
+ // 8. Use your custom feature API, if any
55
+ exodus.myCustomFeature.doThatThingYouDo()
47
56
  ```
48
57
 
49
58
  ## Lifecycle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.47",
3
+ "version": "2.0.0-alpha.48",
4
4
  "description": "The headless Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc",
6
6
  "main": "src/index.js",
@@ -45,6 +45,7 @@
45
45
  "@exodus/feature-flags": "^2.1.0",
46
46
  "@exodus/fee-monitors": "^1.0.0",
47
47
  "@exodus/fetch": "^1.2.1",
48
+ "@exodus/fusion": "^5.0.0",
48
49
  "@exodus/geolocation": "^2.0.0",
49
50
  "@exodus/key-identifier-provider": "^1.1.3",
50
51
  "@exodus/keychain": "^4.0.0",
@@ -88,5 +89,5 @@
88
89
  "nock": "^13.3.1",
89
90
  "p-defer": "^4.0.0"
90
91
  },
91
- "gitHead": "003665277a4a7ee772af60ab555f5692b1f840f6"
92
+ "gitHead": "a8a419acb6f13d21b294f346e1c00f10a5b3a90b"
92
93
  }
@@ -15,7 +15,7 @@ const abTesting = () => {
15
15
  },
16
16
  {
17
17
  definition: abTestingDefinition,
18
- writesAtom: ['abTestingAtom'],
18
+ writesAtoms: ['abTestingAtom'],
19
19
  },
20
20
  { definition: abTestingPluginDefinition },
21
21
  { definition: abTestingApiDefinition },
@@ -1,4 +1,5 @@
1
- import { createFusionAtomFactory, createStorageAtomFactory } from '@exodus/atoms'
1
+ import { createStorageAtomFactory } from '@exodus/atoms'
2
+ import { fusionAtomFactory } from '@exodus/fusion/atoms'
2
3
 
3
4
  import localeApiDefinition from './api'
4
5
  import localePluginDefinition from './plugin'
@@ -12,7 +13,8 @@ const locale = () => {
12
13
  id: 'currencyAtom',
13
14
  type: 'atom',
14
15
  factory: ({ fusion, config }) =>
15
- createFusionAtomFactory({ fusion })({
16
+ fusionAtomFactory({
17
+ fusion,
16
18
  path: `private.currency`,
17
19
  defaultValue: config.defaultValue,
18
20
  }),
@@ -39,8 +41,8 @@ const locale = () => {
39
41
  ],
40
42
  storage: { namespace: 'locale' },
41
43
  },
42
- { definition: localePluginDefinition },
43
- { definition: localeApiDefinition },
44
+ { definition: localePluginDefinition, writesAtoms: ['languageAtom'] },
45
+ { definition: localeApiDefinition, writesAtoms: ['languageAtom', 'currencyAtom'] },
44
46
  ],
45
47
  }
46
48
  }
@@ -23,7 +23,7 @@ const nfts = () => {
23
23
  definition: { type: 'monitor', ...nftsMonitorDefinition },
24
24
  writesAtoms: ['nftsCacheAtom'],
25
25
  },
26
- { definition: nftsModuleDefinition },
26
+ { definition: nftsModuleDefinition, writesAtoms: ['nftsCacheAtom', 'nftsConfigAtom'] },
27
27
  { definition: nftsPluginDefinition },
28
28
  { definition: nftsApiDefinition },
29
29
  ],
@@ -18,7 +18,10 @@ const personalNotes = () => {
18
18
  },
19
19
  ],
20
20
  },
21
- { definition: { type: 'module', ...personalNotesDefinition } },
21
+ {
22
+ definition: { type: 'module', ...personalNotesDefinition },
23
+ writesAtoms: ['personalNotesAtom'],
24
+ },
22
25
  { definition: personalNotesPluginDefinition },
23
26
  { definition: personalNotesApiDefinition },
24
27
  ],
@@ -15,7 +15,7 @@ const wallet = () => {
15
15
  },
16
16
  { definition: lockedAtomDefinition },
17
17
  { definition: restoreAtomDefinition },
18
- { definition: restorePluginDefinition },
18
+ { definition: restorePluginDefinition, writesAtoms: ['restoreAtom'] },
19
19
  { definition: walletApi },
20
20
  ],
21
21
  }