|
|
@ -63,11 +63,9 @@ Accounts.prototype._addAccount = function (privateKey, balance) { |
|
|
|
|
|
|
|
|
|
|
|
this.accounts[ethJSUtil.toChecksumAddress('0x' + address.toString('hex'))] = { privateKey, nonce: 0 } |
|
|
|
this.accounts[ethJSUtil.toChecksumAddress('0x' + address.toString('hex'))] = { privateKey, nonce: 0 } |
|
|
|
this.accounts[ethJSUtil.toChecksumAddress('0x' + address.toString('hex'))] = { privateKey, nonce: 0 } |
|
|
|
this.accounts[ethJSUtil.toChecksumAddress('0x' + address.toString('hex'))] = { privateKey, nonce: 0 } |
|
|
|
// this.accountsList[ethJSUtil.toChecksumAddress('0x' + address.toString('hex'))] = { privateKey, nonce: 0 }
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Accounts.prototype.newAccount = function (cb) { |
|
|
|
Accounts.prototype.newAccount = function (cb) { |
|
|
|
console.dir("newAccount") |
|
|
|
|
|
|
|
let privateKey |
|
|
|
let privateKey |
|
|
|
do { |
|
|
|
do { |
|
|
|
privateKey = crypto.randomBytes(32) |
|
|
|
privateKey = crypto.randomBytes(32) |
|
|
@ -84,8 +82,7 @@ Accounts.prototype.methods = function () { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Accounts.prototype.eth_accounts = function (payload, cb) { |
|
|
|
Accounts.prototype.eth_accounts = function (_payload, cb) { |
|
|
|
// return cb(null, this.accountsList.map((x) => ethJSUtil.toChecksumAddress(x.address)))
|
|
|
|
|
|
|
|
return cb(null, Object.keys(this.accounts)) |
|
|
|
return cb(null, Object.keys(this.accounts)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|