Skip to content

Commit 6297989

Browse files
committed
protocol docs: add jsonrpc example for blockchain.outpoint.subscribe
1 parent 1363789 commit 6297989

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

docs/protocol-methods.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,41 @@ as an input (spends it).
674674
.. function:: blockchain.outpoint.subscribe([tx_hash, txout_idx], status)
675675
:noindex:
676676

677+
**Full JSON-RPC Example**
678+
679+
Here is an example where the client sends a request, gets an immediate response,
680+
and then at some point later - while the connection is still open -
681+
receives a notification.
682+
683+
::
684+
685+
-> {
686+
"jsonrpc": "2.0",
687+
"id": 4,
688+
"method": "blockchain.outpoint.subscribe",
689+
"params": ["1872b27abc497492a775fe335abfe368af575733144a7ecd4b249d8fd885b3cf", 1]
690+
}
691+
<- {
692+
"jsonrpc": "2.0",
693+
"result": {"height": 1866594},
694+
"id": 4
695+
}
696+
697+
# notification after broadcasting tx 4a19a360f71814c566977114c49ccfeb8a7e4719eda26cee27fa504f3f02ca09
698+
<- {
699+
"jsonrpc": "2.0",
700+
"method": "blockchain.outpoint.subscribe",
701+
"params": [
702+
["1872b27abc497492a775fe335abfe368af575733144a7ecd4b249d8fd885b3cf", 1],
703+
{
704+
"height": 1866594,
705+
"spender_txhash": "4a19a360f71814c566977114c49ccfeb8a7e4719eda26cee27fa504f3f02ca09",
706+
"spender_height": 0
707+
}
708+
]
709+
}
710+
711+
677712
blockchain.outpoint.unsubscribe
678713
===============================
679714

0 commit comments

Comments
 (0)