infoblock
Version:
A typed wrapper of the blockchain.info API
25 lines (24 loc) • 1.23 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var Transaction_1 = __importDefault(require("./Transaction"));
var Address = /** @class */ (function () {
function Address(address, txCount, unredeemedTxCount, balance, totalSent, totalReceived, transactions) {
this.address = address;
this.transactionsCount = txCount;
this.unredeemedTransactionsCount = unredeemedTxCount;
this.balance = balance;
this.totalSent = totalSent;
this.totalReceived = totalReceived;
this.transactions = transactions;
}
Address.constructFromObj = function (_a) {
var address = _a.address, n_tx = _a.n_tx, n_unredeemed = _a.n_unredeemed, total_received = _a.total_received, total_sent = _a.total_sent, final_balance = _a.final_balance, txs = _a.txs;
var transactions = txs ? txs.map(Transaction_1.default.constructFromObj) : [];
return new Address(address, n_tx, n_unredeemed, final_balance, total_sent, total_received, transactions);
};
return Address;
}());
exports.default = Address;