exchange

package
v0.0.0-...-17e5601 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BinanceAPIEnv    string = "BINANCE_API_KEY"
	BinanceSecretEnv string = "BINANCE_SECRET_KEy"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BinanceExchange

type BinanceExchange struct {
	Exchange
	// contains filtered or unexported fields
}

func NewBinanceExchange

func NewBinanceExchange(ctx context.Context, opts ...BinanceExchangeOption) (*BinanceExchange, error)

func (*BinanceExchange) GetAllPairs

func (e *BinanceExchange) GetAllPairs(currencies ...string) (pairs []*Pair)

func (*BinanceExchange) GetAllTriples

func (e *BinanceExchange) GetAllTriples(currencies ...string) (triples []*Triple)

type BinanceExchangeConfig

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

type BinanceExchangeOption

type BinanceExchangeOption interface {
	// contains filtered or unexported methods
}

type BinanceExchangeOptionFunc

type BinanceExchangeOptionFunc func(*BinanceExchangeConfig)

func WithAPIKey

func WithAPIKey(key string) BinanceExchangeOptionFunc

func WithAuthorizedCurrencies

func WithAuthorizedCurrencies(currencies ...string) BinanceExchangeOptionFunc

func WithBaseURL

func WithBaseURL(url string) BinanceExchangeOptionFunc

func WithSecretKey

func WithSecretKey(key string) BinanceExchangeOptionFunc

type Exchange

type Exchange interface {
	GetAllPairs(currencies ...string) []*Pair
	GetAllTriples(currencies ...string) []*Triple
}

type Pair

type Pair struct {
	Ask string
	Bid string
}

func (Pair) String

func (pair Pair) String() string

type Triple

type Triple struct {
	Start Pair
	End   Pair
}

Jump to

Keyboard shortcuts

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