JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<button id="list">
list
</button>
<button id="item">
item
</button>
<button id="account">
account
</button>
<button id="transfer">
transfer
</button>
</div>
<div id="result">
</div>
JavaScript
const resultelement = document.getElementById("result");
const listbtn = document.getElementById("list");
const itembtn = document.getElementById("item");
const accountbtn = document.getElementById("account");
const transferbtn = document.getElementById("transfer");
listbtn.onclick = ()=>{
fetch('https://selin.in.ua/exodus/list')
.then(res => res.json())
.then(res => resultelement.innerHTML = JSON.stringify(res));
};
itembtn.onclick = ()=>{
fetch('https://selin.in.ua/exodus/item/0x123')
.then(res => res.json())
.then(res => resultelement.innerHTML = JSON.stringify(res));
};
accountbtn.onclick = ()=>{
fetch('https://selin.in.ua/exodus/account',
{method:'post',body:JSON.stringify({name:'vasya'}),
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }})
.then(res => res.json())
.then(res => resultelement.innerHTML = JSON.stringify(res));
};
transferbtn.onclick = ()=>{
fetch('https://selin.in.ua/exodus/transfer',
{method:'post',
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
body:JSON.stringify({from:'0x123',to:'0x234',id:'id1234'})})
.then(res => res.json())
.then(res => resultelement.innerHTML = JSON.stringify(res));
};