rarible / protocol

Issues, Questions, Feature requests for Rarible Protocol
64 stars 34 forks source link

Webhook for filled orders #3

Open nickjuntilla opened 3 years ago

nickjuntilla commented 3 years ago

We would like to alert our users when an NFT is sold. This way we could send them a congratulatory email or something of that nature. This could be possible by having a webhook callback parameter in the sell order.

antho1404 commented 3 years ago

Currently, one workaround is to listen to to the event Match of the exchange smart contract end send an email or whatever job you need when the event is received.

That's not ideal as this requires your backend to maintain a connection to the blockchain but at least there is a way to do that.

evgenynacu commented 3 years ago

One question: do you prefer to get a webhook for this or for example to use websocket for event streaming?

antho1404 commented 3 years ago

Webhook would definitely be better as it can be connected to a stateless/serverless endpoint. Websocket is interesting but maintaining an open connection is always tricky. I don't see much value in that, as it can already be done by directly listening to the events in the smart contract.

nickjuntilla commented 3 years ago

I agree with @antho1404 we use stateless google cloud functions and the webhook is great.

evgenynacu commented 3 years ago

Ok, thanks for the information @antho1404 @nickjuntilla

Also, if you have capacity to contribute, will guide you to how this can be implemented and what should be changed. Let me know if you are ready to contribute

antho1404 commented 3 years ago

Depending on the time required, I might be able to contribute to that.

evgenynacu commented 3 years ago

@sanufriev could you guide @antho1404 and anyone interested what's needed to be done to add a webhook for order state change

antho1404 commented 3 years ago

This issue has been closed. What's the status? Is this something possible to do now? If so, how? Or is this something that will not be done because it can be done directly by listening to the chain?

eduardstal commented 3 years ago

This issue has been closed. What's the status? Is this something possible to do now? If so, how? Or is this something that will not be done because it can be done directly by listening to the chain?

Hey Antho, I was under the mistaken idea that you were reached by @sanufriev already. Then this issue should not be closed, let me try to get ahold of him again to look over this issue.