From 8f0108d7b57712a098281ac150fb2be067c4bc6e Mon Sep 17 00:00:00 2001 From: Chris <34682781+monkins1010@users.noreply.github.com> Date: Thu, 7 Mar 2024 08:41:16 +0000 Subject: [PATCH] updates --- src/App.vue | 6 +++--- src/utils/proxyverusd.js | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 src/utils/proxyverusd.js diff --git a/src/App.vue b/src/App.vue index 54fa2eb..f2cb40d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,12 +17,12 @@ {{ getTickerByCurrencyId(currency.currencyid) }} - {{ getReserveDaiPrice(currency.reserves) }} DAI - {{ getReserveVrscPrice(currency.reserves) }} VRSC + {{ new Intl.NumberFormat().format(getReserveDaiPrice(currency.reserves)) }} DAI + {{ new Intl.NumberFormat().format(getReserveVrscPrice(currency.reserves)) }} VRSC {{ getReserveMkrPrice(currency.reserves) }} MKR {{ getReserveEthPrice(currency.reserves) }} ETH {{ parseFloat(currency.priceinreserve.toFixed(6)) }} - {{ parseFloat(currency.reserves.toFixed(3)) }} + {{ new Intl.NumberFormat().format(parseFloat(currency.reserves.toFixed(3))) }} {{ currency.weight }} diff --git a/src/utils/proxyverusd.js b/src/utils/proxyverusd.js new file mode 100644 index 0000000..d031ca2 --- /dev/null +++ b/src/utils/proxyverusd.js @@ -0,0 +1,23 @@ +import { VerusdRpcInterface } from 'verusd-rpc-ts-client'; + +const verusd = VerusdRpcInterface("iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq", "https://api.verustest.net"); + +export const fetchCurrency = async (currency) => { + try { + const response = await verusd.getCurrency(currency); + return response; + } catch (error) { + console.error("Error fetching currency:", error); + throw error; + } +}; + +export const fetchInfo = async () => { + try { + const response = await verusd.getInfo(); + return response; + } catch (error) { + console.error("Error fetching info:", error); + throw error; + } +}; \ No newline at end of file