Socket
Socket
Sign inDemoInstall

eth-dcent-keyring

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eth-dcent-keyring - npm Package Compare versions

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) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc