UNPKG

zumokit

Version:

ZumoKit is a Wallet as a Service SDK

35 lines (34 loc) 1.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Account = void 0; var decimal_js_1 = require("decimal.js"); var AccountCryptoProperties_1 = require("./AccountCryptoProperties"); var AccountFiatProperties_1 = require("./AccountFiatProperties"); var Card_1 = require("./Card"); /** Account details. */ var Account = /** @class */ (function () { /** @internal */ function Account(json) { this.json = json; this.id = json.id; this.currencyType = json.currencyType; this.currencyCode = json.currencyCode; this.network = json.network; this.type = json.type; this.custodyType = json.custodyType; this.balance = new decimal_js_1.Decimal(json.balance); this.ledgerBalance = new decimal_js_1.Decimal(json.ledgerBalance); this.availableBalance = new decimal_js_1.Decimal(json.availableBalance); this.overdraftLimit = new decimal_js_1.Decimal(json.overdraftLimit); this.hasNominatedAccount = !!json.hasNominatedAccount; this.cryptoProperties = json.cryptoProperties ? new AccountCryptoProperties_1.AccountCryptoProperties(json.cryptoProperties) : null; this.fiatProperties = json.fiatProperties ? new AccountFiatProperties_1.AccountFiatProperties(json.fiatProperties) : null; this.cards = json.cards.map(function (cardJson) { return new Card_1.Card(cardJson); }); } return Account; }()); exports.Account = Account;