Add blocked wallet API endpoint
This endpoints allows interactive NFTs to access the blocked wallet lists as the HEN API domain can be accessed from within the iframe sandbox.
It could probably do with extending error handling for missing/invalid parameter (400) or the github file being unavailable (503).
$ curl localhost:3001/blocklist?tz=tz1RBogZUNv2XJnTzArQJxc4KkvL5nT2kEMb
{"blocked":true}
$ curl localhost:3001/blocklist?tz=foo
{"blocked":false}
$ curl localhost:3001/blocklist
{"blocked":false}
nice! Out of curiosity why speciffy a blocked prop instead of just having a true/false? to expand in the future?
Also. I wonder if we should normalise the response types so we can better handle errors and feedback on the frontend.
maybe
status: 200, error: null, data: { "blocked": true }
Something like that? What do you think?
Out of curiosity why speciffy a blocked prop instead of just having a true/false? to expand in the future?
Just a habit of preferring to use key-value pairs, easier to specify & validate using json-schema than with arbitrary strings or keys.
Also. I wonder if we should normalise the response types so we can better handle errors and feedback on the frontend.
I've been recently looking at adding more error handling with a specific error response object - I'll probably add a draft PR when I get time to work on it a bit more. I was aiming to get some unit tests added first.
This PR solves: https://trello.com/c/06s3jR18/31-banlist-entrypoint
@crzypatchwork any chance you can have a look at this in the next few days?