Issue
If I go to https://protonscan.io/accounts/username I get a 400 response for a user that doesn't exist and a 200 response for a user that exists on get_account (https://proton.greymass.com/v1/chain/get_account)
How do we check this properly and reliably and "Nice to have": How do we get the avatar for that user or other information, all from the front end?
Thanks.
Solution
So the solution I chose is this:
let userProvided; // here I get the username from the front-end
// then I fetch the user's data
fetch('https://proton.eosusa.news/v2/state/get_account?account=' + userProvided).then(response => {
return response.json();
}).then(data => {
// after the data is parsed into an object we can use it here
console.log(data);
});
Answered By - Lucian Answer Checked By - Candace Johnson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.