@exodus/headless 2.0.0-alpha.99 → 2.0.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 +356 -0
- package/README.md +18 -7
- package/package.json +50 -42
- package/src/api/debug.js +13 -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 +34 -24
- package/src/ioc.js +28 -9
- 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,362 @@
|
|
|
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](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.149...@exodus/headless@2.0.0) (2023-12-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @exodus/headless
|
|
9
|
+
|
|
10
|
+
## [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)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- add debug apis (dev only) ([#4992](https://github.com/ExodusMovement/exodus-hydra/issues/4992)) ([022c0aa](https://github.com/ExodusMovement/exodus-hydra/commit/022c0aabb66bc99243fdeb78e8d8eb47413974c8))
|
|
15
|
+
|
|
16
|
+
## [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)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- add startup-counter feature ([#4870](https://github.com/ExodusMovement/exodus-hydra/issues/4870)) ([e2a1c18](https://github.com/ExodusMovement/exodus-hydra/commit/e2a1c18922de3cddf69fb7840712fc2bfdac687a))
|
|
21
|
+
- allow force restore ([#4953](https://github.com/ExodusMovement/exodus-hydra/issues/4953)) ([10d5e06](https://github.com/ExodusMovement/exodus-hydra/commit/10d5e06b00830fcdfe3c66698bbd729fbd8b3efe))
|
|
22
|
+
- assign feature id as namespace ([#4962](https://github.com/ExodusMovement/exodus-hydra/issues/4962)) ([8af7ce4](https://github.com/ExodusMovement/exodus-hydra/commit/8af7ce4dbcc058d01966be85dc1aa53a4a65a488))
|
|
23
|
+
|
|
24
|
+
## [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)
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
- 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)
|
|
29
|
+
|
|
30
|
+
## [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)
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
- make passphrase cache optional ([#4915](https://github.com/ExodusMovement/exodus-hydra/issues/4915)) ([1a5738b](https://github.com/ExodusMovement/exodus-hydra/commit/1a5738b830e200012d271ff5553e5985dd3ffe7c))
|
|
35
|
+
|
|
36
|
+
## [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)
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package @exodus/headless
|
|
39
|
+
|
|
40
|
+
## [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)
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
- add public key store to headless ([#4852](https://github.com/ExodusMovement/exodus-hydra/issues/4852)) ([c003055](https://github.com/ExodusMovement/exodus-hydra/commit/c0030555487e95aadb9bae78710d85cc1496febd))
|
|
45
|
+
|
|
46
|
+
## [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)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @exodus/headless
|
|
49
|
+
|
|
50
|
+
## [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)
|
|
51
|
+
|
|
52
|
+
**Note:** Version bump only for package @exodus/headless
|
|
53
|
+
|
|
54
|
+
## [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)
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
|
|
58
|
+
- addressProvider api improvements ([#4804](https://github.com/ExodusMovement/exodus-hydra/issues/4804)) ([4221e07](https://github.com/ExodusMovement/exodus-hydra/commit/4221e07e54955740ae352c69444d80a77741ed0b))
|
|
59
|
+
- 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))
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
- zero balance after send is ignore ([#4725](https://github.com/ExodusMovement/exodus-hydra/issues/4725)) ([56c5d35](https://github.com/ExodusMovement/exodus-hydra/commit/56c5d35ca1643e869c112d0166df036ec988088f))
|
|
64
|
+
|
|
65
|
+
## [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)
|
|
66
|
+
|
|
67
|
+
### Features
|
|
68
|
+
|
|
69
|
+
- **headless:** unlock migrateable storage ([#4561](https://github.com/ExodusMovement/exodus-hydra/issues/4561)) ([6d726a4](https://github.com/ExodusMovement/exodus-hydra/commit/6d726a4de678fd19f4742d431d67148d6f150573))
|
|
70
|
+
|
|
71
|
+
## [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)
|
|
72
|
+
|
|
73
|
+
### Features
|
|
74
|
+
|
|
75
|
+
- **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))
|
|
76
|
+
|
|
77
|
+
### Bug Fixes
|
|
78
|
+
|
|
79
|
+
- headless migrations ([#4568](https://github.com/ExodusMovement/exodus-hydra/issues/4568)) ([610a3a4](https://github.com/ExodusMovement/exodus-hydra/commit/610a3a4ada3124f8aba5d177274db7c05c86fc7e))
|
|
80
|
+
|
|
81
|
+
## [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)
|
|
82
|
+
|
|
83
|
+
### Bug Fixes
|
|
84
|
+
|
|
85
|
+
- import from atoms index ([#4508](https://github.com/ExodusMovement/exodus-hydra/issues/4508)) ([923fb99](https://github.com/ExodusMovement/exodus-hydra/commit/923fb992328b63e45401c78176b5a6ef7b666eee))
|
|
86
|
+
|
|
87
|
+
## [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)
|
|
88
|
+
|
|
89
|
+
**Note:** Version bump only for package @exodus/headless
|
|
90
|
+
|
|
91
|
+
## [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)
|
|
92
|
+
|
|
93
|
+
### ⚠ BREAKING CHANGES
|
|
94
|
+
|
|
95
|
+
- don't expect fusion as adapter (#4443)
|
|
96
|
+
|
|
97
|
+
### Features
|
|
98
|
+
|
|
99
|
+
- clear assets feature in plugin ([#4444](https://github.com/ExodusMovement/exodus-hydra/issues/4444)) ([ac5442d](https://github.com/ExodusMovement/exodus-hydra/commit/ac5442d30ead24260f10f336497fbc745ff66e17))
|
|
100
|
+
- don't expect fusion as adapter ([#4443](https://github.com/ExodusMovement/exodus-hydra/issues/4443)) ([fc7a886](https://github.com/ExodusMovement/exodus-hydra/commit/fc7a8861a1d5a50cae3ceb04570731b1d11c3820))
|
|
101
|
+
|
|
102
|
+
## [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)
|
|
103
|
+
|
|
104
|
+
### Bug Fixes
|
|
105
|
+
|
|
106
|
+
- headless test config ([#4399](https://github.com/ExodusMovement/exodus-hydra/issues/4399)) ([27618df](https://github.com/ExodusMovement/exodus-hydra/commit/27618df282becfb07e25759d7e870c1ce9cc6331))
|
|
107
|
+
|
|
108
|
+
## [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)
|
|
109
|
+
|
|
110
|
+
### Features
|
|
111
|
+
|
|
112
|
+
- **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))
|
|
113
|
+
- use transaction signer ([#3751](https://github.com/ExodusMovement/exodus-hydra/issues/3751)) ([0e60e89](https://github.com/ExodusMovement/exodus-hydra/commit/0e60e8963a799435c5528f596447813b9e012ead))
|
|
114
|
+
|
|
115
|
+
## [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)
|
|
116
|
+
|
|
117
|
+
### Features
|
|
118
|
+
|
|
119
|
+
- clear storage in parallel ([#4314](https://github.com/ExodusMovement/exodus-hydra/issues/4314)) ([e035d9f](https://github.com/ExodusMovement/exodus-hydra/commit/e035d9f082af16e1aad57348f4011fd4f077929d))
|
|
120
|
+
- **remote-config:** redux module ([#4319](https://github.com/ExodusMovement/exodus-hydra/issues/4319)) ([883954a](https://github.com/ExodusMovement/exodus-hydra/commit/883954ad80acd1b01183a848963c6d0181e66bb7))
|
|
121
|
+
|
|
122
|
+
## [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)
|
|
123
|
+
|
|
124
|
+
### Features
|
|
125
|
+
|
|
126
|
+
- **crypto-news-monitor:** add redux module ([#4294](https://github.com/ExodusMovement/exodus-hydra/issues/4294)) ([fed61cb](https://github.com/ExodusMovement/exodus-hydra/commit/fed61cbd7ba9bdb37efea6288078a2aa76c22364))
|
|
127
|
+
|
|
128
|
+
## [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)
|
|
129
|
+
|
|
130
|
+
**Note:** Version bump only for package @exodus/headless
|
|
131
|
+
|
|
132
|
+
## [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)
|
|
133
|
+
|
|
134
|
+
### Bug Fixes
|
|
135
|
+
|
|
136
|
+
- tests ([#4187](https://github.com/ExodusMovement/exodus-hydra/issues/4187)) ([8d25c40](https://github.com/ExodusMovement/exodus-hydra/commit/8d25c40905ab08ea4f837ce34eeff793072b5ee9))
|
|
137
|
+
|
|
138
|
+
## [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)
|
|
139
|
+
|
|
140
|
+
**Note:** Version bump only for package @exodus/headless
|
|
141
|
+
|
|
142
|
+
## [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)
|
|
143
|
+
|
|
144
|
+
**Note:** Version bump only for package @exodus/headless
|
|
145
|
+
|
|
146
|
+
## [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)
|
|
147
|
+
|
|
148
|
+
**Note:** Version bump only for package @exodus/headless
|
|
149
|
+
|
|
150
|
+
## [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)
|
|
151
|
+
|
|
152
|
+
**Note:** Version bump only for package @exodus/headless
|
|
153
|
+
|
|
154
|
+
## [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)
|
|
155
|
+
|
|
156
|
+
### ⚠ BREAKING CHANGES
|
|
157
|
+
|
|
158
|
+
- **headless:** ship assets feature (#4100)
|
|
159
|
+
|
|
160
|
+
### Features
|
|
161
|
+
|
|
162
|
+
- **headless:** emit pre-load event ([#4102](https://github.com/ExodusMovement/exodus-hydra/issues/4102)) ([0db6168](https://github.com/ExodusMovement/exodus-hydra/commit/0db616811faf4a3926fd8dc9fe8d39aab88fa728))
|
|
163
|
+
- **headless:** ship assets feature ([#4100](https://github.com/ExodusMovement/exodus-hydra/issues/4100)) ([694accc](https://github.com/ExodusMovement/exodus-hydra/commit/694accc504893e08d3d47f16a704e141953bdcca))
|
|
164
|
+
|
|
165
|
+
## [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)
|
|
166
|
+
|
|
167
|
+
- add storage namespace for wallet-compatibilty-modes [1cf62547](https://github.com/ExodusMovement/exodus-hydra/pull/3644/commits/1cf6254755f8b9326b55afae21b6a2cf92e998a9)
|
|
168
|
+
|
|
169
|
+
## [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)
|
|
170
|
+
|
|
171
|
+
### Bug Fixes
|
|
172
|
+
|
|
173
|
+
- dedupe baseAssetNamesToMonitor atom ([#3875](https://github.com/ExodusMovement/exodus-hydra/issues/3875)) ([add2cdb](https://github.com/ExodusMovement/exodus-hydra/commit/add2cdb6f68d2d615e4043ff606f66129622c303))
|
|
174
|
+
|
|
175
|
+
## [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)
|
|
176
|
+
|
|
177
|
+
### Features
|
|
178
|
+
|
|
179
|
+
- 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))
|
|
180
|
+
- add assets module definition ([#3931](https://github.com/ExodusMovement/exodus-hydra/issues/3931)) ([3157f44](https://github.com/ExodusMovement/exodus-hydra/commit/3157f44de260fa4c2c48dda311f907c114b07088))
|
|
181
|
+
- add async flag to `onAboveThreshold` ([#3915](https://github.com/ExodusMovement/exodus-hydra/issues/3915)) ([70d304d](https://github.com/ExodusMovement/exodus-hydra/commit/70d304d27a84fbe17612c68773c29fc0affdb07c))
|
|
182
|
+
- **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))
|
|
183
|
+
- **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))
|
|
184
|
+
|
|
185
|
+
## [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)
|
|
186
|
+
|
|
187
|
+
### Features
|
|
188
|
+
|
|
189
|
+
- **headless:** do not attach atoms anymore ([#3890](https://github.com/ExodusMovement/exodus-hydra/issues/3890)) ([78894d7](https://github.com/ExodusMovement/exodus-hydra/commit/78894d7f9148f6f2754cc71ecf649161d7056558))
|
|
190
|
+
|
|
191
|
+
### Bug Fixes
|
|
192
|
+
|
|
193
|
+
- headless dependency definition ([#3889](https://github.com/ExodusMovement/exodus-hydra/issues/3889)) ([627b24e](https://github.com/ExodusMovement/exodus-hydra/commit/627b24e3fa214e5222d1c118deb0eb7baae8f144))
|
|
194
|
+
|
|
195
|
+
## [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)
|
|
196
|
+
|
|
197
|
+
### Features
|
|
198
|
+
|
|
199
|
+
- support additional Solana derivation paths ([#3418](https://github.com/ExodusMovement/exodus-hydra/issues/3418)) ([abd701d](https://github.com/ExodusMovement/exodus-hydra/commit/abd701d44f928c1d3a0a99f23b1240ef3b9b2f24))
|
|
200
|
+
|
|
201
|
+
## [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)
|
|
202
|
+
|
|
203
|
+
### ⚠ BREAKING CHANGES
|
|
204
|
+
|
|
205
|
+
- **ui-config:** expose utils to compute events (#3819)
|
|
206
|
+
|
|
207
|
+
### Features
|
|
208
|
+
|
|
209
|
+
- **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))
|
|
210
|
+
|
|
211
|
+
## [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)
|
|
212
|
+
|
|
213
|
+
### Bug Fixes
|
|
214
|
+
|
|
215
|
+
- bump preprocessor to include performance monitor ([#3814](https://github.com/ExodusMovement/exodus-hydra/issues/3814)) ([68a50e8](https://github.com/ExodusMovement/exodus-hydra/commit/68a50e830acc5713c4629758b9104c2eae16cb71))
|
|
216
|
+
|
|
217
|
+
## [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)
|
|
218
|
+
|
|
219
|
+
### ⚠ BREAKING CHANGES
|
|
220
|
+
|
|
221
|
+
- accept feature config (#3789)
|
|
222
|
+
- use injected fetchival (#3748)
|
|
223
|
+
|
|
224
|
+
### Features
|
|
225
|
+
|
|
226
|
+
- accept feature config ([#3789](https://github.com/ExodusMovement/exodus-hydra/issues/3789)) ([beac45f](https://github.com/ExodusMovement/exodus-hydra/commit/beac45fd516383b1ab48fc077a417cbc06ba9f5b))
|
|
227
|
+
- use injected fetchival ([#3748](https://github.com/ExodusMovement/exodus-hydra/issues/3748)) ([46b226b](https://github.com/ExodusMovement/exodus-hydra/commit/46b226ba28fdc0a600d0bc803eb7c4083d49f2d7))
|
|
228
|
+
|
|
229
|
+
## [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)
|
|
230
|
+
|
|
231
|
+
### Code Refactoring
|
|
232
|
+
|
|
233
|
+
- refactor: load assets on start (#3725)
|
|
234
|
+
|
|
235
|
+
## [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)
|
|
236
|
+
|
|
237
|
+
### Features
|
|
238
|
+
|
|
239
|
+
- bump balances in headless ([#3666](https://github.com/ExodusMovement/exodus-hydra/issues/3666)) ([2c58bb0](https://github.com/ExodusMovement/exodus-hydra/commit/2c58bb02654f3bd52854cabf2f182a0bc6cb38f2))
|
|
240
|
+
|
|
241
|
+
## [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)
|
|
242
|
+
|
|
243
|
+
### ⚠ BREAKING CHANGES
|
|
244
|
+
|
|
245
|
+
- **headless:** remove attached restoringAssetsAtom (#3639)
|
|
246
|
+
|
|
247
|
+
use atom observer of restore-progress-tracker@2.1.0 instead
|
|
248
|
+
|
|
249
|
+
### Features
|
|
250
|
+
|
|
251
|
+
- upgrade auto-enable-assets-plugin https://github.com/ExodusMovement/exodus-hydra/pull/3655
|
|
252
|
+
|
|
253
|
+
### Code Refactoring
|
|
254
|
+
|
|
255
|
+
- **headless:** remove attached restoringAssetsAtom ([#3639](https://github.com/ExodusMovement/exodus-hydra/issues/3639)) ([d541956](https://github.com/ExodusMovement/exodus-hydra/commit/d541956e9d28cbcc1689a39ed45caaffabf6ce4c))
|
|
256
|
+
|
|
257
|
+
## [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)
|
|
258
|
+
|
|
259
|
+
### ⚠ BREAKING CHANGES
|
|
260
|
+
|
|
261
|
+
- emit rates from plugin (#3572)
|
|
262
|
+
|
|
263
|
+
### Features
|
|
264
|
+
|
|
265
|
+
- emit rates from plugin ([#3572](https://github.com/ExodusMovement/exodus-hydra/issues/3572)) ([ae25681](https://github.com/ExodusMovement/exodus-hydra/commit/ae25681940138927581efe32740125571f9a71ae))
|
|
266
|
+
|
|
267
|
+
## [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)
|
|
268
|
+
|
|
269
|
+
### Features
|
|
270
|
+
|
|
271
|
+
- update config preprocessor ([#3621](https://github.com/ExodusMovement/exodus-hydra/issues/3621)) ([6b1ba7a](https://github.com/ExodusMovement/exodus-hydra/commit/6b1ba7a8a6b2436b8561d5a346de87229ae8826e))
|
|
272
|
+
|
|
273
|
+
## [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)
|
|
274
|
+
|
|
275
|
+
**Note:** Version bump only for package @exodus/headless
|
|
276
|
+
|
|
277
|
+
## [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)
|
|
278
|
+
|
|
279
|
+
### Features
|
|
280
|
+
|
|
281
|
+
- add restartAutoLockTimer to wallet api ([#3552](https://github.com/ExodusMovement/exodus-hydra/issues/3552)) ([0de829d](https://github.com/ExodusMovement/exodus-hydra/commit/0de829d4ff321ed7cd340f9a6c16567a6f1bc74f))
|
|
282
|
+
|
|
283
|
+
## [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)
|
|
284
|
+
|
|
285
|
+
### Features
|
|
286
|
+
|
|
287
|
+
- update rates-monitor in headless ([#3510](https://github.com/ExodusMovement/exodus-hydra/issues/3510)) ([21fc5b9](https://github.com/ExodusMovement/exodus-hydra/commit/21fc5b9550152701d42573b9c9dec615db6a7d33))
|
|
288
|
+
|
|
289
|
+
## [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)
|
|
290
|
+
|
|
291
|
+
### ⚠ BREAKING CHANGES
|
|
292
|
+
|
|
293
|
+
- balances.load (#3383)
|
|
294
|
+
|
|
295
|
+
### Features
|
|
296
|
+
|
|
297
|
+
- balances.load ([#3383](https://github.com/ExodusMovement/exodus-hydra/issues/3383)) ([754179f](https://github.com/ExodusMovement/exodus-hydra/commit/754179f65713afc19490240702aa0fee18047073))
|
|
298
|
+
|
|
299
|
+
## [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)
|
|
300
|
+
|
|
301
|
+
**Note:** Version bump only for package @exodus/headless
|
|
302
|
+
|
|
303
|
+
## [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)
|
|
304
|
+
|
|
305
|
+
### Features
|
|
306
|
+
|
|
307
|
+
- improve error from plugin ([#3398](https://github.com/ExodusMovement/exodus-hydra/issues/3398)) ([22371a3](https://github.com/ExodusMovement/exodus-hydra/commit/22371a3166ee55fe4c8ff68bd2b9d0b5918e3671))
|
|
308
|
+
- 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))
|
|
309
|
+
|
|
310
|
+
### Bug Fixes
|
|
311
|
+
|
|
312
|
+
- **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))
|
|
313
|
+
|
|
314
|
+
## [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)
|
|
315
|
+
|
|
316
|
+
### ⚠ BREAKING CHANGES
|
|
317
|
+
|
|
318
|
+
- change ui config data structure (#3294)
|
|
319
|
+
|
|
320
|
+
### Features
|
|
321
|
+
|
|
322
|
+
- change ui config data structure ([#3294](https://github.com/ExodusMovement/exodus-hydra/issues/3294)) ([eaceb99](https://github.com/ExodusMovement/exodus-hydra/commit/eaceb99ad4310255ff70769435f16f2daa43ce5a))
|
|
323
|
+
|
|
324
|
+
## [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)
|
|
325
|
+
|
|
326
|
+
### Bug Fixes
|
|
327
|
+
|
|
328
|
+
- 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))
|
|
329
|
+
|
|
330
|
+
## [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)
|
|
331
|
+
|
|
332
|
+
### Features
|
|
333
|
+
|
|
334
|
+
- **headless:** attach migrations ([#3279](https://github.com/ExodusMovement/exodus-hydra/issues/3279)) ([4f78909](https://github.com/ExodusMovement/exodus-hydra/commit/4f78909223b6517855f12ea31ee5976cdf8a3513))
|
|
335
|
+
|
|
336
|
+
## [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)
|
|
337
|
+
|
|
338
|
+
### ⚠ BREAKING CHANGES
|
|
339
|
+
|
|
340
|
+
- deserialize address provider apis (#3265)
|
|
341
|
+
|
|
342
|
+
### Features
|
|
343
|
+
|
|
344
|
+
- deserialize address provider apis ([#3265](https://github.com/ExodusMovement/exodus-hydra/issues/3265)) ([db894e9](https://github.com/ExodusMovement/exodus-hydra/commit/db894e92c8f16ebd1278a56b353f1dc7a1c06b59))
|
|
345
|
+
|
|
346
|
+
## [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)
|
|
347
|
+
|
|
348
|
+
### Features
|
|
349
|
+
|
|
350
|
+
- bump enabled-assets ([#3250](https://github.com/ExodusMovement/exodus-hydra/issues/3250)) ([26b2ea8](https://github.com/ExodusMovement/exodus-hydra/commit/26b2ea896470506b7af310564c1d1516db521e56))
|
|
351
|
+
|
|
352
|
+
## [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)
|
|
353
|
+
|
|
354
|
+
### ⚠ BREAKING CHANGES
|
|
355
|
+
|
|
356
|
+
- add stop lifecycle hook (#3251)
|
|
357
|
+
|
|
358
|
+
### Features
|
|
359
|
+
|
|
360
|
+
- add stop lifecycle hook ([#3251](https://github.com/ExodusMovement/exodus-hydra/issues/3251)) ([e713074](https://github.com/ExodusMovement/exodus-hydra/commit/e7130744f557087aa5ae65bddc2f0bea63f6c1e3))
|
|
361
|
+
|
|
6
362
|
## [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
363
|
|
|
8
364
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -197,7 +197,7 @@ Currently not used.
|
|
|
197
197
|
|
|
198
198
|
## Headless API
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
### wallet
|
|
201
201
|
|
|
202
202
|
> Type: object
|
|
203
203
|
|
|
@@ -217,7 +217,7 @@ Currently not used.
|
|
|
217
217
|
| unload | `async () => void` | Unloads UI by rehydratating data through port (`BE Only`) |
|
|
218
218
|
| changeLockTimer | `async ({ ttl: number }) => void` | Change auto unlock ttl (`BE Only`) |
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
### isMnemonicValid
|
|
221
221
|
|
|
222
222
|
> Type: function
|
|
223
223
|
|
|
@@ -228,7 +228,7 @@ Currently not used.
|
|
|
228
228
|
|
|
229
229
|
**Returns**: `boolean`
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
### walletAccounts
|
|
232
232
|
|
|
233
233
|
> Type: object
|
|
234
234
|
|
|
@@ -240,7 +240,7 @@ Currently not used.
|
|
|
240
240
|
| disable | `async (name) => void` | Disables an existing WalletAccount. |
|
|
241
241
|
| getEnabled | `async () => object` | Returns enabled walletAccounts as `{ [name]: WalletAccount }`. |
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
### blockchainMetadata
|
|
244
244
|
|
|
245
245
|
> Type: object
|
|
246
246
|
|
|
@@ -258,7 +258,7 @@ Currently not used.
|
|
|
258
258
|
| removeAccountState | `async ({ assetName: string, walletAccount: string }) => void` | Remove accountState for AssetSource. |
|
|
259
259
|
| batch | `() => Batch` | Create a batch of updates. See [blockchainMetadata](../blockchain-metadata) README for batching details. |
|
|
260
260
|
|
|
261
|
-
|
|
261
|
+
### assets
|
|
262
262
|
|
|
263
263
|
> Type: object
|
|
264
264
|
|
|
@@ -268,7 +268,7 @@ Currently not used.
|
|
|
268
268
|
| disable | `async (assetNames: string[]) => void` | Disables assets. |
|
|
269
269
|
| addAndEnableToken | `async (assetId: string, baseAssetName: string) => string` | Adds and enables a custom token. Returns the created `asset`'s `.name` |
|
|
270
270
|
|
|
271
|
-
|
|
271
|
+
### locale
|
|
272
272
|
|
|
273
273
|
> Type: object
|
|
274
274
|
|
|
@@ -277,7 +277,7 @@ Currently not used.
|
|
|
277
277
|
| setCurrency | `async (currency: string) => void` | Changes current currency. |
|
|
278
278
|
| setLanguage | `async (language: string) => void` | Changes current language. |
|
|
279
279
|
|
|
280
|
-
|
|
280
|
+
### subscribe
|
|
281
281
|
|
|
282
282
|
> Type: function
|
|
283
283
|
|
|
@@ -285,3 +285,14 @@ Currently not used.
|
|
|
285
285
|
| ----------- | ------------------------------------------ | ------------------------------------------ |
|
|
286
286
|
| subscribe | `({ type: string, payload: any }) => void` | Subscribe to receive events. |
|
|
287
287
|
| unsubscribe | `({ type: string, payload: any }) => void` | Unsubscribe handler from receiving events. |
|
|
288
|
+
|
|
289
|
+
### featureFlags
|
|
290
|
+
|
|
291
|
+
> Type: object
|
|
292
|
+
|
|
293
|
+
| Method | Type | Description |
|
|
294
|
+
| ------- | ------------------------------------- | -------------------------------------- |
|
|
295
|
+
| enable | `async (featureName: string) => void` | Enables a feature-flag gated feature. |
|
|
296
|
+
| disable | `async (featureName: string) => void` | Disables a feature-flag gated feature. |
|
|
297
|
+
|
|
298
|
+
See [more details](../../features/feature-flags/).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/headless",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.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,72 @@
|
|
|
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.0.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/geolocation": "^
|
|
43
|
-
"@exodus/key-
|
|
44
|
-
"@exodus/
|
|
45
|
-
"@exodus/
|
|
46
|
-
"@exodus/
|
|
43
|
+
"@exodus/geolocation": "^3.0.0",
|
|
44
|
+
"@exodus/hd-key-slip-10": "^2.0.0",
|
|
45
|
+
"@exodus/key-identifier-provider": "^1.4.0",
|
|
46
|
+
"@exodus/keychain": "^4.3.0",
|
|
47
|
+
"@exodus/locale": "^2.0.2",
|
|
48
|
+
"@exodus/module": "^1.2.2",
|
|
47
49
|
"@exodus/pricing": "^1.1.0",
|
|
48
|
-
"@exodus/
|
|
49
|
-
"@exodus/
|
|
50
|
-
"@exodus/
|
|
51
|
-
"@exodus/
|
|
52
|
-
"@exodus/
|
|
53
|
-
"@exodus/
|
|
50
|
+
"@exodus/public-key-store": "^1.2.0",
|
|
51
|
+
"@exodus/rates-monitor": "^4.0.2",
|
|
52
|
+
"@exodus/remote-config": "^2.3.0",
|
|
53
|
+
"@exodus/restore-progress-tracker": "^3.0.0",
|
|
54
|
+
"@exodus/sodium-crypto": "^3.2.0",
|
|
55
|
+
"@exodus/startup-counter": "^1.0.0",
|
|
56
|
+
"@exodus/tx-signer": "^1.1.0",
|
|
57
|
+
"@exodus/wallet": "^10.3.0",
|
|
58
|
+
"@exodus/wallet-accounts": "^15.0.0",
|
|
59
|
+
"@exodus/wallet-compatibility-modes": "^3.2.0",
|
|
54
60
|
"bip39": "^2.6.0",
|
|
55
61
|
"events": "^3.3.0",
|
|
56
62
|
"lodash": "npm:@exodus/lodash@^4.17.21-exodus.2",
|
|
57
63
|
"minimalistic-assert": "^1.0.1"
|
|
58
64
|
},
|
|
59
65
|
"devDependencies": {
|
|
60
|
-
"@exodus/ab-testing": "^
|
|
66
|
+
"@exodus/ab-testing": "^7.1.0",
|
|
61
67
|
"@exodus/algorand-lib": "^2.0.1",
|
|
62
68
|
"@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": "^
|
|
69
|
+
"@exodus/apy-rates": "^3.3.1",
|
|
70
|
+
"@exodus/assets-feature": "workspace:^",
|
|
71
|
+
"@exodus/bitcoin-plugin": "^1.0.14",
|
|
72
|
+
"@exodus/connected-origins": "^3.3.0",
|
|
73
|
+
"@exodus/crypto-news-monitor": "^4.1.0",
|
|
68
74
|
"@exodus/currency": "^2.2.0",
|
|
69
|
-
"@exodus/ethereum-lib": "^
|
|
75
|
+
"@exodus/ethereum-lib": "^3.3.34",
|
|
70
76
|
"@exodus/ethereum-meta": "^1.0.23",
|
|
71
77
|
"@exodus/exodus-pricing-client": "^1.2.0",
|
|
72
|
-
"@exodus/
|
|
73
|
-
"@exodus/
|
|
74
|
-
"@exodus/
|
|
75
|
-
"@exodus/
|
|
76
|
-
"@exodus/
|
|
77
|
-
"@exodus/
|
|
78
|
+
"@exodus/key-utils": "^3.0.0",
|
|
79
|
+
"@exodus/kyc": "^4.2.0",
|
|
80
|
+
"@exodus/litecoin-meta": "^1.0.0",
|
|
81
|
+
"@exodus/market-history": "^7.2.0",
|
|
82
|
+
"@exodus/models": "^10.1.0",
|
|
83
|
+
"@exodus/nfts": "^7.1.2",
|
|
84
|
+
"@exodus/personal-notes": "^3.6.0",
|
|
85
|
+
"@exodus/referrals": "^8.0.1",
|
|
78
86
|
"@exodus/solana-lib": "^1.3.11",
|
|
79
87
|
"@exodus/solana-meta": "^1.0.2",
|
|
80
88
|
"@exodus/storage-encrypted": "^1.1.2",
|
|
81
|
-
"@exodus/storage-memory": "^2.1.
|
|
82
|
-
"@exodus/top-movers-monitor": "^3.
|
|
83
|
-
"@exodus/ui-config": "^
|
|
89
|
+
"@exodus/storage-memory": "^2.1.1",
|
|
90
|
+
"@exodus/top-movers-monitor": "^3.2.0",
|
|
91
|
+
"@exodus/ui-config": "^3.3.0",
|
|
84
92
|
"@exodus/wild-emitter": "^1.0.0",
|
|
85
93
|
"buffer-json": "^2.0.0",
|
|
86
94
|
"deepmerge": "^4.2.2",
|
|
@@ -89,8 +97,8 @@
|
|
|
89
97
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
90
98
|
"events": "^3.3.0",
|
|
91
99
|
"jest": "^29.1.2",
|
|
92
|
-
"
|
|
100
|
+
"msw": "^2.0.0",
|
|
93
101
|
"p-defer": "^4.0.0"
|
|
94
102
|
},
|
|
95
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "a4af3e13c365318d2105d7d9c8ccfbfa2aa089a0"
|
|
96
104
|
}
|
package/src/api/debug.js
ADDED
|
@@ -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,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 }) => {
|
|
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 }),
|
|
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,68 @@
|
|
|
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
9
|
import geolocation from '@exodus/geolocation'
|
|
10
10
|
import keychain from '@exodus/keychain'
|
|
11
11
|
import locale from '@exodus/locale'
|
|
12
12
|
import pricing from '@exodus/pricing'
|
|
13
|
+
import publicKeyStore from '@exodus/public-key-store'
|
|
13
14
|
import rates from '@exodus/rates-monitor'
|
|
14
15
|
import remoteConfig from '@exodus/remote-config'
|
|
15
16
|
import restoreProgressTracker from '@exodus/restore-progress-tracker'
|
|
17
|
+
import startupCounter from '@exodus/startup-counter'
|
|
18
|
+
import transactionSigner from '@exodus/tx-signer'
|
|
16
19
|
import wallet from '@exodus/wallet'
|
|
17
20
|
import walletAccounts from '@exodus/wallet-accounts'
|
|
18
21
|
|
|
19
22
|
import createApi from './api'
|
|
20
|
-
import attachAtoms from './atoms/attach'
|
|
21
|
-
import { atomsToAttach } from './constants'
|
|
22
23
|
import createIOC from './ioc'
|
|
24
|
+
import attachMigrations from './migrations/attach'
|
|
23
25
|
import attachPlugins from './plugins/attach'
|
|
24
26
|
|
|
25
27
|
const createExodus = ({ adapters, config, port }) => {
|
|
26
28
|
const ioc = createIOC({ adapters, config })
|
|
27
29
|
|
|
28
|
-
ioc.use(
|
|
29
|
-
ioc.use(
|
|
30
|
-
ioc.use(walletAccounts())
|
|
31
|
-
ioc.use(blockchainMetadata())
|
|
30
|
+
ioc.use(addressProvider({ config: config.addressProvider }))
|
|
31
|
+
ioc.use(assetsFeature())
|
|
32
32
|
ioc.use(availableAssets())
|
|
33
|
+
ioc.use(balances(config.balances))
|
|
34
|
+
ioc.use(blockchainMetadata())
|
|
33
35
|
ioc.use(enabledAssets())
|
|
34
|
-
ioc.use(
|
|
35
|
-
ioc.use(
|
|
36
|
+
ioc.use(featureFlags())
|
|
37
|
+
ioc.use(fees())
|
|
36
38
|
ioc.use(geolocation())
|
|
39
|
+
ioc.use(keychain(config.keychain))
|
|
40
|
+
ioc.use(locale())
|
|
37
41
|
ioc.use(pricing())
|
|
38
|
-
ioc.use(
|
|
42
|
+
ioc.use(publicKeyStore())
|
|
39
43
|
ioc.use(rates())
|
|
40
|
-
ioc.use(
|
|
41
|
-
ioc.use(locale())
|
|
42
|
-
ioc.use(addressProvider({ config: config.addressProvider }))
|
|
44
|
+
ioc.use(remoteConfig())
|
|
43
45
|
ioc.use(restoreProgressTracker())
|
|
46
|
+
ioc.use(startupCounter())
|
|
47
|
+
ioc.use(transactionSigner())
|
|
48
|
+
ioc.use(wallet())
|
|
49
|
+
ioc.use(walletAccounts())
|
|
44
50
|
|
|
45
51
|
ioc.register({ definition: { id: 'port', type: 'port', factory: () => port } })
|
|
46
52
|
|
|
47
53
|
const resolve = () => {
|
|
48
54
|
ioc.resolve()
|
|
49
55
|
|
|
50
|
-
const {
|
|
56
|
+
const { storage, migrateableStorage } = ioc.getByType('adapter')
|
|
51
57
|
|
|
52
58
|
const { application, wallet, unlockEncryptedStorage } = ioc.getByType('module')
|
|
53
59
|
|
|
60
|
+
const { migrations } = ioc.getAll()
|
|
61
|
+
|
|
54
62
|
application.on('start', (payload) => port.emit('start', payload))
|
|
55
63
|
|
|
64
|
+
application.hook('load', (args) => port.emit('pre-load', args))
|
|
65
|
+
|
|
56
66
|
application.on('load', (args) => port.emit('load', args))
|
|
57
67
|
|
|
58
68
|
application.on('create', async ({ hasPassphraseSet }) => {
|
|
@@ -86,21 +96,21 @@ const createExodus = ({ adapters, config, port }) => {
|
|
|
86
96
|
application.hook('unlock', async () => {
|
|
87
97
|
if (typeof storage.unlock === 'function') unlockEncryptedStorage(storage)
|
|
88
98
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
application.hook('clear', async () => {
|
|
93
|
-
await Promise.all([assetsModule.clear(), fusion.clearStorage()])
|
|
99
|
+
// normally unlocked during migrations, also unlock here just in case
|
|
100
|
+
if (typeof migrateableStorage.unlock === 'function')
|
|
101
|
+
unlockEncryptedStorage(migrateableStorage)
|
|
94
102
|
})
|
|
95
103
|
|
|
96
104
|
application.on('clear', () => port.emit('clear'))
|
|
97
105
|
|
|
98
106
|
application.on('restart', (payload) => port.emit('restart', payload))
|
|
99
107
|
|
|
100
|
-
|
|
101
|
-
|
|
108
|
+
attachMigrations({
|
|
109
|
+
migrations,
|
|
110
|
+
adapters,
|
|
102
111
|
application,
|
|
103
|
-
atoms:
|
|
112
|
+
atoms: ioc.getByType('atom'),
|
|
113
|
+
modules: ioc.getByType('module'),
|
|
104
114
|
})
|
|
105
115
|
|
|
106
116
|
attachPlugins({
|
|
@@ -109,7 +119,7 @@ const createExodus = ({ adapters, config, port }) => {
|
|
|
109
119
|
logger: ioc.get('createLogger')('attachPlugins'),
|
|
110
120
|
})
|
|
111
121
|
|
|
112
|
-
return createApi({ ioc, port })
|
|
122
|
+
return createApi({ ioc, port, config })
|
|
113
123
|
}
|
|
114
124
|
|
|
115
125
|
return { ...ioc, resolve }
|
package/src/ioc.js
CHANGED
|
@@ -1,25 +1,43 @@
|
|
|
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'
|
|
4
5
|
import devModeAtoms from '@exodus/dependency-preprocessors/src/preprocessors/dev-mode-atoms'
|
|
5
6
|
import logify from '@exodus/dependency-preprocessors/src/preprocessors/logify'
|
|
6
|
-
import namespaceConfig from '@exodus/dependency-preprocessors/src/preprocessors/namespace-config'
|
|
7
7
|
import namespaceStorage from '@exodus/dependency-preprocessors/src/preprocessors/namespace-storage'
|
|
8
8
|
import optional from '@exodus/dependency-preprocessors/src/preprocessors/optional'
|
|
9
|
+
import performanceMonitor from '@exodus/dependency-preprocessors/src/preprocessors/performance-monitor'
|
|
9
10
|
import readOnlyAtoms from '@exodus/dependency-preprocessors/src/preprocessors/read-only-atoms'
|
|
10
11
|
import assert from 'minimalistic-assert'
|
|
11
12
|
|
|
12
13
|
import createDependencies from './dependencies'
|
|
13
14
|
|
|
14
15
|
const createIOC = ({ adapters, config }) => {
|
|
15
|
-
const { createLogger } = adapters
|
|
16
|
-
const {
|
|
16
|
+
const { createLogger, performance = {} } = adapters
|
|
17
|
+
const {
|
|
18
|
+
readOnlyAtoms: readOnlyAtomsConfig,
|
|
19
|
+
devModeAtoms: devModeAtomsConfig,
|
|
20
|
+
performanceMonitor: performanceMonitorConfig,
|
|
21
|
+
} = config.ioc ?? {}
|
|
17
22
|
|
|
18
23
|
const ioc = createIocContainer({ logger: createLogger('exodus:ioc') })
|
|
19
24
|
|
|
25
|
+
const performanceLogger = createLogger('exodus:performance')
|
|
26
|
+
|
|
20
27
|
const preprocessors = [
|
|
21
28
|
logify({ createLogger }),
|
|
22
|
-
|
|
29
|
+
performanceMonitorConfig?.enabled &&
|
|
30
|
+
performanceMonitor({
|
|
31
|
+
now: performance.now,
|
|
32
|
+
onAboveThreshold:
|
|
33
|
+
performance.onAboveThreshold ??
|
|
34
|
+
(({ id, method, async, duration }) =>
|
|
35
|
+
performanceLogger.log(
|
|
36
|
+
`${id}.${method} ${async ? 'resolved after' : 'took'} ${duration}ms`
|
|
37
|
+
)),
|
|
38
|
+
config: performanceMonitorConfig,
|
|
39
|
+
}),
|
|
40
|
+
configPreprocessor(),
|
|
23
41
|
alias(),
|
|
24
42
|
// NOTE: order matters, this should come after `alias`
|
|
25
43
|
namespaceStorage(),
|
|
@@ -29,8 +47,8 @@ const createIOC = ({ adapters, config }) => {
|
|
|
29
47
|
...readOnlyAtomsConfig,
|
|
30
48
|
}),
|
|
31
49
|
optional(),
|
|
32
|
-
|
|
33
|
-
]
|
|
50
|
+
devModeAtomsConfig && devModeAtoms(devModeAtomsConfig),
|
|
51
|
+
].filter(Boolean)
|
|
34
52
|
|
|
35
53
|
const registerMultiple = (dependencies) => {
|
|
36
54
|
ioc.registerMultiple(preprocess({ dependencies, preprocessors }))
|
|
@@ -40,12 +58,13 @@ const createIOC = ({ adapters, config }) => {
|
|
|
40
58
|
registerMultiple([dependency])
|
|
41
59
|
}
|
|
42
60
|
|
|
43
|
-
const use = (
|
|
44
|
-
for (const { definition } of
|
|
61
|
+
const use = (feature) => {
|
|
62
|
+
for (const { definition } of feature.definitions) {
|
|
45
63
|
assert(definition.type, `ioc.use: "${definition.id}" is missing type field`)
|
|
64
|
+
definition.namespace = feature.id
|
|
46
65
|
}
|
|
47
66
|
|
|
48
|
-
registerMultiple(
|
|
67
|
+
registerMultiple(feature.definitions)
|
|
49
68
|
}
|
|
50
69
|
|
|
51
70
|
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
|