@exodus/headless 2.0.0-alpha.29 → 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -206
- package/README.md +15 -132
- package/package.json +14 -49
- package/src/api.js +2 -103
- package/src/application.js +40 -58
- package/src/dependencies/atoms.js +1 -152
- package/src/dependencies/index.js +1 -16
- package/src/dependencies/modules.js +8 -108
- package/src/index.js +4 -117
- package/src/ioc.js +1 -15
- package/src/atoms/attach.js +0 -40
- package/src/atoms/base-asset-names-to-monitor.js +0 -21
- package/src/constants.js +0 -16
- package/src/dependencies/atom-collections.js +0 -25
- package/src/dependencies/monitors.js +0 -56
- package/src/dependencies/plugins.js +0 -7
- package/src/plugins/attach.js +0 -19
- package/src/plugins/index.js +0 -3
- package/src/plugins/log-lifecycle.js +0 -25
- package/src/unlock-encrypted-storage.js +0 -19
- package/src/utils/blockchain-metadata.js +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,212 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [2.0.0-alpha.29](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.28...@exodus/headless@2.0.0-alpha.29) (2023-06-01)
|
|
7
|
-
|
|
8
|
-
### Features
|
|
9
|
-
|
|
10
|
-
- allow replacing existing dependencies ([#1753](https://github.com/ExodusMovement/exodus-hydra/issues/1753)) ([df6060d](https://github.com/ExodusMovement/exodus-hydra/commit/df6060d09f67dac21f3994dee04223567c921d0a))
|
|
11
|
-
|
|
12
|
-
## [2.0.0-alpha.28](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.27...@exodus/headless@2.0.0-alpha.28) (2023-05-31)
|
|
13
|
-
|
|
14
|
-
### Features
|
|
15
|
-
|
|
16
|
-
- add crypto news monitor to headless ([#1750](https://github.com/ExodusMovement/exodus-hydra/issues/1750)) ([64d46a3](https://github.com/ExodusMovement/exodus-hydra/commit/64d46a3d95c3b34d504b0b7128961df1427b6853))
|
|
17
|
-
|
|
18
|
-
## [2.0.0-alpha.27](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.26...@exodus/headless@2.0.0-alpha.27) (2023-05-31)
|
|
19
|
-
|
|
20
|
-
### Features
|
|
21
|
-
|
|
22
|
-
- integrate top-movers monitor into headless ([#1743](https://github.com/ExodusMovement/exodus-hydra/issues/1743)) ([05c4b22](https://github.com/ExodusMovement/exodus-hydra/commit/05c4b22e69e823563d81bfe7b30a2d21574d0c45))
|
|
23
|
-
|
|
24
|
-
## [2.0.0-alpha.26](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.25...@exodus/headless@2.0.0-alpha.26) (2023-05-30)
|
|
25
|
-
|
|
26
|
-
### Features
|
|
27
|
-
|
|
28
|
-
- integrate feeMonitors into headless ([#1732](https://github.com/ExodusMovement/exodus-hydra/issues/1732)) ([5a4b9b4](https://github.com/ExodusMovement/exodus-hydra/commit/5a4b9b4e2e7b70ac550775860a3bf5474e21a4d0))
|
|
29
|
-
|
|
30
|
-
## [2.0.0-alpha.25](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.24...@exodus/headless@2.0.0-alpha.25) (2023-05-26)
|
|
31
|
-
|
|
32
|
-
### Features
|
|
33
|
-
|
|
34
|
-
- migrate connected origins to headless ([#1702](https://github.com/ExodusMovement/exodus-hydra/issues/1702)) ([7f6678e](https://github.com/ExodusMovement/exodus-hydra/commit/7f6678eabc5a66dbf11002f021bb700bec3d32f3))
|
|
35
|
-
|
|
36
|
-
## [2.0.0-alpha.24](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.23...@exodus/headless@2.0.0-alpha.24) (2023-05-26)
|
|
37
|
-
|
|
38
|
-
### Features
|
|
39
|
-
|
|
40
|
-
- emit extra payload on application create hook ([#1709](https://github.com/ExodusMovement/exodus-hydra/issues/1709)) ([23412f6](https://github.com/ExodusMovement/exodus-hydra/commit/23412f603cb36c1249d0ed8248a1e44742d5dac9))
|
|
41
|
-
|
|
42
|
-
## [2.0.0-alpha.23](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.22...@exodus/headless@2.0.0-alpha.23) (2023-05-24)
|
|
43
|
-
|
|
44
|
-
### Features
|
|
45
|
-
|
|
46
|
-
- add personal notes to headless ([#1676](https://github.com/ExodusMovement/exodus-hydra/issues/1676)) ([c658211](https://github.com/ExodusMovement/exodus-hydra/commit/c6582113b56953edbf68fd0f4d29f4ee802e8bf5))
|
|
47
|
-
|
|
48
|
-
### Bug Fixes
|
|
49
|
-
|
|
50
|
-
- handle market-history-new-assets ([#1657](https://github.com/ExodusMovement/exodus-hydra/issues/1657)) ([89ff868](https://github.com/ExodusMovement/exodus-hydra/commit/89ff868ade7def9dc1ae99555f069e1a0cfeacba))
|
|
51
|
-
- start geolocation at start ([#1669](https://github.com/ExodusMovement/exodus-hydra/issues/1669)) ([ecfd0f3](https://github.com/ExodusMovement/exodus-hydra/commit/ecfd0f3a74ebf2ed5bca53c67c55ec304df91f4c))
|
|
52
|
-
|
|
53
|
-
## [2.0.0-alpha.22](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.21...@exodus/headless@2.0.0-alpha.22) (2023-05-16)
|
|
54
|
-
|
|
55
|
-
### Features
|
|
56
|
-
|
|
57
|
-
- **headless:** bump geolocation ([#1642](https://github.com/ExodusMovement/exodus-hydra/issues/1642)) ([ff1d61b](https://github.com/ExodusMovement/exodus-hydra/commit/ff1d61b0b91ec54fe78f99a33ad987e3a0e54d65))
|
|
58
|
-
|
|
59
|
-
## [2.0.0-alpha.21](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.20...@exodus/headless@2.0.0-alpha.21) (2023-05-16)
|
|
60
|
-
|
|
61
|
-
### Features
|
|
62
|
-
|
|
63
|
-
- add mock address provider to headless ([#1637](https://github.com/ExodusMovement/exodus-hydra/issues/1637)) ([c331601](https://github.com/ExodusMovement/exodus-hydra/commit/c331601d7de43bab8f67c7d48905b11a54ffccad))
|
|
64
|
-
- disable kyc tests ([#1638](https://github.com/ExodusMovement/exodus-hydra/issues/1638)) ([b51cfaf](https://github.com/ExodusMovement/exodus-hydra/commit/b51cfafe2431ff99695f0fc74c9b7590f67fe427))
|
|
65
|
-
|
|
66
|
-
## [2.0.0-alpha.20](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.19...@exodus/headless@2.0.0-alpha.20) (2023-05-12)
|
|
67
|
-
|
|
68
|
-
### Features
|
|
69
|
-
|
|
70
|
-
- stop timers on remoteConfig.stop(), kyc.stop(), referrals.stop() ([#1593](https://github.com/ExodusMovement/exodus-hydra/issues/1593)) ([0f73363](https://github.com/ExodusMovement/exodus-hydra/commit/0f7336362cdc5a6f878109e6353ac241795e4fc6))
|
|
71
|
-
|
|
72
|
-
### Bug Fixes
|
|
73
|
-
|
|
74
|
-
- kyc tests ([#1619](https://github.com/ExodusMovement/exodus-hydra/issues/1619)) ([20da423](https://github.com/ExodusMovement/exodus-hydra/commit/20da423b98aa3b950e197b4a2290898c731c59b2))
|
|
75
|
-
- kyc tests (again) ([#1626](https://github.com/ExodusMovement/exodus-hydra/issues/1626)) ([0f12f89](https://github.com/ExodusMovement/exodus-hydra/commit/0f12f898691504aefffeaca0db2fd3dbe9740ff6))
|
|
76
|
-
|
|
77
|
-
## [2.0.0-alpha.19](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.18...@exodus/headless@2.0.0-alpha.19) (2023-05-08)
|
|
78
|
-
|
|
79
|
-
### ⚠ BREAKING CHANGES
|
|
80
|
-
|
|
81
|
-
- use revamped geolocation (#1559)
|
|
82
|
-
|
|
83
|
-
### Features
|
|
84
|
-
|
|
85
|
-
- add addressesProvider to headless ([#1540](https://github.com/ExodusMovement/exodus-hydra/issues/1540)) ([90e963a](https://github.com/ExodusMovement/exodus-hydra/commit/90e963aafa0bb855d8c857902feac37514985d4a))
|
|
86
|
-
- add kyc and referrals modules to headless ([#1539](https://github.com/ExodusMovement/exodus-hydra/issues/1539)) ([1a0cf7c](https://github.com/ExodusMovement/exodus-hydra/commit/1a0cf7c18cbbfc5f2b92d9720d9cbf17cd850214))
|
|
87
|
-
|
|
88
|
-
### Code Refactoring
|
|
89
|
-
|
|
90
|
-
- use revamped geolocation ([#1559](https://github.com/ExodusMovement/exodus-hydra/issues/1559)) ([4378d13](https://github.com/ExodusMovement/exodus-hydra/commit/4378d137a67e4836a45c72e6bfc79590d4b7ab20))
|
|
91
|
-
|
|
92
|
-
## [2.0.0-alpha.18](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.17...@exodus/headless@2.0.0-alpha.18) (2023-05-05)
|
|
93
|
-
|
|
94
|
-
### Bug Fixes
|
|
95
|
-
|
|
96
|
-
- announce that featureFlags writes to featureFlagAtoms ([#1548](https://github.com/ExodusMovement/exodus-hydra/issues/1548)) ([fefac86](https://github.com/ExodusMovement/exodus-hydra/commit/fefac86970ab11e85d530d8424ca9f3de86fed91))
|
|
97
|
-
|
|
98
|
-
## [2.0.0-alpha.17](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.16...@exodus/headless@2.0.0-alpha.17) (2023-05-05)
|
|
99
|
-
|
|
100
|
-
### ⚠ BREAKING CHANGES
|
|
101
|
-
|
|
102
|
-
- don't serialize port payloads (#1458)
|
|
103
|
-
|
|
104
|
-
### Features
|
|
105
|
-
|
|
106
|
-
- add feature-flags to headless ([#1516](https://github.com/ExodusMovement/exodus-hydra/issues/1516)) ([9d2da89](https://github.com/ExodusMovement/exodus-hydra/commit/9d2da895d4f58d34674b19d42fe3fd621d439f73))
|
|
107
|
-
|
|
108
|
-
### Code Refactoring
|
|
109
|
-
|
|
110
|
-
- don't serialize port payloads ([#1458](https://github.com/ExodusMovement/exodus-hydra/issues/1458)) ([9b98a28](https://github.com/ExodusMovement/exodus-hydra/commit/9b98a28b091146ad0dee631a236629f25a16b3e2))
|
|
111
|
-
|
|
112
|
-
## [2.0.0-alpha.16](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.15...@exodus/headless@2.0.0-alpha.16) (2023-05-04)
|
|
113
|
-
|
|
114
|
-
### Bug Fixes
|
|
115
|
-
|
|
116
|
-
- bump atoms in headless ([#1523](https://github.com/ExodusMovement/exodus-hydra/issues/1523)) ([7b6ca0b](https://github.com/ExodusMovement/exodus-hydra/commit/7b6ca0b19ccad9e33c9c0f0aac03feddad9d4cac))
|
|
117
|
-
|
|
118
|
-
## [2.0.0-alpha.15](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.14...@exodus/headless@2.0.0-alpha.15) (2023-05-04)
|
|
119
|
-
|
|
120
|
-
### ⚠ BREAKING CHANGES
|
|
121
|
-
|
|
122
|
-
- use readOnlyAtoms dependency processor (#1497)
|
|
123
|
-
|
|
124
|
-
### Features
|
|
125
|
-
|
|
126
|
-
- add geolocation to headless ([#1514](https://github.com/ExodusMovement/exodus-hydra/issues/1514)) ([44a8620](https://github.com/ExodusMovement/exodus-hydra/commit/44a8620249f8de2147dc073098b68f0562fb7287))
|
|
127
|
-
- use readOnlyAtoms dependency processor ([#1497](https://github.com/ExodusMovement/exodus-hydra/issues/1497)) ([b3b4866](https://github.com/ExodusMovement/exodus-hydra/commit/b3b4866084428496aeff30dcb14ec583d6f4d64f))
|
|
128
|
-
|
|
129
|
-
### Bug Fixes
|
|
130
|
-
|
|
131
|
-
- enabledAssets storage access ([#1519](https://github.com/ExodusMovement/exodus-hydra/issues/1519)) ([c4d9463](https://github.com/ExodusMovement/exodus-hydra/commit/c4d9463829b0015e70ce617e11940b1fea5bfbe6))
|
|
132
|
-
|
|
133
|
-
## [2.0.0-alpha.14](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.13...@exodus/headless@2.0.0-alpha.14) (2023-05-03)
|
|
134
|
-
|
|
135
|
-
**Note:** Version bump only for package @exodus/headless
|
|
136
|
-
|
|
137
|
-
## [2.0.0-alpha.13](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.12...@exodus/headless@2.0.0-alpha.13) (2023-05-02)
|
|
138
|
-
|
|
139
|
-
### Features
|
|
140
|
-
|
|
141
|
-
- add rates monitor to headless ([#1470](https://github.com/ExodusMovement/exodus-hydra/issues/1470)) ([d214b9a](https://github.com/ExodusMovement/exodus-hydra/commit/d214b9a22ca0649bbd79e2c8f6d9592733c802d2))
|
|
142
|
-
|
|
143
|
-
### Bug Fixes
|
|
144
|
-
|
|
145
|
-
- get assetsModule from 'adapters' ([#1491](https://github.com/ExodusMovement/exodus-hydra/issues/1491)) ([b010cbd](https://github.com/ExodusMovement/exodus-hydra/commit/b010cbd319ffcd02d18a7492dc20e2d7ba7fe1c4))
|
|
146
|
-
|
|
147
|
-
## [2.0.0-alpha.12](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.11...@exodus/headless@2.0.0-alpha.12) (2023-05-02)
|
|
148
|
-
|
|
149
|
-
### Features
|
|
150
|
-
|
|
151
|
-
- add balances to headless ([#1379](https://github.com/ExodusMovement/exodus-hydra/issues/1379)) ([b5d6846](https://github.com/ExodusMovement/exodus-hydra/commit/b5d6846d86b9d83463ece51a2ef14c4fd898d438))
|
|
152
|
-
|
|
153
|
-
## [2.0.0-alpha.11](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.10...@exodus/headless@2.0.0-alpha.11) (2023-05-02)
|
|
154
|
-
|
|
155
|
-
### Features
|
|
156
|
-
|
|
157
|
-
- migrate locales atoms ([#1457](https://github.com/ExodusMovement/exodus-hydra/issues/1457)) ([e6f3a7f](https://github.com/ExodusMovement/exodus-hydra/commit/e6f3a7feb4319d8aa44032e27df746343fdb66eb))
|
|
158
|
-
- migrate market history module ([#1456](https://github.com/ExodusMovement/exodus-hydra/issues/1456)) ([3e64532](https://github.com/ExodusMovement/exodus-hydra/commit/3e64532b739ea802f0df841b7c030c2c912d57e8))
|
|
159
|
-
|
|
160
|
-
## [2.0.0-alpha.10](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.9...@exodus/headless@2.0.0-alpha.10) (2023-04-30)
|
|
161
|
-
|
|
162
|
-
### Features
|
|
163
|
-
|
|
164
|
-
- add pricingClient to headless ([#1439](https://github.com/ExodusMovement/exodus-hydra/issues/1439)) ([2a82a4c](https://github.com/ExodusMovement/exodus-hydra/commit/2a82a4c663b542178580908aaaff840524d55369))
|
|
165
|
-
- attach wallet account atoms ([#1437](https://github.com/ExodusMovement/exodus-hydra/issues/1437)) ([2648699](https://github.com/ExodusMovement/exodus-hydra/commit/264869986c175091e6bc7c48e852946bd60911d6))
|
|
166
|
-
|
|
167
|
-
## [2.0.0-alpha.9](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.8...@exodus/headless@2.0.0-alpha.9) (2023-04-26)
|
|
168
|
-
|
|
169
|
-
### Features
|
|
170
|
-
|
|
171
|
-
- add available-assets to headless ([#1361](https://github.com/ExodusMovement/exodus-hydra/issues/1361)) ([900d142](https://github.com/ExodusMovement/exodus-hydra/commit/900d142018ff112f36ef0f7ef53cf5020020e3ca))
|
|
172
|
-
|
|
173
|
-
## [2.0.0-alpha.8](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.7...@exodus/headless@2.0.0-alpha.8) (2023-04-25)
|
|
174
|
-
|
|
175
|
-
### Features
|
|
176
|
-
|
|
177
|
-
- add enabled-assets to headless ([#1235](https://github.com/ExodusMovement/exodus-hydra/issues/1235)) ([a808b75](https://github.com/ExodusMovement/exodus-hydra/commit/a808b750bd911c33241ae710fbf8d8ba7e2073a6))
|
|
178
|
-
- add lifecycle docs ([#1313](https://github.com/ExodusMovement/exodus-hydra/issues/1313)) ([df18faa](https://github.com/ExodusMovement/exodus-hydra/commit/df18faa9c341404c2feaadf51ec46236c54e2f15))
|
|
179
|
-
- add remoteConfig module ([#1370](https://github.com/ExodusMovement/exodus-hydra/issues/1370)) ([ebc888d](https://github.com/ExodusMovement/exodus-hydra/commit/ebc888d6440c509a19dd6c9c600033fd41128ad7))
|
|
180
|
-
- add support for plugins ([#1351](https://github.com/ExodusMovement/exodus-hydra/issues/1351)) ([fac0e2a](https://github.com/ExodusMovement/exodus-hydra/commit/fac0e2a727b0e71ad5f0619b8457c7e80612f707))
|
|
181
|
-
|
|
182
|
-
## [2.0.0-alpha.7](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.6...@exodus/headless@2.0.0-alpha.7) (2023-04-24)
|
|
183
|
-
|
|
184
|
-
### ⚠ BREAKING CHANGES
|
|
185
|
-
|
|
186
|
-
- pass compatibility modes config to wallet (#1223)
|
|
187
|
-
|
|
188
|
-
### Features
|
|
189
|
-
|
|
190
|
-
- add blockchain metadata to headless ([#1293](https://github.com/ExodusMovement/exodus-hydra/issues/1293)) ([04390a7](https://github.com/ExodusMovement/exodus-hydra/commit/04390a71cb01744cd427f470735fa0748b9157ca))
|
|
191
|
-
- add namespaceStorage preprocessor ([#1322](https://github.com/ExodusMovement/exodus-hydra/issues/1322)) ([95f403e](https://github.com/ExodusMovement/exodus-hydra/commit/95f403e59c87f90901247619c727496ebac0a399))
|
|
192
|
-
- pass compatibility modes config to wallet ([#1223](https://github.com/ExodusMovement/exodus-hydra/issues/1223)) ([b49b640](https://github.com/ExodusMovement/exodus-hydra/commit/b49b64097af7969e210e5ecf5395ee7f40a13eac))
|
|
193
|
-
|
|
194
|
-
## [2.0.0-alpha.6](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.5...@exodus/headless@2.0.0-alpha.6) (2023-04-20)
|
|
195
|
-
|
|
196
|
-
### Features
|
|
197
|
-
|
|
198
|
-
- add walletAccounts in headless ([#1184](https://github.com/ExodusMovement/exodus-hydra/issues/1184)) ([8d9c93d](https://github.com/ExodusMovement/exodus-hydra/commit/8d9c93d86173476211d596e883a72b51b645e866))
|
|
199
|
-
|
|
200
|
-
## [2.0.0-alpha.5](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.4...@exodus/headless@2.0.0-alpha.5) (2023-04-20)
|
|
201
|
-
|
|
202
|
-
### Features
|
|
203
|
-
|
|
204
|
-
- force restart on import ([#1297](https://github.com/ExodusMovement/exodus-hydra/issues/1297)) ([3900196](https://github.com/ExodusMovement/exodus-hydra/commit/39001966ce7d962ddde9df8aa3b93619053569f8))
|
|
205
|
-
- **headless:** clear storage when seed not present ([#1300](https://github.com/ExodusMovement/exodus-hydra/issues/1300)) ([c3c76f5](https://github.com/ExodusMovement/exodus-hydra/commit/c3c76f5953d91e5ef308b129f1bb2fec0dc41500))
|
|
206
|
-
- unlock encrypted storage on wallet unlock ([#1304](https://github.com/ExodusMovement/exodus-hydra/issues/1304)) ([09ea5f2](https://github.com/ExodusMovement/exodus-hydra/commit/09ea5f20ff9547557f59d4c416cee3291f348fdf))
|
|
207
|
-
|
|
208
|
-
## [2.0.0-alpha.4](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.3...@exodus/headless@2.0.0-alpha.4) (2023-04-13)
|
|
209
|
-
|
|
210
|
-
**Note:** Version bump only for package @exodus/headless
|
|
211
|
-
|
|
212
6
|
## [2.0.0-alpha.3](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.2...@exodus/headless@2.0.0-alpha.3) (2023-04-11)
|
|
213
7
|
|
|
214
8
|
### Features
|
package/README.md
CHANGED
|
@@ -2,15 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
The headless Exodus wallet SDK
|
|
4
4
|
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
- [Quick Start](#quick-start)
|
|
8
|
-
- [Lifecycle](#lifecycle)
|
|
9
|
-
- [Port](#port)
|
|
10
|
-
- [Adapters](#adapters)
|
|
11
|
-
- [Config](#config)
|
|
12
|
-
- [Headless API](#headless-api)
|
|
13
|
-
|
|
14
5
|
## Quick Start
|
|
15
6
|
|
|
16
7
|
```js
|
|
@@ -43,65 +34,6 @@ const exodus = container.resolve()
|
|
|
43
34
|
await exodus.wallet.create({ passphrase: 'my-super-secure-passphrase' })
|
|
44
35
|
```
|
|
45
36
|
|
|
46
|
-
## Lifecycle
|
|
47
|
-
|
|
48
|
-
The headless wallet instance transitions through different states during his life. When moving from one another, there are two things that are triggered:
|
|
49
|
-
|
|
50
|
-
- Fires hook call: Allows modules to subscribe and halt transition until listener resolves.
|
|
51
|
-
- Fires event call: Emitted after all hooks had been executed and resolved.
|
|
52
|
-
|
|
53
|
-
Below you can find a state diagram that visualize what hooks are triggered between state transitions:
|
|
54
|
-
|
|
55
|
-
```mermaid
|
|
56
|
-
stateDiagram-v2
|
|
57
|
-
direction LR
|
|
58
|
-
[*] --> Starting
|
|
59
|
-
|
|
60
|
-
state Starting {
|
|
61
|
-
direction LR
|
|
62
|
-
|
|
63
|
-
state "Needs clear storage?*" as NeedsClear
|
|
64
|
-
state "Is importing?" as IsImporting
|
|
65
|
-
|
|
66
|
-
NeedsClear --> Clearing : CLEAR
|
|
67
|
-
Clearing --> IsImporting
|
|
68
|
-
IsImporting --> Importing : IMPORT
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
Starting --> Started : START
|
|
72
|
-
|
|
73
|
-
state Started {
|
|
74
|
-
direction LR
|
|
75
|
-
|
|
76
|
-
state "Has seed?" as HasSeed
|
|
77
|
-
|
|
78
|
-
HasSeed --> Empty : No
|
|
79
|
-
HasSeed --> Locked : Yes
|
|
80
|
-
|
|
81
|
-
Empty --> Locked : CREATE \n---or---\nIMPORT
|
|
82
|
-
|
|
83
|
-
Locked --> Migrating : MIGRATE
|
|
84
|
-
Migrating --> Unlocked : UNLOCK
|
|
85
|
-
Unlocked --> Locked : LOCK
|
|
86
|
-
|
|
87
|
-
Unlocked --> Restarting : DELETE
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
Restarting --> [*] : RESTART
|
|
93
|
-
|
|
94
|
-
Started --> Started : LOAD
|
|
95
|
-
|
|
96
|
-
classDef conditional fill:#ededed,stroke:#c2c2c2,color:#a6a6a6,stroke-width:2;
|
|
97
|
-
|
|
98
|
-
class NeedsClear conditional
|
|
99
|
-
class IsImporting conditional
|
|
100
|
-
class HasSeed conditional
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
\* Wallet needs to clear storage if seed is not present or is restoring a new wallet
|
|
104
|
-
|
|
105
37
|
## Port
|
|
106
38
|
|
|
107
39
|
Event bus between headless wallet and client
|
|
@@ -189,21 +121,21 @@ Currently not used.
|
|
|
189
121
|
|
|
190
122
|
> Type: object
|
|
191
123
|
|
|
192
|
-
| Method | Type
|
|
193
|
-
| ------------------------ |
|
|
194
|
-
| exists | `async () => boolean`
|
|
195
|
-
| create | `async ({ passphrase?: string }) => void`
|
|
196
|
-
| import | `async ({ mnemonic: string, passphrase?: string
|
|
197
|
-
| delete | `async ({ passphrase?: string }) => void`
|
|
198
|
-
| lock | `async () => void`
|
|
199
|
-
| unlock | `async ({ passphrase?: string }) => void`
|
|
200
|
-
| isLocked | `async () => boolean`
|
|
201
|
-
| getMnemonic | `async () => void`
|
|
202
|
-
| changePassphrase | `async ({ currentPassphrase?: string. newPassphrase: string }) => void`
|
|
203
|
-
| restoreFromCurrentPhrase | `async ({ passphrase?: string }) => void`
|
|
204
|
-
| load | `async () => void`
|
|
205
|
-
| unload | `async () => void`
|
|
206
|
-
| changeLockTimer | `async ({ ttl: number }) => void`
|
|
124
|
+
| Method | Type | Description |
|
|
125
|
+
| ------------------------ | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
126
|
+
| exists | `async () => boolean` | Checks if a wallet exists on the device. |
|
|
127
|
+
| create | `async ({ passphrase?: string }) => void` | Creates new wallet |
|
|
128
|
+
| import | `async ({ mnemonic: string, passphrase?: string }) => void` | Imports existing wallet |
|
|
129
|
+
| delete | `async ({ passphrase?: string }) => void` | Deletes wallet. Passphrase is mandatory if wallet was created with one |
|
|
130
|
+
| lock | `async () => void` | Locks wallet |
|
|
131
|
+
| unlock | `async ({ passphrase?: string }) => void` | Unlocks wallet. Passphrase is mandatory if wallet was created with one |
|
|
132
|
+
| isLocked | `async () => boolean` | Checks if wallet is locked |
|
|
133
|
+
| getMnemonic | `async () => void` | Sets wallet as backed up |
|
|
134
|
+
| changePassphrase | `async ({ currentPassphrase?: string. newPassphrase: string }) => void` | Change passphrase. Current passphrase is mandatory if wallet was created with one |
|
|
135
|
+
| restoreFromCurrentPhrase | `async ({ passphrase?: string }) => void` | Restore current wallet. Passphrase is mandatory if wallet was created with one |
|
|
136
|
+
| load | `async () => void` | Loads UI by rehydratating data through port (`BE Only`) |
|
|
137
|
+
| unload | `async () => void` | Unloads UI by rehydratating data through port (`BE Only`) |
|
|
138
|
+
| changeLockTimer | `async ({ ttl: number }) => void` | Change auto unlock ttl (`BE Only`) |
|
|
207
139
|
|
|
208
140
|
## isMnemonicValid
|
|
209
141
|
|
|
@@ -216,55 +148,6 @@ Currently not used.
|
|
|
216
148
|
|
|
217
149
|
**Returns**: `boolean`
|
|
218
150
|
|
|
219
|
-
## walletAccounts
|
|
220
|
-
|
|
221
|
-
> Type: object
|
|
222
|
-
|
|
223
|
-
| Method | Type | Description |
|
|
224
|
-
| ---------- | ------------------------------------------- | -------------------------------------------------------------- |
|
|
225
|
-
| create | `async (walletAccountFields) => void` | Creates a new WalletAccount with the provided fields. |
|
|
226
|
-
| update | `async (name, walletAccountFields) => void` | Updates an existing WalletAccount with the provided fields. |
|
|
227
|
-
| enable | `async (name) => void` | Enables an existing WalletAccount. |
|
|
228
|
-
| disable | `async (name) => void` | Disables an existing WalletAccount. |
|
|
229
|
-
| getEnabled | `async () => object` | Returns enabled walletAccounts as `{ [name]: WalletAccount }`. |
|
|
230
|
-
|
|
231
|
-
## blockchainMetadata
|
|
232
|
-
|
|
233
|
-
> Type: object
|
|
234
|
-
|
|
235
|
-
| Method | Type | Description |
|
|
236
|
-
| ---------------------- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
237
|
-
| getTxLog | `async ({ assetName, walletAccount }) => TxSet` | Get the TxSet for the provided `assetName`/`walletAccount` combination (AssetSource) |
|
|
238
|
-
| getLoadedTxLogs | `async () => object` | Get the all loaded `TxSet`s as a `{ [walletAccount]: { [assetName]: TxSet } } object` |
|
|
239
|
-
| updateTxs | `async ({ assetName: string, walletAccount: string, txs: object[] }) => void` | Add or update txs with updates provided in `txs` |
|
|
240
|
-
| overwriteTxs | `async ({ assetName: string, walletAccount: string, txs: object[], notifyReceivedTxs: ?boolean }) => void` | Overwrite specified txs. |
|
|
241
|
-
| clearTxs | `async ({ assetName: string, walletAccount: string }) => void` | Remove txs for AssetSource. |
|
|
242
|
-
| removeTxs | `async ({ assetName: string, walletAccount: string, txs: object[] }) => void` | Remove provided txs. |
|
|
243
|
-
| getAccountState | `async ({ assetName, walletAccount }) => AccountState` | Get the AccountState for the provided AssetSource |
|
|
244
|
-
| getLoadedAccountStates | `async () => object` | Get the all loaded `AccountState`s as a `{ [walletAccount]: { [assetName]: AccountState } } object` |
|
|
245
|
-
| updateAccountState | `async ({ assetName: string, walletAccount: string, newData: object }) => void` | Update accountState for AssetSource. |
|
|
246
|
-
| removeAccountState | `async ({ assetName: string, walletAccount: string }) => void` | Remove accountState for AssetSource. |
|
|
247
|
-
| batch | `() => Batch` | Create a batch of updates. See [blockchainMetadata](../blockchain-metadata) README for batching details. |
|
|
248
|
-
|
|
249
|
-
## assets
|
|
250
|
-
|
|
251
|
-
> Type: object
|
|
252
|
-
|
|
253
|
-
| Method | Type | Description |
|
|
254
|
-
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
255
|
-
| enable | `async (assetNames: string[]) => void` | Enables assets. |
|
|
256
|
-
| disable | `async (assetNames: string[]) => void` | Disables assets. |
|
|
257
|
-
| addAndEnableToken | `async (assetId: string, baseAssetName: string) => string` | Adds and enables a custom token. Returns the created `asset`'s `.name` |
|
|
258
|
-
|
|
259
|
-
## locale
|
|
260
|
-
|
|
261
|
-
> Type: object
|
|
262
|
-
|
|
263
|
-
| Method | Type | Description |
|
|
264
|
-
| ----------- | ---------------------------------- | ------------------------- |
|
|
265
|
-
| setCurrency | `async (currency: string) => void` | Changes current currency. |
|
|
266
|
-
| setLanguage | `async (language: string) => void` | Changes current language. |
|
|
267
|
-
|
|
268
151
|
## subscribe
|
|
269
152
|
|
|
270
153
|
> Type: function
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/headless",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
4
|
"description": "The headless Exodus wallet SDK",
|
|
5
5
|
"author": "Exodus Movement Inc",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -23,65 +23,30 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"lint": "eslint . --ignore-path ../../.gitignore",
|
|
25
25
|
"lint:fix": "yarn lint --fix",
|
|
26
|
-
"test": "jest
|
|
26
|
+
"test": "jest"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@exodus/
|
|
30
|
-
"@exodus/
|
|
31
|
-
"@exodus/
|
|
32
|
-
"@exodus/balances": "^6.0.0",
|
|
33
|
-
"@exodus/basic-utils": "^2.0.0",
|
|
34
|
-
"@exodus/blockchain-metadata": "^8.0.1",
|
|
35
|
-
"@exodus/config": "^7.0.0",
|
|
36
|
-
"@exodus/connected-origins": "^1.1.2",
|
|
37
|
-
"@exodus/crypto-news-monitor": "^2.0.0",
|
|
38
|
-
"@exodus/dependency-injection": "^1.4.0",
|
|
39
|
-
"@exodus/dependency-preprocessors": "^2.4.0",
|
|
40
|
-
"@exodus/enabled-assets": "^6.0.1",
|
|
41
|
-
"@exodus/exodus-pricing-client": "^1.1.0",
|
|
42
|
-
"@exodus/feature-flags": "^2.0.1",
|
|
43
|
-
"@exodus/fee-monitors": "^1.0.0",
|
|
29
|
+
"@exodus/atoms": "^2.9.0",
|
|
30
|
+
"@exodus/dependency-injection": "^1.2.0",
|
|
31
|
+
"@exodus/dependency-preprocessors": "^2.0.2",
|
|
44
32
|
"@exodus/fetch": "^1.2.1",
|
|
45
|
-
"@exodus/
|
|
46
|
-
"@exodus/
|
|
47
|
-
"@exodus/keychain": "^4.0.0",
|
|
48
|
-
"@exodus/kyc": "^3.4.0",
|
|
49
|
-
"@exodus/market-history": "^3.1.0",
|
|
33
|
+
"@exodus/key-identifier-provider": "^1.1.1",
|
|
34
|
+
"@exodus/keychain": "^3.2.1",
|
|
50
35
|
"@exodus/module": "^1.0.0",
|
|
51
|
-
"@exodus/
|
|
52
|
-
"@exodus/
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"@exodus/wallet": "^6.0.1",
|
|
56
|
-
"@exodus/wallet-accounts": "^8.0.1",
|
|
57
|
-
"@exodus/wallet-compatibility-modes": "^2.0.0",
|
|
58
|
-
"bip39": "^2.6.0",
|
|
59
|
-
"events": "^3.3.0",
|
|
60
|
-
"lodash": "npm:@exodus/lodash@^4.17.21-exodus.2",
|
|
36
|
+
"@exodus/wallet": "^5.0.0",
|
|
37
|
+
"@exodus/wallet-compatibility-modes": "1.0.2",
|
|
38
|
+
"bip39": "2.6.0",
|
|
39
|
+
"lodash": "https://registry.yarnpkg.com/@exodus/lodash/-/lodash-4.17.21-exodus.2.tgz",
|
|
61
40
|
"minimalistic-assert": "^1.0.1"
|
|
62
41
|
},
|
|
63
42
|
"devDependencies": {
|
|
64
|
-
"@exodus/algorand-lib": "^2.0.1",
|
|
65
|
-
"@exodus/algorand-meta": "^1.1.4",
|
|
66
|
-
"@exodus/bitcoin-lib": "^2.2.1",
|
|
67
|
-
"@exodus/bitcoin-meta": "^1.0.0",
|
|
68
|
-
"@exodus/currency": "^2.2.0",
|
|
69
43
|
"@exodus/ethereum-lib": "^2.22.2",
|
|
70
|
-
"@exodus/ethereum-meta": "^1.0.23",
|
|
71
|
-
"@exodus/models": "^8.11.1",
|
|
72
44
|
"@exodus/solana-lib": "^1.3.11",
|
|
73
|
-
"@exodus/
|
|
74
|
-
"@exodus/storage-encrypted": "^1.1.2",
|
|
75
|
-
"@exodus/storage-memory": "^2.1.0",
|
|
45
|
+
"@exodus/storage-memory": "^1.1.0",
|
|
76
46
|
"@exodus/wild-emitter": "^1.0.0",
|
|
77
47
|
"buffer-json": "^2.0.0",
|
|
78
|
-
"deepmerge": "^4.2.2",
|
|
79
48
|
"eslint": "^8.33.0",
|
|
80
|
-
"
|
|
81
|
-
"events": "^3.3.0",
|
|
82
|
-
"jest": "^29.1.2",
|
|
83
|
-
"nock": "^13.3.1",
|
|
84
|
-
"p-defer": "^4.0.0"
|
|
49
|
+
"jest": "^29.1.2"
|
|
85
50
|
},
|
|
86
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "f564f9445892bf57cf79ce8921c35ed874ab0b71"
|
|
87
52
|
}
|
package/src/api.js
CHANGED
|
@@ -1,39 +1,9 @@
|
|
|
1
1
|
import { validateMnemonic as isMnemonicValid } from 'bip39'
|
|
2
2
|
|
|
3
3
|
const createApi = ({ ioc, port }) => {
|
|
4
|
-
const {
|
|
4
|
+
const { passphraseCache } = ioc.getByType('adapter')
|
|
5
5
|
|
|
6
|
-
const {
|
|
7
|
-
addressesProvider,
|
|
8
|
-
application,
|
|
9
|
-
blockchainMetadata,
|
|
10
|
-
enabledAssets,
|
|
11
|
-
kyc,
|
|
12
|
-
personalNotes,
|
|
13
|
-
referrals,
|
|
14
|
-
remoteConfig,
|
|
15
|
-
wallet,
|
|
16
|
-
walletAccounts,
|
|
17
|
-
connectedOrigins,
|
|
18
|
-
} = ioc.getByType('module')
|
|
19
|
-
|
|
20
|
-
const { ratesMonitor, feeMonitors } = ioc.getByType('monitor')
|
|
21
|
-
|
|
22
|
-
const {
|
|
23
|
-
// ...
|
|
24
|
-
currencyAtom,
|
|
25
|
-
enabledWalletAccountsAtom,
|
|
26
|
-
languageAtom,
|
|
27
|
-
connectedOriginsAtom,
|
|
28
|
-
} = ioc.getByType('atom')
|
|
29
|
-
|
|
30
|
-
// TODO: do this on 'unload'
|
|
31
|
-
const stop = () => {
|
|
32
|
-
kyc.stop()
|
|
33
|
-
referrals.stop()
|
|
34
|
-
remoteConfig.stop()
|
|
35
|
-
feeMonitors.stop()
|
|
36
|
-
}
|
|
6
|
+
const { application, wallet } = ioc.getByType('module')
|
|
37
7
|
|
|
38
8
|
return {
|
|
39
9
|
wallet: {
|
|
@@ -57,80 +27,9 @@ const createApi = ({ ioc, port }) => {
|
|
|
57
27
|
changeLockTimer: application.changeLockTimer,
|
|
58
28
|
isLocked: () => wallet.isLocked(),
|
|
59
29
|
},
|
|
60
|
-
walletAccounts: {
|
|
61
|
-
create: walletAccounts.create,
|
|
62
|
-
update: walletAccounts.update,
|
|
63
|
-
disable: walletAccounts.disable,
|
|
64
|
-
enable: walletAccounts.enable,
|
|
65
|
-
getEnabled: enabledWalletAccountsAtom.get,
|
|
66
|
-
},
|
|
67
|
-
blockchainMetadata: {
|
|
68
|
-
getTxLog: blockchainMetadata.getTxLog,
|
|
69
|
-
getLoadedTxLogs: blockchainMetadata.getLoadedTxLogs,
|
|
70
|
-
updateTxs: blockchainMetadata.updateTxs,
|
|
71
|
-
overwriteTxs: blockchainMetadata.overwriteTxs,
|
|
72
|
-
clearTxs: blockchainMetadata.clearTxs,
|
|
73
|
-
removeTxs: blockchainMetadata.removeTxs,
|
|
74
|
-
getAccountState: blockchainMetadata.getAccountState,
|
|
75
|
-
getLoadedAccountStates: blockchainMetadata.getLoadedAccountStates,
|
|
76
|
-
updateAccountState: blockchainMetadata.updateAccountState,
|
|
77
|
-
removeAccountState: blockchainMetadata.removeAccountState,
|
|
78
|
-
batch: blockchainMetadata.batch,
|
|
79
|
-
},
|
|
80
|
-
assets: {
|
|
81
|
-
enable: enabledAssets.enable,
|
|
82
|
-
disable: enabledAssets.disable,
|
|
83
|
-
addAndEnableToken: async (...args) => {
|
|
84
|
-
const asset = await assetsModule.addToken(...args)
|
|
85
|
-
await enabledAssets.enable([asset.name])
|
|
86
|
-
return asset.name
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
remoteConfig: {
|
|
90
|
-
get: remoteConfig.get,
|
|
91
|
-
getAll: remoteConfig.getAll,
|
|
92
|
-
},
|
|
93
|
-
locale: {
|
|
94
|
-
setLanguage: (value) => languageAtom.set(value),
|
|
95
|
-
setCurrency: (value) => currencyAtom.set(value),
|
|
96
|
-
},
|
|
97
|
-
rates: {
|
|
98
|
-
refresh: () => ratesMonitor.update(),
|
|
99
|
-
},
|
|
100
|
-
addressesProvider: {
|
|
101
|
-
getAddress: addressesProvider.getAddress.bind(addressesProvider),
|
|
102
|
-
getSupportedPurposes: addressesProvider.getSupportedPurposes.bind(addressesProvider),
|
|
103
|
-
getReceiveAddress: addressesProvider.getReceiveAddress.bind(addressesProvider),
|
|
104
|
-
},
|
|
105
|
-
kyc: {
|
|
106
|
-
start: kyc.start,
|
|
107
|
-
sync: kyc.sync,
|
|
108
|
-
requestKycToken: kyc.requestKycToken,
|
|
109
|
-
},
|
|
110
|
-
referrals: {
|
|
111
|
-
setReferredBy: referrals.setReferredBy,
|
|
112
|
-
referralCodeExists: referrals.referralCodeExists,
|
|
113
|
-
},
|
|
114
|
-
personalNotes: {
|
|
115
|
-
upsert: personalNotes.upsert,
|
|
116
|
-
},
|
|
117
30
|
isMnemonicValid,
|
|
118
31
|
subscribe: port.subscribe.bind(port),
|
|
119
32
|
unsubscribe: port.unsubscribe.bind(port),
|
|
120
|
-
stop,
|
|
121
|
-
connectedOrigins: {
|
|
122
|
-
get: connectedOriginsAtom.get,
|
|
123
|
-
add: connectedOrigins.add,
|
|
124
|
-
untrust: connectedOrigins.untrust,
|
|
125
|
-
isTrusted: connectedOrigins.isTrusted,
|
|
126
|
-
isAutoApprove: connectedOrigins.isAutoApprove,
|
|
127
|
-
setFavorite: connectedOrigins.setFavorite,
|
|
128
|
-
setAutoApprove: connectedOrigins.setAutoApprove,
|
|
129
|
-
connect: connectedOrigins.connect,
|
|
130
|
-
disconnect: connectedOrigins.disconnect,
|
|
131
|
-
updateConnection: connectedOrigins.updateConnection,
|
|
132
|
-
clearConnections: connectedOrigins.clearConnections,
|
|
133
|
-
},
|
|
134
33
|
}
|
|
135
34
|
}
|
|
136
35
|
|