Code: Select all
const App = () => {
const [ticker, setTicker] = useState({
last: 0,
});
useEffect(()=> {
async function getAvaxcoinPrice() {
const { data } = await axios.get('https://nitinr-cors.herokuapp.com/https://api.wazirx.com/api/v2/tickers/avaxusdt');
setTicker(data.ticker);
}
getAvaxcoinPrice();
setInterval(() => getAvaxcoinPrice(), 10000);
}, []);
useEffect(()=> {
async function getSandcoinPrice() {
const { data } = await axios.get('https://nitinr-cors.herokuapp.com/https://api.wazirx.com/api/v2/tickers/sandusdt');
setTicker(data.ticker);
}
getSandcoinPrice();
setInterval(() => getSandcoinPrice(), 10000);
}, []);
return (
AVAX
SAND
);
};