Documentation
¶
Index ¶
- Variables
- func Get24HourChange(sym string) float64
- func GetAddressBalance() float32
- func GetAddressData(addx string)
- func GetHourChange(sym string) float64
- func GetPrice(sym string) float64
- func GetTokenBalance(sym string) float32
- func GetTokenChange(sym string) float32
- func GetTokenImageUrl(sym string) string
- func GetTokenList() []string
- func GetTokenName(sym string) string
- func GetTokenUrl(sym string) string
- func PullCoinData(yamlConfig Config)
- func RefreshPrice()
- type Config
Constants ¶
This section is empty.
Variables ¶
var ActiveTokenList []string
ActiveTokenList contains the tokens found under a provided ETH address
Functions ¶
func Get24HourChange ¶
Get24HourChange returns the 24 hour change of a coin given its ticker symbol
func GetAddressBalance ¶
func GetAddressBalance() float32
GetAddressBalance tracks the balance of coins associated with an address In the future a map can be created to track each balance per address
func GetAddressData ¶
func GetAddressData(addx string)
GetAddressData is a call to get all ERC-20 coins assocated with a specific ERC-20 address provided in the config file.
func GetHourChange ¶
GetHourChange returns the 1 hour change of a coin given its ticker symbol
func GetTokenBalance ¶
GetTokenBalance returns the balance of a coin given its ticker symbol
func GetTokenChange ¶
GetTokenChange returns the 1 hour price difference of a coin given its ticker symbol
func GetTokenImageUrl ¶
GetTokenImageUrl returns the url to the token image
func GetTokenList ¶
func GetTokenList() []string
GetTokenList returns a string array of the current tokens associated with a provided ERC-20 address
func GetTokenName ¶
GetTokenName returns the friendly name of a coin given its ticker symbol
func GetTokenUrl ¶
GetTokenUrl returns the website of a coin given its ticker symbol
func PullCoinData ¶
func PullCoinData(yamlConfig Config)
PullCoinData accepts a basic API url/token config structure
func RefreshPrice ¶
func RefreshPrice()
RefreshPrice is used to refresh token prices in the background
Types ¶
type Config ¶
type Config struct { Api struct { ApiUrl string `yaml:"url"` ApiTokenHeader string `yaml:"tokenheader"` ApiToken string `yaml:"token"` ApiAddress string `yaml:"walletaddress"` ApiPort string `yaml:"port"` } `yaml:"api"` }
Config structure provides a simple structure for the CMC API url - The url for the API tokenheader - The API token header syntax used to authenticate token - The actual secret token (This should be protected!)
func GetConfigData ¶
func GetConfigData() Config
GetConfigData Reads the API configuration from a config yaml file