Documentation ¶
Index ¶
- Variables
- func CanonicalizeSymbol(symbol string) string
- func Fetch(stream *health.Stream, btcAvgPubkey string, btcAvgPrivkey string, ...) error
- func FetchCMC() (exchangeRates, error)
- func IsCorrectIDForSymbol(symbol string, id int64) bool
- func NewBTCAVGFetcher(pubkey string, privkey string) fetchFn
- func PinnedSymbolsToIDsJSON() []byte
- type Writer
Constants ¶
This section is empty.
Variables ¶
var AltSymbolsToCanonicalSymbols = map[string]string{
"IOTA": "MIOTA",
}
AltSymbolsToCanonicalSymbols maps symbols that may be used in some sources to represent coins that we use a different symbol for
var PinnedSymbolsToIDs = map[string]int64{
"BTC": 1,
"LTC": 2,
"NXT": 66,
"DOGE": 74,
"DASH": 131,
"XMR": 328,
"ETH": 1027,
"ZEC": 1437,
"BCH": 1831,
"BTG": 2083,
"CMT": 2246,
"KNC": 1982,
"BTM": 1866,
"ICN": 1408,
"GTC": 2336,
"BLZ": 2505,
"HOT": 2682,
"RCN": 2096,
"FAIR": 224,
"EDR": 2835,
"CPC": 2482,
"QBT": 2242,
"KEY": 2398,
"RED": 2771,
"HMC": 2484,
"NET": 1811,
"LNC": 2677,
"CAN": 2343,
"BET": 1771,
"SPD": 2616,
"CAT": 2334,
"GCC": 1531,
"PUT": 2419,
"MAG": 2218,
"CRC": 2664,
"ACC": 2225,
"PXC": 35,
"ETT": 1714,
"XIN": 2349,
"HERO": 1805,
"HNC": 1004,
"ENT": 1474,
"LBTC": 1825,
"CMS": 2262,
}
PinnedSymbolsToIDs maps symbols that may be used by multiple coins to a single coin by its CMC IDs.
var RequiredSymbols = []string{
"USD",
"EUR",
"GBP",
"CAD",
"RUB",
"BRL",
"AUD",
"BGN",
"NOK",
"CZK",
"BTC",
"BCH",
"ZEC",
"ETH",
}
RequiredSymbols are symbols we expect to be present and their absence should be treated as an error.
Functions ¶
func CanonicalizeSymbol ¶ added in v0.3.0
CanonicalizeSymbol returns the canonical symbol from the given one, which may or may not be a nickname
func Fetch ¶ added in v0.3.0
func Fetch(stream *health.Stream, btcAvgPubkey string, btcAvgPrivkey string, writers ...Writer) error
Fetch gets data from all sources, formats it, and sends it to the Writers.
func IsCorrectIDForSymbol ¶ added in v0.3.0
IsCorrectIDForSymbol checks if the given id is the correct one for the given symbol based on the map `PinnedSymbolsToIDs`
func NewBTCAVGFetcher ¶ added in v0.3.0
func PinnedSymbolsToIDsJSON ¶ added in v0.3.0
func PinnedSymbolsToIDsJSON() []byte
PinnedSymbolsToIDsJSON returns the PinnedSymbolsToIDs marshaled to JSON
Types ¶
type Writer ¶ added in v0.3.0
Writer is a callback for data collected from the backend sources
func NewFileSystemWriter ¶ added in v0.3.0
NewFileSystemWriter creates a Writer to writes to a local filesystem