Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for Websocket API #1256

Merged
merged 3 commits into from Jun 13, 2018
Merged

Add documentation for Websocket API #1256

merged 3 commits into from Jun 13, 2018

Conversation

shal
Copy link

@shal shal commented Jun 6, 2018

No description provided.

{
"jwt": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"
}
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need the list of subscription channels and information between what message goes on public channel and which ones on private channel @yivo @ashanaakh

| `created_at` | Order create time in iso8601 format. |
| `origin_volume` | The amount user wnt to sell/buy. |
| `trades_count` | Number of trades. |
| `trades` | List of trades. |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is other message types.

@shal
Copy link
Author

shal commented Jun 7, 2018

@mod as I see in the websocket protocol source code, here is no private/public channels.
Here:
https://github.com/rubykube/peatio/blob/8537db2b28e35ff71b64a35d494207bd302e6739/app/api/api_v2/websocket_protocol.rb#L47-L48

and here:

https://github.com/rubykube/peatio/blob/8537db2b28e35ff71b64a35d494207bd302e6739/app/api/api_v2/websocket_protocol.rb#L61-L62

I think it is initialized only once on the websocket connection.
Here:
https://github.com/rubykube/peatio/blob/8537db2b28e35ff71b64a35d494207bd302e6739/lib/daemons/websocket_api.rb#L19

Also for me important to mention, that API has on three main types of messages:

  • orderbook
  • trade
  • order

@yivo yivo changed the title Add documentation for websocket api Add documentation for Websocket API Jun 8, 2018
@@ -0,0 +1,124 @@
# Peatio WebSocket API
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashanaakh Can you add some small Ruby script into this doc to demonstrate usage?

@mod
Copy link

mod commented Jun 8, 2018

I don't understand how to use this as API by reading this md file, use more English words please describe make a drawing, do whatever it takes

@shal
Copy link
Author

shal commented Jun 8, 2018

@mod I think there is no use to add drawing here. @yivo I've added ruby code in the bottom, looks much clear for me.

@mod mod merged commit a31ae3e into openware:1-8-stable Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants