Skip to content

Commit

Permalink
test if I can get the balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Shangaman committed Nov 4, 2022
1 parent ea7910b commit ff01ba5
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,34 @@ fetch('http://127.0.0.1:51473/', {
}).then(res => res.text())
.then(text => console.log(text));
*/

(async () => {
try {
await fetch(url, {signal});
} catch (error) {
if (error.name === 'AbortError') {
console.log('request was aborted');
}
}
})();

async function getgoogle(){
let output= await fetch('https://google.com')
return await output.text()
try{
let output= await fetch('http://127.0.0.1:51473/', {
method: 'POST',
headers: {
'content-type': 'text/plain;',
'Authorization': 'Basic ' + encodeBase64('masternode_test:p')
},
body: '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": [] }'});
return output.text()
}catch(error){
if (error.name === 'AbortError') {
return "request was aborted'";
}else{
return "non u sac";
}
}
}


Expand Down

0 comments on commit ff01ba5

Please sign in to comment.