market

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://binance-docs.github.io/apidocs/spot/en/#exchange-information
	EndpointExchangeInfo = "/api/v3/exchangeInfo"
)
View Source
const (
	// https://binance-docs.github.io/apidocs/spot/en/#order-book
	EndpointOrderBook = "/api/v3/depth"
)

Variables

This section is empty.

Functions

func ExchangeInformationData

func ExchangeInformationData(connRest ConnectorRest, parm ExchangeInformationParam) ([]byte, error)

func OrderBookData

func OrderBookData(connRest ConnectorRest, parm OrderBookParam) ([]byte, error)

func Ticker24hrData

func Ticker24hrData(connRest ConnectorRest, parm Ticker24hrParam) ([]byte, error)

func TimeData

func TimeData(connRest ConnectorRest) ([]byte, error)

Получение исходных данных от страницы

Types

type ExchangeFilters

type ExchangeFilters struct {
	FilterType          string `json:"filterType"`
	MaxNumOrders        int    `json:"maxNumOrders"`
	MaxNumAlgoOrders    int    `json:"maxNumAlgoOrders"`
	MaxNumIcebergOrders int    `json:"maxNumIcebergOrders"`
}

type ExchangeInformationParam

type ExchangeInformationParam struct {
	Symbol      string
	Symbols     []string
	Permissions []string
}

type ExchangeInformationResp

type ExchangeInformationResp struct {
	Timezone        string            `json:"timezone"`
	ServerTime      int64             `json:"serverTime"`
	RateLimits      []RateLimits      `json:"rateLimits"`
	ExchangeFilters []ExchangeFilters `json:"exchangeFilters"`
	Symbols         []Symbol          `json:"symbols"`
}

func ExchangeInformation

func ExchangeInformation(connRest ConnectorRest, parm ExchangeInformationParam) (ExchangeInformationResp, error)

type OrderBookParam

type OrderBookParam struct {
	Symbol string `structs:"symbol"`
	Limit  int64  `structs:"symbol,omitempty"` // optional
}

type OrderBookResp

type OrderBookResp struct {
	LastUpdateID int        `json:"lastUpdateId"`
	Bids         [][]string `json:"bids"`
	Asks         [][]string `json:"asks"`
}

func OrderBook

func OrderBook(connRest ConnectorRest, parm OrderBookParam) (OrderBookResp, error)

type RateLimits

type RateLimits struct {
	RateLimitType string `json:"rateLimitType"`
	Interval      string `json:"interval"`
	IntervalNum   int    `json:"intervalNum"`
	Limit         int    `json:"limit"`
}

https://binance-docs.github.io/apidocs/spot/en/#public-api-definitions

type Symbol

type Symbol struct {
	Symbol                          string          `json:"symbol"`
	Status                          string          `json:"status"`
	BaseAsset                       string          `json:"baseAsset"`
	BaseAssetPrecision              int             `json:"baseAssetPrecision"`
	QuoteAsset                      string          `json:"quoteAsset"`
	QuotePrecision                  int             `json:"quotePrecision"`
	QuoteAssetPrecision             int             `json:"quoteAssetPrecision"`
	BaseCommissionPrecision         int             `json:"baseCommissionPrecision"`
	QuoteCommissionPrecision        int             `json:"quoteCommissionPrecision"`
	OrderTypes                      []string        `json:"orderTypes"`
	IcebergAllowed                  bool            `json:"icebergAllowed"`
	OcoAllowed                      bool            `json:"ocoAllowed"`
	QuoteOrderQtyMarketAllowed      bool            `json:"quoteOrderQtyMarketAllowed"`
	AllowTrailingStop               bool            `json:"allowTrailingStop"`
	CancelReplaceAllowed            bool            `json:"cancelReplaceAllowed"`
	IsSpotTradingAllowed            bool            `json:"isSpotTradingAllowed"`
	IsMarginTradingAllowed          bool            `json:"isMarginTradingAllowed"`
	Filters                         []SymbolFilters `json:"filters"`
	Permissions                     []string        `json:"permissions"`
	DefaultSelfTradePreventionMode  string          `json:"defaultSelfTradePreventionMode"`
	AllowedSelfTradePreventionModes []string        `json:"allowedSelfTradePreventionModes"`
}

type SymbolFilters

type SymbolFilters struct {
	FilterType            string `json:"filterType"`
	MinPrice              string `json:"minPrice"`
	MaxPrice              string `json:"maxPrice"`
	TickSize              string `json:"tickSize"`
	MultiplierUp          string `json:"multiplierUp"`
	MultiplierDown        string `json:"multiplierDown"`
	AvgPriceMins          int    `json:"avgPriceMins"`
	BidMultiplierUp       string `json:"bidMultiplierUp"`
	BidMultiplierDown     string `json:"bidMultiplierDown"`
	AskMultiplierUp       string `json:"askMultiplierUp"`
	AskMultiplierDown     string `json:"askMultiplierDown"`
	MinQty                string `json:"minQty"`
	MaxQty                string `json:"maxQty"`
	StepSize              string `json:"stepSize"`
	MinNotional           string `json:"minNotional"`
	ApplyMinToMarket      bool   `json:"applyMinToMarket"`
	MaxNotional           string `json:"maxNotional"`
	ApplyMaxToMarket      bool   `json:"applyMaxToMarket"`
	ApplyToMarket         bool   `json:"applyToMarket"`
	Limit                 int    `json:"limit"`
	MinTrailingAboveDelta int    `json:"minTrailingAboveDelta"`
	MaxTrailingAboveDelta int    `json:"maxTrailingAboveDelta"`
	MinTrailingBelowDelta int    `json:"minTrailingBelowDelta"`
	MaxTrailingBelowDelta int    `json:"maxTrailingBelowDelta"`
	MaxNumOrders          int    `json:"maxNumOrders"`
	MaxNumAlgoOrders      int    `json:"maxNumAlgoOrders"`
	MaxNumIcebergOrders   int    `json:"maxNumIcebergOrders"`
	MaxPosition           string `json:"maxPosition"`
}

https://binance-docs.github.io/apidocs/spot/en/#filters

type Ticker24hrParam

type Ticker24hrParam struct {
	Symbol  string   `structs:"symbol,omitempty"`  // optional
	Symbols []string `structs:"symbols,omitempty"` // optional
	Type    string   `structs:"type,omitempty"`    // optional
}

type Ticker24hrResp

type Ticker24hrResp struct {
	Symbol             string `json:"symbol"`
	PriceChange        string `json:"priceChange"`
	PriceChangePercent string `json:"priceChangePercent"`
	WeightedAvgPrice   string `json:"weightedAvgPrice"`
	PrevClosePrice     string `json:"prevClosePrice"`
	LastPrice          string `json:"lastPrice"`
	LastQty            string `json:"lastQty"`
	BidPrice           string `json:"bidPrice"`
	BidQty             string `json:"bidQty"`
	AskPrice           string `json:"askPrice"`
	AskQty             string `json:"askQty"`
	OpenPrice          string `json:"openPrice"`
	HighPrice          string `json:"highPrice"`
	LowPrice           string `json:"lowPrice"`
	Volume             string `json:"volume"`
	QuoteVolume        string `json:"quoteVolume"`
	OpenTime           int64  `json:"openTime"`
	CloseTime          int64  `json:"closeTime"`
	FirstID            int    `json:"firstId"`
	LastID             int    `json:"lastId"`
	Count              int    `json:"count"`
}

func Ticker24hr

func Ticker24hr(connRest ConnectorRest, parm Ticker24hrParam) ([]Ticker24hrResp, error)

type TimeResp

type TimeResp struct {
	ServerTime int64 `json:"serverTime"`
}

func Time

func Time(connRest ConnectorRest) (TimeResp, error)

Jump to

Keyboard shortcuts

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