exchanges

package
v0.0.0-...-f351f3f Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrencyToJson

func GetCurrencyToJson(cd CurrencyData) ([]byte, error)

Types

type AppExchange

type AppExchange struct{}

func (AppExchange) GetExchangeByJson

func (ae AppExchange) GetExchangeByJson(exchangeId int, data []byte) domain.Exchange

type Currency

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

func GetCurrencyFromJson

func GetCurrencyFromJson(data []byte) (*Currency, error)

func (*Currency) Balances

func (c *Currency) Balances(assets []string) ([]domain.Balance, error)

func (*Currency) Buy

func (c *Currency) Buy(pair domain.Pair, amount decimal.Decimal) (*domain.Order, error)

func (*Currency) CancelOrder

func (c *Currency) CancelOrder(orderId string, pair domain.Pair) error

func (*Currency) GetHistoryOrders

func (c *Currency) GetHistoryOrders(pairs []domain.Pair) ([]domain.Order, error)

func (*Currency) GetOpenOrders

func (c *Currency) GetOpenOrders(filter *domain.OrderFilter) ([]domain.Order, error)

func (*Currency) GetOrderFee

func (c *Currency) GetOrderFee(pair domain.Pair, amount decimal.Decimal, price decimal.Decimal) (domain.Balance, error)

func (*Currency) GetPairFee

func (c *Currency) GetPairFee(pair domain.Pair) (domain.Balance, error)

func (*Currency) LastPrice

func (c *Currency) LastPrice(pair domain.Pair) (decimal.Decimal, error)

func (Currency) Name

func (c Currency) Name() string

func (*Currency) Sell

func (c *Currency) Sell(pair domain.Pair, amount decimal.Decimal, price decimal.Decimal) (*domain.Order, error)

type CurrencyData

type CurrencyData struct {
	ApiKey string `json:"api_key"`
	Secret string `json:"secret"`
}

type ExchangeId

type ExchangeId int
const (
	CurrencyId    ExchangeId = iota
	MaxExchangeId ExchangeId = iota
)

Jump to

Keyboard shortcuts

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