bybitapi

package
v1.51.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2023 License: AGPL-3.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
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 AccountInfo struct {
	MarginMode          string `json:"marginMode"`
	UpdatedTime         string `json:"updatedTime"`
	UnifiedMarginStatus int    `json:"unifiedMarginStatus"`
	DcpStatus           string `json:"dcpStatus"`
	TimeWindow          int    `json:"timeWindow"`
	SmpGroup            int    `json:"smpGroup"`
}

type Category

type Category string
const (
	CategorySpot Category = "spot"
)

type GetAccountInfoRequest

type GetAccountInfoRequest struct {
	// contains filtered or unexported fields
}

func (*GetAccountInfoRequest) Do

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 (*GetInstrumentsInfoRequest) Cursor

func (*GetInstrumentsInfoRequest) Do

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 (*GetInstrumentsInfoRequest) Symbol

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

type Status

type Status string
const (
	// StatusTrading is only include the "Trading" status for `spot` category.
	StatusTrading Status = "Trading"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL