UNPKG

@interlay/interbtc

Version:

JavaScript library to interact with InterBTC

32 lines 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.currencyFactory = exports.currencyNameToCurrency = void 0; const interbtc_api_1 = require("@interlay/interbtc-api"); const monetary_js_1 = require("@interlay/monetary-js"); function currencyNameToCurrency(name) { let currency; switch (name) { case "Bitcoin": currency = monetary_js_1.Bitcoin; break; case "Polkadot": currency = monetary_js_1.Polkadot; break; case "Kusama": currency = monetary_js_1.Kusama; break; case "Interlay": currency = monetary_js_1.Interlay; break; case "Kintsugi": currency = monetary_js_1.Kintsugi; break; } return currency; } exports.currencyNameToCurrency = currencyNameToCurrency; function currencyFactory(currency) { return ((amount, base = false) => (0, interbtc_api_1.newMonetaryAmount)(amount, currency, base)); } exports.currencyFactory = currencyFactory; //# sourceMappingURL=currencyMapper.js.map