Skip to main content

Module models

Module models 

Source
Expand description

Request and response models of the REST endpoints used by the connectors.

Bybit writes every number as a text ("81695.30") and an absent number as an empty text. The readers here take either, keep the digits as written (an exact decimal, never a float) and turn the empty text into zero or None. Fields the connectors do not use are not modelled: the reply may carry more.

Structs§

AmendOrderRequest
The body of POST /v5/order/amend: the order is named by orderId or orderLinkId, the fields set are changed.
CancelAllResult
The answer to cancel-all.
CancelOrderRequest
The body of POST /v5/order/cancel.
CoinBalance
One coin of a wallet.
CreateOrderRequest
The body of POST /v5/order/create. Only the fields that are set are sent.
Envelope
The envelope of every REST reply.
ExecutionRecord
A fill (/v5/execution/list, and the execution stream).
InstrumentInfo
One instrument of /v5/market/instruments-info.
Kline
One candle: the open time and the prices, from the list of /v5/market/kline.
KlineResult
The result of /v5/market/kline: the rows are the newest first.
Level
One level of an order book: price and size.
LotSizeFilter
The size rules of an instrument.
OrderBookResult
The order book of /v5/market/orderbook.
OrderRecord
An order as the exchange lists it (/v5/order/realtime, /v5/order/history, and the order stream).
OrderRef
The answer to a command on one order: the number and the client id.
Page
A page of a list with a cursor. The list is empty and the cursor empty at the end.
PositionRecord
A position of /v5/position/list or of the position stream.
PriceFilter
The price rules of an instrument.
PublicTradeRecord
One trade of /v5/market/recent-trade.
ServerTime
The server time (/v5/market/time).
Ticker
One ticker of /v5/market/tickers.
WalletRecord
A wallet: /v5/account/wallet-balance and the wallet stream.

Functions§

dec
A decimal from a JSON text or number. The empty text is zero.
int
An integer from a JSON text or number. The empty text, null and an absent field are zero.
opt_dec
A decimal from a JSON text or number. The empty text, null and an absent field are None.
ser_dec
Writes a decimal as a JSON text, the way the API wants numbers in a request.