@helium/currency
Version:
Utilities for handling different currency types on the Helium blockchain
53 lines • 1.71 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const currency_types_1 = require("./currency_types");
const Errors_1 = require("./Errors");
class CurrencyType {
static fromTicker(ticker = 'HNT') {
switch (ticker === null || ticker === void 0 ? void 0 : ticker.toUpperCase()) {
case this.default.ticker:
return this.default;
case this.security.ticker:
return this.security;
case this.mobile.ticker:
return this.mobile;
case this.iot.ticker:
return this.iot;
case this.solTokens.ticker:
return this.solTokens;
case this.usd.ticker:
return this.usd;
default:
throw (0, Errors_1.UnsupportedTickerError)(ticker);
}
}
static get default() {
return new currency_types_1.NetworkTokens();
}
static get networkToken() {
return new currency_types_1.NetworkTokens();
}
static get mobile() {
return new currency_types_1.MobileTokens();
}
static get solTokens() {
return new currency_types_1.SolTokens();
}
static get iot() {
return new currency_types_1.IotTokens();
}
static get testNetworkToken() {
return new currency_types_1.TestNetworkTokens();
}
static get dataCredit() {
return new currency_types_1.DataCredits();
}
static get security() {
return new currency_types_1.SecurityTokens();
}
static get usd() {
return new currency_types_1.USDollars();
}
}
exports.default = CurrencyType;
//# sourceMappingURL=CurrencyType.js.map