WebSocket WAMP notifications

In this section we describe the subscription methods available with GreenAddress API. Subscribe them to obtain real time notifications about new relevant events on the blockchain, which means new blocks, or transactions related to your account.

With Twisted and Autobahn WAMP, you can can bind callbacks on notifications, similarly to what you did with called methods, (i.e. you may want to iterate on your transactions to determinate the confirmations, everytime you receive a new block_count notification).

tx_notify

Subscribe to http://greenaddressit.com/tx_notify to receive notifications on each new transaction relevant to currently logged in wallet. The notification data is of the following format:

{
        wallet_id: Number,
        subaccounts: [Number, ...],
        value: Number,
        txhash: String
}

where txhash contains a hex-encoded hash of the new transaction.

block_count

Subscribe to http://greenaddressit.com/block_count to receive notifications on each new block from the Bitcoin network. The notification data is of the following format:

{
        count: Number
}

where count contains the number of last discovered block.