@rabby-wallet/eth-hd-keyring 4.1.0-beta.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -0
- package/index.ts +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -73,6 +73,7 @@ class HdKeyring extends eth_simple_keyring_1.default {
|
|
|
73
73
|
this.needPassphrase = false;
|
|
74
74
|
this.accounts = [];
|
|
75
75
|
this.accountDetails = {};
|
|
76
|
+
this.passphrase = '';
|
|
76
77
|
this.setAccountDetail = (address, accountDetail) => {
|
|
77
78
|
this.accountDetails = Object.assign(Object.assign({}, this.accountDetails), { [address.toLowerCase()]: accountDetail });
|
|
78
79
|
};
|
|
@@ -104,6 +105,7 @@ class HdKeyring extends eth_simple_keyring_1.default {
|
|
|
104
105
|
this.byImport = !!opts.byImport;
|
|
105
106
|
this.index = opts.index || 0;
|
|
106
107
|
this.needPassphrase = opts.needPassphrase || !!opts.passphrase;
|
|
108
|
+
this.passphrase = opts.passphrase;
|
|
107
109
|
this.accounts = opts.accounts || [];
|
|
108
110
|
this.accountDetails = opts.accountDetails || {};
|
|
109
111
|
this.publicKey = opts.publicKey || '';
|
|
@@ -285,6 +287,7 @@ class HdKeyring extends eth_simple_keyring_1.default {
|
|
|
285
287
|
: `${this.hdPath}/${index}`;
|
|
286
288
|
}
|
|
287
289
|
setPassphrase(passphrase) {
|
|
290
|
+
this.passphrase = passphrase;
|
|
288
291
|
this.initFromMnemonic(this.mnemonic, passphrase);
|
|
289
292
|
for (const acc of this.accounts) {
|
|
290
293
|
const detail = this.getAccountDetail(acc);
|
package/index.ts
CHANGED
|
@@ -68,6 +68,7 @@ class HdKeyring extends SimpleKeyring {
|
|
|
68
68
|
needPassphrase = false;
|
|
69
69
|
accounts: string[] = [];
|
|
70
70
|
accountDetails: Record<string, AccountDetail> = {};
|
|
71
|
+
passphrase?: string = '';
|
|
71
72
|
|
|
72
73
|
/* PUBLIC METHODS */
|
|
73
74
|
constructor(opts: DeserializeOption = {} as any) {
|
|
@@ -99,6 +100,7 @@ class HdKeyring extends SimpleKeyring {
|
|
|
99
100
|
this.byImport = !!opts.byImport;
|
|
100
101
|
this.index = opts.index || 0;
|
|
101
102
|
this.needPassphrase = opts.needPassphrase || !!opts.passphrase;
|
|
103
|
+
this.passphrase = opts.passphrase;
|
|
102
104
|
this.accounts = opts.accounts || [];
|
|
103
105
|
this.accountDetails = opts.accountDetails || {};
|
|
104
106
|
this.publicKey = opts.publicKey || '';
|
|
@@ -331,6 +333,7 @@ class HdKeyring extends SimpleKeyring {
|
|
|
331
333
|
}
|
|
332
334
|
|
|
333
335
|
setPassphrase(passphrase: string) {
|
|
336
|
+
this.passphrase = passphrase;
|
|
334
337
|
this.initFromMnemonic(this.mnemonic, passphrase);
|
|
335
338
|
|
|
336
339
|
for (const acc of this.accounts) {
|