spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.39k stars 3.08k forks source link

[ELECTRUM MERCHANT] Subscribe to multiple payments through websockets by working with JSON #4380

Open kenkit opened 6 years ago

kenkit commented 6 years ago

In short I want it to be almost exactly like https://block.io/docs/notifications Under

Web Sockets

I think it will be much more developer friendly

What I want is to subscribe to multiple address payments and get each payment update information seperately with details like address payment ammount etc, I know this should be easy by modifying the websockets.py

kenkit commented 6 years ago

Or another better solution would be modify ws.sendMessage('paid') to send a json containing the address and ammount paid, then I can use this as the equivalent to block.io

kenkit commented 6 years ago

This will require changine this methods to use json

 def handleMessage(self):
        assert self.data[0:3] == 'id:'

Respond with a json of the received payment information with the ammount

if sum(result.values()) >=amount:
                            ws.sendMessage('paid')