@exodus/headless 3.1.1 → 3.1.3
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 +4 -0
- package/package.json +18 -18
- package/src/application/module/application.js +2 -2
- package/src/index.js +1 -1
- package/src/ioc.js +0 -80
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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
|
+
## [3.1.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@3.1.1...@exodus/headless@3.1.2) (2024-02-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @exodus/headless
|
|
9
|
+
|
|
6
10
|
## [3.1.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@3.1.0...@exodus/headless@3.1.1) (2024-01-29)
|
|
7
11
|
|
|
8
12
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/headless",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "The platform-agnostic Exodus wallet SDK",
|
|
5
5
|
"author": "Exodus Movement Inc.",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@exodus/address-provider": "^9.2.0",
|
|
30
|
+
"@exodus/argo": "^1.0.0",
|
|
30
31
|
"@exodus/assets-feature": "^4.0.1",
|
|
31
32
|
"@exodus/atoms": "^7.0.0",
|
|
32
33
|
"@exodus/available-assets": "^8.0.0",
|
|
@@ -64,33 +65,33 @@
|
|
|
64
65
|
"minimalistic-assert": "^1.0.1"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
67
|
-
"@exodus/ab-testing": "
|
|
68
|
+
"@exodus/ab-testing": "workspace:^",
|
|
68
69
|
"@exodus/algorand-lib": "^2.0.1",
|
|
69
70
|
"@exodus/algorand-meta": "^1.1.4",
|
|
70
|
-
"@exodus/analytics": "
|
|
71
|
-
"@exodus/apy-rates": "
|
|
71
|
+
"@exodus/analytics": "workspace:^",
|
|
72
|
+
"@exodus/apy-rates": "workspace:^",
|
|
72
73
|
"@exodus/assets-feature": "workspace:^",
|
|
73
74
|
"@exodus/bitcoin-plugin": "^1.0.14",
|
|
74
|
-
"@exodus/connected-origins": "
|
|
75
|
-
"@exodus/crypto-news-monitor": "
|
|
75
|
+
"@exodus/connected-origins": "workspace:^",
|
|
76
|
+
"@exodus/crypto-news-monitor": "workspace:^",
|
|
76
77
|
"@exodus/currency": "^2.2.0",
|
|
77
78
|
"@exodus/ethereum-lib": "^3.3.34",
|
|
78
79
|
"@exodus/ethereum-meta": "^1.0.23",
|
|
79
|
-
"@exodus/exodus-pricing-client": "
|
|
80
|
+
"@exodus/exodus-pricing-client": "workspace:^",
|
|
80
81
|
"@exodus/key-utils": "^3.0.0",
|
|
81
|
-
"@exodus/kyc": "
|
|
82
|
+
"@exodus/kyc": "workspace:^",
|
|
82
83
|
"@exodus/litecoin-meta": "^1.0.0",
|
|
83
|
-
"@exodus/market-history": "
|
|
84
|
+
"@exodus/market-history": "workspace:^",
|
|
84
85
|
"@exodus/models": "^10.1.0",
|
|
85
|
-
"@exodus/nfts": "
|
|
86
|
-
"@exodus/personal-notes": "
|
|
87
|
-
"@exodus/referrals": "
|
|
86
|
+
"@exodus/nfts": "workspace:^",
|
|
87
|
+
"@exodus/personal-notes": "workspace:^",
|
|
88
|
+
"@exodus/referrals": "workspace:^",
|
|
88
89
|
"@exodus/solana-lib": "^1.3.11",
|
|
89
90
|
"@exodus/solana-meta": "^1.0.2",
|
|
90
|
-
"@exodus/storage-encrypted": "
|
|
91
|
-
"@exodus/storage-memory": "
|
|
92
|
-
"@exodus/top-movers-monitor": "
|
|
93
|
-
"@exodus/ui-config": "
|
|
91
|
+
"@exodus/storage-encrypted": "workspace:^",
|
|
92
|
+
"@exodus/storage-memory": "workspace:^",
|
|
93
|
+
"@exodus/top-movers-monitor": "workspace:^",
|
|
94
|
+
"@exodus/ui-config": "workspace:^",
|
|
94
95
|
"@exodus/wild-emitter": "^1.0.0",
|
|
95
96
|
"buffer-json": "^2.0.0",
|
|
96
97
|
"deepmerge": "^4.2.2",
|
|
@@ -101,6 +102,5 @@
|
|
|
101
102
|
"jest": "^29.1.2",
|
|
102
103
|
"msw": "^2.0.0",
|
|
103
104
|
"p-defer": "^4.0.0"
|
|
104
|
-
}
|
|
105
|
-
"gitHead": "5f285cee06abaf98437619a5a8aa5381b8eefc36"
|
|
105
|
+
}
|
|
106
106
|
}
|
|
@@ -296,9 +296,9 @@ class Application extends ExodusModule {
|
|
|
296
296
|
this._logger.log('passphrase changed')
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
delete = async ({ forgotPassphrase } = {}) => {
|
|
299
|
+
delete = async ({ forgotPassphrase, restartOptions } = {}) => {
|
|
300
300
|
await this.#storage.set(DELETE_FLAG, true)
|
|
301
|
-
await this.fire(Hook.Restart, { reason: 'delete', forgotPassphrase })
|
|
301
|
+
await this.fire(Hook.Restart, { ...restartOptions, reason: 'delete', forgotPassphrase })
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
stop = async () => {
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import addressProvider from '@exodus/address-provider'
|
|
2
|
+
import createIOC from '@exodus/argo'
|
|
2
3
|
import assetsFeature from '@exodus/assets-feature'
|
|
3
4
|
import availableAssets from '@exodus/available-assets'
|
|
4
5
|
import balances from '@exodus/balances'
|
|
@@ -23,7 +24,6 @@ import walletAccounts from '@exodus/wallet-accounts'
|
|
|
23
24
|
import createApi from './api'
|
|
24
25
|
import application from './application'
|
|
25
26
|
import createDependencies from './dependencies'
|
|
26
|
-
import createIOC from './ioc'
|
|
27
27
|
import attachMigrations from './migrations/attach'
|
|
28
28
|
import attachPlugins from './plugins/attach'
|
|
29
29
|
|
package/src/ioc.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import createIocContainer from '@exodus/dependency-injection'
|
|
2
|
-
import preprocess from '@exodus/dependency-preprocessors'
|
|
3
|
-
import alias from '@exodus/dependency-preprocessors/src/preprocessors/alias'
|
|
4
|
-
import configPreprocessor from '@exodus/dependency-preprocessors/src/preprocessors/config'
|
|
5
|
-
import debuggerPreprocessor from '@exodus/dependency-preprocessors/src/preprocessors/debugger'
|
|
6
|
-
import devModeAtoms from '@exodus/dependency-preprocessors/src/preprocessors/dev-mode-atoms'
|
|
7
|
-
import logify from '@exodus/dependency-preprocessors/src/preprocessors/logify'
|
|
8
|
-
import namespaceStorage from '@exodus/dependency-preprocessors/src/preprocessors/namespace-storage'
|
|
9
|
-
import optional from '@exodus/dependency-preprocessors/src/preprocessors/optional'
|
|
10
|
-
import performanceMonitor from '@exodus/dependency-preprocessors/src/preprocessors/performance-monitor'
|
|
11
|
-
import readOnlyAtoms from '@exodus/dependency-preprocessors/src/preprocessors/read-only-atoms'
|
|
12
|
-
import assert from 'minimalistic-assert'
|
|
13
|
-
|
|
14
|
-
const createIOC = ({ adapters, config, debug }) => {
|
|
15
|
-
const { createLogger, unsafeStorage, performance = {} } = adapters
|
|
16
|
-
const {
|
|
17
|
-
readOnlyAtoms: readOnlyAtomsConfig,
|
|
18
|
-
devModeAtoms: devModeAtomsConfig,
|
|
19
|
-
performanceMonitor: performanceMonitorConfig,
|
|
20
|
-
} = config.ioc ?? {}
|
|
21
|
-
|
|
22
|
-
const ioc = createIocContainer({ logger: createLogger('exodus:ioc') })
|
|
23
|
-
|
|
24
|
-
const performanceLogger = createLogger('exodus:performance')
|
|
25
|
-
|
|
26
|
-
const preprocessors = [
|
|
27
|
-
logify({ createLogger }),
|
|
28
|
-
performanceMonitorConfig?.enabled &&
|
|
29
|
-
performanceMonitor({
|
|
30
|
-
now: performance.now,
|
|
31
|
-
onAboveThreshold:
|
|
32
|
-
performance.onAboveThreshold ??
|
|
33
|
-
(({ id, method, async, duration }) =>
|
|
34
|
-
performanceLogger.log(
|
|
35
|
-
`${id}.${method} ${async ? 'resolved after' : 'took'} ${duration}ms`
|
|
36
|
-
)),
|
|
37
|
-
config: performanceMonitorConfig,
|
|
38
|
-
}),
|
|
39
|
-
configPreprocessor(),
|
|
40
|
-
alias(),
|
|
41
|
-
// NOTE: order matters, this should come after `alias`
|
|
42
|
-
namespaceStorage(),
|
|
43
|
-
readOnlyAtoms({
|
|
44
|
-
logger: createLogger('exodus:read-only-atoms'),
|
|
45
|
-
warn: true,
|
|
46
|
-
...readOnlyAtomsConfig,
|
|
47
|
-
}),
|
|
48
|
-
optional(),
|
|
49
|
-
devModeAtomsConfig && devModeAtoms(devModeAtomsConfig),
|
|
50
|
-
debuggerPreprocessor({ debug, unsafeStorage }),
|
|
51
|
-
].filter(Boolean)
|
|
52
|
-
|
|
53
|
-
const nodes = []
|
|
54
|
-
|
|
55
|
-
const registerMultiple = (dependencies) => {
|
|
56
|
-
nodes.push(...dependencies)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const register = (dependency) => {
|
|
60
|
-
nodes.push(dependency)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const use = (feature) => {
|
|
64
|
-
for (const { definition } of feature.definitions) {
|
|
65
|
-
assert(definition.type, `ioc.use: "${definition.id}" is missing type field`)
|
|
66
|
-
definition.namespace = feature.id
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
registerMultiple(feature.definitions)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const resolve = () => {
|
|
73
|
-
ioc.registerMultiple(preprocess({ dependencies: nodes, preprocessors }))
|
|
74
|
-
ioc.resolve()
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return { ...ioc, resolve, register, registerMultiple, use }
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export default createIOC
|