diff --git a/lib/wallet/account.js b/lib/wallet/account.js index cfea412d..82d854b8 100644 --- a/lib/wallet/account.js +++ b/lib/wallet/account.js @@ -815,6 +815,7 @@ Account.prototype.inspect = function inspect() { const nested = this.nestedAddress(); return { + id: this.id, wid: this.wid, name: this.name, network: this.network.type, @@ -843,14 +844,12 @@ Account.prototype.inspect = function inspect() { * @returns {Object} */ -Account.prototype.toJSON = function toJSON(minimal, balance) { +Account.prototype.toJSON = function toJSON(balance) { const receive = this.receiveAddress(); const change = this.changeAddress(); const nested = this.nestedAddress(); return { - wid: minimal ? undefined : this.wid, - id: minimal ? undefined : this.id, name: this.name, initialized: this.initialized, witness: this.witness, diff --git a/lib/wallet/http.js b/lib/wallet/http.js index cbf6a01d..172ee6e4 100644 --- a/lib/wallet/http.js +++ b/lib/wallet/http.js @@ -264,7 +264,7 @@ HTTPServer.prototype.initRouter = function initRouter() { const balance = await req.wallet.getBalance(account.accountIndex); - res.send(200, account.toJSON(false, balance)); + res.send(200, account.toJSON(balance)); }); // Create account (compat) @@ -286,7 +286,7 @@ HTTPServer.prototype.initRouter = function initRouter() { const account = await req.wallet.createAccount(options, passphrase); const balance = await req.wallet.getBalance(account.accountIndex); - res.send(200, account.toJSON(false, balance)); + res.send(200, account.toJSON(balance)); }); // Create account @@ -308,7 +308,7 @@ HTTPServer.prototype.initRouter = function initRouter() { const account = await req.wallet.createAccount(options, passphrase); const balance = await req.wallet.getBalance(account.accountIndex); - res.send(200, account.toJSON(false, balance)); + res.send(200, account.toJSON(balance)); }); // Change passphrase