eth-dcent-keyring
Advanced tools
Comparing version 0.1.1 to 0.1.2
12
index.js
@@ -23,2 +23,3 @@ const { EventEmitter } = require('events') | ||
this.accounts = [] | ||
this._accounts = [] | ||
this.page = 0 | ||
@@ -37,2 +38,3 @@ this.perPage = 1 // support only one account | ||
accounts: this.accounts, | ||
_accounts: this._accounts, | ||
// page: this.page, | ||
@@ -47,2 +49,3 @@ // paths: this.paths, | ||
this.accounts = opts.accounts || [] | ||
this._accounts = opts._accounts || [] | ||
// this.page = opts.page || 0 | ||
@@ -54,4 +57,4 @@ // this.perPage = opts.perPage || 1 | ||
isUnlocked () { | ||
LOG('isUnlocked - ', Boolean(this.accounts && this.accounts.length !== 0)) | ||
return Boolean(this.accounts && this.accounts.length !== 0) | ||
LOG('isUnlocked - ', Boolean(this._accounts && this._accounts.length !== 0)) | ||
return Boolean(this._accounts && this._accounts.length !== 0) | ||
} | ||
@@ -62,3 +65,3 @@ | ||
if (this.isUnlocked()) { | ||
return Promise.resolve(this.accounts[0]) // return first account address | ||
return Promise.resolve(this._accounts[0]) // return first account address | ||
} | ||
@@ -72,3 +75,3 @@ return new Promise((resolve, reject) => { | ||
LOG('getAddress return - ', response.body.parameter.address) | ||
this.accounts = [ response.body.parameter.address ] | ||
this._accounts = [ response.body.parameter.address ] | ||
resolve(response.body.parameter.address) // return address of first account | ||
@@ -275,2 +278,3 @@ } else if (response.body.error) { | ||
this.accounts = [] | ||
this._accounts = [] | ||
this.page = 0 | ||
@@ -277,0 +281,0 @@ this.unlockedAccount = 0 |
{ | ||
"name": "eth-dcent-keyring", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A MetaMask compatible keyring, for D'CENT hardware wallets", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -40,2 +40,3 @@ global.window = require('./window.shim') | ||
accounts: [fakeAccounts[0]], | ||
_accounts: [fakeAccounts[0]], | ||
}) | ||
@@ -100,2 +101,3 @@ }) | ||
keyring.removeAccount(fakeAccounts[0]) | ||
keyring._accounts = [] | ||
// there is no account !! | ||
@@ -102,0 +104,0 @@ keyring.unlock().catch((e) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29416
602