@exodus/headless 2.0.0-alpha.99 → 2.1.0
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 +366 -0
- package/README.md +30 -7
- package/package.json +51 -42
- package/src/api/debug.js +21 -0
- package/src/{api.js → api/index.js} +4 -12
- package/src/api/reporting.js +39 -0
- package/src/application.js +39 -8
- package/src/atoms/base-asset-names-to-monitor.js +11 -9
- package/src/constants.js +1 -21
- package/src/dependencies/index.js +0 -3
- package/src/dependencies/modules.js +3 -1
- package/src/index.js +38 -26
- package/src/ioc.js +31 -10
- package/src/migrations/attach.js +62 -0
- package/src/plugins/attach.js +7 -3
- package/src/utils/fusion.js +17 -0
- package/src/utils/promises.js +7 -0
- package/src/atoms/attach.js +0 -29
- package/src/reporting.js +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,372 @@
|
|
|
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.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0...@exodus/headless@2.1.0) (2023-12-18)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- add geolocation debug api ([#5000](https://github.com/ExodusMovement/exodus-hydra/issues/5000)) ([63f7420](https://github.com/ExodusMovement/exodus-hydra/commit/63f7420ac9f2dee98702691d382e6561310f31cc))
|
|
11
|
+
- **debug:** add clear and restart methods ([#5109](https://github.com/ExodusMovement/exodus-hydra/issues/5109)) ([77170cf](https://github.com/ExodusMovement/exodus-hydra/commit/77170cf42c261f18269f0d2de3091f7db752af2e))
|
|
12
|
+
- filesystem feature ([#5058](https://github.com/ExodusMovement/exodus-hydra/issues/5058)) ([1d3d85d](https://github.com/ExodusMovement/exodus-hydra/commit/1d3d85dc2e200954230305a0a6c0e36f35c79db2))
|
|
13
|
+
- **headless:** pass debug flag instead of using env build ([#5087](https://github.com/ExodusMovement/exodus-hydra/issues/5087)) ([f5be292](https://github.com/ExodusMovement/exodus-hydra/commit/f5be292047781c808173df377eaa43e590350a2e))
|
|
14
|
+
- **headless:** use debugger preprocessor ([#5088](https://github.com/ExodusMovement/exodus-hydra/issues/5088)) ([7e15717](https://github.com/ExodusMovement/exodus-hydra/commit/7e15717cb18dfa169e668bcdce6cde9a412c321d))
|
|
15
|
+
|
|
16
|
+
## [2.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.149...@exodus/headless@2.0.0) (2023-12-15)
|
|
17
|
+
|
|
18
|
+
**Note:** Version bump only for package @exodus/headless
|
|
19
|
+
|
|
20
|
+
## [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)
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
- add debug apis (dev only) ([#4992](https://github.com/ExodusMovement/exodus-hydra/issues/4992)) ([022c0aa](https://github.com/ExodusMovement/exodus-hydra/commit/022c0aabb66bc99243fdeb78e8d8eb47413974c8))
|
|
25
|
+
|
|
26
|
+
## [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)
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
- add startup-counter feature ([#4870](https://github.com/ExodusMovement/exodus-hydra/issues/4870)) ([e2a1c18](https://github.com/ExodusMovement/exodus-hydra/commit/e2a1c18922de3cddf69fb7840712fc2bfdac687a))
|
|
31
|
+
- allow force restore ([#4953](https://github.com/ExodusMovement/exodus-hydra/issues/4953)) ([10d5e06](https://github.com/ExodusMovement/exodus-hydra/commit/10d5e06b00830fcdfe3c66698bbd729fbd8b3efe))
|
|
32
|
+
- assign feature id as namespace ([#4962](https://github.com/ExodusMovement/exodus-hydra/issues/4962)) ([8af7ce4](https://github.com/ExodusMovement/exodus-hydra/commit/8af7ce4dbcc058d01966be85dc1aa53a4a65a488))
|
|
33
|
+
|
|
34
|
+
## [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)
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
- compute feature-is-enabled in geolocation ([#4939](https://github.com/ExodusMovement/exodus-hydra/issues/4939)) ([3a9bac6](https://github.com/ExodusMovement/exodus-hydra/commit/3a9bac6f1b3116f2849ca74ffae6be454e590acb)), closes [#4941](https://github.com/ExodusMovement/exodus-hydra/issues/4941)
|
|
39
|
+
|
|
40
|
+
## [2.0.0-alpha.146](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.145...@exodus/headless@2.0.0-alpha.146) (2023-11-30)
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
- make passphrase cache optional ([#4915](https://github.com/ExodusMovement/exodus-hydra/issues/4915)) ([1a5738b](https://github.com/ExodusMovement/exodus-hydra/commit/1a5738b830e200012d271ff5553e5985dd3ffe7c))
|
|
45
|
+
|
|
46
|
+
## [2.0.0-alpha.145](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.144...@exodus/headless@2.0.0-alpha.145) (2023-11-23)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @exodus/headless
|
|
49
|
+
|
|
50
|
+
## [2.0.0-alpha.144](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.143...@exodus/headless@2.0.0-alpha.144) (2023-11-23)
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
- add public key store to headless ([#4852](https://github.com/ExodusMovement/exodus-hydra/issues/4852)) ([c003055](https://github.com/ExodusMovement/exodus-hydra/commit/c0030555487e95aadb9bae78710d85cc1496febd))
|
|
55
|
+
|
|
56
|
+
## [2.0.0-alpha.143](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.142...@exodus/headless@2.0.0-alpha.143) (2023-11-22)
|
|
57
|
+
|
|
58
|
+
**Note:** Version bump only for package @exodus/headless
|
|
59
|
+
|
|
60
|
+
## [2.0.0-alpha.142](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.141...@exodus/headless@2.0.0-alpha.142) (2023-11-21)
|
|
61
|
+
|
|
62
|
+
**Note:** Version bump only for package @exodus/headless
|
|
63
|
+
|
|
64
|
+
## [2.0.0-alpha.141](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.140...@exodus/headless@2.0.0-alpha.141) (2023-11-20)
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
- addressProvider api improvements ([#4804](https://github.com/ExodusMovement/exodus-hydra/issues/4804)) ([4221e07](https://github.com/ExodusMovement/exodus-hydra/commit/4221e07e54955740ae352c69444d80a77741ed0b))
|
|
69
|
+
- expand hardware public keys api in `walletAccounts` ([#4723](https://github.com/ExodusMovement/exodus-hydra/issues/4723)) ([fd40db8](https://github.com/ExodusMovement/exodus-hydra/commit/fd40db84fb5b92505037823e170b53563502de01))
|
|
70
|
+
|
|
71
|
+
### Bug Fixes
|
|
72
|
+
|
|
73
|
+
- zero balance after send is ignore ([#4725](https://github.com/ExodusMovement/exodus-hydra/issues/4725)) ([56c5d35](https://github.com/ExodusMovement/exodus-hydra/commit/56c5d35ca1643e869c112d0166df036ec988088f))
|
|
74
|
+
|
|
75
|
+
## [2.0.0-alpha.140](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.139...@exodus/headless@2.0.0-alpha.140) (2023-10-25)
|
|
76
|
+
|
|
77
|
+
### Features
|
|
78
|
+
|
|
79
|
+
- **headless:** unlock migrateable storage ([#4561](https://github.com/ExodusMovement/exodus-hydra/issues/4561)) ([6d726a4](https://github.com/ExodusMovement/exodus-hydra/commit/6d726a4de678fd19f4742d431d67148d6f150573))
|
|
80
|
+
|
|
81
|
+
## [2.0.0-alpha.139](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.138...@exodus/headless@2.0.0-alpha.139) (2023-10-25)
|
|
82
|
+
|
|
83
|
+
### Features
|
|
84
|
+
|
|
85
|
+
- **reporting:** don't wait for long-running exports ([#4549](https://github.com/ExodusMovement/exodus-hydra/issues/4549)) ([c1568a5](https://github.com/ExodusMovement/exodus-hydra/commit/c1568a5e5c53b7eb7469aceac19a7bedbc265d45))
|
|
86
|
+
|
|
87
|
+
### Bug Fixes
|
|
88
|
+
|
|
89
|
+
- headless migrations ([#4568](https://github.com/ExodusMovement/exodus-hydra/issues/4568)) ([610a3a4](https://github.com/ExodusMovement/exodus-hydra/commit/610a3a4ada3124f8aba5d177274db7c05c86fc7e))
|
|
90
|
+
|
|
91
|
+
## [2.0.0-alpha.138](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.137...@exodus/headless@2.0.0-alpha.138) (2023-10-20)
|
|
92
|
+
|
|
93
|
+
### Bug Fixes
|
|
94
|
+
|
|
95
|
+
- import from atoms index ([#4508](https://github.com/ExodusMovement/exodus-hydra/issues/4508)) ([923fb99](https://github.com/ExodusMovement/exodus-hydra/commit/923fb992328b63e45401c78176b5a6ef7b666eee))
|
|
96
|
+
|
|
97
|
+
## [2.0.0-alpha.137](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.136...@exodus/headless@2.0.0-alpha.137) (2023-10-18)
|
|
98
|
+
|
|
99
|
+
**Note:** Version bump only for package @exodus/headless
|
|
100
|
+
|
|
101
|
+
## [2.0.0-alpha.136](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.135...@exodus/headless@2.0.0-alpha.136) (2023-10-17)
|
|
102
|
+
|
|
103
|
+
### ⚠ BREAKING CHANGES
|
|
104
|
+
|
|
105
|
+
- don't expect fusion as adapter (#4443)
|
|
106
|
+
|
|
107
|
+
### Features
|
|
108
|
+
|
|
109
|
+
- clear assets feature in plugin ([#4444](https://github.com/ExodusMovement/exodus-hydra/issues/4444)) ([ac5442d](https://github.com/ExodusMovement/exodus-hydra/commit/ac5442d30ead24260f10f336497fbc745ff66e17))
|
|
110
|
+
- don't expect fusion as adapter ([#4443](https://github.com/ExodusMovement/exodus-hydra/issues/4443)) ([fc7a886](https://github.com/ExodusMovement/exodus-hydra/commit/fc7a8861a1d5a50cae3ceb04570731b1d11c3820))
|
|
111
|
+
|
|
112
|
+
## [2.0.0-alpha.135](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.134...@exodus/headless@2.0.0-alpha.135) (2023-10-16)
|
|
113
|
+
|
|
114
|
+
### Bug Fixes
|
|
115
|
+
|
|
116
|
+
- headless test config ([#4399](https://github.com/ExodusMovement/exodus-hydra/issues/4399)) ([27618df](https://github.com/ExodusMovement/exodus-hydra/commit/27618df282becfb07e25759d7e870c1ce9cc6331))
|
|
117
|
+
|
|
118
|
+
## [2.0.0-alpha.134](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.133...@exodus/headless@2.0.0-alpha.134) (2023-10-05)
|
|
119
|
+
|
|
120
|
+
### Features
|
|
121
|
+
|
|
122
|
+
- **ui-config:** do not emit using atom id ([#4342](https://github.com/ExodusMovement/exodus-hydra/issues/4342)) ([df9d7b6](https://github.com/ExodusMovement/exodus-hydra/commit/df9d7b67bbca1c351128afd2e7a76a718dd71a79))
|
|
123
|
+
- use transaction signer ([#3751](https://github.com/ExodusMovement/exodus-hydra/issues/3751)) ([0e60e89](https://github.com/ExodusMovement/exodus-hydra/commit/0e60e8963a799435c5528f596447813b9e012ead))
|
|
124
|
+
|
|
125
|
+
## [2.0.0-alpha.133](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.132...@exodus/headless@2.0.0-alpha.133) (2023-10-04)
|
|
126
|
+
|
|
127
|
+
### Features
|
|
128
|
+
|
|
129
|
+
- clear storage in parallel ([#4314](https://github.com/ExodusMovement/exodus-hydra/issues/4314)) ([e035d9f](https://github.com/ExodusMovement/exodus-hydra/commit/e035d9f082af16e1aad57348f4011fd4f077929d))
|
|
130
|
+
- **remote-config:** redux module ([#4319](https://github.com/ExodusMovement/exodus-hydra/issues/4319)) ([883954a](https://github.com/ExodusMovement/exodus-hydra/commit/883954ad80acd1b01183a848963c6d0181e66bb7))
|
|
131
|
+
|
|
132
|
+
## [2.0.0-alpha.132](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.131...@exodus/headless@2.0.0-alpha.132) (2023-10-03)
|
|
133
|
+
|
|
134
|
+
### Features
|
|
135
|
+
|
|
136
|
+
- **crypto-news-monitor:** add redux module ([#4294](https://github.com/ExodusMovement/exodus-hydra/issues/4294)) ([fed61cb](https://github.com/ExodusMovement/exodus-hydra/commit/fed61cbd7ba9bdb37efea6288078a2aa76c22364))
|
|
137
|
+
|
|
138
|
+
## [2.0.0-alpha.131](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.130...@exodus/headless@2.0.0-alpha.131) (2023-09-27)
|
|
139
|
+
|
|
140
|
+
**Note:** Version bump only for package @exodus/headless
|
|
141
|
+
|
|
142
|
+
## [2.0.0-alpha.130](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.129...@exodus/headless@2.0.0-alpha.130) (2023-09-22)
|
|
143
|
+
|
|
144
|
+
### Bug Fixes
|
|
145
|
+
|
|
146
|
+
- tests ([#4187](https://github.com/ExodusMovement/exodus-hydra/issues/4187)) ([8d25c40](https://github.com/ExodusMovement/exodus-hydra/commit/8d25c40905ab08ea4f837ce34eeff793072b5ee9))
|
|
147
|
+
|
|
148
|
+
## [2.0.0-alpha.129](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.128...@exodus/headless@2.0.0-alpha.129) (2023-09-20)
|
|
149
|
+
|
|
150
|
+
**Note:** Version bump only for package @exodus/headless
|
|
151
|
+
|
|
152
|
+
## [2.0.0-alpha.128](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.127...@exodus/headless@2.0.0-alpha.128) (2023-09-19)
|
|
153
|
+
|
|
154
|
+
**Note:** Version bump only for package @exodus/headless
|
|
155
|
+
|
|
156
|
+
## [2.0.0-alpha.127](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.126...@exodus/headless@2.0.0-alpha.127) (2023-09-19)
|
|
157
|
+
|
|
158
|
+
**Note:** Version bump only for package @exodus/headless
|
|
159
|
+
|
|
160
|
+
## [2.0.0-alpha.126](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.125...@exodus/headless@2.0.0-alpha.126) (2023-09-19)
|
|
161
|
+
|
|
162
|
+
**Note:** Version bump only for package @exodus/headless
|
|
163
|
+
|
|
164
|
+
## [2.0.0-alpha.125](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.124...@exodus/headless@2.0.0-alpha.125) (2023-09-18)
|
|
165
|
+
|
|
166
|
+
### ⚠ BREAKING CHANGES
|
|
167
|
+
|
|
168
|
+
- **headless:** ship assets feature (#4100)
|
|
169
|
+
|
|
170
|
+
### Features
|
|
171
|
+
|
|
172
|
+
- **headless:** emit pre-load event ([#4102](https://github.com/ExodusMovement/exodus-hydra/issues/4102)) ([0db6168](https://github.com/ExodusMovement/exodus-hydra/commit/0db616811faf4a3926fd8dc9fe8d39aab88fa728))
|
|
173
|
+
- **headless:** ship assets feature ([#4100](https://github.com/ExodusMovement/exodus-hydra/issues/4100)) ([694accc](https://github.com/ExodusMovement/exodus-hydra/commit/694accc504893e08d3d47f16a704e141953bdcca))
|
|
174
|
+
|
|
175
|
+
## [2.0.0-alpha.124](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.123...@exodus/headless@2.0.0-alpha.124) (2023-09-16)
|
|
176
|
+
|
|
177
|
+
- add storage namespace for wallet-compatibilty-modes [1cf62547](https://github.com/ExodusMovement/exodus-hydra/pull/3644/commits/1cf6254755f8b9326b55afae21b6a2cf92e998a9)
|
|
178
|
+
|
|
179
|
+
## [2.0.0-alpha.123](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.122...@exodus/headless@2.0.0-alpha.123) (2023-09-12)
|
|
180
|
+
|
|
181
|
+
### Bug Fixes
|
|
182
|
+
|
|
183
|
+
- dedupe baseAssetNamesToMonitor atom ([#3875](https://github.com/ExodusMovement/exodus-hydra/issues/3875)) ([add2cdb](https://github.com/ExodusMovement/exodus-hydra/commit/add2cdb6f68d2d615e4043ff606f66129622c303))
|
|
184
|
+
|
|
185
|
+
## [2.0.0-alpha.122](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.121...@exodus/headless@2.0.0-alpha.122) (2023-09-11)
|
|
186
|
+
|
|
187
|
+
### Features
|
|
188
|
+
|
|
189
|
+
- add asset preferences to assets-feature redux module ([#3879](https://github.com/ExodusMovement/exodus-hydra/issues/3879)) ([6b60a16](https://github.com/ExodusMovement/exodus-hydra/commit/6b60a162a2af845374911ccacf1c58dbf2620523))
|
|
190
|
+
- add assets module definition ([#3931](https://github.com/ExodusMovement/exodus-hydra/issues/3931)) ([3157f44](https://github.com/ExodusMovement/exodus-hydra/commit/3157f44de260fa4c2c48dda311f907c114b07088))
|
|
191
|
+
- add async flag to `onAboveThreshold` ([#3915](https://github.com/ExodusMovement/exodus-hydra/issues/3915)) ([70d304d](https://github.com/ExodusMovement/exodus-hydra/commit/70d304d27a84fbe17612c68773c29fc0affdb07c))
|
|
192
|
+
- **apy-rates:** remove atom suffix to event ([#3896](https://github.com/ExodusMovement/exodus-hydra/issues/3896)) ([3d83a22](https://github.com/ExodusMovement/exodus-hydra/commit/3d83a223b95859572d074bea834ca71de6340da0))
|
|
193
|
+
- **connected-origins:** remove atom suffix to event ([#3897](https://github.com/ExodusMovement/exodus-hydra/issues/3897)) ([1dae6dd](https://github.com/ExodusMovement/exodus-hydra/commit/1dae6ddc3cf681e718913ca1f9edc3bb97be5145))
|
|
194
|
+
|
|
195
|
+
## [2.0.0-alpha.121](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.120...@exodus/headless@2.0.0-alpha.121) (2023-09-07)
|
|
196
|
+
|
|
197
|
+
### Features
|
|
198
|
+
|
|
199
|
+
- **headless:** do not attach atoms anymore ([#3890](https://github.com/ExodusMovement/exodus-hydra/issues/3890)) ([78894d7](https://github.com/ExodusMovement/exodus-hydra/commit/78894d7f9148f6f2754cc71ecf649161d7056558))
|
|
200
|
+
|
|
201
|
+
### Bug Fixes
|
|
202
|
+
|
|
203
|
+
- headless dependency definition ([#3889](https://github.com/ExodusMovement/exodus-hydra/issues/3889)) ([627b24e](https://github.com/ExodusMovement/exodus-hydra/commit/627b24e3fa214e5222d1c118deb0eb7baae8f144))
|
|
204
|
+
|
|
205
|
+
## [2.0.0-alpha.120](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.119...@exodus/headless@2.0.0-alpha.120) (2023-09-06)
|
|
206
|
+
|
|
207
|
+
### Features
|
|
208
|
+
|
|
209
|
+
- support additional Solana derivation paths ([#3418](https://github.com/ExodusMovement/exodus-hydra/issues/3418)) ([abd701d](https://github.com/ExodusMovement/exodus-hydra/commit/abd701d44f928c1d3a0a99f23b1240ef3b9b2f24))
|
|
210
|
+
|
|
211
|
+
## [2.0.0-alpha.119](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.118...@exodus/headless@2.0.0-alpha.119) (2023-09-01)
|
|
212
|
+
|
|
213
|
+
### ⚠ BREAKING CHANGES
|
|
214
|
+
|
|
215
|
+
- **ui-config:** expose utils to compute events (#3819)
|
|
216
|
+
|
|
217
|
+
### Features
|
|
218
|
+
|
|
219
|
+
- **ui-config:** expose utils to compute events ([#3819](https://github.com/ExodusMovement/exodus-hydra/issues/3819)) ([32d8bfd](https://github.com/ExodusMovement/exodus-hydra/commit/32d8bfd0a992ee25c9771dfe875683a4b8c8ae3d))
|
|
220
|
+
|
|
221
|
+
## [2.0.0-alpha.118](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.117...@exodus/headless@2.0.0-alpha.118) (2023-09-01)
|
|
222
|
+
|
|
223
|
+
### Bug Fixes
|
|
224
|
+
|
|
225
|
+
- bump preprocessor to include performance monitor ([#3814](https://github.com/ExodusMovement/exodus-hydra/issues/3814)) ([68a50e8](https://github.com/ExodusMovement/exodus-hydra/commit/68a50e830acc5713c4629758b9104c2eae16cb71))
|
|
226
|
+
|
|
227
|
+
## [2.0.0-alpha.117](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.116...@exodus/headless@2.0.0-alpha.117) (2023-08-31)
|
|
228
|
+
|
|
229
|
+
### ⚠ BREAKING CHANGES
|
|
230
|
+
|
|
231
|
+
- accept feature config (#3789)
|
|
232
|
+
- use injected fetchival (#3748)
|
|
233
|
+
|
|
234
|
+
### Features
|
|
235
|
+
|
|
236
|
+
- accept feature config ([#3789](https://github.com/ExodusMovement/exodus-hydra/issues/3789)) ([beac45f](https://github.com/ExodusMovement/exodus-hydra/commit/beac45fd516383b1ab48fc077a417cbc06ba9f5b))
|
|
237
|
+
- use injected fetchival ([#3748](https://github.com/ExodusMovement/exodus-hydra/issues/3748)) ([46b226b](https://github.com/ExodusMovement/exodus-hydra/commit/46b226ba28fdc0a600d0bc803eb7c4083d49f2d7))
|
|
238
|
+
|
|
239
|
+
## [2.0.0-alpha.116](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.115...@exodus/headless@2.0.0-alpha.116) (2023-08-28)
|
|
240
|
+
|
|
241
|
+
### Code Refactoring
|
|
242
|
+
|
|
243
|
+
- refactor: load assets on start (#3725)
|
|
244
|
+
|
|
245
|
+
## [2.0.0-alpha.115](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.114...@exodus/headless@2.0.0-alpha.115) (2023-08-28)
|
|
246
|
+
|
|
247
|
+
### Features
|
|
248
|
+
|
|
249
|
+
- bump balances in headless ([#3666](https://github.com/ExodusMovement/exodus-hydra/issues/3666)) ([2c58bb0](https://github.com/ExodusMovement/exodus-hydra/commit/2c58bb02654f3bd52854cabf2f182a0bc6cb38f2))
|
|
250
|
+
|
|
251
|
+
## [2.0.0-alpha.114](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.113...@exodus/headless@2.0.0-alpha.114) (2023-08-28)
|
|
252
|
+
|
|
253
|
+
### ⚠ BREAKING CHANGES
|
|
254
|
+
|
|
255
|
+
- **headless:** remove attached restoringAssetsAtom (#3639)
|
|
256
|
+
|
|
257
|
+
use atom observer of restore-progress-tracker@2.1.0 instead
|
|
258
|
+
|
|
259
|
+
### Features
|
|
260
|
+
|
|
261
|
+
- upgrade auto-enable-assets-plugin https://github.com/ExodusMovement/exodus-hydra/pull/3655
|
|
262
|
+
|
|
263
|
+
### Code Refactoring
|
|
264
|
+
|
|
265
|
+
- **headless:** remove attached restoringAssetsAtom ([#3639](https://github.com/ExodusMovement/exodus-hydra/issues/3639)) ([d541956](https://github.com/ExodusMovement/exodus-hydra/commit/d541956e9d28cbcc1689a39ed45caaffabf6ce4c))
|
|
266
|
+
|
|
267
|
+
## [2.0.0-alpha.113](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.112...@exodus/headless@2.0.0-alpha.113) (2023-08-25)
|
|
268
|
+
|
|
269
|
+
### ⚠ BREAKING CHANGES
|
|
270
|
+
|
|
271
|
+
- emit rates from plugin (#3572)
|
|
272
|
+
|
|
273
|
+
### Features
|
|
274
|
+
|
|
275
|
+
- emit rates from plugin ([#3572](https://github.com/ExodusMovement/exodus-hydra/issues/3572)) ([ae25681](https://github.com/ExodusMovement/exodus-hydra/commit/ae25681940138927581efe32740125571f9a71ae))
|
|
276
|
+
|
|
277
|
+
## [2.0.0-alpha.112](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.111...@exodus/headless@2.0.0-alpha.112) (2023-08-25)
|
|
278
|
+
|
|
279
|
+
### Features
|
|
280
|
+
|
|
281
|
+
- update config preprocessor ([#3621](https://github.com/ExodusMovement/exodus-hydra/issues/3621)) ([6b1ba7a](https://github.com/ExodusMovement/exodus-hydra/commit/6b1ba7a8a6b2436b8561d5a346de87229ae8826e))
|
|
282
|
+
|
|
283
|
+
## [2.0.0-alpha.111](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.110...@exodus/headless@2.0.0-alpha.111) (2023-08-23)
|
|
284
|
+
|
|
285
|
+
**Note:** Version bump only for package @exodus/headless
|
|
286
|
+
|
|
287
|
+
## [2.0.0-alpha.110](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.109...@exodus/headless@2.0.0-alpha.110) (2023-08-23)
|
|
288
|
+
|
|
289
|
+
### Features
|
|
290
|
+
|
|
291
|
+
- add restartAutoLockTimer to wallet api ([#3552](https://github.com/ExodusMovement/exodus-hydra/issues/3552)) ([0de829d](https://github.com/ExodusMovement/exodus-hydra/commit/0de829d4ff321ed7cd340f9a6c16567a6f1bc74f))
|
|
292
|
+
|
|
293
|
+
## [2.0.0-alpha.109](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.108...@exodus/headless@2.0.0-alpha.109) (2023-08-22)
|
|
294
|
+
|
|
295
|
+
### Features
|
|
296
|
+
|
|
297
|
+
- update rates-monitor in headless ([#3510](https://github.com/ExodusMovement/exodus-hydra/issues/3510)) ([21fc5b9](https://github.com/ExodusMovement/exodus-hydra/commit/21fc5b9550152701d42573b9c9dec615db6a7d33))
|
|
298
|
+
|
|
299
|
+
## [2.0.0-alpha.108](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.107...@exodus/headless@2.0.0-alpha.108) (2023-08-21)
|
|
300
|
+
|
|
301
|
+
### ⚠ BREAKING CHANGES
|
|
302
|
+
|
|
303
|
+
- balances.load (#3383)
|
|
304
|
+
|
|
305
|
+
### Features
|
|
306
|
+
|
|
307
|
+
- balances.load ([#3383](https://github.com/ExodusMovement/exodus-hydra/issues/3383)) ([754179f](https://github.com/ExodusMovement/exodus-hydra/commit/754179f65713afc19490240702aa0fee18047073))
|
|
308
|
+
|
|
309
|
+
## [2.0.0-alpha.107](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.106...@exodus/headless@2.0.0-alpha.107) (2023-08-17)
|
|
310
|
+
|
|
311
|
+
**Note:** Version bump only for package @exodus/headless
|
|
312
|
+
|
|
313
|
+
## [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)
|
|
314
|
+
|
|
315
|
+
### Features
|
|
316
|
+
|
|
317
|
+
- improve error from plugin ([#3398](https://github.com/ExodusMovement/exodus-hydra/issues/3398)) ([22371a3](https://github.com/ExodusMovement/exodus-hydra/commit/22371a3166ee55fe4c8ff68bd2b9d0b5918e3671))
|
|
318
|
+
- 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))
|
|
319
|
+
|
|
320
|
+
### Bug Fixes
|
|
321
|
+
|
|
322
|
+
- **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))
|
|
323
|
+
|
|
324
|
+
## [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)
|
|
325
|
+
|
|
326
|
+
### ⚠ BREAKING CHANGES
|
|
327
|
+
|
|
328
|
+
- change ui config data structure (#3294)
|
|
329
|
+
|
|
330
|
+
### Features
|
|
331
|
+
|
|
332
|
+
- change ui config data structure ([#3294](https://github.com/ExodusMovement/exodus-hydra/issues/3294)) ([eaceb99](https://github.com/ExodusMovement/exodus-hydra/commit/eaceb99ad4310255ff70769435f16f2daa43ce5a))
|
|
333
|
+
|
|
334
|
+
## [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)
|
|
335
|
+
|
|
336
|
+
### Bug Fixes
|
|
337
|
+
|
|
338
|
+
- don't require fusionKeysDeferred in migration logic ([#3298](https://github.com/ExodusMovement/exodus-hydra/issues/3298)) ([fef851d](https://github.com/ExodusMovement/exodus-hydra/commit/fef851dd4b806cb855a7fffedfce3651f8aecb61))
|
|
339
|
+
|
|
340
|
+
## [2.0.0-alpha.103](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.102...@exodus/headless@2.0.0-alpha.103) (2023-08-09)
|
|
341
|
+
|
|
342
|
+
### Features
|
|
343
|
+
|
|
344
|
+
- **headless:** attach migrations ([#3279](https://github.com/ExodusMovement/exodus-hydra/issues/3279)) ([4f78909](https://github.com/ExodusMovement/exodus-hydra/commit/4f78909223b6517855f12ea31ee5976cdf8a3513))
|
|
345
|
+
|
|
346
|
+
## [2.0.0-alpha.102](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.101...@exodus/headless@2.0.0-alpha.102) (2023-08-09)
|
|
347
|
+
|
|
348
|
+
### ⚠ BREAKING CHANGES
|
|
349
|
+
|
|
350
|
+
- deserialize address provider apis (#3265)
|
|
351
|
+
|
|
352
|
+
### Features
|
|
353
|
+
|
|
354
|
+
- deserialize address provider apis ([#3265](https://github.com/ExodusMovement/exodus-hydra/issues/3265)) ([db894e9](https://github.com/ExodusMovement/exodus-hydra/commit/db894e92c8f16ebd1278a56b353f1dc7a1c06b59))
|
|
355
|
+
|
|
356
|
+
## [2.0.0-alpha.101](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.100...@exodus/headless@2.0.0-alpha.101) (2023-08-09)
|
|
357
|
+
|
|
358
|
+
### Features
|
|
359
|
+
|
|
360
|
+
- bump enabled-assets ([#3250](https://github.com/ExodusMovement/exodus-hydra/issues/3250)) ([26b2ea8](https://github.com/ExodusMovement/exodus-hydra/commit/26b2ea896470506b7af310564c1d1516db521e56))
|
|
361
|
+
|
|
362
|
+
## [2.0.0-alpha.100](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.99...@exodus/headless@2.0.0-alpha.100) (2023-08-09)
|
|
363
|
+
|
|
364
|
+
### ⚠ BREAKING CHANGES
|
|
365
|
+
|
|
366
|
+
- add stop lifecycle hook (#3251)
|
|
367
|
+
|
|
368
|
+
### Features
|
|
369
|
+
|
|
370
|
+
- add stop lifecycle hook ([#3251](https://github.com/ExodusMovement/exodus-hydra/issues/3251)) ([e713074](https://github.com/ExodusMovement/exodus-hydra/commit/e7130744f557087aa5ae65bddc2f0bea63f6c1e3))
|
|
371
|
+
|
|
6
372
|
## [2.0.0-alpha.99](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.98...@exodus/headless@2.0.0-alpha.99) (2023-08-08)
|
|
7
373
|
|
|
8
374
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -195,9 +195,21 @@ An object with additional configuration options for the Exodus instance.
|
|
|
195
195
|
|
|
196
196
|
Currently not used.
|
|
197
197
|
|
|
198
|
+
## Debugging
|
|
199
|
+
|
|
200
|
+
Some features expose APIs for easy debugging, troubleshooting, and PR testing. You can access these APIs under exodus.debug. To enable them, simply pass debug: true to the headless factory function:
|
|
201
|
+
|
|
202
|
+
```js
|
|
203
|
+
import createExodus from '@exodus/headless'
|
|
204
|
+
|
|
205
|
+
const exodusContainer = createExodus({ port, adapters, config, debug: true })
|
|
206
|
+
|
|
207
|
+
exodusContainer.debug.geolocation.merge({ countryCode: 'US' })
|
|
208
|
+
```
|
|
209
|
+
|
|
198
210
|
## Headless API
|
|
199
211
|
|
|
200
|
-
|
|
212
|
+
### wallet
|
|
201
213
|
|
|
202
214
|
> Type: object
|
|
203
215
|
|
|
@@ -217,7 +229,7 @@ Currently not used.
|
|
|
217
229
|
| unload | `async () => void` | Unloads UI by rehydratating data through port (`BE Only`) |
|
|
218
230
|
| changeLockTimer | `async ({ ttl: number }) => void` | Change auto unlock ttl (`BE Only`) |
|
|
219
231
|
|
|
220
|
-
|
|
232
|
+
### isMnemonicValid
|
|
221
233
|
|
|
222
234
|
> Type: function
|
|
223
235
|
|
|
@@ -228,7 +240,7 @@ Currently not used.
|
|
|
228
240
|
|
|
229
241
|
**Returns**: `boolean`
|
|
230
242
|
|
|
231
|
-
|
|
243
|
+
### walletAccounts
|
|
232
244
|
|
|
233
245
|
> Type: object
|
|
234
246
|
|
|
@@ -240,7 +252,7 @@ Currently not used.
|
|
|
240
252
|
| disable | `async (name) => void` | Disables an existing WalletAccount. |
|
|
241
253
|
| getEnabled | `async () => object` | Returns enabled walletAccounts as `{ [name]: WalletAccount }`. |
|
|
242
254
|
|
|
243
|
-
|
|
255
|
+
### blockchainMetadata
|
|
244
256
|
|
|
245
257
|
> Type: object
|
|
246
258
|
|
|
@@ -258,7 +270,7 @@ Currently not used.
|
|
|
258
270
|
| removeAccountState | `async ({ assetName: string, walletAccount: string }) => void` | Remove accountState for AssetSource. |
|
|
259
271
|
| batch | `() => Batch` | Create a batch of updates. See [blockchainMetadata](../blockchain-metadata) README for batching details. |
|
|
260
272
|
|
|
261
|
-
|
|
273
|
+
### assets
|
|
262
274
|
|
|
263
275
|
> Type: object
|
|
264
276
|
|
|
@@ -268,7 +280,7 @@ Currently not used.
|
|
|
268
280
|
| disable | `async (assetNames: string[]) => void` | Disables assets. |
|
|
269
281
|
| addAndEnableToken | `async (assetId: string, baseAssetName: string) => string` | Adds and enables a custom token. Returns the created `asset`'s `.name` |
|
|
270
282
|
|
|
271
|
-
|
|
283
|
+
### locale
|
|
272
284
|
|
|
273
285
|
> Type: object
|
|
274
286
|
|
|
@@ -277,7 +289,7 @@ Currently not used.
|
|
|
277
289
|
| setCurrency | `async (currency: string) => void` | Changes current currency. |
|
|
278
290
|
| setLanguage | `async (language: string) => void` | Changes current language. |
|
|
279
291
|
|
|
280
|
-
|
|
292
|
+
### subscribe
|
|
281
293
|
|
|
282
294
|
> Type: function
|
|
283
295
|
|
|
@@ -285,3 +297,14 @@ Currently not used.
|
|
|
285
297
|
| ----------- | ------------------------------------------ | ------------------------------------------ |
|
|
286
298
|
| subscribe | `({ type: string, payload: any }) => void` | Subscribe to receive events. |
|
|
287
299
|
| unsubscribe | `({ type: string, payload: any }) => void` | Unsubscribe handler from receiving events. |
|
|
300
|
+
|
|
301
|
+
### featureFlags
|
|
302
|
+
|
|
303
|
+
> Type: object
|
|
304
|
+
|
|
305
|
+
| Method | Type | Description |
|
|
306
|
+
| ------- | ------------------------------------- | -------------------------------------- |
|
|
307
|
+
| enable | `async (featureName: string) => void` | Enables a feature-flag gated feature. |
|
|
308
|
+
| disable | `async (featureName: string) => void` | Disables a feature-flag gated feature. |
|
|
309
|
+
|
|
310
|
+
See [more details](../../features/feature-flags/).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/headless",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "The platform-agnostic Exodus wallet SDK",
|
|
5
5
|
"author": "Exodus Movement Inc.",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -23,64 +23,73 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"lint": "eslint . --ignore-path ../../.gitignore",
|
|
25
25
|
"lint:fix": "yarn lint --fix",
|
|
26
|
-
"test": "jest
|
|
26
|
+
"test": "NODE_OPTIONS=--max-old-space-size=4096 jest"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@exodus/address-provider": "^
|
|
30
|
-
"@exodus/
|
|
31
|
-
"@exodus/
|
|
32
|
-
"@exodus/
|
|
33
|
-
"@exodus/
|
|
29
|
+
"@exodus/address-provider": "^9.0.1",
|
|
30
|
+
"@exodus/assets-feature": "^4.0.1",
|
|
31
|
+
"@exodus/atoms": "^7.0.0",
|
|
32
|
+
"@exodus/auto-enable-assets-plugin": "^4.4.0",
|
|
33
|
+
"@exodus/available-assets": "^8.0.0",
|
|
34
|
+
"@exodus/balances": "^12.0.1",
|
|
34
35
|
"@exodus/basic-utils": "^2.0.0",
|
|
35
|
-
"@exodus/blockchain-metadata": "^
|
|
36
|
-
"@exodus/dependency-injection": "^2.0
|
|
37
|
-
"@exodus/dependency-preprocessors": "^
|
|
38
|
-
"@exodus/enabled-assets": "^
|
|
39
|
-
"@exodus/feature-flags": "^
|
|
40
|
-
"@exodus/fee-monitors": "^
|
|
36
|
+
"@exodus/blockchain-metadata": "^15.0.0",
|
|
37
|
+
"@exodus/dependency-injection": "^2.1.0",
|
|
38
|
+
"@exodus/dependency-preprocessors": "^4.1.0",
|
|
39
|
+
"@exodus/enabled-assets": "^9.0.1",
|
|
40
|
+
"@exodus/feature-flags": "^5.1.0",
|
|
41
|
+
"@exodus/fee-data-monitors": "^3.0.0",
|
|
41
42
|
"@exodus/fetch": "^1.2.1",
|
|
42
|
-
"@exodus/
|
|
43
|
-
"@exodus/
|
|
44
|
-
"@exodus/
|
|
45
|
-
"@exodus/
|
|
46
|
-
"@exodus/
|
|
43
|
+
"@exodus/filesystem": "^1.1.0",
|
|
44
|
+
"@exodus/geolocation": "^3.1.0",
|
|
45
|
+
"@exodus/hd-key-slip-10": "^2.0.0",
|
|
46
|
+
"@exodus/key-identifier-provider": "^1.4.0",
|
|
47
|
+
"@exodus/keychain": "^4.3.0",
|
|
48
|
+
"@exodus/locale": "^2.0.2",
|
|
49
|
+
"@exodus/module": "^1.2.2",
|
|
47
50
|
"@exodus/pricing": "^1.1.0",
|
|
48
|
-
"@exodus/
|
|
49
|
-
"@exodus/
|
|
50
|
-
"@exodus/
|
|
51
|
-
"@exodus/
|
|
52
|
-
"@exodus/
|
|
53
|
-
"@exodus/
|
|
51
|
+
"@exodus/public-key-store": "^1.2.0",
|
|
52
|
+
"@exodus/rates-monitor": "^4.0.2",
|
|
53
|
+
"@exodus/remote-config": "^2.3.0",
|
|
54
|
+
"@exodus/restore-progress-tracker": "^3.0.0",
|
|
55
|
+
"@exodus/sodium-crypto": "^3.2.0",
|
|
56
|
+
"@exodus/startup-counter": "^1.0.0",
|
|
57
|
+
"@exodus/tx-signer": "^1.1.0",
|
|
58
|
+
"@exodus/wallet": "^10.3.0",
|
|
59
|
+
"@exodus/wallet-accounts": "^15.0.0",
|
|
60
|
+
"@exodus/wallet-compatibility-modes": "^3.2.0",
|
|
54
61
|
"bip39": "^2.6.0",
|
|
55
62
|
"events": "^3.3.0",
|
|
56
63
|
"lodash": "npm:@exodus/lodash@^4.17.21-exodus.2",
|
|
57
64
|
"minimalistic-assert": "^1.0.1"
|
|
58
65
|
},
|
|
59
66
|
"devDependencies": {
|
|
60
|
-
"@exodus/ab-testing": "^
|
|
67
|
+
"@exodus/ab-testing": "^7.1.0",
|
|
61
68
|
"@exodus/algorand-lib": "^2.0.1",
|
|
62
69
|
"@exodus/algorand-meta": "^1.1.4",
|
|
63
|
-
"@exodus/apy-rates": "^3.
|
|
64
|
-
"@exodus/
|
|
65
|
-
"@exodus/bitcoin-
|
|
66
|
-
"@exodus/connected-origins": "^3.
|
|
67
|
-
"@exodus/crypto-news-monitor": "^
|
|
70
|
+
"@exodus/apy-rates": "^3.3.1",
|
|
71
|
+
"@exodus/assets-feature": "workspace:^",
|
|
72
|
+
"@exodus/bitcoin-plugin": "^1.0.14",
|
|
73
|
+
"@exodus/connected-origins": "^3.3.0",
|
|
74
|
+
"@exodus/crypto-news-monitor": "^4.1.0",
|
|
68
75
|
"@exodus/currency": "^2.2.0",
|
|
69
|
-
"@exodus/ethereum-lib": "^
|
|
76
|
+
"@exodus/ethereum-lib": "^3.3.34",
|
|
70
77
|
"@exodus/ethereum-meta": "^1.0.23",
|
|
71
78
|
"@exodus/exodus-pricing-client": "^1.2.0",
|
|
72
|
-
"@exodus/
|
|
73
|
-
"@exodus/
|
|
74
|
-
"@exodus/
|
|
75
|
-
"@exodus/
|
|
76
|
-
"@exodus/
|
|
77
|
-
"@exodus/
|
|
79
|
+
"@exodus/key-utils": "^3.0.0",
|
|
80
|
+
"@exodus/kyc": "^4.2.0",
|
|
81
|
+
"@exodus/litecoin-meta": "^1.0.0",
|
|
82
|
+
"@exodus/market-history": "^7.2.0",
|
|
83
|
+
"@exodus/models": "^10.1.0",
|
|
84
|
+
"@exodus/nfts": "^7.1.4",
|
|
85
|
+
"@exodus/personal-notes": "^3.6.0",
|
|
86
|
+
"@exodus/referrals": "^8.0.1",
|
|
78
87
|
"@exodus/solana-lib": "^1.3.11",
|
|
79
88
|
"@exodus/solana-meta": "^1.0.2",
|
|
80
89
|
"@exodus/storage-encrypted": "^1.1.2",
|
|
81
|
-
"@exodus/storage-memory": "^2.1.
|
|
82
|
-
"@exodus/top-movers-monitor": "^3.
|
|
83
|
-
"@exodus/ui-config": "^
|
|
90
|
+
"@exodus/storage-memory": "^2.1.1",
|
|
91
|
+
"@exodus/top-movers-monitor": "^3.2.0",
|
|
92
|
+
"@exodus/ui-config": "^3.3.0",
|
|
84
93
|
"@exodus/wild-emitter": "^1.0.0",
|
|
85
94
|
"buffer-json": "^2.0.0",
|
|
86
95
|
"deepmerge": "^4.2.2",
|
|
@@ -89,8 +98,8 @@
|
|
|
89
98
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
90
99
|
"events": "^3.3.0",
|
|
91
100
|
"jest": "^29.1.2",
|
|
92
|
-
"
|
|
101
|
+
"msw": "^2.0.0",
|
|
93
102
|
"p-defer": "^4.0.0"
|
|
94
103
|
},
|
|
95
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "19a9d0cdb9f2b1a8dd9b1b4802f95bfafcd46c60"
|
|
96
105
|
}
|
package/src/api/debug.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const createApi = ({ ioc, port, debug }) => {
|
|
2
|
+
if (!debug) return {}
|
|
3
|
+
|
|
4
|
+
const apis = ioc.getByType('debug')
|
|
5
|
+
|
|
6
|
+
const { unsafeStorage } = ioc.getByType('adapter')
|
|
7
|
+
|
|
8
|
+
const clear = async () => {
|
|
9
|
+
await unsafeStorage.namespace('debug').clear()
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const restart = async () => {
|
|
13
|
+
port.emit('restart', { reason: 'debug' })
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
debug: Object.assign({}, ...Object.values(apis), { clear, restart }),
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default createApi
|
|
@@ -1,26 +1,18 @@
|
|
|
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 }) => {
|
|
6
|
+
const createApi = ({ ioc, port, config, debug }) => {
|
|
6
7
|
const apis = ioc.getByType('api')
|
|
7
|
-
const { remoteConfig } = ioc.getByType('module')
|
|
8
|
-
const { feeMonitors, nftsMonitor } = ioc.getByType('monitor')
|
|
9
|
-
|
|
10
|
-
// TODO: do this on 'unload'
|
|
11
|
-
const stop = () => {
|
|
12
|
-
remoteConfig.stop()
|
|
13
|
-
feeMonitors.stop()
|
|
14
|
-
nftsMonitor?.stop()
|
|
15
|
-
}
|
|
16
8
|
|
|
17
9
|
return {
|
|
18
10
|
...Object.assign({}, ...Object.values(apis)),
|
|
19
|
-
...
|
|
11
|
+
...createDebug({ ioc, port, debug }),
|
|
12
|
+
...createReporting({ ioc, config }),
|
|
20
13
|
isMnemonicValid,
|
|
21
14
|
subscribe: port.subscribe.bind(port),
|
|
22
15
|
unsubscribe: port.unsubscribe.bind(port),
|
|
23
|
-
stop,
|
|
24
16
|
}
|
|
25
17
|
}
|
|
26
18
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { zipObject } from 'lodash'
|
|
2
|
+
|
|
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')
|
|
9
|
+
|
|
10
|
+
const getReports = async () => {
|
|
11
|
+
if (await lockedAtom.get()) throw new Error('Unable to export when locked')
|
|
12
|
+
|
|
13
|
+
const reports = Object.values(nodes)
|
|
14
|
+
|
|
15
|
+
const timeoutPromise = rejectAfter(
|
|
16
|
+
exportTimeout,
|
|
17
|
+
`Export took longer than the maximum export timeout of ${Math.ceil(exportTimeout / 1000)}s`
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
const resolvedReports = await Promise.allSettled(
|
|
21
|
+
reports.map((report) => Promise.race([report.export(), timeoutPromise]))
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
const namespaces = reports.map((report) => report.namespace)
|
|
25
|
+
const data = resolvedReports.map((outcome) =>
|
|
26
|
+
outcome.status === 'fulfilled' ? outcome.value : { error: outcome.reason }
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
return zipObject(namespaces, data)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
reporting: {
|
|
34
|
+
export: getReports,
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default createReporting
|
package/src/application.js
CHANGED
|
@@ -21,6 +21,14 @@ const RESTORE_FLAG = 'restoreFlag'
|
|
|
21
21
|
|
|
22
22
|
const HOOKS = new Set(Object.values(Hook))
|
|
23
23
|
|
|
24
|
+
const passphraseCachePlaceholder = {
|
|
25
|
+
get: () => {},
|
|
26
|
+
set: () => {},
|
|
27
|
+
changeTtl: () => {},
|
|
28
|
+
clear: () => {},
|
|
29
|
+
scheduleClear: () => {},
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
class Application extends ExodusModule {
|
|
25
33
|
#hooks = {}
|
|
26
34
|
#wallet = null
|
|
@@ -29,7 +37,7 @@ class Application extends ExodusModule {
|
|
|
29
37
|
#applicationStarted = null
|
|
30
38
|
#resolveStart = null
|
|
31
39
|
|
|
32
|
-
constructor({ wallet, unsafeStorage, passphraseCache, logger }) {
|
|
40
|
+
constructor({ wallet, unsafeStorage, passphraseCache = passphraseCachePlaceholder, logger }) {
|
|
33
41
|
super({ name: 'Application', logger })
|
|
34
42
|
|
|
35
43
|
this.#wallet = wallet
|
|
@@ -56,7 +64,7 @@ class Application extends ExodusModule {
|
|
|
56
64
|
const walletExists = await this.#wallet.exists()
|
|
57
65
|
|
|
58
66
|
if (isImporting || !walletExists) {
|
|
59
|
-
await this.fire(Hook.Clear)
|
|
67
|
+
await this.fire(Hook.Clear, null, { concurrent: true })
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
if (isImporting) await this.fire(Hook.Import)
|
|
@@ -103,6 +111,7 @@ class Application extends ExodusModule {
|
|
|
103
111
|
isRestoring,
|
|
104
112
|
})
|
|
105
113
|
}
|
|
114
|
+
|
|
106
115
|
unload = async () => {
|
|
107
116
|
await this.#applicationStarted
|
|
108
117
|
await this.#passphraseCache.scheduleClear()
|
|
@@ -119,19 +128,28 @@ class Application extends ExodusModule {
|
|
|
119
128
|
this.#hooks[hookName].push(listener)
|
|
120
129
|
}
|
|
121
130
|
|
|
122
|
-
fire = async (hookName, params) => {
|
|
131
|
+
fire = async (hookName, params, { concurrent } = {}) => {
|
|
123
132
|
assert(HOOKS.has(hookName), `no such hook: ${hookName}`)
|
|
124
|
-
|
|
133
|
+
|
|
134
|
+
this._logger.debug(`firing hooks ${concurrent ? 'concurrently' : 'sequentially'}`, hookName)
|
|
125
135
|
|
|
126
136
|
const hooks = this.#hooks[hookName] || []
|
|
127
137
|
|
|
128
|
-
|
|
138
|
+
const hookFns = hooks.map((hook) => async () => {
|
|
129
139
|
try {
|
|
130
|
-
await
|
|
140
|
+
await hook(params)
|
|
131
141
|
} catch (err) {
|
|
132
|
-
this._logger.error(`application lifecycle hook failed: ${hookName}`,
|
|
142
|
+
this._logger.error(`application lifecycle hook failed: ${hookName}`, hook.name, params, err)
|
|
133
143
|
throw err
|
|
134
144
|
}
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
if (concurrent) {
|
|
148
|
+
await Promise.allSettled(hookFns.map((promise) => promise()))
|
|
149
|
+
} else {
|
|
150
|
+
for (let i = 0; i < hookFns.length; i++) {
|
|
151
|
+
await hookFns[i]()
|
|
152
|
+
}
|
|
135
153
|
}
|
|
136
154
|
|
|
137
155
|
this.emit(hookName, params)
|
|
@@ -166,6 +184,7 @@ class Application extends ExodusModule {
|
|
|
166
184
|
const { forceRestart, forgotPassphrase, ...wallet } = opts
|
|
167
185
|
|
|
168
186
|
await this.#wallet.import(wallet)
|
|
187
|
+
await this.fire(Hook.Backup)
|
|
169
188
|
|
|
170
189
|
if (forceRestart || walletExists) {
|
|
171
190
|
await this.#storage.set(IMPORT_FLAG, true)
|
|
@@ -202,13 +221,17 @@ class Application extends ExodusModule {
|
|
|
202
221
|
if (isRestoring) {
|
|
203
222
|
await this.fire(Hook.Restore)
|
|
204
223
|
await this.#storage.delete(RESTORE_FLAG)
|
|
205
|
-
await this.setBackedUp()
|
|
206
224
|
await this.fire(Hook.RestoreCompleted)
|
|
207
225
|
}
|
|
208
226
|
|
|
209
227
|
this.fire(Hook.AssetsSynced)
|
|
210
228
|
}
|
|
211
229
|
|
|
230
|
+
restore = async () => {
|
|
231
|
+
await this.#storage.set(RESTORE_FLAG, true)
|
|
232
|
+
await this.restoreIfNeeded()
|
|
233
|
+
}
|
|
234
|
+
|
|
212
235
|
#autoUnlock = async () => {
|
|
213
236
|
const walletLocked = await this.#wallet.isLocked()
|
|
214
237
|
const passphrase = await this.#passphraseCache.get()
|
|
@@ -263,10 +286,18 @@ class Application extends ExodusModule {
|
|
|
263
286
|
await this.fire(Hook.Restart, { reason: 'delete', forgotPassphrase })
|
|
264
287
|
}
|
|
265
288
|
|
|
289
|
+
stop = async () => {
|
|
290
|
+
await this.fire(Hook.Stop)
|
|
291
|
+
}
|
|
292
|
+
|
|
266
293
|
changeLockTimer = async ({ ttl }) => {
|
|
267
294
|
await this.#passphraseCache.changeTtl(ttl)
|
|
268
295
|
}
|
|
269
296
|
|
|
297
|
+
restartAutoLockTimer = async () => {
|
|
298
|
+
await this.#passphraseCache.scheduleClear()
|
|
299
|
+
}
|
|
300
|
+
|
|
270
301
|
isRestoring = async () => {
|
|
271
302
|
return this.#storage.get(RESTORE_FLAG)
|
|
272
303
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { combine, compute } from '@exodus/atoms'
|
|
1
|
+
import { combine, compute, dedupe } from '@exodus/atoms'
|
|
2
2
|
import { uniq } from 'lodash'
|
|
3
3
|
|
|
4
4
|
const getNetworks = (assetNames, assets) =>
|
|
@@ -19,14 +19,16 @@ const createBaseAssetNamesToMonitorAtom = ({
|
|
|
19
19
|
return getNetworks(assetNames, assetsModule.getAssets())
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
return dedupe(
|
|
23
|
+
compute({
|
|
24
|
+
atom: combine({
|
|
25
|
+
isRestore: restoreAtom,
|
|
26
|
+
enabledAssets: enabledAssetsAtom,
|
|
27
|
+
availableAssetNames: availableAssetNamesAtom,
|
|
28
|
+
}),
|
|
29
|
+
selector,
|
|
30
|
+
})
|
|
31
|
+
)
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
// eslint-disable-next-line @exodus/export-default/named
|
package/src/constants.js
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
export const atomsToAttach = [
|
|
2
|
-
'abTestingAtom',
|
|
3
|
-
'apyRatesAtom',
|
|
4
|
-
'availableAssetNamesAtom',
|
|
5
|
-
'balancesAtom',
|
|
6
|
-
'connectedOriginsAtom',
|
|
7
|
-
'cryptoNewsAtom',
|
|
8
|
-
'currencyAtom',
|
|
9
|
-
'enabledWalletAccountsAtom',
|
|
10
|
-
'featureFlagsAtom',
|
|
11
|
-
'geolocationAtom',
|
|
12
|
-
'kycAtom',
|
|
13
|
-
'languageAtom',
|
|
14
|
-
'nftsConfigAtom',
|
|
15
|
-
'personalNotesAtom',
|
|
16
|
-
'referralsAtom',
|
|
17
|
-
'topMoversAtom',
|
|
18
|
-
'walletAccountsAtom',
|
|
19
|
-
'restoringAssetsAtom',
|
|
20
|
-
]
|
|
21
|
-
|
|
22
1
|
export const LifecycleHook = Object.freeze({
|
|
23
2
|
Lock: 'lock',
|
|
24
3
|
Unlock: 'unlock',
|
|
@@ -26,6 +5,7 @@ export const LifecycleHook = Object.freeze({
|
|
|
26
5
|
Import: 'import',
|
|
27
6
|
Migrate: 'migrate',
|
|
28
7
|
Start: 'start',
|
|
8
|
+
Stop: 'stop',
|
|
29
9
|
Restart: 'restart',
|
|
30
10
|
Load: 'load',
|
|
31
11
|
Unload: 'unload',
|
|
@@ -11,13 +11,10 @@ import createPluginDependencies from './plugins'
|
|
|
11
11
|
import { wrapConstant } from './utils'
|
|
12
12
|
|
|
13
13
|
const adapterKeys = [
|
|
14
|
-
// ...
|
|
15
|
-
'assetsModule',
|
|
16
14
|
'createLogger',
|
|
17
15
|
'legacyPrivToPub',
|
|
18
16
|
'seedStorage',
|
|
19
17
|
'unsafeStorage',
|
|
20
|
-
'fusion',
|
|
21
18
|
'fetch',
|
|
22
19
|
'freeze',
|
|
23
20
|
]
|
|
@@ -11,7 +11,7 @@ const createModuleDependencies = ({ config }) =>
|
|
|
11
11
|
definition: {
|
|
12
12
|
id: 'application',
|
|
13
13
|
factory: createApplication,
|
|
14
|
-
dependencies: ['unsafeStorage', 'passphraseCache', 'wallet', 'logger'],
|
|
14
|
+
dependencies: ['unsafeStorage', 'passphraseCache?', 'wallet', 'logger'],
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -23,6 +23,8 @@ const createModuleDependencies = ({ config }) =>
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
definition: walletCompatibilityModesDefinition,
|
|
26
|
+
storage: { namespace: 'walletCompatibilityModes' },
|
|
27
|
+
aliases: [{ implementationId: 'unsafeStorage', interfaceId: 'storage' }],
|
|
26
28
|
},
|
|
27
29
|
{ definition: unlockEncryptedStorageDefinition },
|
|
28
30
|
].map(withType('module'))
|
package/src/index.js
CHANGED
|
@@ -1,58 +1,70 @@
|
|
|
1
1
|
import addressProvider from '@exodus/address-provider'
|
|
2
|
+
import assetsFeature from '@exodus/assets-feature'
|
|
2
3
|
import availableAssets from '@exodus/available-assets'
|
|
3
4
|
import balances from '@exodus/balances'
|
|
4
|
-
import { pick } from '@exodus/basic-utils'
|
|
5
5
|
import blockchainMetadata from '@exodus/blockchain-metadata'
|
|
6
6
|
import enabledAssets from '@exodus/enabled-assets'
|
|
7
7
|
import featureFlags from '@exodus/feature-flags'
|
|
8
|
-
import fees from '@exodus/fee-monitors'
|
|
8
|
+
import fees from '@exodus/fee-data-monitors'
|
|
9
|
+
import filesystem from '@exodus/filesystem'
|
|
9
10
|
import geolocation from '@exodus/geolocation'
|
|
10
11
|
import keychain from '@exodus/keychain'
|
|
11
12
|
import locale from '@exodus/locale'
|
|
12
13
|
import pricing from '@exodus/pricing'
|
|
14
|
+
import publicKeyStore from '@exodus/public-key-store'
|
|
13
15
|
import rates from '@exodus/rates-monitor'
|
|
14
16
|
import remoteConfig from '@exodus/remote-config'
|
|
15
17
|
import restoreProgressTracker from '@exodus/restore-progress-tracker'
|
|
18
|
+
import startupCounter from '@exodus/startup-counter'
|
|
19
|
+
import transactionSigner from '@exodus/tx-signer'
|
|
16
20
|
import wallet from '@exodus/wallet'
|
|
17
21
|
import walletAccounts from '@exodus/wallet-accounts'
|
|
18
22
|
|
|
19
23
|
import createApi from './api'
|
|
20
|
-
import attachAtoms from './atoms/attach'
|
|
21
|
-
import { atomsToAttach } from './constants'
|
|
22
24
|
import createIOC from './ioc'
|
|
25
|
+
import attachMigrations from './migrations/attach'
|
|
23
26
|
import attachPlugins from './plugins/attach'
|
|
24
27
|
|
|
25
|
-
const createExodus = ({ adapters, config, port }) => {
|
|
26
|
-
const ioc = createIOC({ adapters, config })
|
|
28
|
+
const createExodus = ({ adapters, config, port, debug = false }) => {
|
|
29
|
+
const ioc = createIOC({ adapters, config, debug })
|
|
27
30
|
|
|
28
|
-
ioc.use(
|
|
29
|
-
ioc.use(
|
|
30
|
-
ioc.use(walletAccounts())
|
|
31
|
-
ioc.use(blockchainMetadata())
|
|
31
|
+
ioc.use(addressProvider({ config: config.addressProvider }))
|
|
32
|
+
ioc.use(assetsFeature())
|
|
32
33
|
ioc.use(availableAssets())
|
|
34
|
+
ioc.use(balances(config.balances))
|
|
35
|
+
ioc.use(blockchainMetadata())
|
|
33
36
|
ioc.use(enabledAssets())
|
|
34
|
-
ioc.use(
|
|
35
|
-
ioc.use(
|
|
37
|
+
ioc.use(featureFlags())
|
|
38
|
+
ioc.use(fees())
|
|
39
|
+
ioc.use(filesystem())
|
|
36
40
|
ioc.use(geolocation())
|
|
41
|
+
ioc.use(keychain(config.keychain))
|
|
42
|
+
ioc.use(locale())
|
|
37
43
|
ioc.use(pricing())
|
|
38
|
-
ioc.use(
|
|
44
|
+
ioc.use(publicKeyStore())
|
|
39
45
|
ioc.use(rates())
|
|
40
|
-
ioc.use(
|
|
41
|
-
ioc.use(locale())
|
|
42
|
-
ioc.use(addressProvider({ config: config.addressProvider }))
|
|
46
|
+
ioc.use(remoteConfig())
|
|
43
47
|
ioc.use(restoreProgressTracker())
|
|
48
|
+
ioc.use(startupCounter())
|
|
49
|
+
ioc.use(transactionSigner())
|
|
50
|
+
ioc.use(wallet())
|
|
51
|
+
ioc.use(walletAccounts())
|
|
44
52
|
|
|
45
53
|
ioc.register({ definition: { id: 'port', type: 'port', factory: () => port } })
|
|
46
54
|
|
|
47
55
|
const resolve = () => {
|
|
48
56
|
ioc.resolve()
|
|
49
57
|
|
|
50
|
-
const {
|
|
58
|
+
const { storage, migrateableStorage } = ioc.getByType('adapter')
|
|
51
59
|
|
|
52
60
|
const { application, wallet, unlockEncryptedStorage } = ioc.getByType('module')
|
|
53
61
|
|
|
62
|
+
const { migrations } = ioc.getAll()
|
|
63
|
+
|
|
54
64
|
application.on('start', (payload) => port.emit('start', payload))
|
|
55
65
|
|
|
66
|
+
application.hook('load', (args) => port.emit('pre-load', args))
|
|
67
|
+
|
|
56
68
|
application.on('load', (args) => port.emit('load', args))
|
|
57
69
|
|
|
58
70
|
application.on('create', async ({ hasPassphraseSet }) => {
|
|
@@ -86,21 +98,21 @@ const createExodus = ({ adapters, config, port }) => {
|
|
|
86
98
|
application.hook('unlock', async () => {
|
|
87
99
|
if (typeof storage.unlock === 'function') unlockEncryptedStorage(storage)
|
|
88
100
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
application.hook('clear', async () => {
|
|
93
|
-
await Promise.all([assetsModule.clear(), fusion.clearStorage()])
|
|
101
|
+
// normally unlocked during migrations, also unlock here just in case
|
|
102
|
+
if (typeof migrateableStorage.unlock === 'function')
|
|
103
|
+
unlockEncryptedStorage(migrateableStorage)
|
|
94
104
|
})
|
|
95
105
|
|
|
96
106
|
application.on('clear', () => port.emit('clear'))
|
|
97
107
|
|
|
98
108
|
application.on('restart', (payload) => port.emit('restart', payload))
|
|
99
109
|
|
|
100
|
-
|
|
101
|
-
|
|
110
|
+
attachMigrations({
|
|
111
|
+
migrations,
|
|
112
|
+
adapters,
|
|
102
113
|
application,
|
|
103
|
-
atoms:
|
|
114
|
+
atoms: ioc.getByType('atom'),
|
|
115
|
+
modules: ioc.getByType('module'),
|
|
104
116
|
})
|
|
105
117
|
|
|
106
118
|
attachPlugins({
|
|
@@ -109,7 +121,7 @@ const createExodus = ({ adapters, config, port }) => {
|
|
|
109
121
|
logger: ioc.get('createLogger')('attachPlugins'),
|
|
110
122
|
})
|
|
111
123
|
|
|
112
|
-
return createApi({ ioc, port })
|
|
124
|
+
return createApi({ ioc, port, config, debug })
|
|
113
125
|
}
|
|
114
126
|
|
|
115
127
|
return { ...ioc, resolve }
|
package/src/ioc.js
CHANGED
|
@@ -1,25 +1,44 @@
|
|
|
1
1
|
import createIocContainer from '@exodus/dependency-injection'
|
|
2
2
|
import preprocess from '@exodus/dependency-preprocessors'
|
|
3
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'
|
|
4
6
|
import devModeAtoms from '@exodus/dependency-preprocessors/src/preprocessors/dev-mode-atoms'
|
|
5
7
|
import logify from '@exodus/dependency-preprocessors/src/preprocessors/logify'
|
|
6
|
-
import namespaceConfig from '@exodus/dependency-preprocessors/src/preprocessors/namespace-config'
|
|
7
8
|
import namespaceStorage from '@exodus/dependency-preprocessors/src/preprocessors/namespace-storage'
|
|
8
9
|
import optional from '@exodus/dependency-preprocessors/src/preprocessors/optional'
|
|
10
|
+
import performanceMonitor from '@exodus/dependency-preprocessors/src/preprocessors/performance-monitor'
|
|
9
11
|
import readOnlyAtoms from '@exodus/dependency-preprocessors/src/preprocessors/read-only-atoms'
|
|
10
12
|
import assert from 'minimalistic-assert'
|
|
11
13
|
|
|
12
14
|
import createDependencies from './dependencies'
|
|
13
15
|
|
|
14
|
-
const createIOC = ({ adapters, config }) => {
|
|
15
|
-
const { createLogger } = adapters
|
|
16
|
-
const {
|
|
16
|
+
const createIOC = ({ adapters, config, debug }) => {
|
|
17
|
+
const { createLogger, unsafeStorage, performance = {} } = adapters
|
|
18
|
+
const {
|
|
19
|
+
readOnlyAtoms: readOnlyAtomsConfig,
|
|
20
|
+
devModeAtoms: devModeAtomsConfig,
|
|
21
|
+
performanceMonitor: performanceMonitorConfig,
|
|
22
|
+
} = config.ioc ?? {}
|
|
17
23
|
|
|
18
24
|
const ioc = createIocContainer({ logger: createLogger('exodus:ioc') })
|
|
19
25
|
|
|
26
|
+
const performanceLogger = createLogger('exodus:performance')
|
|
27
|
+
|
|
20
28
|
const preprocessors = [
|
|
21
29
|
logify({ createLogger }),
|
|
22
|
-
|
|
30
|
+
performanceMonitorConfig?.enabled &&
|
|
31
|
+
performanceMonitor({
|
|
32
|
+
now: performance.now,
|
|
33
|
+
onAboveThreshold:
|
|
34
|
+
performance.onAboveThreshold ??
|
|
35
|
+
(({ id, method, async, duration }) =>
|
|
36
|
+
performanceLogger.log(
|
|
37
|
+
`${id}.${method} ${async ? 'resolved after' : 'took'} ${duration}ms`
|
|
38
|
+
)),
|
|
39
|
+
config: performanceMonitorConfig,
|
|
40
|
+
}),
|
|
41
|
+
configPreprocessor(),
|
|
23
42
|
alias(),
|
|
24
43
|
// NOTE: order matters, this should come after `alias`
|
|
25
44
|
namespaceStorage(),
|
|
@@ -29,8 +48,9 @@ const createIOC = ({ adapters, config }) => {
|
|
|
29
48
|
...readOnlyAtomsConfig,
|
|
30
49
|
}),
|
|
31
50
|
optional(),
|
|
32
|
-
|
|
33
|
-
|
|
51
|
+
devModeAtomsConfig && devModeAtoms(devModeAtomsConfig),
|
|
52
|
+
debuggerPreprocessor({ debug, unsafeStorage }),
|
|
53
|
+
].filter(Boolean)
|
|
34
54
|
|
|
35
55
|
const registerMultiple = (dependencies) => {
|
|
36
56
|
ioc.registerMultiple(preprocess({ dependencies, preprocessors }))
|
|
@@ -40,12 +60,13 @@ const createIOC = ({ adapters, config }) => {
|
|
|
40
60
|
registerMultiple([dependency])
|
|
41
61
|
}
|
|
42
62
|
|
|
43
|
-
const use = (
|
|
44
|
-
for (const { definition } of
|
|
63
|
+
const use = (feature) => {
|
|
64
|
+
for (const { definition } of feature.definitions) {
|
|
45
65
|
assert(definition.type, `ioc.use: "${definition.id}" is missing type field`)
|
|
66
|
+
definition.namespace = feature.id
|
|
46
67
|
}
|
|
47
68
|
|
|
48
|
-
registerMultiple(
|
|
69
|
+
registerMultiple(feature.definitions)
|
|
49
70
|
}
|
|
50
71
|
|
|
51
72
|
registerMultiple(createDependencies({ adapters, config }))
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { deriveSyncKeys } from '../utils/fusion'
|
|
2
|
+
|
|
3
|
+
const attachMigrations = ({ migrations = [], application, modules, adapters, ...deps }) => {
|
|
4
|
+
const { unsafeStorage, migrateableStorage } = adapters
|
|
5
|
+
const { analytics, unlockEncryptedStorage, wallet, fusionKeysDeferred, migrateableFusion } =
|
|
6
|
+
modules
|
|
7
|
+
|
|
8
|
+
// Override encrypted storage with migrations own instance to make sure no modules reads from it before migrations ran
|
|
9
|
+
const migrationFlagsStorage = unsafeStorage.namespace('migrations')
|
|
10
|
+
const migrationAdapters = { ...adapters, storage: migrateableStorage }
|
|
11
|
+
const migrationModules = { ...modules, fusion: migrateableFusion }
|
|
12
|
+
|
|
13
|
+
const attachMigration = async (migration) => {
|
|
14
|
+
const { name, factory } = migration
|
|
15
|
+
const logger = adapters.createLogger(`exodus:migration:${name}`)
|
|
16
|
+
|
|
17
|
+
logger.log('running migration')
|
|
18
|
+
|
|
19
|
+
let success = false
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
const start = performance.now()
|
|
23
|
+
|
|
24
|
+
await factory({ ...deps, adapters: migrationAdapters, modules: migrationModules, logger })
|
|
25
|
+
|
|
26
|
+
const time = performance.now() - start
|
|
27
|
+
|
|
28
|
+
logger.log(`migration successful in ${time.toFixed(2)}ms`)
|
|
29
|
+
|
|
30
|
+
await migrationFlagsStorage.set(name, true)
|
|
31
|
+
|
|
32
|
+
success = true
|
|
33
|
+
} catch (error) {
|
|
34
|
+
logger.log(`migration failed: ${error.stack}`)
|
|
35
|
+
} finally {
|
|
36
|
+
analytics.track({
|
|
37
|
+
event: 'ClientMigrationRun',
|
|
38
|
+
properties: { migrationId: name, success },
|
|
39
|
+
force: true,
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
application.hook('migrate', async () => {
|
|
45
|
+
await unlockEncryptedStorage(migrateableStorage)
|
|
46
|
+
if (fusionKeysDeferred) await deriveSyncKeys(wallet.seed).then(fusionKeysDeferred.resolve)
|
|
47
|
+
|
|
48
|
+
const migrationNames = migrations.map((migration) => migration.name)
|
|
49
|
+
const migrationFlags = await migrationFlagsStorage.batchGet(migrationNames)
|
|
50
|
+
const migrationsDiff = migrations.filter((v, k) => !migrationFlags[k])
|
|
51
|
+
|
|
52
|
+
for (const migration of migrationsDiff) {
|
|
53
|
+
await attachMigration(migration)
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
application.hook('clear', async () => {
|
|
58
|
+
await migrationFlagsStorage.clear()
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default attachMigrations
|
package/src/plugins/attach.js
CHANGED
|
@@ -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
|
-
(
|
|
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
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { pick } from '@exodus/basic-utils'
|
|
2
|
+
import HDKeySlip10 from '@exodus/hd-key-slip-10'
|
|
3
|
+
import sodium from '@exodus/sodium-crypto'
|
|
4
|
+
|
|
5
|
+
const EXODUS_PURPOSE = Number.parseInt(Buffer.from('exo').toString('hex'), '16')
|
|
6
|
+
|
|
7
|
+
const EXO_2_PATH = `m/${EXODUS_PURPOSE}'/2'`
|
|
8
|
+
|
|
9
|
+
const BIP43_PURPOSE_SYNC = `${EXO_2_PATH}/0'`
|
|
10
|
+
|
|
11
|
+
export const deriveSyncKeys = async (seed) => {
|
|
12
|
+
const derived = HDKeySlip10.fromSeed(seed).derive(BIP43_PURPOSE_SYNC).key
|
|
13
|
+
|
|
14
|
+
const keys = await sodium.getSodiumKeysFromSeed(derived)
|
|
15
|
+
|
|
16
|
+
return pick(keys, ['box', 'sign', 'secret', 'derived'])
|
|
17
|
+
}
|
package/src/atoms/attach.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const emitAtomValue = async (opts) => {
|
|
2
|
-
const { port, atomId, atom } = opts
|
|
3
|
-
const value = 'value' in opts ? opts.value : await atom.get()
|
|
4
|
-
port.emit(atomId, value)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const emitFromAtoms = ({ atoms, port }) =>
|
|
8
|
-
Object.entries(atoms).forEach(async ([atomId, atom]) => emitAtomValue({ port, atomId, atom }))
|
|
9
|
-
|
|
10
|
-
const attachAtom = ({ port, application, atom, atomId }) => {
|
|
11
|
-
let loaded = false
|
|
12
|
-
|
|
13
|
-
application.on('load', async () => {
|
|
14
|
-
loaded = true
|
|
15
|
-
await emitAtomValue({ port, atomId, atom })
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
atom.observe((value) => {
|
|
19
|
-
if (loaded) emitAtomValue({ port, atomId, atom, value })
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const attachAtoms = ({ port, application, atoms }) => {
|
|
24
|
-
for (const [atomId, atom] of Object.entries(atoms)) {
|
|
25
|
-
attachAtom({ port, application, atom, atomId })
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default attachAtoms
|
package/src/reporting.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { zipObject } from 'lodash'
|
|
2
|
-
|
|
3
|
-
const createReporting = ({ ioc }) => {
|
|
4
|
-
const getReports = async () => {
|
|
5
|
-
const nodes = ioc.getByType('report')
|
|
6
|
-
const reports = Object.values(nodes)
|
|
7
|
-
|
|
8
|
-
const resolvedReports = await Promise.allSettled(reports.map((report) => report.export()))
|
|
9
|
-
|
|
10
|
-
const namespaces = reports.map((report) => report.namespace)
|
|
11
|
-
const data = resolvedReports.map((outcome) =>
|
|
12
|
-
outcome.status === 'fulfilled' ? outcome.value : { error: outcome.reason }
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
return zipObject(namespaces, data)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
reporting: {
|
|
20
|
-
export: getReports,
|
|
21
|
-
},
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default createReporting
|