coinbase

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinPriceResponse

type CoinPriceResponse struct {
	Data struct {
		Currency string          `json:"currency"`
		Amount   decimal.Decimal `json:"amount"`
	} `json:"data"`
}

type Coinbase

type Coinbase struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config) *Coinbase

func (*Coinbase) GetCryptoPrice

func (cb *Coinbase) GetCryptoPrice(symbol string) (*CoinPriceResponse, error)

func (*Coinbase) GetFiatRatesToUSD

func (cb *Coinbase) GetFiatRatesToUSD() (*CurrencyItems, error)

type Config

type Config struct {
	APIKey    string
	APISecret string
}

type CurrencyItems

type CurrencyItems struct {
	Data []struct {
		ID      string          `json:"id"`
		Name    string          `json:"name"`
		MinSize string          `json:"min_size"`
		RateUSD decimal.Decimal `json:"-"`
	} `json:"data"`
}

type ExchangeRates

type ExchangeRates struct {
	Data struct {
		Currency string            `json:"currency"`
		Rates    map[string]string `json:"rates"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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