avida

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogLevel  string
	Exchanges []Exchange
	Positions []Position
}

Config represents the avida config file.

func GetConfig

func GetConfig(logger *log.Logger) Config

GetConfig reads the avida config file.

type Exchange

type Exchange struct {
	Exchange  string
	APIKey    string
	APISecret string
}

Exchange represents a single crypto exchange.

func (*Exchange) GetPositions

func (e *Exchange) GetPositions() (*[]Position, error)

GetPositions returns all positions on a given exchange.

type Position

type Position struct {
	Symbol string
	Amount float64
}

Position presents a single position in either a wallet or an exchange.

func NewPosition

func NewPosition(symbol string, amount float64) *Position

NewPosition creates a new Position.

func (*Position) GetValueUSD

func (p *Position) GetValueUSD() (float64, error)

GetValueUSD will calculate the value of a ColdAsset based on the current price of the coin on CoinMarketCap.

Jump to

Keyboard shortcuts

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