@exodus/headless 4.0.0-rc.2 → 4.0.0-rc.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/headless",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.4",
|
|
4
4
|
"description": "The platform-agnostic Exodus wallet SDK",
|
|
5
5
|
"author": "Exodus Movement Inc.",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@exodus/startup-counter": "^1.0.0",
|
|
60
60
|
"@exodus/tx-signer": "^2.0.1-rc.0",
|
|
61
61
|
"@exodus/wallet": "^13.0.0-rc.0",
|
|
62
|
-
"@exodus/wallet-accounts": "^16.
|
|
62
|
+
"@exodus/wallet-accounts": "^16.2.0-rc.2",
|
|
63
63
|
"@exodus/wallet-compatibility-modes": "^4.0.0",
|
|
64
64
|
"bip39": "^2.6.0",
|
|
65
65
|
"events": "^3.3.0",
|
package/src/api/index.js
CHANGED
|
@@ -19,6 +19,7 @@ const createApi = ({ ioc, port, config, debug }) => {
|
|
|
19
19
|
// TODO: Improve api here. exodus.wallet.create makes sense, but it's confusing it calls application
|
|
20
20
|
featureApis.wallet = {
|
|
21
21
|
...featureApis.wallet,
|
|
22
|
+
addSeed: application.addSeed,
|
|
22
23
|
start: application.start,
|
|
23
24
|
stop: application.stop,
|
|
24
25
|
load: application.load,
|
|
@@ -207,6 +207,15 @@ class Application extends ExodusModule {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
addSeed = async ({ mnemonic, compatibilityMode }) => {
|
|
211
|
+
this._logger.log('adding seed to wallet')
|
|
212
|
+
|
|
213
|
+
await this.#applicationStarted
|
|
214
|
+
|
|
215
|
+
const seedId = await this.#wallet.addSeed({ mnemonic })
|
|
216
|
+
await this.fire(Hook.AddSeed, { seedId, compatibilityMode })
|
|
217
|
+
}
|
|
218
|
+
|
|
210
219
|
getMnemonic = async (opts) => this.#wallet.getMnemonic(opts)
|
|
211
220
|
|
|
212
221
|
setBackedUp = async () => {
|
package/src/index.js
CHANGED
|
@@ -99,6 +99,8 @@ const createExodus = ({ adapters, config, port, debug = false }) => {
|
|
|
99
99
|
|
|
100
100
|
application.on('import', () => port.emit('import', { walletExists: true }))
|
|
101
101
|
|
|
102
|
+
application.on('add-seed', () => port.emit('add-seed'))
|
|
103
|
+
|
|
102
104
|
application.hook('unlock', async () => {
|
|
103
105
|
if (typeof storage.unlock === 'function') unlockEncryptedStorage(storage)
|
|
104
106
|
|