Documentation
¶
Index ¶
- Constants
- type APIResponse
- type AccountInfo
- type Category
- type GetAccountInfoRequest
- func (g *GetAccountInfoRequest) Do(ctx context.Context) (*AccountInfo, error)
- func (g *GetAccountInfoRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetAccountInfoRequest) GetParametersJSON() ([]byte, error)
- func (g *GetAccountInfoRequest) GetParametersQuery() (url.Values, error)
- func (g *GetAccountInfoRequest) GetQueryParameters() (url.Values, error)
- func (g *GetAccountInfoRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetAccountInfoRequest) GetSlugsMap() (map[string]string, error)
- type GetInstrumentsInfoRequest
- func (g *GetInstrumentsInfoRequest) Category(category Category) *GetInstrumentsInfoRequest
- func (g *GetInstrumentsInfoRequest) Cursor(cursor string) *GetInstrumentsInfoRequest
- func (g *GetInstrumentsInfoRequest) Do(ctx context.Context) (*InstrumentsInfo, error)
- func (g *GetInstrumentsInfoRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetInstrumentsInfoRequest) GetParametersJSON() ([]byte, error)
- func (g *GetInstrumentsInfoRequest) GetParametersQuery() (url.Values, error)
- func (g *GetInstrumentsInfoRequest) GetQueryParameters() (url.Values, error)
- func (g *GetInstrumentsInfoRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetInstrumentsInfoRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetInstrumentsInfoRequest) Limit(limit uint64) *GetInstrumentsInfoRequest
- func (g *GetInstrumentsInfoRequest) Symbol(symbol string) *GetInstrumentsInfoRequest
- type InstrumentsInfo
- type RestClient
- func (c *RestClient) Auth(key, secret string)
- func (c *RestClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, ...) (*http.Request, error)
- func (c *RestClient) NewGetAccountRequest() *GetAccountInfoRequest
- func (c *RestClient) NewGetInstrumentsInfoRequest() *GetInstrumentsInfoRequest
- type Status
Constants ¶
const RestBaseURL = "https://api.bybit.com"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type APIResponse struct {
RetCode uint `json:"retCode"`
RetMsg string `json:"retMsg"`
Result json.RawMessage `json:"result"`
RetExtInfo json.RawMessage `json:"retExtInfo"`
Time types.MillisecondTimestamp `json:"time"`
}
type AccountInfo ¶
type GetAccountInfoRequest ¶
type GetAccountInfoRequest struct {
// contains filtered or unexported fields
}
func (*GetAccountInfoRequest) Do ¶
func (g *GetAccountInfoRequest) Do(ctx context.Context) (*AccountInfo, error)
func (*GetAccountInfoRequest) GetParameters ¶
func (g *GetAccountInfoRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetAccountInfoRequest) GetParametersJSON ¶
func (g *GetAccountInfoRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetAccountInfoRequest) GetParametersQuery ¶
func (g *GetAccountInfoRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetAccountInfoRequest) GetQueryParameters ¶
func (g *GetAccountInfoRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetAccountInfoRequest) GetSlugParameters ¶
func (g *GetAccountInfoRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetAccountInfoRequest) GetSlugsMap ¶
func (g *GetAccountInfoRequest) GetSlugsMap() (map[string]string, error)
type GetInstrumentsInfoRequest ¶
type GetInstrumentsInfoRequest struct {
// contains filtered or unexported fields
}
func (*GetInstrumentsInfoRequest) Category ¶
func (g *GetInstrumentsInfoRequest) Category(category Category) *GetInstrumentsInfoRequest
func (*GetInstrumentsInfoRequest) Cursor ¶
func (g *GetInstrumentsInfoRequest) Cursor(cursor string) *GetInstrumentsInfoRequest
func (*GetInstrumentsInfoRequest) Do ¶
func (g *GetInstrumentsInfoRequest) Do(ctx context.Context) (*InstrumentsInfo, error)
func (*GetInstrumentsInfoRequest) GetParameters ¶
func (g *GetInstrumentsInfoRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetInstrumentsInfoRequest) GetParametersJSON ¶
func (g *GetInstrumentsInfoRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetInstrumentsInfoRequest) GetParametersQuery ¶
func (g *GetInstrumentsInfoRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetInstrumentsInfoRequest) GetQueryParameters ¶
func (g *GetInstrumentsInfoRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetInstrumentsInfoRequest) GetSlugParameters ¶
func (g *GetInstrumentsInfoRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetInstrumentsInfoRequest) GetSlugsMap ¶
func (g *GetInstrumentsInfoRequest) GetSlugsMap() (map[string]string, error)
func (*GetInstrumentsInfoRequest) Limit ¶
func (g *GetInstrumentsInfoRequest) Limit(limit uint64) *GetInstrumentsInfoRequest
func (*GetInstrumentsInfoRequest) Symbol ¶
func (g *GetInstrumentsInfoRequest) Symbol(symbol string) *GetInstrumentsInfoRequest
type InstrumentsInfo ¶
type InstrumentsInfo struct {
Category Category `json:"category"`
List []struct {
Symbol string `json:"symbol"`
BaseCoin string `json:"baseCoin"`
QuoteCoin string `json:"quoteCoin"`
Innovation string `json:"innovation"`
Status Status `json:"status"`
MarginTrading string `json:"marginTrading"`
LotSizeFilter struct {
BasePrecision fixedpoint.Value `json:"basePrecision"`
QuotePrecision fixedpoint.Value `json:"quotePrecision"`
MinOrderQty fixedpoint.Value `json:"minOrderQty"`
MaxOrderQty fixedpoint.Value `json:"maxOrderQty"`
MinOrderAmt fixedpoint.Value `json:"minOrderAmt"`
MaxOrderAmt fixedpoint.Value `json:"maxOrderAmt"`
} `json:"lotSizeFilter"`
PriceFilter struct {
TickSize fixedpoint.Value `json:"tickSize"`
} `json:"priceFilter"`
} `json:"list"`
}
type RestClient ¶
type RestClient struct {
requestgen.BaseAPIClient
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient() (*RestClient, error)
func (*RestClient) Auth ¶
func (c *RestClient) Auth(key, secret string)
func (*RestClient) NewAuthenticatedRequest ¶
func (c *RestClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, payload interface{}) (*http.Request, error)
newAuthenticatedRequest creates new http request for authenticated routes.
func (*RestClient) NewGetAccountRequest ¶
func (c *RestClient) NewGetAccountRequest() *GetAccountInfoRequest
func (*RestClient) NewGetInstrumentsInfoRequest ¶
func (c *RestClient) NewGetInstrumentsInfoRequest() *GetInstrumentsInfoRequest