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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://binance-docs.github.io/apidocs/futures/en/#exchange-information
	EndpointExchangeInformation = "/fapi/v1/exchangeInfo"
)
View Source
const (
	// https://binance-docs.github.io/apidocs/futures/en/#get-funding-rate-history
	EndpointFundingRateHistory = "/fapi/v1/fundingRate"
)

Variables

This section is empty.

Functions

func ExchangeInformationData

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

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

func FundingRateData

func FundingRateData(connRest ConnectorRest, parm FundingRateHistoryParam) ([]byte, error)

func KlineData

func KlineData(connRest ConnectorRest, parm KlineParam) ([]byte, error)

func Ticker24hrData

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

Types

type ExchangeInformationResp

type ExchangeInformationResp struct {
	Timezone    string `json:"timezone"`
	ServerTime  int64  `json:"serverTime"`
	FuturesType string `json:"futuresType"`
	RateLimits  []struct {
		RateLimitType string `json:"rateLimitType"`
		Interval      string `json:"interval"`
		IntervalNum   int    `json:"intervalNum"`
		Limit         int    `json:"limit"`
	} `json:"rateLimits"`
	ExchangeFilters []any `json:"exchangeFilters"`
	Assets          []struct {
		Asset             string `json:"asset"`
		MarginAvailable   bool   `json:"marginAvailable"`
		AutoAssetExchange string `json:"autoAssetExchange"`
	} `json:"assets"`
	Symbols []struct {
		Symbol                string   `json:"symbol"`
		Pair                  string   `json:"pair"`
		ContractType          string   `json:"contractType"`
		DeliveryDate          int64    `json:"deliveryDate"`
		OnboardDate           int64    `json:"onboardDate"`
		Status                string   `json:"status"`
		MaintMarginPercent    string   `json:"maintMarginPercent"`
		RequiredMarginPercent string   `json:"requiredMarginPercent"`
		BaseAsset             string   `json:"baseAsset"`
		QuoteAsset            string   `json:"quoteAsset"`
		MarginAsset           string   `json:"marginAsset"`
		PricePrecision        int      `json:"pricePrecision"`
		QuantityPrecision     int      `json:"quantityPrecision"`
		BaseAssetPrecision    int      `json:"baseAssetPrecision"`
		QuotePrecision        int      `json:"quotePrecision"`
		UnderlyingType        string   `json:"underlyingType"`
		UnderlyingSubType     []string `json:"underlyingSubType"`
		SettlePlan            int      `json:"settlePlan"`
		TriggerProtect        string   `json:"triggerProtect"`
		LiquidationFee        string   `json:"liquidationFee"`
		MarketTakeBound       string   `json:"marketTakeBound"`
		MaxMoveOrderLimit     int      `json:"maxMoveOrderLimit"`
		Filters               []struct {
			MinPrice          string `json:"minPrice,omitempty"`
			TickSize          string `json:"tickSize,omitempty"`
			MaxPrice          string `json:"maxPrice,omitempty"`
			FilterType        string `json:"filterType"`
			MaxQty            string `json:"maxQty,omitempty"`
			MinQty            string `json:"minQty,omitempty"`
			StepSize          string `json:"stepSize,omitempty"`
			Limit             int    `json:"limit,omitempty"`
			Notional          string `json:"notional,omitempty"`
			MultiplierDown    string `json:"multiplierDown,omitempty"`
			MultiplierUp      string `json:"multiplierUp,omitempty"`
			MultiplierDecimal string `json:"multiplierDecimal,omitempty"`
		} `json:"filters"`
		OrderTypes  []string `json:"orderTypes"`
		TimeInForce []string `json:"timeInForce"`
	} `json:"symbols"`
}

func ExchangeInformation

func ExchangeInformation(connRest ConnectorRest) (ExchangeInformationResp, error)

type FundingRateHistoryParam

type FundingRateHistoryParam struct {
	Symbol    string `structs:"symbol,omitempty"`    // optional
	StartTime int64  `structs:"startTime,omitempty"` // optional
	EndTime   int64  `structs:"endTime,omitempty"`   // optional
	Limit     int64  `structs:"limit,omitempty"`     // optional
}

type FundingRateHistoryResp

type FundingRateHistoryResp []struct {
	Symbol      string `json:"symbol"`
	FundingRate string `json:"fundingRate"`
	FundingTime int64  `json:"fundingTime"`
}

func FundingRate

func FundingRate(connRest ConnectorRest, parm FundingRateHistoryParam) (FundingRateHistoryResp, error)

type KlineParam

type KlineParam struct {
	Symbol    string                  `structs:"symbol"`
	Interval  enums.KlineIntervalType `structs:"interval"`
	StartTime int64                   `structs:"startTime,omitempty"` // optional
	EndTime   int64                   `structs:"endTime,omitempty"`   // optional
	Limit     int64                   `structs:"limit,omitempty"`     // optional
}

type KlineResp

type KlineResp struct {
	OpenTime                 int64  `json:"openTime"`
	Open                     string `json:"open"`
	High                     string `json:"high"`
	Low                      string `json:"low"`
	Close                    string `json:"close"`
	Volume                   string `json:"volume"`
	CloseTime                int64  `json:"closeTime"`
	QuoteAssetVolume         string `json:"quoteAssetVolume"`
	NumberOfTrades           int64  `json:"numberOfTrades"`
	TakerBuyBaseAssetVolume  string `json:"takerBuyBaseAssetVolume"`
	TakerBuyQuoteAssetVolume string `json:"takerBuyQuoteAssetVolume"`
	Ignore                   string `json:"ignore"`
}

func Kline

func Kline(connRest ConnectorRest, parm KlineParam) ([]KlineResp, error)

type Ticker24hrParam

type Ticker24hrParam struct {
	Symbol string `structs:"symbol,omitempty"` // optional
}

type Ticker24hrResp

type Ticker24hrResp struct {
	Symbol             string `json:"symbol"`
	PriceChange        string `json:"priceChange"`
	PriceChangePercent string `json:"priceChangePercent"`
	WeightedAvgPrice   string `json:"weightedAvgPrice"`
	LastPrice          string `json:"lastPrice"`
	LastQty            string `json:"lastQty"`
	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)

Jump to

Keyboard shortcuts

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