toJSON fixes.

This commit is contained in:
Christopher Jeffrey 2016-01-18 17:12:20 -08:00
parent d2205241ee
commit c8da41aa9d
3 changed files with 4 additions and 3 deletions

View File

@ -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'),

View File

@ -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,

View File

@ -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