exchange

package
v0.0.0-...-1c83c00 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatFloat

func FormatFloat(v float64) string

Types

type BTCM

type BTCM struct {
	ConfigExchange
	Exchange
	// contains filtered or unexported fields
}

Each exchange has to have its own struct

func (*BTCM) GetBalance

func (b *BTCM) GetBalance(assets []string) string

func (*BTCM) GetName

func (b *BTCM) GetName() string

func (*BTCM) GetOrderbook

func (b *BTCM) GetOrderbook(pair string) string

func (*BTCM) Init

func (b *BTCM) Init()

type Config

type Config struct {
	Exchanges []ConfigExchange    `json:"exchanges"`
	Symbols   []ConfigChildSymbol `json:"symbols"`
}

type ConfigChildSymbol

type ConfigChildSymbol struct {
	Id string `json:"id"`
}

type ConfigExchange

type ConfigExchange struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	ApiKey     string `json:"apiKey"`
	PrivateKey string `json:"privateKey"`
	BaseURL    string `json:"baseURL"`
}

type Exchange

type Exchange interface {
	GetBalance(assets []string) string
	GetOrderbook(string) string
	GetName() string
}

Methods to be implemented by each exchange

Jump to

Keyboard shortcuts

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