Skip to content
This repository has been archived by the owner on Nov 10, 2021. It is now read-only.

Add blocked wallet API endpoint #63

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

skenaja
Copy link
Contributor

@skenaja skenaja commented Apr 27, 2021

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}

@andrevenancio
Copy link

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?

@skenaja
Copy link
Contributor Author

skenaja commented Apr 27, 2021

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.

@andrevenancio
Copy link

@andrevenancio
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants