bitstamp

package
v0.4.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BitstampDetails = types.ExchangeQueryDetails{
		Exchange:      exchange_common.EXCHANGE_ID_BITSTAMP,
		Url:           "https://www.bitstamp.net/api/v2/ticker/",
		PriceFunction: BitstampPriceFunction,
		IsMultiMarket: true,
	}
)

Functions

func BitstampPriceFunction

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

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

Types

type BitstampTicker

type BitstampTicker struct {
	Pair      string `json:"pair" validate:"required"`
	AskPrice  string `json:"ask" validate:"required,positive-float-string"`
	BidPrice  string `json:"bid" validate:"required,positive-float-string"`
	LastPrice string `json:"last" validate:"required,positive-float-string"`
}

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

func (BitstampTicker) GetAskPrice

func (t BitstampTicker) GetAskPrice() string

func (BitstampTicker) GetBidPrice

func (t BitstampTicker) GetBidPrice() string

func (BitstampTicker) GetLastPrice

func (t BitstampTicker) GetLastPrice() string

func (BitstampTicker) GetPair

func (t BitstampTicker) GetPair() string

Jump to

Keyboard shortcuts

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