@exodus/headless 2.0.0-alpha.28 → 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 CHANGED
@@ -3,206 +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.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)
7
-
8
- ### Features
9
-
10
- - add crypto news monitor to headless ([#1750](https://github.com/ExodusMovement/exodus-hydra/issues/1750)) ([64d46a3](https://github.com/ExodusMovement/exodus-hydra/commit/64d46a3d95c3b34d504b0b7128961df1427b6853))
11
-
12
- ## [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)
13
-
14
- ### Features
15
-
16
- - integrate top-movers monitor into headless ([#1743](https://github.com/ExodusMovement/exodus-hydra/issues/1743)) ([05c4b22](https://github.com/ExodusMovement/exodus-hydra/commit/05c4b22e69e823563d81bfe7b30a2d21574d0c45))
17
-
18
- ## [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)
19
-
20
- ### Features
21
-
22
- - integrate feeMonitors into headless ([#1732](https://github.com/ExodusMovement/exodus-hydra/issues/1732)) ([5a4b9b4](https://github.com/ExodusMovement/exodus-hydra/commit/5a4b9b4e2e7b70ac550775860a3bf5474e21a4d0))
23
-
24
- ## [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)
25
-
26
- ### Features
27
-
28
- - migrate connected origins to headless ([#1702](https://github.com/ExodusMovement/exodus-hydra/issues/1702)) ([7f6678e](https://github.com/ExodusMovement/exodus-hydra/commit/7f6678eabc5a66dbf11002f021bb700bec3d32f3))
29
-
30
- ## [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)
31
-
32
- ### Features
33
-
34
- - 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))
35
-
36
- ## [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)
37
-
38
- ### Features
39
-
40
- - add personal notes to headless ([#1676](https://github.com/ExodusMovement/exodus-hydra/issues/1676)) ([c658211](https://github.com/ExodusMovement/exodus-hydra/commit/c6582113b56953edbf68fd0f4d29f4ee802e8bf5))
41
-
42
- ### Bug Fixes
43
-
44
- - handle market-history-new-assets ([#1657](https://github.com/ExodusMovement/exodus-hydra/issues/1657)) ([89ff868](https://github.com/ExodusMovement/exodus-hydra/commit/89ff868ade7def9dc1ae99555f069e1a0cfeacba))
45
- - start geolocation at start ([#1669](https://github.com/ExodusMovement/exodus-hydra/issues/1669)) ([ecfd0f3](https://github.com/ExodusMovement/exodus-hydra/commit/ecfd0f3a74ebf2ed5bca53c67c55ec304df91f4c))
46
-
47
- ## [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)
48
-
49
- ### Features
50
-
51
- - **headless:** bump geolocation ([#1642](https://github.com/ExodusMovement/exodus-hydra/issues/1642)) ([ff1d61b](https://github.com/ExodusMovement/exodus-hydra/commit/ff1d61b0b91ec54fe78f99a33ad987e3a0e54d65))
52
-
53
- ## [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)
54
-
55
- ### Features
56
-
57
- - add mock address provider to headless ([#1637](https://github.com/ExodusMovement/exodus-hydra/issues/1637)) ([c331601](https://github.com/ExodusMovement/exodus-hydra/commit/c331601d7de43bab8f67c7d48905b11a54ffccad))
58
- - disable kyc tests ([#1638](https://github.com/ExodusMovement/exodus-hydra/issues/1638)) ([b51cfaf](https://github.com/ExodusMovement/exodus-hydra/commit/b51cfafe2431ff99695f0fc74c9b7590f67fe427))
59
-
60
- ## [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)
61
-
62
- ### Features
63
-
64
- - 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))
65
-
66
- ### Bug Fixes
67
-
68
- - kyc tests ([#1619](https://github.com/ExodusMovement/exodus-hydra/issues/1619)) ([20da423](https://github.com/ExodusMovement/exodus-hydra/commit/20da423b98aa3b950e197b4a2290898c731c59b2))
69
- - kyc tests (again) ([#1626](https://github.com/ExodusMovement/exodus-hydra/issues/1626)) ([0f12f89](https://github.com/ExodusMovement/exodus-hydra/commit/0f12f898691504aefffeaca0db2fd3dbe9740ff6))
70
-
71
- ## [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)
72
-
73
- ### ⚠ BREAKING CHANGES
74
-
75
- - use revamped geolocation (#1559)
76
-
77
- ### Features
78
-
79
- - add addressesProvider to headless ([#1540](https://github.com/ExodusMovement/exodus-hydra/issues/1540)) ([90e963a](https://github.com/ExodusMovement/exodus-hydra/commit/90e963aafa0bb855d8c857902feac37514985d4a))
80
- - 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))
81
-
82
- ### Code Refactoring
83
-
84
- - use revamped geolocation ([#1559](https://github.com/ExodusMovement/exodus-hydra/issues/1559)) ([4378d13](https://github.com/ExodusMovement/exodus-hydra/commit/4378d137a67e4836a45c72e6bfc79590d4b7ab20))
85
-
86
- ## [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)
87
-
88
- ### Bug Fixes
89
-
90
- - announce that featureFlags writes to featureFlagAtoms ([#1548](https://github.com/ExodusMovement/exodus-hydra/issues/1548)) ([fefac86](https://github.com/ExodusMovement/exodus-hydra/commit/fefac86970ab11e85d530d8424ca9f3de86fed91))
91
-
92
- ## [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)
93
-
94
- ### ⚠ BREAKING CHANGES
95
-
96
- - don't serialize port payloads (#1458)
97
-
98
- ### Features
99
-
100
- - add feature-flags to headless ([#1516](https://github.com/ExodusMovement/exodus-hydra/issues/1516)) ([9d2da89](https://github.com/ExodusMovement/exodus-hydra/commit/9d2da895d4f58d34674b19d42fe3fd621d439f73))
101
-
102
- ### Code Refactoring
103
-
104
- - don't serialize port payloads ([#1458](https://github.com/ExodusMovement/exodus-hydra/issues/1458)) ([9b98a28](https://github.com/ExodusMovement/exodus-hydra/commit/9b98a28b091146ad0dee631a236629f25a16b3e2))
105
-
106
- ## [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)
107
-
108
- ### Bug Fixes
109
-
110
- - bump atoms in headless ([#1523](https://github.com/ExodusMovement/exodus-hydra/issues/1523)) ([7b6ca0b](https://github.com/ExodusMovement/exodus-hydra/commit/7b6ca0b19ccad9e33c9c0f0aac03feddad9d4cac))
111
-
112
- ## [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)
113
-
114
- ### ⚠ BREAKING CHANGES
115
-
116
- - use readOnlyAtoms dependency processor (#1497)
117
-
118
- ### Features
119
-
120
- - add geolocation to headless ([#1514](https://github.com/ExodusMovement/exodus-hydra/issues/1514)) ([44a8620](https://github.com/ExodusMovement/exodus-hydra/commit/44a8620249f8de2147dc073098b68f0562fb7287))
121
- - use readOnlyAtoms dependency processor ([#1497](https://github.com/ExodusMovement/exodus-hydra/issues/1497)) ([b3b4866](https://github.com/ExodusMovement/exodus-hydra/commit/b3b4866084428496aeff30dcb14ec583d6f4d64f))
122
-
123
- ### Bug Fixes
124
-
125
- - enabledAssets storage access ([#1519](https://github.com/ExodusMovement/exodus-hydra/issues/1519)) ([c4d9463](https://github.com/ExodusMovement/exodus-hydra/commit/c4d9463829b0015e70ce617e11940b1fea5bfbe6))
126
-
127
- ## [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)
128
-
129
- **Note:** Version bump only for package @exodus/headless
130
-
131
- ## [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)
132
-
133
- ### Features
134
-
135
- - add rates monitor to headless ([#1470](https://github.com/ExodusMovement/exodus-hydra/issues/1470)) ([d214b9a](https://github.com/ExodusMovement/exodus-hydra/commit/d214b9a22ca0649bbd79e2c8f6d9592733c802d2))
136
-
137
- ### Bug Fixes
138
-
139
- - get assetsModule from 'adapters' ([#1491](https://github.com/ExodusMovement/exodus-hydra/issues/1491)) ([b010cbd](https://github.com/ExodusMovement/exodus-hydra/commit/b010cbd319ffcd02d18a7492dc20e2d7ba7fe1c4))
140
-
141
- ## [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)
142
-
143
- ### Features
144
-
145
- - add balances to headless ([#1379](https://github.com/ExodusMovement/exodus-hydra/issues/1379)) ([b5d6846](https://github.com/ExodusMovement/exodus-hydra/commit/b5d6846d86b9d83463ece51a2ef14c4fd898d438))
146
-
147
- ## [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)
148
-
149
- ### Features
150
-
151
- - migrate locales atoms ([#1457](https://github.com/ExodusMovement/exodus-hydra/issues/1457)) ([e6f3a7f](https://github.com/ExodusMovement/exodus-hydra/commit/e6f3a7feb4319d8aa44032e27df746343fdb66eb))
152
- - migrate market history module ([#1456](https://github.com/ExodusMovement/exodus-hydra/issues/1456)) ([3e64532](https://github.com/ExodusMovement/exodus-hydra/commit/3e64532b739ea802f0df841b7c030c2c912d57e8))
153
-
154
- ## [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)
155
-
156
- ### Features
157
-
158
- - add pricingClient to headless ([#1439](https://github.com/ExodusMovement/exodus-hydra/issues/1439)) ([2a82a4c](https://github.com/ExodusMovement/exodus-hydra/commit/2a82a4c663b542178580908aaaff840524d55369))
159
- - attach wallet account atoms ([#1437](https://github.com/ExodusMovement/exodus-hydra/issues/1437)) ([2648699](https://github.com/ExodusMovement/exodus-hydra/commit/264869986c175091e6bc7c48e852946bd60911d6))
160
-
161
- ## [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)
162
-
163
- ### Features
164
-
165
- - add available-assets to headless ([#1361](https://github.com/ExodusMovement/exodus-hydra/issues/1361)) ([900d142](https://github.com/ExodusMovement/exodus-hydra/commit/900d142018ff112f36ef0f7ef53cf5020020e3ca))
166
-
167
- ## [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)
168
-
169
- ### Features
170
-
171
- - add enabled-assets to headless ([#1235](https://github.com/ExodusMovement/exodus-hydra/issues/1235)) ([a808b75](https://github.com/ExodusMovement/exodus-hydra/commit/a808b750bd911c33241ae710fbf8d8ba7e2073a6))
172
- - add lifecycle docs ([#1313](https://github.com/ExodusMovement/exodus-hydra/issues/1313)) ([df18faa](https://github.com/ExodusMovement/exodus-hydra/commit/df18faa9c341404c2feaadf51ec46236c54e2f15))
173
- - add remoteConfig module ([#1370](https://github.com/ExodusMovement/exodus-hydra/issues/1370)) ([ebc888d](https://github.com/ExodusMovement/exodus-hydra/commit/ebc888d6440c509a19dd6c9c600033fd41128ad7))
174
- - add support for plugins ([#1351](https://github.com/ExodusMovement/exodus-hydra/issues/1351)) ([fac0e2a](https://github.com/ExodusMovement/exodus-hydra/commit/fac0e2a727b0e71ad5f0619b8457c7e80612f707))
175
-
176
- ## [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)
177
-
178
- ### ⚠ BREAKING CHANGES
179
-
180
- - pass compatibility modes config to wallet (#1223)
181
-
182
- ### Features
183
-
184
- - add blockchain metadata to headless ([#1293](https://github.com/ExodusMovement/exodus-hydra/issues/1293)) ([04390a7](https://github.com/ExodusMovement/exodus-hydra/commit/04390a71cb01744cd427f470735fa0748b9157ca))
185
- - add namespaceStorage preprocessor ([#1322](https://github.com/ExodusMovement/exodus-hydra/issues/1322)) ([95f403e](https://github.com/ExodusMovement/exodus-hydra/commit/95f403e59c87f90901247619c727496ebac0a399))
186
- - pass compatibility modes config to wallet ([#1223](https://github.com/ExodusMovement/exodus-hydra/issues/1223)) ([b49b640](https://github.com/ExodusMovement/exodus-hydra/commit/b49b64097af7969e210e5ecf5395ee7f40a13eac))
187
-
188
- ## [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)
189
-
190
- ### Features
191
-
192
- - add walletAccounts in headless ([#1184](https://github.com/ExodusMovement/exodus-hydra/issues/1184)) ([8d9c93d](https://github.com/ExodusMovement/exodus-hydra/commit/8d9c93d86173476211d596e883a72b51b645e866))
193
-
194
- ## [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)
195
-
196
- ### Features
197
-
198
- - force restart on import ([#1297](https://github.com/ExodusMovement/exodus-hydra/issues/1297)) ([3900196](https://github.com/ExodusMovement/exodus-hydra/commit/39001966ce7d962ddde9df8aa3b93619053569f8))
199
- - **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))
200
- - unlock encrypted storage on wallet unlock ([#1304](https://github.com/ExodusMovement/exodus-hydra/issues/1304)) ([09ea5f2](https://github.com/ExodusMovement/exodus-hydra/commit/09ea5f20ff9547557f59d4c416cee3291f348fdf))
201
-
202
- ## [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)
203
-
204
- **Note:** Version bump only for package @exodus/headless
205
-
206
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)
207
7
 
208
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 | Description |
193
- | ------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
194
- | exists | `async () => boolean` | Checks if a wallet exists on the device. |
195
- | create | `async ({ passphrase?: string }) => void` | Creates new wallet |
196
- | import | `async ({ mnemonic: string, passphrase?: string, forceRestart?: boolean }) => void` | Imports existing wallet |
197
- | delete | `async ({ passphrase?: string }) => void` | Deletes wallet. Passphrase is mandatory if wallet was created with one |
198
- | lock | `async () => void` | Locks wallet |
199
- | unlock | `async ({ passphrase?: string }) => void` | Unlocks wallet. Passphrase is mandatory if wallet was created with one |
200
- | isLocked | `async () => boolean` | Checks if wallet is locked |
201
- | getMnemonic | `async () => void` | Sets wallet as backed up |
202
- | changePassphrase | `async ({ currentPassphrase?: string. newPassphrase: string }) => void` | Change passphrase. Current passphrase is mandatory if wallet was created with one |
203
- | restoreFromCurrentPhrase | `async ({ passphrase?: string }) => void` | Restore current wallet. Passphrase is mandatory if wallet was created with one |
204
- | load | `async () => void` | Loads UI by rehydratating data through port (`BE Only`) |
205
- | unload | `async () => void` | Unloads UI by rehydratating data through port (`BE Only`) |
206
- | changeLockTimer | `async ({ ttl: number }) => void` | Change auto unlock ttl (`BE Only`) |
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.28",
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 --runInBand"
26
+ "test": "jest"
27
27
  },
28
28
  "dependencies": {
29
- "@exodus/addresses-provider": "^3.0.2",
30
- "@exodus/atoms": "^3.5.3",
31
- "@exodus/available-assets": "^2.0.0",
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",
29
+ "@exodus/atoms": "^2.9.0",
38
30
  "@exodus/dependency-injection": "^1.2.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",
31
+ "@exodus/dependency-preprocessors": "^2.0.2",
44
32
  "@exodus/fetch": "^1.2.1",
45
- "@exodus/geolocation": "^2.0.0",
46
- "@exodus/key-identifier-provider": "^1.1.3",
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/personal-notes": "^3.0.1",
52
- "@exodus/rates-monitor": "^2.0.0",
53
- "@exodus/referrals": "^5.2.0",
54
- "@exodus/top-movers-monitor": "^2.0.1",
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/solana-meta": "^1.0.2",
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
- "eslint-plugin-simple-import-sort": "^7.0.0",
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": "6fb5a03d52683575d54955a961717eb590e3fe57"
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 { assetsModule, passphraseCache } = ioc.getByType('adapter')
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