diff --git a/lib/bcoin/block.js b/lib/bcoin/block.js index d6626ffe..790eaba5 100644 --- a/lib/bcoin/block.js +++ b/lib/bcoin/block.js @@ -634,7 +634,7 @@ Block.prototype.inspect = function inspect() { Block.prototype.toJSON = function toJSON() { return { - v: '1', + v: 1, type: 'block', subtype: this.subtype, hash: this.hash('hex'), diff --git a/lib/bcoin/tx.js b/lib/bcoin/tx.js index c3a099ce..35dec219 100644 --- a/lib/bcoin/tx.js +++ b/lib/bcoin/tx.js @@ -1387,7 +1387,7 @@ TX.prototype.inspect = function inspect() { TX.prototype.toJSON = function toJSON() { // Compact representation return { - v: '1', + v: 1, type: 'tx', ts: this.ts, ps: this.ps, diff --git a/lib/bcoin/wallet.js b/lib/bcoin/wallet.js index f3f4662c..07db60a7 100644 --- a/lib/bcoin/wallet.js +++ b/lib/bcoin/wallet.js @@ -658,7 +658,8 @@ Wallet.prototype.toJSON = function toJSON(encrypt) { network: network.type, encrypted: encrypt ? true : false, label: this.label, - address: this.getAddress(), + address: this.getKeyAddress(), + scriptaddress: this.getScriptAddress(), balance: utils.toBTC(this.balance()), pub: this.getPublicKey('hex'), priv: encrypt