Merge pull request #96 from cmgustavo/bug/01-json
Normalize address information (json). Just show listed fields
This commit is contained in:
commit
0b8619dae3
|
@ -51,7 +51,7 @@ exports.show = function(req, res, next) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return common.handleErrors(err, res);
|
return common.handleErrors(err, res);
|
||||||
} else {
|
} else {
|
||||||
return res.jsonp(a);
|
return res.jsonp(a.getObj());
|
||||||
}
|
}
|
||||||
}, req.query.noTxList);
|
}, req.query.noTxList);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,24 @@ function Address(addrStr) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Address.prototype.getObj = function() {
|
||||||
|
// Normalize json address
|
||||||
|
return {
|
||||||
|
'addrStr': this.addrStr,
|
||||||
|
'balance': this.balance,
|
||||||
|
'balanceSat': this.balanceSat,
|
||||||
|
'totalReceived': this.totalReceived,
|
||||||
|
'totalReceivedSat': this.totalReceivedSat,
|
||||||
|
'totalSent': this.totalSent,
|
||||||
|
'totalSentSat': this.totalSentSat,
|
||||||
|
'unconfirmedBalance': this.unconfirmedBalance,
|
||||||
|
'unconfirmedBalanceSat': this.unconfirmedBalanceSat,
|
||||||
|
'unconfirmedTxApperances': this.unconfirmedTxApperances,
|
||||||
|
'txApperances': this.txApperances,
|
||||||
|
'transactions': this.transactions
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
Address.prototype.getUtxo = function(next) {
|
Address.prototype.getUtxo = function(next) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var tDb = TransactionDb;
|
var tDb = TransactionDb;
|
||||||
|
|
Loading…
Reference in New Issue