mirror of
https://github.com/bitcoin/bips.git
synced 2025-03-04 03:03:53 +01:00
Improve documents of Stratum methods
This commit is contained in:
parent
4cf8985789
commit
1936b49803
3 changed files with 60 additions and 20 deletions
|
@ -22,7 +22,7 @@
|
|||
! Description
|
||||
|-
|
||||
! Result
|
||||
| <code>array</code>
|
||||
| <code>array</code> of <code>string</code>s
|
||||
| <code>["discovery","example","example.pubsub"]</code>
|
||||
| The services that are implemented by the server.
|
||||
|}
|
||||
|
@ -51,7 +51,7 @@
|
|||
! Description
|
||||
|-
|
||||
! Result
|
||||
| <code>array</code>
|
||||
| <code>array</code> of <code>string</code>s
|
||||
| <code>["blockchain.info","firstbits.com"]</code>
|
||||
| The vendors of the requested service.
|
||||
|}
|
||||
|
@ -80,7 +80,7 @@
|
|||
! Description
|
||||
|-
|
||||
! Result
|
||||
| <code>array</code>
|
||||
| <code>array</code> of <code>string</code>s
|
||||
| <code>["create","resolve"]</code>
|
||||
| The methods of the requested service.
|
||||
|}
|
||||
|
@ -111,5 +111,35 @@
|
|||
! Result
|
||||
| <code>array</code>
|
||||
| <code>["Some method help text",[ ["address","string","String containing full Bitcoin address."] ]]</code>
|
||||
| The parameters of the requested method.
|
||||
| The help text and parameters of the requested method.
|
||||
|-
|
||||
! Result [0] (<code>help_text</code>)
|
||||
| <code>string</code>
|
||||
| <code>Some method help text</code>
|
||||
| The help text of requested method.
|
||||
|-
|
||||
! Result [1] (<code>params</code>)
|
||||
| <code>array</code> of <code>array</code>s
|
||||
| <code>[ ["address","string","String containing full Bitcoin address."] ]</code>
|
||||
| The parameters of requested method.
|
||||
|-
|
||||
! Result [1][index] (<code>params[index]</code>)
|
||||
| <code>array</code> of <code>array</code>s
|
||||
| <code>["address","string","String containing full Bitcoin address."]</code>
|
||||
| The parameter at position <code>index</code> of requested method.
|
||||
|-
|
||||
! Result [1][index][0]
|
||||
| <code>string</code>
|
||||
| <code>address</code>
|
||||
| The name of the parameter at position <code>index</code> of requested method.
|
||||
|-
|
||||
! Result [1][index][1]
|
||||
| <code>string</code>
|
||||
| <code>string</code>
|
||||
| The type of the parameter at position <code>index</code> of requested method.
|
||||
|-
|
||||
! Result [1][index][2]
|
||||
| <code>string</code>
|
||||
| <code>string</code>
|
||||
| The description of the parameter at position <code>index</code> of requested method.
|
||||
|}
|
|
@ -49,7 +49,7 @@ Ping the server and get a pong back with the same text.
|
|||
! Params [0] (<code>payload</code>)
|
||||
| <code>mixed</code>
|
||||
| <code>12345678</code>
|
||||
| The ping text.
|
||||
| The ping payload.
|
||||
|-
|
||||
! <ins>[Response]</ins>
|
||||
! Type
|
||||
|
@ -57,9 +57,9 @@ Ping the server and get a pong back with the same text.
|
|||
! Description
|
||||
|-
|
||||
! Result
|
||||
| <code>string</code>
|
||||
| <code>Hello world!</code>
|
||||
| The "Hello world" text.
|
||||
| <code>mixed</code>
|
||||
| <code>12345678</code>
|
||||
| The pong payload, same as the ping payload.
|
||||
|}
|
||||
|
||||
==Method: Synchronous==
|
||||
|
@ -132,7 +132,7 @@ Ask the server to throw an exception in a signed JSON-RPC object.
|
|||
! Description
|
||||
|-
|
||||
! Method
|
||||
| colspan="3" | <code>example.throw_exception</code>
|
||||
| colspan="3" | <code>example.throw_signed_exception</code>
|
||||
|-
|
||||
! <ins>[Response]</ins>
|
||||
! Type
|
||||
|
|
|
@ -31,9 +31,19 @@ Subscribe on an event.
|
|||
! Description
|
||||
|-
|
||||
! Result
|
||||
| ...
|
||||
| ...
|
||||
| ...
|
||||
| <code>array</code>
|
||||
| <code>["example.pubsub.time_event", "some-subscription-key"]</code>
|
||||
| The subscription information.
|
||||
|-
|
||||
! Result [0] (<code>event</code>)
|
||||
| <code>string</code>
|
||||
| <code>example.pubsub.time_event</code>
|
||||
| The subscription event name. In this case, it is <code>example.pubsub.time_event</code>.
|
||||
|-
|
||||
! Result [1] (<code>subscription_key</code>)
|
||||
| <code>string</code>
|
||||
| <code>some-subscription-key</code>
|
||||
| The subscription key of the event subscription.
|
||||
|}
|
||||
|
||||
==Method: Time Event==
|
||||
|
@ -43,7 +53,7 @@ The time event that gets emitted.
|
|||
* Method name: <code>time_event</code>
|
||||
|
||||
{|
|
||||
! <ins>[Request]</ins>
|
||||
! <ins>[Notification]</ins>
|
||||
! Type
|
||||
! Example
|
||||
! Description
|
||||
|
@ -51,10 +61,10 @@ The time event that gets emitted.
|
|||
! Method
|
||||
| colspan="3" | <code>example.pubsub.time_event</code>
|
||||
|-
|
||||
! Params [0]
|
||||
| ...
|
||||
| ...
|
||||
| ...
|
||||
! Params [0] (<code>t</code>)
|
||||
| <code>int</code>
|
||||
| <code>1231006505</code>
|
||||
| The time when the time event was emitted.
|
||||
|}
|
||||
|
||||
==Method: Unsubscribe==
|
||||
|
@ -83,7 +93,7 @@ Unsubscribe from an event.
|
|||
! Description
|
||||
|-
|
||||
! Result
|
||||
| <code>string</code>
|
||||
| <code>some-subscription-key</code>
|
||||
| The subscription key of the event subscription.
|
||||
| <code>boolean</code>
|
||||
| <code>true</code>
|
||||
| True if subscription is removed from session, false if failed.
|
||||
|}
|
Loading…
Add table
Reference in a new issue