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

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.149](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.148...@exodus/headless@2.0.0-alpha.149) (2023-12-13)
7
+
8
+ ### Features
9
+
10
+ - add debug apis (dev only) ([#4992](https://github.com/ExodusMovement/exodus-hydra/issues/4992)) ([022c0aa](https://github.com/ExodusMovement/exodus-hydra/commit/022c0aabb66bc99243fdeb78e8d8eb47413974c8))
11
+
6
12
  ## [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
13
 
8
14
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.148",
3
+ "version": "2.0.0-alpha.149",
4
4
  "description": "The platform-agnostic Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc.",
6
6
  "main": "src/index.js",
@@ -31,11 +31,11 @@
31
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
- "@exodus/balances": "^12.0.0",
34
+ "@exodus/balances": "^12.0.1",
35
35
  "@exodus/basic-utils": "^2.0.0",
36
36
  "@exodus/blockchain-metadata": "^15.0.0",
37
- "@exodus/dependency-injection": "^2.0.1",
38
- "@exodus/dependency-preprocessors": "^3.1.1",
37
+ "@exodus/dependency-injection": "^2.1.0",
38
+ "@exodus/dependency-preprocessors": "^4.0.0",
39
39
  "@exodus/enabled-assets": "^9.0.1",
40
40
  "@exodus/feature-flags": "^5.1.0",
41
41
  "@exodus/fee-data-monitors": "^3.0.0",
@@ -100,5 +100,5 @@
100
100
  "msw": "^2.0.0",
101
101
  "p-defer": "^4.0.0"
102
102
  },
103
- "gitHead": "678623e0bd6eddc9d7615648878938a807cf3a33"
103
+ "gitHead": "20d96231a08ff6a8cad77f5c7ef8f9b62627656f"
104
104
  }
@@ -0,0 +1,13 @@
1
+ const createApi = ({ ioc }) => {
2
+ const { env } = ioc.getByType('adapter')
3
+
4
+ if (!env || env.build !== 'development') return {}
5
+
6
+ const apis = ioc.getByType('debug')
7
+
8
+ return {
9
+ debug: Object.assign({}, ...Object.values(apis)),
10
+ }
11
+ }
12
+
13
+ export default createApi
@@ -1,13 +1,15 @@
1
1
  import { validateMnemonic as isMnemonicValid } from 'bip39'
2
2
 
3
+ import createDebug from './debug'
3
4
  import createReporting from './reporting'
4
5
 
5
- const createApi = ({ ioc, port, lockedAtom, config }) => {
6
+ const createApi = ({ ioc, port, config }) => {
6
7
  const apis = ioc.getByType('api')
7
8
 
8
9
  return {
9
10
  ...Object.assign({}, ...Object.values(apis)),
10
- ...createReporting({ ioc, lockedAtom, config }),
11
+ ...createDebug({ ioc }),
12
+ ...createReporting({ ioc, config }),
11
13
  isMnemonicValid,
12
14
  subscribe: port.subscribe.bind(port),
13
15
  unsubscribe: port.unsubscribe.bind(port),
@@ -1,12 +1,15 @@
1
1
  import { zipObject } from 'lodash'
2
2
 
3
- import { rejectAfter } from './utils/promises'
3
+ import { rejectAfter } from '../utils/promises'
4
+
5
+ const createReporting = ({ ioc, config: { exportTimeout = 2000 } }) => {
6
+ const nodes = ioc.getByType('report')
7
+
8
+ const { lockedAtom } = ioc.getByType('atom')
4
9
 
5
- const createReporting = ({ ioc, lockedAtom, config: { exportTimeout = 2000 } }) => {
6
10
  const getReports = async () => {
7
11
  if (await lockedAtom.get()) throw new Error('Unable to export when locked')
8
12
 
9
- const nodes = ioc.getByType('report')
10
13
  const reports = Object.values(nodes)
11
14
 
12
15
  const timeoutPromise = rejectAfter(
package/src/index.js CHANGED
@@ -55,8 +55,6 @@ const createExodus = ({ adapters, config, port }) => {
55
55
 
56
56
  const { storage, migrateableStorage } = ioc.getByType('adapter')
57
57
 
58
- const { lockedAtom } = ioc.getByType('atom')
59
-
60
58
  const { application, wallet, unlockEncryptedStorage } = ioc.getByType('module')
61
59
 
62
60
  const { migrations } = ioc.getAll()
@@ -121,7 +119,7 @@ const createExodus = ({ adapters, config, port }) => {
121
119
  logger: ioc.get('createLogger')('attachPlugins'),
122
120
  })
123
121
 
124
- return createApi({ ioc, port, config, lockedAtom })
122
+ return createApi({ ioc, port, config })
125
123
  }
126
124
 
127
125
  return { ...ioc, resolve }