toJSON fixes.
This commit is contained in:
parent
d2205241ee
commit
c8da41aa9d
@ -634,7 +634,7 @@ Block.prototype.inspect = function inspect() {
|
|||||||
|
|
||||||
Block.prototype.toJSON = function toJSON() {
|
Block.prototype.toJSON = function toJSON() {
|
||||||
return {
|
return {
|
||||||
v: '1',
|
v: 1,
|
||||||
type: 'block',
|
type: 'block',
|
||||||
subtype: this.subtype,
|
subtype: this.subtype,
|
||||||
hash: this.hash('hex'),
|
hash: this.hash('hex'),
|
||||||
|
|||||||
@ -1387,7 +1387,7 @@ TX.prototype.inspect = function inspect() {
|
|||||||
TX.prototype.toJSON = function toJSON() {
|
TX.prototype.toJSON = function toJSON() {
|
||||||
// Compact representation
|
// Compact representation
|
||||||
return {
|
return {
|
||||||
v: '1',
|
v: 1,
|
||||||
type: 'tx',
|
type: 'tx',
|
||||||
ts: this.ts,
|
ts: this.ts,
|
||||||
ps: this.ps,
|
ps: this.ps,
|
||||||
|
|||||||
@ -658,7 +658,8 @@ Wallet.prototype.toJSON = function toJSON(encrypt) {
|
|||||||
network: network.type,
|
network: network.type,
|
||||||
encrypted: encrypt ? true : false,
|
encrypted: encrypt ? true : false,
|
||||||
label: this.label,
|
label: this.label,
|
||||||
address: this.getAddress(),
|
address: this.getKeyAddress(),
|
||||||
|
scriptaddress: this.getScriptAddress(),
|
||||||
balance: utils.toBTC(this.balance()),
|
balance: utils.toBTC(this.balance()),
|
||||||
pub: this.getPublicKey('hex'),
|
pub: this.getPublicKey('hex'),
|
||||||
priv: encrypt
|
priv: encrypt
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user