gate

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GateDetails = types.ExchangeQueryDetails{
	Exchange:      exchange_common.EXCHANGE_ID_GATE,
	Url:           "https://api.gateio.ws/api/v4/spot/tickers",
	PriceFunction: GatePriceFunction,
	IsMultiMarket: true,
}

Functions

func GatePriceFunction

func GatePriceFunction(
	response *http.Response,
	tickerToExponent map[string]int32,
	resolver types.Resolver,
) (tickerToPrice map[string]uint64, unavailableTickers map[string]error, err error)

GatePriceFunction transforms an API response from Gate into a map of tickers to prices that have been shifted by a market specific exponent.

Types

type GateTicker

type GateTicker struct {
	Pair      string `json:"currency_pair" validate:"required"`
	AskPrice  string `json:"lowest_ask" validate:"required,positive-float-string"`
	BidPrice  string `json:"highest_bid" validate:"required,positive-float-string"`
	LastPrice string `json:"last" validate:"required,positive-float-string"`
}

GateTicker is our representation of ticker information returned in Gate response. Need to implement interface `Ticker` in util.go.

func (GateTicker) GetAskPrice

func (t GateTicker) GetAskPrice() string

func (GateTicker) GetBidPrice

func (t GateTicker) GetBidPrice() string

func (GateTicker) GetLastPrice

func (t GateTicker) GetLastPrice() string

func (GateTicker) GetPair

func (t GateTicker) GetPair() string

Jump to

Keyboard shortcuts

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