hicetnunc-api icon indicating copy to clipboard operation
hicetnunc-api copied to clipboard

Add blocked wallet API endpoint

Open skenaja opened this issue 4 years ago • 4 comments

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}

skenaja avatar Apr 27 '21 15:04 skenaja

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?

andrevenancio avatar Apr 27 '21 15:04 andrevenancio

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.

skenaja avatar Apr 27 '21 15:04 skenaja

This PR solves: https://trello.com/c/06s3jR18/31-banlist-entrypoint

andrevenancio avatar Apr 30 '21 10:04 andrevenancio

@crzypatchwork any chance you can have a look at this in the next few days?

andrevenancio avatar May 05 '21 09:05 andrevenancio