@exodus/headless 2.0.0-alpha.104 → 2.0.0-alpha.106

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,27 @@
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.106](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.105...@exodus/headless@2.0.0-alpha.106) (2023-08-16)
7
+
8
+ ### Features
9
+
10
+ - improve error from plugin ([#3398](https://github.com/ExodusMovement/exodus-hydra/issues/3398)) ([22371a3](https://github.com/ExodusMovement/exodus-hydra/commit/22371a3166ee55fe4c8ff68bd2b9d0b5918e3671))
11
+ - no reporting export when wallet is locked ([#3393](https://github.com/ExodusMovement/exodus-hydra/issues/3393)) ([da76b0b](https://github.com/ExodusMovement/exodus-hydra/commit/da76b0bc65df1b7ffc5b32a5148985c3b1a191f9))
12
+
13
+ ### Bug Fixes
14
+
15
+ - **nfts:** monitors shouldn't return empty data if network requests fail ([#3159](https://github.com/ExodusMovement/exodus-hydra/issues/3159)) ([a512bbf](https://github.com/ExodusMovement/exodus-hydra/commit/a512bbf933d92d12d2a54342422868d88b3aabdf))
16
+
17
+ ## [2.0.0-alpha.105](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.104...@exodus/headless@2.0.0-alpha.105) (2023-08-11)
18
+
19
+ ### ⚠ BREAKING CHANGES
20
+
21
+ - change ui config data structure (#3294)
22
+
23
+ ### Features
24
+
25
+ - change ui config data structure ([#3294](https://github.com/ExodusMovement/exodus-hydra/issues/3294)) ([eaceb99](https://github.com/ExodusMovement/exodus-hydra/commit/eaceb99ad4310255ff70769435f16f2daa43ce5a))
26
+
6
27
  ## [2.0.0-alpha.104](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.103...@exodus/headless@2.0.0-alpha.104) (2023-08-10)
7
28
 
8
29
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.104",
3
+ "version": "2.0.0-alpha.106",
4
4
  "description": "The platform-agnostic Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc.",
6
6
  "main": "src/index.js",
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@exodus/address-provider": "^7.0.0",
30
- "@exodus/atoms": "^5.4.0",
30
+ "@exodus/atoms": "^5.5.0",
31
31
  "@exodus/auto-enable-assets-plugin": "^4.0.1",
32
- "@exodus/available-assets": "^3.0.0",
32
+ "@exodus/available-assets": "^4.0.0",
33
33
  "@exodus/balances": "^8.0.0",
34
34
  "@exodus/basic-utils": "^2.0.0",
35
35
  "@exodus/blockchain-metadata": "^11.1.0",
@@ -71,10 +71,11 @@
71
71
  "@exodus/ethereum-lib": "^2.22.2",
72
72
  "@exodus/ethereum-meta": "^1.0.23",
73
73
  "@exodus/exodus-pricing-client": "^1.2.0",
74
+ "@exodus/key-utils": "^3.0.0",
74
75
  "@exodus/kyc": "^4.0.0",
75
76
  "@exodus/market-history": "^5.0.1",
76
77
  "@exodus/models": "^8.11.1",
77
- "@exodus/nfts": "^5.0.1",
78
+ "@exodus/nfts": "^5.0.3",
78
79
  "@exodus/personal-notes": "^3.4.0",
79
80
  "@exodus/referrals": "^7.0.0",
80
81
  "@exodus/solana-lib": "^1.3.11",
@@ -82,7 +83,7 @@
82
83
  "@exodus/storage-encrypted": "^1.1.2",
83
84
  "@exodus/storage-memory": "^2.1.0",
84
85
  "@exodus/top-movers-monitor": "^3.0.0",
85
- "@exodus/ui-config": "^1.0.0",
86
+ "@exodus/ui-config": "^2.0.0",
86
87
  "@exodus/wild-emitter": "^1.0.0",
87
88
  "buffer-json": "^2.0.0",
88
89
  "deepmerge": "^4.2.2",
@@ -94,5 +95,5 @@
94
95
  "nock": "^13.3.1",
95
96
  "p-defer": "^4.0.0"
96
97
  },
97
- "gitHead": "1bed084e20f3481d73d380404bd46a3bf2b0907e"
98
+ "gitHead": "a2422a97c02da806d98da5396d15798719952d06"
98
99
  }
package/src/api.js CHANGED
@@ -2,12 +2,12 @@ import { validateMnemonic as isMnemonicValid } from 'bip39'
2
2
 
3
3
  import createReporting from './reporting'
4
4
 
5
- const createApi = ({ ioc, port }) => {
5
+ const createApi = ({ ioc, port, lockedAtom }) => {
6
6
  const apis = ioc.getByType('api')
7
7
 
8
8
  return {
9
9
  ...Object.assign({}, ...Object.values(apis)),
10
- ...createReporting({ ioc }),
10
+ ...createReporting({ ioc, lockedAtom }),
11
11
  isMnemonicValid,
12
12
  subscribe: port.subscribe.bind(port),
13
13
  unsubscribe: port.unsubscribe.bind(port),
@@ -129,7 +129,12 @@ class Application extends ExodusModule {
129
129
  try {
130
130
  await hooks[i](params)
131
131
  } catch (err) {
132
- this._logger.error(`application lifecycle hook failed: ${hookName}`, hooks[i], params)
132
+ this._logger.error(
133
+ `application lifecycle hook failed: ${hookName}`,
134
+ hooks[i].name,
135
+ params,
136
+ err
137
+ )
133
138
  throw err
134
139
  }
135
140
  }
package/src/index.js CHANGED
@@ -50,6 +50,8 @@ const createExodus = ({ adapters, config, port }) => {
50
50
 
51
51
  const { assetsModule, storage, fusion } = ioc.getByType('adapter')
52
52
 
53
+ const { lockedAtom } = ioc.getByType('atom')
54
+
53
55
  const { application, wallet, unlockEncryptedStorage } = ioc.getByType('module')
54
56
 
55
57
  const { migrations } = ioc.getAll()
@@ -120,7 +122,7 @@ const createExodus = ({ adapters, config, port }) => {
120
122
  logger: ioc.get('createLogger')('attachPlugins'),
121
123
  })
122
124
 
123
- return createApi({ ioc, port })
125
+ return createApi({ ioc, port, lockedAtom })
124
126
  }
125
127
 
126
128
  return { ...ioc, resolve }
@@ -8,9 +8,8 @@ const LIFECYCLE_METHOD_TO_HOOK_NAME = Object.fromEntries(
8
8
  )
9
9
 
10
10
  const attachPlugins = ({ plugins, application, logger }) => {
11
- const timeFn =
12
- (fn, name) =>
13
- async (...args) => {
11
+ const timeFn = (fn, name) => {
12
+ const pluginWrapper = async (...args) => {
14
13
  const start = Date.now()
15
14
  try {
16
15
  return await fn(...args)
@@ -19,6 +18,11 @@ const attachPlugins = ({ plugins, application, logger }) => {
19
18
  }
20
19
  }
21
20
 
21
+ Object.defineProperty(pluginWrapper, 'name', { value: name, writable: false })
22
+
23
+ return pluginWrapper
24
+ }
25
+
22
26
  Object.entries(plugins).forEach(([name, lifecycleMethods]) => {
23
27
  const entries = Object.entries(lifecycleMethods || {})
24
28
 
package/src/reporting.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import { zipObject } from 'lodash'
2
2
 
3
- const createReporting = ({ ioc }) => {
3
+ const createReporting = ({ ioc, lockedAtom }) => {
4
4
  const getReports = async () => {
5
+ if (await lockedAtom.get()) throw new Error('Unable to export when locked')
6
+
5
7
  const nodes = ioc.getByType('report')
6
8
  const reports = Object.values(nodes)
7
9