Update README.md

This commit is contained in:
okxapi 2022-12-16 18:09:57 +08:00 committed by GitHub
parent 59f2b568e6
commit 0fbcb4f23f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 8 deletions

View File

@ -116,16 +116,23 @@ passphrase = ""
- Run `example.py` - Run `example.py`
- Uncomment the corresponding method and then pass the arguments and call the interfaces - Uncomment the corresponding method and then pass the arguments and call the interfaces
- WebSocketAPI - WebSocketAPI
- Open `websocket_example.py` * Open `WsPrivate`and`WsPublic`
- According to the `public channel`/`private channel`, select the corresponding `url`, the corresponding start method, and pass in the corresponding parameters * choose the right `url`(if private channel need login info).
```python ```python
# WebSocket public channel # WebSocket Public channel
url = "wss://ws.okx.com:8443/ws/v5/public?brokerId=9999" url = "wss://ws.okx.com:8443/ws/v5/public"
# WebSocket Private channel
url = "wss://ws.okx.com:8443/ws/v5/private"
```
# WebSocket private channel ```python
url = "wss://ws.okx.com:8443/ws/v5/private?brokerId=9999" # Public channel not need login(e.g. tickers,candle,mark-price,books,funding-rate)
``` refer to WsPublicTest.py
# Private channel nedd login(e.g. account,positions,orders)
refer to WsPrivateTest.py
```
P.S. P.S.