35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
async function send(userID, asset){
|
|
data={
|
|
userID: userID,
|
|
asset: asset
|
|
}
|
|
let response = await fetch('https://tradegame.nannal.com/submit', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json;charset=utf-8'
|
|
},
|
|
body: JSON.stringify(data)
|
|
})
|
|
|
|
let result = await response.json();
|
|
console.log(response.json)
|
|
document.getElementById("input").innerHTML=result.text
|
|
|
|
|
|
}
|
|
|
|
|
|
setInterval(async () => {
|
|
let response = await fetch('https://tradegame.nannal.com/status')
|
|
let result = await response.json();
|
|
document.getElementById("AgneUSD").innerHTML= result.users.Agne.USD
|
|
document.getElementById("AgneBTC").innerHTML= result.users.Agne.BTC
|
|
document.getElementById("DanUSD").innerHTML= result.users.Dan.USD
|
|
document.getElementById("DanBTC").innerHTML= result.users.Dan.BTC
|
|
document.getElementById("ask").innerHTML= "Ask: "+result.ask
|
|
document.getElementById("bid").innerHTML= "Bid: "+result.bid
|
|
document.getElementById("price").innerHTML= "Price: "+result.price
|
|
console.log("X")
|
|
}, 1000);
|
|
|