@exodus/headless 2.0.0-alpha.19 → 2.0.0-alpha.2

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,147 +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.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)
7
-
8
- ### ⚠ BREAKING CHANGES
9
-
10
- - use revamped geolocation (#1559)
11
-
12
- ### Features
13
-
14
- - add addressesProvider to headless ([#1540](https://github.com/ExodusMovement/exodus-hydra/issues/1540)) ([90e963a](https://github.com/ExodusMovement/exodus-hydra/commit/90e963aafa0bb855d8c857902feac37514985d4a))
15
- - 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))
16
-
17
- ### Code Refactoring
18
-
19
- - use revamped geolocation ([#1559](https://github.com/ExodusMovement/exodus-hydra/issues/1559)) ([4378d13](https://github.com/ExodusMovement/exodus-hydra/commit/4378d137a67e4836a45c72e6bfc79590d4b7ab20))
20
-
21
- ## [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)
22
-
23
- ### Bug Fixes
24
-
25
- - announce that featureFlags writes to featureFlagAtoms ([#1548](https://github.com/ExodusMovement/exodus-hydra/issues/1548)) ([fefac86](https://github.com/ExodusMovement/exodus-hydra/commit/fefac86970ab11e85d530d8424ca9f3de86fed91))
26
-
27
- ## [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)
28
-
29
- ### ⚠ BREAKING CHANGES
30
-
31
- - don't serialize port payloads (#1458)
32
-
33
- ### Features
34
-
35
- - add feature-flags to headless ([#1516](https://github.com/ExodusMovement/exodus-hydra/issues/1516)) ([9d2da89](https://github.com/ExodusMovement/exodus-hydra/commit/9d2da895d4f58d34674b19d42fe3fd621d439f73))
36
-
37
- ### Code Refactoring
38
-
39
- - don't serialize port payloads ([#1458](https://github.com/ExodusMovement/exodus-hydra/issues/1458)) ([9b98a28](https://github.com/ExodusMovement/exodus-hydra/commit/9b98a28b091146ad0dee631a236629f25a16b3e2))
40
-
41
- ## [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)
42
-
43
- ### Bug Fixes
44
-
45
- - bump atoms in headless ([#1523](https://github.com/ExodusMovement/exodus-hydra/issues/1523)) ([7b6ca0b](https://github.com/ExodusMovement/exodus-hydra/commit/7b6ca0b19ccad9e33c9c0f0aac03feddad9d4cac))
46
-
47
- ## [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)
48
-
49
- ### ⚠ BREAKING CHANGES
50
-
51
- - use readOnlyAtoms dependency processor (#1497)
52
-
53
- ### Features
54
-
55
- - add geolocation to headless ([#1514](https://github.com/ExodusMovement/exodus-hydra/issues/1514)) ([44a8620](https://github.com/ExodusMovement/exodus-hydra/commit/44a8620249f8de2147dc073098b68f0562fb7287))
56
- - use readOnlyAtoms dependency processor ([#1497](https://github.com/ExodusMovement/exodus-hydra/issues/1497)) ([b3b4866](https://github.com/ExodusMovement/exodus-hydra/commit/b3b4866084428496aeff30dcb14ec583d6f4d64f))
57
-
58
- ### Bug Fixes
59
-
60
- - enabledAssets storage access ([#1519](https://github.com/ExodusMovement/exodus-hydra/issues/1519)) ([c4d9463](https://github.com/ExodusMovement/exodus-hydra/commit/c4d9463829b0015e70ce617e11940b1fea5bfbe6))
61
-
62
- ## [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)
63
-
64
- **Note:** Version bump only for package @exodus/headless
65
-
66
- ## [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)
67
-
68
- ### Features
69
-
70
- - add rates monitor to headless ([#1470](https://github.com/ExodusMovement/exodus-hydra/issues/1470)) ([d214b9a](https://github.com/ExodusMovement/exodus-hydra/commit/d214b9a22ca0649bbd79e2c8f6d9592733c802d2))
71
-
72
- ### Bug Fixes
73
-
74
- - get assetsModule from 'adapters' ([#1491](https://github.com/ExodusMovement/exodus-hydra/issues/1491)) ([b010cbd](https://github.com/ExodusMovement/exodus-hydra/commit/b010cbd319ffcd02d18a7492dc20e2d7ba7fe1c4))
75
-
76
- ## [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)
77
-
78
- ### Features
79
-
80
- - add balances to headless ([#1379](https://github.com/ExodusMovement/exodus-hydra/issues/1379)) ([b5d6846](https://github.com/ExodusMovement/exodus-hydra/commit/b5d6846d86b9d83463ece51a2ef14c4fd898d438))
81
-
82
- ## [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)
83
-
84
- ### Features
85
-
86
- - migrate locales atoms ([#1457](https://github.com/ExodusMovement/exodus-hydra/issues/1457)) ([e6f3a7f](https://github.com/ExodusMovement/exodus-hydra/commit/e6f3a7feb4319d8aa44032e27df746343fdb66eb))
87
- - migrate market history module ([#1456](https://github.com/ExodusMovement/exodus-hydra/issues/1456)) ([3e64532](https://github.com/ExodusMovement/exodus-hydra/commit/3e64532b739ea802f0df841b7c030c2c912d57e8))
88
-
89
- ## [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)
90
-
91
- ### Features
92
-
93
- - add pricingClient to headless ([#1439](https://github.com/ExodusMovement/exodus-hydra/issues/1439)) ([2a82a4c](https://github.com/ExodusMovement/exodus-hydra/commit/2a82a4c663b542178580908aaaff840524d55369))
94
- - attach wallet account atoms ([#1437](https://github.com/ExodusMovement/exodus-hydra/issues/1437)) ([2648699](https://github.com/ExodusMovement/exodus-hydra/commit/264869986c175091e6bc7c48e852946bd60911d6))
95
-
96
- ## [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)
97
-
98
- ### Features
99
-
100
- - add available-assets to headless ([#1361](https://github.com/ExodusMovement/exodus-hydra/issues/1361)) ([900d142](https://github.com/ExodusMovement/exodus-hydra/commit/900d142018ff112f36ef0f7ef53cf5020020e3ca))
101
-
102
- ## [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)
103
-
104
- ### Features
105
-
106
- - add enabled-assets to headless ([#1235](https://github.com/ExodusMovement/exodus-hydra/issues/1235)) ([a808b75](https://github.com/ExodusMovement/exodus-hydra/commit/a808b750bd911c33241ae710fbf8d8ba7e2073a6))
107
- - add lifecycle docs ([#1313](https://github.com/ExodusMovement/exodus-hydra/issues/1313)) ([df18faa](https://github.com/ExodusMovement/exodus-hydra/commit/df18faa9c341404c2feaadf51ec46236c54e2f15))
108
- - add remoteConfig module ([#1370](https://github.com/ExodusMovement/exodus-hydra/issues/1370)) ([ebc888d](https://github.com/ExodusMovement/exodus-hydra/commit/ebc888d6440c509a19dd6c9c600033fd41128ad7))
109
- - add support for plugins ([#1351](https://github.com/ExodusMovement/exodus-hydra/issues/1351)) ([fac0e2a](https://github.com/ExodusMovement/exodus-hydra/commit/fac0e2a727b0e71ad5f0619b8457c7e80612f707))
110
-
111
- ## [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)
112
-
113
- ### ⚠ BREAKING CHANGES
114
-
115
- - pass compatibility modes config to wallet (#1223)
116
-
117
- ### Features
118
-
119
- - add blockchain metadata to headless ([#1293](https://github.com/ExodusMovement/exodus-hydra/issues/1293)) ([04390a7](https://github.com/ExodusMovement/exodus-hydra/commit/04390a71cb01744cd427f470735fa0748b9157ca))
120
- - add namespaceStorage preprocessor ([#1322](https://github.com/ExodusMovement/exodus-hydra/issues/1322)) ([95f403e](https://github.com/ExodusMovement/exodus-hydra/commit/95f403e59c87f90901247619c727496ebac0a399))
121
- - pass compatibility modes config to wallet ([#1223](https://github.com/ExodusMovement/exodus-hydra/issues/1223)) ([b49b640](https://github.com/ExodusMovement/exodus-hydra/commit/b49b64097af7969e210e5ecf5395ee7f40a13eac))
122
-
123
- ## [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)
124
-
125
- ### Features
126
-
127
- - add walletAccounts in headless ([#1184](https://github.com/ExodusMovement/exodus-hydra/issues/1184)) ([8d9c93d](https://github.com/ExodusMovement/exodus-hydra/commit/8d9c93d86173476211d596e883a72b51b645e866))
128
-
129
- ## [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)
130
-
131
- ### Features
132
-
133
- - force restart on import ([#1297](https://github.com/ExodusMovement/exodus-hydra/issues/1297)) ([3900196](https://github.com/ExodusMovement/exodus-hydra/commit/39001966ce7d962ddde9df8aa3b93619053569f8))
134
- - **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))
135
- - unlock encrypted storage on wallet unlock ([#1304](https://github.com/ExodusMovement/exodus-hydra/issues/1304)) ([09ea5f2](https://github.com/ExodusMovement/exodus-hydra/commit/09ea5f20ff9547557f59d4c416cee3291f348fdf))
136
-
137
- ## [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)
138
-
139
- **Note:** Version bump only for package @exodus/headless
140
-
141
- ## [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)
142
-
143
- ### Features
144
-
145
- - export subscribe/unsubscribe ([#1161](https://github.com/ExodusMovement/exodus-hydra/issues/1161)) ([7da465f](https://github.com/ExodusMovement/exodus-hydra/commit/7da465fc1734fd0818a55ff740704adb8c6ae222))
146
-
147
6
  ## [2.0.0-alpha.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.1...@exodus/headless@2.0.0-alpha.2) (2023-04-10)
148
7
 
149
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,74 +34,15 @@ 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
108
40
 
109
- | Method | Type | Description |
110
- | ----------- | ------------------------------------------ | ------------------------------------------ |
111
- | subscribe | `({ type: string, payload: any }) => void` | Subscribe to receive events. |
112
- | unsubscribe | `({ type: string, payload: any }) => void` | Unsubscribe handler from receiving events. |
113
- | emit | `(type: string, payload: any) => void` | Emit an event. |
41
+ | Method | Type | Description |
42
+ | -------------------- | ------------------------------------------ | ------------------------------------------ |
43
+ | subscribe | `({ type: string, payload: any }) => void` | Subscribe to receive events. |
44
+ | unsubscribe(handler) | `({ type: string, payload: any }) => void` | Unsubscribe handler from receiving events. |
45
+ | emit | `(type: string, payload: any) => void` | Emit an event. |
114
46
 
115
47
  ## Adapters
116
48
 
@@ -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
 
@@ -215,61 +147,3 @@ Currently not used.
215
147
  | wordlist | `string[]` | Words list to check against. |
216
148
 
217
149
  **Returns**: `boolean`
218
-
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
- ## subscribe
269
-
270
- > Type: function
271
-
272
- | Argument | Type | Description |
273
- | ----------- | ------------------------------------------ | ------------------------------------------ |
274
- | subscribe | `({ type: string, payload: any }) => void` | Subscribe to receive events. |
275
- | unsubscribe | `({ type: string, payload: any }) => void` | Unsubscribe handler from receiving events. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.19",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "The headless Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc",
6
6
  "main": "src/index.js",
@@ -26,55 +26,27 @@
26
26
  "test": "jest"
27
27
  },
28
28
  "dependencies": {
29
- "@exodus/addresses-provider": "^3.0.2",
30
- "@exodus/atoms": "^3.5.2",
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",
29
+ "@exodus/atoms": "^2.9.0",
36
30
  "@exodus/dependency-injection": "^1.2.0",
37
- "@exodus/dependency-preprocessors": "^2.4.0",
38
- "@exodus/enabled-assets": "^6.0.0",
39
- "@exodus/exodus-pricing-client": "^1.1.0",
40
- "@exodus/feature-flags": "^2.0.0",
31
+ "@exodus/dependency-preprocessors": "^2.0.2",
41
32
  "@exodus/fetch": "^1.2.1",
42
- "@exodus/geolocation": "^1.1.0",
43
- "@exodus/key-identifier-provider": "^1.1.3",
44
- "@exodus/keychain": "^4.0.0",
45
- "@exodus/kyc": "^3.4.0",
46
- "@exodus/market-history": "^3.1.0",
33
+ "@exodus/key-identifier-provider": "^1.1.1",
34
+ "@exodus/keychain": "^3.2.1",
47
35
  "@exodus/module": "^1.0.0",
48
- "@exodus/rates-monitor": "^2.0.0",
49
- "@exodus/referrals": "^5.2.0",
50
- "@exodus/wallet": "^6.0.1",
51
- "@exodus/wallet-accounts": "^8.0.1",
52
- "@exodus/wallet-compatibility-modes": "^2.0.0",
53
- "bip39": "^2.6.0",
54
- "events": "^3.3.0",
55
- "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",
56
40
  "minimalistic-assert": "^1.0.1"
57
41
  },
58
42
  "devDependencies": {
59
- "@exodus/algorand-lib": "^2.0.1",
60
- "@exodus/algorand-meta": "^1.1.4",
61
- "@exodus/bitcoin-meta": "^1.0.0",
62
- "@exodus/currency": "^2.2.0",
63
43
  "@exodus/ethereum-lib": "^2.22.2",
64
- "@exodus/ethereum-meta": "^1.0.23",
65
- "@exodus/models": "^8.11.1",
66
44
  "@exodus/solana-lib": "^1.3.11",
67
- "@exodus/solana-meta": "^1.0.2",
68
- "@exodus/storage-encrypted": "^1.1.2",
69
- "@exodus/storage-memory": "^2.1.0",
45
+ "@exodus/storage-memory": "^1.1.0",
70
46
  "@exodus/wild-emitter": "^1.0.0",
71
47
  "buffer-json": "^2.0.0",
72
- "deepmerge": "^4.2.2",
73
48
  "eslint": "^8.33.0",
74
- "events": "^3.3.0",
75
- "jest": "^29.1.2",
76
- "nock": "^13.3.1",
77
- "p-defer": "^4.0.0"
49
+ "jest": "^29.1.2"
78
50
  },
79
- "gitHead": "caf144d4d059cc940c2c70d96407af06bace8038"
51
+ "gitHead": "58929429bb5b339e14fd422ed9955d9765b3394c"
80
52
  }
package/src/api.js CHANGED
@@ -1,28 +1,9 @@
1
1
  import { validateMnemonic as isMnemonicValid } from 'bip39'
2
2
 
3
- const createApi = ({ ioc, port }) => {
4
- const { assetsModule, passphraseCache } = ioc.getByType('adapter')
3
+ const createApi = ({ ioc }) => {
4
+ const { passphraseCache } = ioc.getByType('adapter')
5
5
 
6
- const {
7
- addressesProvider,
8
- application,
9
- blockchainMetadata,
10
- enabledAssets,
11
- kyc,
12
- referrals,
13
- remoteConfig,
14
- wallet,
15
- walletAccounts,
16
- } = ioc.getByType('module')
17
-
18
- const { ratesMonitor } = ioc.getByType('monitor')
19
-
20
- const {
21
- // ...
22
- currencyAtom,
23
- enabledWalletAccountsAtom,
24
- languageAtom,
25
- } = ioc.getByType('atom')
6
+ const { application, wallet } = ioc.getByType('module')
26
7
 
27
8
  return {
28
9
  wallet: {
@@ -46,63 +27,7 @@ const createApi = ({ ioc, port }) => {
46
27
  changeLockTimer: application.changeLockTimer,
47
28
  isLocked: () => wallet.isLocked(),
48
29
  },
49
- walletAccounts: {
50
- create: walletAccounts.create,
51
- update: walletAccounts.update,
52
- disable: walletAccounts.disable,
53
- enable: walletAccounts.enable,
54
- getEnabled: enabledWalletAccountsAtom.get,
55
- },
56
- blockchainMetadata: {
57
- getTxLog: blockchainMetadata.getTxLog,
58
- getLoadedTxLogs: blockchainMetadata.getLoadedTxLogs,
59
- updateTxs: blockchainMetadata.updateTxs,
60
- overwriteTxs: blockchainMetadata.overwriteTxs,
61
- clearTxs: blockchainMetadata.clearTxs,
62
- removeTxs: blockchainMetadata.removeTxs,
63
- getAccountState: blockchainMetadata.getAccountState,
64
- getLoadedAccountStates: blockchainMetadata.getLoadedAccountStates,
65
- updateAccountState: blockchainMetadata.updateAccountState,
66
- removeAccountState: blockchainMetadata.removeAccountState,
67
- batch: blockchainMetadata.batch,
68
- },
69
- assets: {
70
- enable: enabledAssets.enable,
71
- disable: enabledAssets.disable,
72
- addAndEnableToken: async (...args) => {
73
- const asset = await assetsModule.addToken(...args)
74
- await enabledAssets.enable([asset.name])
75
- return asset.name
76
- },
77
- },
78
- remoteConfig: {
79
- get: remoteConfig.get,
80
- getAll: remoteConfig.getAll,
81
- },
82
- locale: {
83
- setLanguage: (value) => languageAtom.set(value),
84
- setCurrency: (value) => currencyAtom.set(value),
85
- },
86
- rates: {
87
- refresh: () => ratesMonitor.update(),
88
- },
89
- addressesProvider: {
90
- getAddress: addressesProvider.getAddress.bind(addressesProvider),
91
- getSupportedPurposes: addressesProvider.getSupportedPurposes.bind(addressesProvider),
92
- getReceiveAddress: addressesProvider.getReceiveAddress.bind(addressesProvider),
93
- },
94
- kyc: {
95
- start: kyc.start,
96
- sync: kyc.sync,
97
- requestKycToken: kyc.requestKycToken,
98
- },
99
- referrals: {
100
- setReferredBy: referrals.setReferredBy,
101
- referralCodeExists: referrals.referralCodeExists,
102
- },
103
30
  isMnemonicValid,
104
- subscribe: port.subscribe.bind(port),
105
- unsubscribe: port.unsubscribe.bind(port),
106
31
  }
107
32
  }
108
33