wallet: minor.
This commit is contained in:
parent
9a8106f4f7
commit
645cafe653
@ -815,6 +815,7 @@ Account.prototype.inspect = function inspect() {
|
|||||||
const nested = this.nestedAddress();
|
const nested = this.nestedAddress();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
id: this.id,
|
||||||
wid: this.wid,
|
wid: this.wid,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
network: this.network.type,
|
network: this.network.type,
|
||||||
@ -843,14 +844,12 @@ Account.prototype.inspect = function inspect() {
|
|||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Account.prototype.toJSON = function toJSON(minimal, balance) {
|
Account.prototype.toJSON = function toJSON(balance) {
|
||||||
const receive = this.receiveAddress();
|
const receive = this.receiveAddress();
|
||||||
const change = this.changeAddress();
|
const change = this.changeAddress();
|
||||||
const nested = this.nestedAddress();
|
const nested = this.nestedAddress();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
wid: minimal ? undefined : this.wid,
|
|
||||||
id: minimal ? undefined : this.id,
|
|
||||||
name: this.name,
|
name: this.name,
|
||||||
initialized: this.initialized,
|
initialized: this.initialized,
|
||||||
witness: this.witness,
|
witness: this.witness,
|
||||||
|
|||||||
@ -264,7 +264,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
|
|||||||
|
|
||||||
const balance = await req.wallet.getBalance(account.accountIndex);
|
const balance = await req.wallet.getBalance(account.accountIndex);
|
||||||
|
|
||||||
res.send(200, account.toJSON(false, balance));
|
res.send(200, account.toJSON(balance));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create account (compat)
|
// Create account (compat)
|
||||||
@ -286,7 +286,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
|
|||||||
const account = await req.wallet.createAccount(options, passphrase);
|
const account = await req.wallet.createAccount(options, passphrase);
|
||||||
const balance = await req.wallet.getBalance(account.accountIndex);
|
const balance = await req.wallet.getBalance(account.accountIndex);
|
||||||
|
|
||||||
res.send(200, account.toJSON(false, balance));
|
res.send(200, account.toJSON(balance));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create account
|
// Create account
|
||||||
@ -308,7 +308,7 @@ HTTPServer.prototype.initRouter = function initRouter() {
|
|||||||
const account = await req.wallet.createAccount(options, passphrase);
|
const account = await req.wallet.createAccount(options, passphrase);
|
||||||
const balance = await req.wallet.getBalance(account.accountIndex);
|
const balance = await req.wallet.getBalance(account.accountIndex);
|
||||||
|
|
||||||
res.send(200, account.toJSON(false, balance));
|
res.send(200, account.toJSON(balance));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Change passphrase
|
// Change passphrase
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user