@exodus/headless 2.0.0-alpha.147 → 2.0.0-alpha.148

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,14 @@
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.148](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.147...@exodus/headless@2.0.0-alpha.148) (2023-12-12)
7
+
8
+ ### Features
9
+
10
+ - add startup-counter feature ([#4870](https://github.com/ExodusMovement/exodus-hydra/issues/4870)) ([e2a1c18](https://github.com/ExodusMovement/exodus-hydra/commit/e2a1c18922de3cddf69fb7840712fc2bfdac687a))
11
+ - allow force restore ([#4953](https://github.com/ExodusMovement/exodus-hydra/issues/4953)) ([10d5e06](https://github.com/ExodusMovement/exodus-hydra/commit/10d5e06b00830fcdfe3c66698bbd729fbd8b3efe))
12
+ - assign feature id as namespace ([#4962](https://github.com/ExodusMovement/exodus-hydra/issues/4962)) ([8af7ce4](https://github.com/ExodusMovement/exodus-hydra/commit/8af7ce4dbcc058d01966be85dc1aa53a4a65a488))
13
+
6
14
  ## [2.0.0-alpha.147](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.146...@exodus/headless@2.0.0-alpha.147) (2023-12-04)
7
15
 
8
16
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.147",
3
+ "version": "2.0.0-alpha.148",
4
4
  "description": "The platform-agnostic Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc.",
6
6
  "main": "src/index.js",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@exodus/address-provider": "^9.0.1",
30
30
  "@exodus/assets-feature": "^4.0.0",
31
- "@exodus/atoms": "^6.0.2",
31
+ "@exodus/atoms": "^7.0.0",
32
32
  "@exodus/auto-enable-assets-plugin": "^4.4.0",
33
33
  "@exodus/available-assets": "^8.0.0",
34
34
  "@exodus/balances": "^12.0.0",
@@ -52,9 +52,10 @@
52
52
  "@exodus/remote-config": "^2.3.0",
53
53
  "@exodus/restore-progress-tracker": "^3.0.0",
54
54
  "@exodus/sodium-crypto": "^3.2.0",
55
+ "@exodus/startup-counter": "^1.0.0",
55
56
  "@exodus/tx-signer": "^1.1.0",
56
57
  "@exodus/wallet": "^10.3.0",
57
- "@exodus/wallet-accounts": "^14.4.0",
58
+ "@exodus/wallet-accounts": "^15.0.0",
58
59
  "@exodus/wallet-compatibility-modes": "^3.2.0",
59
60
  "bip39": "^2.6.0",
60
61
  "events": "^3.3.0",
@@ -77,7 +78,7 @@
77
78
  "@exodus/key-utils": "^3.0.0",
78
79
  "@exodus/kyc": "^4.2.0",
79
80
  "@exodus/litecoin-meta": "^1.0.0",
80
- "@exodus/market-history": "^7.1.0",
81
+ "@exodus/market-history": "^7.2.0",
81
82
  "@exodus/models": "^10.1.0",
82
83
  "@exodus/nfts": "^7.1.2",
83
84
  "@exodus/personal-notes": "^3.6.0",
@@ -99,5 +100,5 @@
99
100
  "msw": "^2.0.0",
100
101
  "p-defer": "^4.0.0"
101
102
  },
102
- "gitHead": "51959d37d308750ca8dab99eb11e9d8279658619"
103
+ "gitHead": "678623e0bd6eddc9d7615648878938a807cf3a33"
103
104
  }
@@ -184,6 +184,7 @@ class Application extends ExodusModule {
184
184
  const { forceRestart, forgotPassphrase, ...wallet } = opts
185
185
 
186
186
  await this.#wallet.import(wallet)
187
+ await this.fire(Hook.Backup)
187
188
 
188
189
  if (forceRestart || walletExists) {
189
190
  await this.#storage.set(IMPORT_FLAG, true)
@@ -220,13 +221,17 @@ class Application extends ExodusModule {
220
221
  if (isRestoring) {
221
222
  await this.fire(Hook.Restore)
222
223
  await this.#storage.delete(RESTORE_FLAG)
223
- await this.setBackedUp()
224
224
  await this.fire(Hook.RestoreCompleted)
225
225
  }
226
226
 
227
227
  this.fire(Hook.AssetsSynced)
228
228
  }
229
229
 
230
+ restore = async () => {
231
+ await this.#storage.set(RESTORE_FLAG, true)
232
+ await this.restoreIfNeeded()
233
+ }
234
+
230
235
  #autoUnlock = async () => {
231
236
  const walletLocked = await this.#wallet.isLocked()
232
237
  const passphrase = await this.#passphraseCache.get()
package/src/index.js CHANGED
@@ -14,6 +14,7 @@ import publicKeyStore from '@exodus/public-key-store'
14
14
  import rates from '@exodus/rates-monitor'
15
15
  import remoteConfig from '@exodus/remote-config'
16
16
  import restoreProgressTracker from '@exodus/restore-progress-tracker'
17
+ import startupCounter from '@exodus/startup-counter'
17
18
  import transactionSigner from '@exodus/tx-signer'
18
19
  import wallet from '@exodus/wallet'
19
20
  import walletAccounts from '@exodus/wallet-accounts'
@@ -26,8 +27,8 @@ import attachPlugins from './plugins/attach'
26
27
  const createExodus = ({ adapters, config, port }) => {
27
28
  const ioc = createIOC({ adapters, config })
28
29
 
29
- ioc.use(assetsFeature())
30
30
  ioc.use(addressProvider({ config: config.addressProvider }))
31
+ ioc.use(assetsFeature())
31
32
  ioc.use(availableAssets())
32
33
  ioc.use(balances(config.balances))
33
34
  ioc.use(blockchainMetadata())
@@ -39,10 +40,11 @@ const createExodus = ({ adapters, config, port }) => {
39
40
  ioc.use(locale())
40
41
  ioc.use(pricing())
41
42
  ioc.use(publicKeyStore())
42
- ioc.use(transactionSigner())
43
43
  ioc.use(rates())
44
44
  ioc.use(remoteConfig())
45
45
  ioc.use(restoreProgressTracker())
46
+ ioc.use(startupCounter())
47
+ ioc.use(transactionSigner())
46
48
  ioc.use(wallet())
47
49
  ioc.use(walletAccounts())
48
50
 
package/src/ioc.js CHANGED
@@ -58,12 +58,13 @@ const createIOC = ({ adapters, config }) => {
58
58
  registerMultiple([dependency])
59
59
  }
60
60
 
61
- const use = (module) => {
62
- for (const { definition } of module.definitions) {
61
+ const use = (feature) => {
62
+ for (const { definition } of feature.definitions) {
63
63
  assert(definition.type, `ioc.use: "${definition.id}" is missing type field`)
64
+ definition.namespace = feature.id
64
65
  }
65
66
 
66
- registerMultiple(module.definitions)
67
+ registerMultiple(feature.definitions)
67
68
  }
68
69
 
69
70
  registerMultiple(createDependencies({ adapters, config }))