bitpanda

package
v0.0.0-...-8276e37 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: NCSA Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderName cotains the common name of the provider.
	ProviderName string = "Bitpanda"
	// APIBaseURL points to the basic API endpoint used for all requests.
	APIBaseURL string = "https://api.bitpanda.com/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitpanda

type Bitpanda struct {

	// Error is used to convey possible errors.
	Error error
	// contains filtered or unexported fields
}

Bitpanda is a specific implementation of a Provider.

func New

func New(c *resty.Client) (p Bitpanda)

New initializes and returns a usable Provider object.

func (*Bitpanda) FetchPrices

func (p *Bitpanda) FetchPrices() (err error)

FetchPrices retrieves all available exchange rates and stores them for further use.

func (*Bitpanda) FetchRate

func (p *Bitpanda) FetchRate(coin string, fiat string) (rate types.ExchangeRate, err error)

FetchRate returns a single ExchangeRate.

func (*Bitpanda) FetchRateSynced

func (p *Bitpanda) FetchRateSynced(coin string, fiat string, rates *types.ExchangeRates, wg *sync.WaitGroup)

FetchRateSynced is a multi-threading implementation of FetchRate.

func (*Bitpanda) SetMarket

func (p *Bitpanda) SetMarket(market string) (err error)

SetMarket does nothing, but needs to be implemented to satisfy the Provider interface.

type Prices

type Prices map[string]map[string]string

Prices is used to store all exchange rates available on Bitpanda.

Jump to

Keyboard shortcuts

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