var AvailableCryptos = [ "BTC", "BCH", "ETH", "LTC", "XRP", "NEO", "QTUM", "EOS", "DASH", "USDT" ]; var AvailableFiatMoney = ["USD"]; var CryptoAssets = []; var FiatAssets = []; function ApplyThousandsSeparators(value, toFixed = 0) { return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(new Number(value).toFixed(toFixed)); } $(function () { var $userPanel = $("header .user-panel"); $userPanel.on("click", function (e) { $(this).toggleClass("active"); e.stopPropagation(); }); $(document).on("click", function () { $userPanel.removeClass("active"); }); }); $.get(GetCoinAPIUrl("v1/assets")) .done(function (response) { var Assets = $.parseJSON(response); $.each(Assets, function (index, item) { if (item.type_is_crypto) { if (AvailableCryptos.indexOf(item.asset_id) >= 0) CryptoAssets[item.asset_id] = item; } else { if (AvailableFiatMoney.indexOf(item.asset_id) >= 0) FiatAssets[item.asset_id] = item; } }); });