UNPKG

@reservoir0x/relay-kit-ui

Version:

Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.

49 lines 1.97 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertSupportedCurrencies = void 0; const tslib_1 = require("tslib"); const moonPayCurrencies_js_1 = tslib_1.__importDefault(require("../constants/moonPayCurrencies.js")); const bitcoin_js_1 = require("./bitcoin.js"); const solana_js_1 = require("./solana.js"); const convertSupportedCurrencies = (currencies) => { if (currencies) { return currencies .filter((currency) => (currency.type === 'crypto' && currency.metadata.chainId && currency.metadata.contractAddress) || currency.code === 'btc' || currency.code.includes('sol')) .map((currency) => { currency = currency; let chainId = currency.metadata.chainId; let contractAddress = currency.metadata.contractAddress; if (currency.code === 'btc') { chainId = `${bitcoin_js_1.bitcoin.id}`; contractAddress = 'bc1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmql8k8'; } else if (currency.code.includes('sol')) { chainId = `${solana_js_1.solana.id}`; if (currency.code === 'sol') { contractAddress = '11111111111111111111111111111111'; } } else { contractAddress = contractAddress.toLowerCase(); } return { name: currency.name, type: currency.type, notAllowedCountries: currency.notAllowedCountries, notAllowedUSStates: currency.notAllowedUSStates, code: currency.code, chainId: chainId, contractAddress: contractAddress }; }); } else { return moonPayCurrencies_js_1.default; } }; exports.convertSupportedCurrencies = convertSupportedCurrencies; //# sourceMappingURL=moonPay.js.map