currency

package
v0.0.0-...-83dca6d Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 17 Imported by: 0

README

GoCryptoTrader package Currency

Build Status Software License GoDoc Coverage Status Go Report Card

This currency package is part of the GoCryptoTrader codebase.

This is still in active development

You can track ideas, planned features and what's in progress on this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.

Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack

Current Features for currency

  • Currency package contains a full suite of packages that provide:
    • Foreign exchange data fetching for FIAT currencies
    • Currency Pair generation
    • Symbol mapping
    • Translation between currencies that have similar strings e.g. XBT, BTC
Please click GoDocs chevron above to view current GoDoc information for this package

Contribution

Please feel free to submit any pull requests or suggest any desired features to be added.

When submitting a PR, please abide by our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Code must adhere to our coding style.
  • Pull requests need to be based on and opened against the master branch.

Donations

If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:

bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc

Documentation

Index

Constants

View Source
const (
	Unset Role = 0
	Fiat  Role = 1 << (iota - 1)
	Cryptocurrency
	Token
	Contract

	UnsetRoleString      = "roleUnset"
	FiatCurrencyString   = "fiatCurrency"
	CryptocurrencyString = "cryptocurrency"
	TokenString          = "token"
	ContractString       = "contract"
)

Bitmasks const for currency roles

View Source
const (
	UnderscoreDelimiter   = "_"
	DashDelimiter         = "-"
	ForwardSlashDelimiter = "/"
	ColonDelimiter        = ":"
)

Const here are packaged defined delimiters

View Source
const (
	DefaultCurrencyFileDelay    = 168 * time.Hour
	DefaultForeignExchangeDelay = 1 * time.Minute
	DefaultStorageFile          = "currency.json"
)

CurrencyFileUpdateDelay defines the rate at which the currency.json file is updated

Variables

View Source
var (
	BTC        = NewCode("BTC")
	LTC        = NewCode("LTC")
	ETH        = NewCode("ETH")
	XRP        = NewCode("XRP")
	BCH        = NewCode("BCH")
	EOS        = NewCode("EOS")
	XLM        = NewCode("XLM")
	USDT       = NewCode("USDT")
	USDC       = NewCode("USDC")
	ADA        = NewCode("ADA")
	XMR        = NewCode("XMR")
	TRX        = NewCode("TRX")
	MIOTA      = NewCode("MIOTA")
	DASH       = NewCode("DASH")
	BNB        = NewCode("BNB")
	NEO        = NewCode("NEO")
	ETC        = NewCode("ETC")
	XEM        = NewCode("XEM")
	XTZ        = NewCode("XTZ")
	VET        = NewCode("VET")
	DOGE       = NewCode("DOGE")
	ZEC        = NewCode("ZEC")
	OMG        = NewCode("OMG")
	BTG        = NewCode("BTG")
	MKR        = NewCode("MKR")
	BCN        = NewCode("BCN")
	ONT        = NewCode("ONT")
	ZRX        = NewCode("ZRX")
	LSK        = NewCode("LSK")
	DCR        = NewCode("DCR")
	QTUM       = NewCode("QTUM")
	BCD        = NewCode("BCD")
	BTS        = NewCode("BTS")
	NANO       = NewCode("NANO")
	ZIL        = NewCode("ZIL")
	SC         = NewCode("SC")
	DGB        = NewCode("DGB")
	ICX        = NewCode("ICX")
	STEEM      = NewCode("STEEM")
	AE         = NewCode("AE")
	XVG        = NewCode("XVG")
	WAVES      = NewCode("WAVES")
	NPXS       = NewCode("NPXS")
	ETN        = NewCode("ETN")
	BTM        = NewCode("BTM")
	BAT        = NewCode("BAT")
	ETP        = NewCode("ETP")
	HOT        = NewCode("HOT")
	STRAT      = NewCode("STRAT") // nolint // Cryptocurrency code
	GNT        = NewCode("GNT")
	REP        = NewCode("REP")
	SNT        = NewCode("SNT")
	PPT        = NewCode("PPT")
	KMD        = NewCode("KMD")
	TUSD       = NewCode("TUSD")
	CNX        = NewCode("CNX")
	LINK       = NewCode("LINK")
	WTC        = NewCode("WTC")
	ARDR       = NewCode("ARDR")
	WAN        = NewCode("WAN")
	MITH       = NewCode("MITH")
	RDD        = NewCode("RDD")
	IOST       = NewCode("IOST")
	IOT        = NewCode("IOT")
	KCS        = NewCode("KCS")
	MAID       = NewCode("MAID")
	XET        = NewCode("XET")
	MOAC       = NewCode("MOAC")
	HC         = NewCode("HC")
	AION       = NewCode("AION")
	AOA        = NewCode("AOA")
	HT         = NewCode("HT")
	ELF        = NewCode("ELF")
	LRC        = NewCode("LRC")
	BNT        = NewCode("BNT")
	CMT        = NewCode("CMT")
	DGD        = NewCode("DGD")
	DCN        = NewCode("DCN")
	FUN        = NewCode("FUN")
	GXS        = NewCode("GXS")
	DROP       = NewCode("DROP")
	MANA       = NewCode("MANA")
	PAY        = NewCode("PAY")
	MCO        = NewCode("MCO")
	THETA      = NewCode("THETA")
	NXT        = NewCode("NXT")
	NOAH       = NewCode("NOAH")
	LOOM       = NewCode("LOOM")
	POWR       = NewCode("POWR")
	WAX        = NewCode("WAX")
	ELA        = NewCode("ELA")
	PIVX       = NewCode("PIVX")
	XIN        = NewCode("XIN")
	DAI        = NewCode("DAI")
	BTCP       = NewCode("BTCP")
	NEXO       = NewCode("NEXO")
	XBT        = NewCode("XBT")
	SAN        = NewCode("SAN")
	GAS        = NewCode("GAS")
	BCC        = NewCode("BCC")
	HCC        = NewCode("HCC")
	OAX        = NewCode("OAX")
	DNT        = NewCode("DNT")
	ICN        = NewCode("ICN")
	LLT        = NewCode("LLT")
	YOYO       = NewCode("YOYO")
	SNGLS      = NewCode("SNGLS")
	BQX        = NewCode("BQX")
	KNC        = NewCode("KNC")
	SNM        = NewCode("SNM")
	CTR        = NewCode("CTR")
	SALT       = NewCode("SALT")
	MDA        = NewCode("MDA")
	IOTA       = NewCode("IOTA")
	SUB        = NewCode("SUB")
	MTL        = NewCode("MTL")
	MTH        = NewCode("MTH")
	ENG        = NewCode("ENG")
	AST        = NewCode("AST")
	CLN        = NewCode("CLN")
	EDG        = NewCode("EDG")
	FIRST      = NewCode("1ST")
	GOLOS      = NewCode("GOLOS")
	ANT        = NewCode("ANT")
	GBG        = NewCode("GBG")
	HMQ        = NewCode("HMQ")
	INCNT      = NewCode("INCNT")
	ACE        = NewCode("ACE")
	ACT        = NewCode("ACT")
	AAC        = NewCode("AAC")
	AIDOC      = NewCode("AIDOC")
	SOC        = NewCode("SOC")
	ATL        = NewCode("ATL")
	AVT        = NewCode("AVT")
	BKX        = NewCode("BKX")
	BEC        = NewCode("BEC")
	VEE        = NewCode("VEE")
	PTOY       = NewCode("PTOY")
	CAG        = NewCode("CAG")
	CIC        = NewCode("CIC")
	CBT        = NewCode("CBT")
	CAN        = NewCode("CAN")
	DAT        = NewCode("DAT")
	DNA        = NewCode("DNA")
	INT        = NewCode("INT")
	IPC        = NewCode("IPC")
	ILA        = NewCode("ILA")
	LIGHT      = NewCode("LIGHT")
	MAG        = NewCode("MAG")
	AMM        = NewCode("AMM")
	MOF        = NewCode("MOF")
	MGC        = NewCode("MGC")
	OF         = NewCode("OF")
	LA         = NewCode("LA")
	LEV        = NewCode("LEV")
	NGC        = NewCode("NGC")
	OKB        = NewCode("OKB")
	MOT        = NewCode("MOT")
	PRA        = NewCode("PRA")
	R          = NewCode("R")
	SSC        = NewCode("SSC")
	SHOW       = NewCode("SHOW")
	SPF        = NewCode("SPF")
	SNC        = NewCode("SNC")
	SWFTC      = NewCode("SWFTC")
	TRA        = NewCode("TRA")
	TOPC       = NewCode("TOPC")
	TRIO       = NewCode("TRIO")
	QVT        = NewCode("QVT")
	UCT        = NewCode("UCT")
	UKG        = NewCode("UKG")
	UTK        = NewCode("UTK")
	VIU        = NewCode("VIU")
	WFEE       = NewCode("WFEE")
	WRC        = NewCode("WRC")
	UGC        = NewCode("UGC")
	YEE        = NewCode("YEE")
	YOYOW      = NewCode("YOYOW")
	ZIP        = NewCode("ZIP")
	READ       = NewCode("READ")
	RCT        = NewCode("RCT")
	REF        = NewCode("REF")
	XUC        = NewCode("XUC")
	FAIR       = NewCode("FAIR")
	GSC        = NewCode("GSC")
	HMC        = NewCode("HMC")
	PLU        = NewCode("PLU")
	PRO        = NewCode("PRO")
	QRL        = NewCode("QRL")
	REN        = NewCode("REN")
	ROUND      = NewCode("ROUND")
	SRN        = NewCode("SRN")
	XID        = NewCode("XID")
	SBD        = NewCode("SBD")
	TAAS       = NewCode("TAAS")
	TKN        = NewCode("TKN")
	VEN        = NewCode("VEN")
	VSL        = NewCode("VSL")
	TRST       = NewCode("TRST")
	XXX        = NewCode("XXX")
	IND        = NewCode("IND")
	LDC        = NewCode("LDC")
	GUP        = NewCode("GUP")
	MGO        = NewCode("MGO")
	MYST       = NewCode("MYST")
	NEU        = NewCode("NEU")
	NET        = NewCode("NET")
	BMC        = NewCode("BMC")
	BCAP       = NewCode("BCAP")
	TIME       = NewCode("TIME")
	CFI        = NewCode("CFI")
	EVX        = NewCode("EVX")
	REQ        = NewCode("REQ")
	VIB        = NewCode("VIB")
	ARK        = NewCode("ARK")
	MOD        = NewCode("MOD")
	ENJ        = NewCode("ENJ")
	STORJ      = NewCode("STORJ")
	RCN        = NewCode("RCN")
	NULS       = NewCode("NULS")
	RDN        = NewCode("RDN")
	DLT        = NewCode("DLT")
	AMB        = NewCode("AMB")
	BCPT       = NewCode("BCPT")
	ARN        = NewCode("ARN")
	GVT        = NewCode("GVT")
	CDT        = NewCode("CDT")
	POE        = NewCode("POE")
	QSP        = NewCode("QSP")
	XZC        = NewCode("XZC")
	TNT        = NewCode("TNT")
	FUEL       = NewCode("FUEL")
	ADX        = NewCode("ADX")
	CND        = NewCode("CND")
	LEND       = NewCode("LEND")
	WABI       = NewCode("WABI")
	SBTC       = NewCode("SBTC")
	BCX        = NewCode("BCX")
	TNB        = NewCode("TNB")
	GTO        = NewCode("GTO")
	OST        = NewCode("OST")
	CVC        = NewCode("CVC")
	DATA       = NewCode("DATA")
	ETF        = NewCode("ETF")
	BRD        = NewCode("BRD")
	NEBL       = NewCode("NEBL")
	VIBE       = NewCode("VIBE")
	LUN        = NewCode("LUN")
	CHAT       = NewCode("CHAT")
	RLC        = NewCode("RLC")
	INS        = NewCode("INS")
	VIA        = NewCode("VIA")
	BLZ        = NewCode("BLZ")
	SYS        = NewCode("SYS")
	NCASH      = NewCode("NCASH")
	POA        = NewCode("POA")
	STORM      = NewCode("STORM")
	WPR        = NewCode("WPR")
	QLC        = NewCode("QLC")
	GRS        = NewCode("GRS")
	CLOAK      = NewCode("CLOAK")
	ZEN        = NewCode("ZEN")
	SKY        = NewCode("SKY")
	IOTX       = NewCode("IOTX")
	QKC        = NewCode("QKC")
	AGI        = NewCode("AGI")
	NXS        = NewCode("NXS")
	EON        = NewCode("EON")
	KEY        = NewCode("KEY")
	NAS        = NewCode("NAS")
	ADD        = NewCode("ADD")
	MEETONE    = NewCode("MEETONE")
	ATD        = NewCode("ATD")
	MFT        = NewCode("MFT")
	EOP        = NewCode("EOP")
	DENT       = NewCode("DENT")
	IQ         = NewCode("IQ")
	DOCK       = NewCode("DOCK")
	POLY       = NewCode("POLY")
	VTHO       = NewCode("VTHO")
	ONG        = NewCode("ONG")
	PHX        = NewCode("PHX")
	GO         = NewCode("GO")
	PAX        = NewCode("PAX")
	PAXG       = NewCode("PAXG")
	EDO        = NewCode("EDO")
	WINGS      = NewCode("WINGS")
	NAV        = NewCode("NAV")
	TRIG       = NewCode("TRIG")
	APPC       = NewCode("APPC")
	KRW        = NewCode("KRW")
	HSR        = NewCode("HSR")
	ETHOS      = NewCode("ETHOS")
	CTXC       = NewCode("CTXC")
	ITC        = NewCode("ITC")
	TRUE       = NewCode("TRUE")
	ABT        = NewCode("ABT")
	RNT        = NewCode("RNT")
	PLY        = NewCode("PLY")
	PST        = NewCode("PST")
	KICK       = NewCode("KICK")
	BTCZ       = NewCode("BTCZ")
	DXT        = NewCode("DXT")
	STQ        = NewCode("STQ")
	INK        = NewCode("INK")
	HBZ        = NewCode("HBZ")
	USDT_ETH   = NewCode("USDT_ETH") // nolint // Cryptocurrency code
	QTUM_ETH   = NewCode("QTUM_ETH") // nolint // Cryptocurrency code
	BTM_ETH    = NewCode("BTM_ETH")  // nolint // Cryptocurrency code
	FIL        = NewCode("FIL")
	STX        = NewCode("STX")
	BOT        = NewCode("BOT")
	VERI       = NewCode("VERI")
	ZSC        = NewCode("ZSC")
	QBT        = NewCode("QBT")
	MED        = NewCode("MED")
	QASH       = NewCode("QASH")
	MDS        = NewCode("MDS")
	GOD        = NewCode("GOD")
	SMT        = NewCode("SMT")
	BTF        = NewCode("BTF")
	NAS_ETH    = NewCode("NAS_ETH") // nolint // Cryptocurrency code
	TSL        = NewCode("TSL")
	BIFI       = NewCode("BIFI")
	BNTY       = NewCode("BNTY")
	DRGN       = NewCode("DRGN")
	GTC        = NewCode("GTC")
	MDT        = NewCode("MDT")
	QUN        = NewCode("QUN")
	GNX        = NewCode("GNX")
	DDD        = NewCode("DDD")
	BTO        = NewCode("BTO")
	TIO        = NewCode("TIO")
	OCN        = NewCode("OCN")
	RUFF       = NewCode("RUFF")
	TNC        = NewCode("TNC")
	SNET       = NewCode("SNET")
	COFI       = NewCode("COFI")
	ZPT        = NewCode("ZPT")
	JNT        = NewCode("JNT")
	MTN        = NewCode("MTN")
	GEM        = NewCode("GEM")
	DADI       = NewCode("DADI")
	RFR        = NewCode("RFR")
	MOBI       = NewCode("MOBI")
	LEDU       = NewCode("LEDU")
	DBC        = NewCode("DBC")
	MKR_OLD    = NewCode("MKR_OLD") // nolint // Cryptocurrency code
	DPY        = NewCode("DPY")
	BCDN       = NewCode("BCDN")
	EOSDAC     = NewCode("EOSDAC")
	TIPS       = NewCode("TIPS")
	XMC        = NewCode("XMC")
	PPS        = NewCode("PPS")
	BOE        = NewCode("BOE")
	MEDX       = NewCode("MEDX")
	SMT_ETH    = NewCode("SMT_ETH") // nolint // Cryptocurrency code
	CS         = NewCode("CS")
	MAN        = NewCode("MAN")
	REM        = NewCode("REM")
	LYM        = NewCode("LYM")
	INSTAR     = NewCode("INSTAR")
	BFT        = NewCode("BFT")
	IHT        = NewCode("IHT")
	SENC       = NewCode("SENC")
	TOMO       = NewCode("TOMO")
	ELEC       = NewCode("ELEC")
	SHIP       = NewCode("SHIP")
	TFD        = NewCode("TFD")
	HAV        = NewCode("HAV")
	HUR        = NewCode("HUR")
	LST        = NewCode("LST")
	LINO       = NewCode("LINO")
	SWTH       = NewCode("SWTH")
	NKN        = NewCode("NKN")
	SOUL       = NewCode("SOUL")
	GALA_NEO   = NewCode("GALA_NEO") // nolint // Cryptocurrency code
	LRN        = NewCode("LRN")
	GSE        = NewCode("GSE")
	RATING     = NewCode("RATING")
	HSC        = NewCode("HSC")
	HIT        = NewCode("HIT")
	DX         = NewCode("DX")
	BXC        = NewCode("BXC")
	GARD       = NewCode("GARD")
	FTI        = NewCode("FTI")
	SOP        = NewCode("SOP")
	LEMO       = NewCode("LEMO")
	RED        = NewCode("RED")
	LBA        = NewCode("LBA")
	KAN        = NewCode("KAN")
	OPEN       = NewCode("OPEN")
	SKM        = NewCode("SKM")
	NBAI       = NewCode("NBAI")
	UPP        = NewCode("UPP")
	ATMI       = NewCode("ATMI")
	TMT        = NewCode("TMT")
	BBK        = NewCode("BBK")
	EDR        = NewCode("EDR")
	MET        = NewCode("MET")
	TCT        = NewCode("TCT")
	EXC        = NewCode("EXC")
	CNC        = NewCode("CNC")
	TIX        = NewCode("TIX")
	XTC        = NewCode("XTC")
	BU         = NewCode("BU")
	GNO        = NewCode("GNO")
	MLN        = NewCode("MLN")
	XBC        = NewCode("XBC")
	BTCD       = NewCode("BTCD")
	BURST      = NewCode("BURST")
	CLAM       = NewCode("CLAM")
	XCP        = NewCode("XCP")
	EMC2       = NewCode("EMC2")
	EXP        = NewCode("EXP")
	FCT        = NewCode("FCT")
	GAME       = NewCode("GAME")
	GRC        = NewCode("GRC")
	HUC        = NewCode("HUC")
	LBC        = NewCode("LBC")
	NMC        = NewCode("NMC")
	NEOS       = NewCode("NEOS")
	OMNI       = NewCode("OMNI")
	PASC       = NewCode("PASC")
	PPC        = NewCode("PPC")
	DSH        = NewCode("DSH")
	GML        = NewCode("GML")
	GSY        = NewCode("GSY")
	POT        = NewCode("POT")
	XPM        = NewCode("XPM")
	AMP        = NewCode("AMP")
	VRC        = NewCode("VRC")
	VTC        = NewCode("VTC")
	ZERO07     = NewCode("007")
	BIT16      = NewCode("BIT16")
	TWO015     = NewCode("2015")
	TWO56      = NewCode("256")
	TWOBACCO   = NewCode("2BACCO")
	TWOGIVE    = NewCode("2GIVE")
	THIRTY2BIT = NewCode("32BIT")
	THREE65    = NewCode("365")
	FOUR04     = NewCode("404")
	SEVEN00    = NewCode("700")
	EIGHTBIT   = NewCode("8BIT")
	ACLR       = NewCode("ACLR")
	ACES       = NewCode("ACES")
	ACPR       = NewCode("ACPR")
	ACID       = NewCode("ACID")
	ACOIN      = NewCode("ACOIN")
	ACRN       = NewCode("ACRN")
	ADAM       = NewCode("ADAM")
	ADT        = NewCode("ADT")
	AIB        = NewCode("AIB")
	ADZ        = NewCode("ADZ")
	AECC       = NewCode("AECC")
	AM         = NewCode("AM")
	AGRI       = NewCode("AGRI")
	AGT        = NewCode("AGT")
	AIR        = NewCode("AIR")
	ALEX       = NewCode("ALEX")
	AUM        = NewCode("AUM")
	ALIEN      = NewCode("ALIEN")
	ALIS       = NewCode("ALIS")
	ALL        = NewCode("ALL")
	ASAFE      = NewCode("ASAFE")
	AMBER      = NewCode("AMBER")
	AMS        = NewCode("AMS")
	ANAL       = NewCode("ANAL")
	ACP        = NewCode("ACP")
	ANI        = NewCode("ANI")
	ANTI       = NewCode("ANTI")
	ALTC       = NewCode("ALTC")
	APT        = NewCode("APT")
	ARCO       = NewCode("ARCO")
	ALC        = NewCode("ALC")
	ARB        = NewCode("ARB")
	ARCT       = NewCode("ARCT")
	ARCX       = NewCode("ARCX")
	ARGUS      = NewCode("ARGUS")
	ARH        = NewCode("ARH")
	ARM        = NewCode("ARM")
	ARNA       = NewCode("ARNA")
	ARPA       = NewCode("ARPA")
	ARTA       = NewCode("ARTA")
	ABY        = NewCode("ABY")
	ARTC       = NewCode("ARTC")
	AL         = NewCode("AL")
	ASN        = NewCode("ASN")
	ADCN       = NewCode("ADCN")
	ATB        = NewCode("ATB")
	ATM        = NewCode("ATM")
	ATMCHA     = NewCode("ATMCHA")
	ATOM       = NewCode("ATOM")
	ADC        = NewCode("ADC")
	ARE        = NewCode("ARE")
	AUR        = NewCode("AUR")
	AV         = NewCode("AV")
	AXIOM      = NewCode("AXIOM")
	B2B        = NewCode("B2B")
	B2         = NewCode("B2")
	B3         = NewCode("B3")
	BAB        = NewCode("BAB")
	BAN        = NewCode("BAN")
	BamitCoin  = NewCode("BamitCoin")
	NANAS      = NewCode("NANAS")
	BBCC       = NewCode("BBCC")
	BTA        = NewCode("BTA")
	BSTK       = NewCode("BSTK")
	BATL       = NewCode("BATL")
	BBH        = NewCode("BBH")
	BITB       = NewCode("BITB")
	BRDD       = NewCode("BRDD")
	XBTS       = NewCode("XBTS")
	BVC        = NewCode("BVC")
	CHATX      = NewCode("CHATX")
	BEEP       = NewCode("BEEP")
	BEEZ       = NewCode("BEEZ")
	BENJI      = NewCode("BENJI")
	BERN       = NewCode("BERN")
	PROFIT     = NewCode("PROFIT")
	BEST       = NewCode("BEST")
	BGF        = NewCode("BGF")
	BIGUP      = NewCode("BIGUP")
	BLRY       = NewCode("BLRY")
	BILL       = NewCode("BILL")
	BIOB       = NewCode("BIOB")
	BIO        = NewCode("BIO")
	BIOS       = NewCode("BIOS")
	BPTN       = NewCode("BPTN")
	BTCA       = NewCode("BTCA")
	BA         = NewCode("BA")
	BAC        = NewCode("BAC")
	BBT        = NewCode("BBT")
	BOSS       = NewCode("BOSS")
	BRONZ      = NewCode("BRONZ")
	CAT        = NewCode("CAT")
	BTD        = NewCode("BTD")
	XBTC21     = NewCode("XBTC21")
	BCA        = NewCode("BCA")
	BCP        = NewCode("BCP")
	BTDOLL     = NewCode("BTDOLL")
	LIZA       = NewCode("LIZA")
	BTCRED     = NewCode("BTCRED")
	BTCS       = NewCode("BTCS")
	BTU        = NewCode("BTU")
	BUM        = NewCode("BUM")
	LITE       = NewCode("LITE")
	BCM        = NewCode("BCM")
	BCS        = NewCode("BCS")
	BTCU       = NewCode("BTCU")
	BM         = NewCode("BM")
	BTCRY      = NewCode("BTCRY")
	BTCR       = NewCode("BTCR")
	HIRE       = NewCode("HIRE")
	STU        = NewCode("STU")
	BITOK      = NewCode("BITOK")
	BITON      = NewCode("BITON")
	BPC        = NewCode("BPC")
	BPOK       = NewCode("BPOK")
	BTP        = NewCode("BTP")
	BITCNY     = NewCode("bitCNY")
	RNTB       = NewCode("RNTB")
	BSH        = NewCode("BSH")
	XBS        = NewCode("XBS")
	BITS       = NewCode("BITS")
	BST        = NewCode("BST")
	BXT        = NewCode("BXT")
	VEG        = NewCode("VEG")
	VOLT       = NewCode("VOLT")
	BTV        = NewCode("BTV")
	BITZ       = NewCode("BITZ")
	BTZ        = NewCode("BTZ")
	BHC        = NewCode("BHC")
	BDC        = NewCode("BDC")
	JACK       = NewCode("JACK")
	BS         = NewCode("BS")
	BSTAR      = NewCode("BSTAR")
	BLAZR      = NewCode("BLAZR")
	BOD        = NewCode("BOD")
	BLUE       = NewCode("BLUE")
	BLU        = NewCode("BLU")
	BLUS       = NewCode("BLUS")
	BMT        = NewCode("BMT")
	BOLI       = NewCode("BOLI")
	BOMB       = NewCode("BOMB")
	BON        = NewCode("BON")
	BOOM       = NewCode("BOOM")
	BOSON      = NewCode("BOSON")
	BSC        = NewCode("BSC")
	BRH        = NewCode("BRH")
	BRAIN      = NewCode("BRAIN")
	BRE        = NewCode("BRE")
	BTCM       = NewCode("BTCM")
	BTCO       = NewCode("BTCO")
	TALK       = NewCode("TALK")
	BUB        = NewCode("BUB")
	BUY        = NewCode("BUY")
	BUZZ       = NewCode("BUZZ")
	BTH        = NewCode("BTH")
	C0C0       = NewCode("C0C0")
	CAB        = NewCode("CAB")
	CF         = NewCode("CF")
	CLO        = NewCode("CLO")
	CAM        = NewCode("CAM")
	CD         = NewCode("CD")
	CANN       = NewCode("CANN")
	CNNC       = NewCode("CNNC")
	CPC        = NewCode("CPC")
	CST        = NewCode("CST")
	CAPT       = NewCode("CAPT")
	CARBON     = NewCode("CARBON")
	CME        = NewCode("CME")
	CTK        = NewCode("CTK")
	CBD        = NewCode("CBD")
	CCC        = NewCode("CCC")
	CNT        = NewCode("CNT")
	XCE        = NewCode("XCE")
	CHRG       = NewCode("CHRG")
	CHEMX      = NewCode("CHEMX")
	CHESS      = NewCode("CHESS")
	CKS        = NewCode("CKS")
	CHILL      = NewCode("CHILL")
	CHIP       = NewCode("CHIP")
	CHOOF      = NewCode("CHOOF")
	CRX        = NewCode("CRX")
	CIN        = NewCode("CIN")
	POLL       = NewCode("POLL")
	CLICK      = NewCode("CLICK")
	CLINT      = NewCode("CLINT")
	CLUB       = NewCode("CLUB")
	CLUD       = NewCode("CLUD")
	COX        = NewCode("COX")
	COXST      = NewCode("COXST")
	CFC        = NewCode("CFC")
	CTIC2      = NewCode("CTIC2")
	COIN       = NewCode("COIN")
	BTTF       = NewCode("BTTF")
	C2         = NewCode("C2")
	CAID       = NewCode("CAID")
	CL         = NewCode("CL")
	CTIC       = NewCode("CTIC")
	CXT        = NewCode("CXT")
	CHP        = NewCode("CHP")
	CV2        = NewCode("CV2")
	COC        = NewCode("COC")
	COMP       = NewCode("COMP")
	CMS        = NewCode("CMS")
	CONX       = NewCode("CONX")
	CCX        = NewCode("CCX")
	CLR        = NewCode("CLR")
	CORAL      = NewCode("CORAL")
	CORG       = NewCode("CORG")
	CSMIC      = NewCode("CSMIC")
	CMC        = NewCode("CMC")
	COV        = NewCode("COV")
	COVX       = NewCode("COVX")
	CRAB       = NewCode("CRAB")
	CRAFT      = NewCode("CRAFT")
	CRNK       = NewCode("CRNK")
	CRAVE      = NewCode("CRAVE")
	CRM        = NewCode("CRM")
	XCRE       = NewCode("XCRE")
	CREDIT     = NewCode("CREDIT")
	CREVA      = NewCode("CREVA")
	CRIME      = NewCode("CRIME")
	CROC       = NewCode("CROC")
	CRC        = NewCode("CRC")
	CRW        = NewCode("CRW")
	CRY        = NewCode("CRY")
	CBX        = NewCode("CBX")
	TKTX       = NewCode("TKTX")
	CB         = NewCode("CB")
	CIRC       = NewCode("CIRC")
	CCB        = NewCode("CCB")
	CDO        = NewCode("CDO")
	CG         = NewCode("CG")
	CJ         = NewCode("CJ")
	CJC        = NewCode("CJC")
	CYT        = NewCode("CYT")
	CRPS       = NewCode("CRPS")
	PING       = NewCode("PING")
	CWXT       = NewCode("CWXT")
	CCT        = NewCode("CCT")
	CTL        = NewCode("CTL")
	CURVES     = NewCode("CURVES")
	CC         = NewCode("CC")
	CYC        = NewCode("CYC")
	CYG        = NewCode("CYG")
	CYP        = NewCode("CYP")
	FUNK       = NewCode("FUNK")
	CZECO      = NewCode("CZECO")
	DALC       = NewCode("DALC")
	DLISK      = NewCode("DLISK")
	MOOND      = NewCode("MOOND")
	DB         = NewCode("DB")
	DCC        = NewCode("DCC")
	DCYP       = NewCode("DCYP")
	DETH       = NewCode("DETH")
	DKC        = NewCode("DKC")
	DISK       = NewCode("DISK")
	DRKT       = NewCode("DRKT")
	DTT        = NewCode("DTT")
	DASHS      = NewCode("DASHS")
	DBTC       = NewCode("DBTC")
	DCT        = NewCode("DCT")
	DBET       = NewCode("DBET")
	DEC        = NewCode("DEC")
	DECR       = NewCode("DECR")
	DEA        = NewCode("DEA")
	DPAY       = NewCode("DPAY")
	DCRE       = NewCode("DCRE")
	DC         = NewCode("DC")
	DES        = NewCode("DES")
	DEM        = NewCode("DEM")
	DXC        = NewCode("DXC")
	DCK        = NewCode("DCK")
	CUBE       = NewCode("CUBE")
	DGMS       = NewCode("DGMS")
	DBG        = NewCode("DBG")
	DGCS       = NewCode("DGCS")
	DBLK       = NewCode("DBLK")
	DIME       = NewCode("DIME")
	DIRT       = NewCode("DIRT")
	DVD        = NewCode("DVD")
	DMT        = NewCode("DMT")
	NOTE       = NewCode("NOTE")
	DGORE      = NewCode("DGORE")
	DLC        = NewCode("DLC")
	DRT        = NewCode("DRT")
	DOTA       = NewCode("DOTA")
	DOX        = NewCode("DOX")
	DRA        = NewCode("DRA")
	DFT        = NewCode("DFT")
	XDB        = NewCode("XDB")
	DRM        = NewCode("DRM")
	DRZ        = NewCode("DRZ")
	DRACO      = NewCode("DRACO")
	DBIC       = NewCode("DBIC")
	DUB        = NewCode("DUB")
	GUM        = NewCode("GUM")
	DUR        = NewCode("DUR")
	DUST       = NewCode("DUST")
	DUX        = NewCode("DUX")
	DXO        = NewCode("DXO")
	ECN        = NewCode("ECN")
	EDR2       = NewCode("EDR2")
	EA         = NewCode("EA")
	EAGS       = NewCode("EAGS")
	EMT        = NewCode("EMT")
	EBONUS     = NewCode("EBONUS")
	ECCHI      = NewCode("ECCHI")
	EKO        = NewCode("EKO")
	ECLI       = NewCode("ECLI")
	ECOB       = NewCode("ECOB")
	ECO        = NewCode("ECO")
	EDIT       = NewCode("EDIT")
	EDRC       = NewCode("EDRC")
	EDC        = NewCode("EDC")
	EGAME      = NewCode("EGAME")
	EGG        = NewCode("EGG")
	EGO        = NewCode("EGO")
	ELC        = NewCode("ELC")
	ELCO       = NewCode("ELCO")
	ECA        = NewCode("ECA")
	EPC        = NewCode("EPC")
	ELE        = NewCode("ELE")
	ONE337     = NewCode("1337")
	EMB        = NewCode("EMB")
	EMC        = NewCode("EMC")
	EPY        = NewCode("EPY")
	EMPC       = NewCode("EMPC")
	EMP        = NewCode("EMP")
	ENE        = NewCode("ENE")
	EET        = NewCode("EET")
	XNG        = NewCode("XNG")
	EGMA       = NewCode("EGMA")
	ENTER      = NewCode("ENTER")
	ETRUST     = NewCode("ETRUST")
	EQL        = NewCode("EQL")
	EQM        = NewCode("EQM")
	EQT        = NewCode("EQT")
	ERR        = NewCode("ERR")
	ESC        = NewCode("ESC")
	ESP        = NewCode("ESP")
	ENT        = NewCode("ENT")
	ETCO       = NewCode("ETCO")
	DOGETH     = NewCode("DOGETH")
	ECASH      = NewCode("ECASH")
	ELITE      = NewCode("ELITE")
	ETHS       = NewCode("ETHS")
	ETL        = NewCode("ETL")
	ETZ        = NewCode("ETZ")
	EUC        = NewCode("EUC")
	EURC       = NewCode("EURC")
	EUROPE     = NewCode("EUROPE")
	EVA        = NewCode("EVA")
	EGC        = NewCode("EGC")
	EOC        = NewCode("EOC")
	EVIL       = NewCode("EVIL")
	EVO        = NewCode("EVO")
	EXB        = NewCode("EXB")
	EXIT       = NewCode("EXIT")
	XT         = NewCode("XT")
	F16        = NewCode("F16")
	FADE       = NewCode("FADE")
	FAZZ       = NewCode("FAZZ")
	FX         = NewCode("FX")
	FIDEL      = NewCode("FIDEL")
	FIDGT      = NewCode("FIDGT")
	FIND       = NewCode("FIND")
	FPC        = NewCode("FPC")
	FIRE       = NewCode("FIRE")
	FFC        = NewCode("FFC")
	FRST       = NewCode("FRST")
	FIST       = NewCode("FIST")
	FIT        = NewCode("FIT")
	FLX        = NewCode("FLX")
	FLVR       = NewCode("FLVR")
	FLY        = NewCode("FLY")
	FONZ       = NewCode("FONZ")
	XFCX       = NewCode("XFCX")
	FOREX      = NewCode("FOREX")
	FRN        = NewCode("FRN")
	FRK        = NewCode("FRK")
	FRWC       = NewCode("FRWC")
	FGZ        = NewCode("FGZ")
	FRE        = NewCode("FRE")
	FRDC       = NewCode("FRDC")
	FJC        = NewCode("FJC")
	FURY       = NewCode("FURY")
	FSN        = NewCode("FSN")
	FCASH      = NewCode("FCASH")
	FTO        = NewCode("FTO")
	FUZZ       = NewCode("FUZZ")
	GAKH       = NewCode("GAKH")
	GBT        = NewCode("GBT")
	UNITS      = NewCode("UNITS")
	FOUR20G    = NewCode("420G")
	GENIUS     = NewCode("GENIUS")
	GEN        = NewCode("GEN")
	GEO        = NewCode("GEO")
	GER        = NewCode("GER")
	GSR        = NewCode("GSR")
	SPKTR      = NewCode("SPKTR")
	GIFT       = NewCode("GIFT")
	WTT        = NewCode("WTT")
	GHS        = NewCode("GHS")
	GIG        = NewCode("GIG")
	GOT        = NewCode("GOT")
	XGTC       = NewCode("XGTC")
	GIZ        = NewCode("GIZ")
	GLO        = NewCode("GLO")
	GCR        = NewCode("GCR")
	BSTY       = NewCode("BSTY")
	GLC        = NewCode("GLC")
	GSX        = NewCode("GSX")
	GOAT       = NewCode("GOAT")
	GB         = NewCode("GB")
	GFL        = NewCode("GFL")
	MNTP       = NewCode("MNTP")
	GP         = NewCode("GP")
	GLUCK      = NewCode("GLUCK")
	GOON       = NewCode("GOON")
	GTFO       = NewCode("GTFO")
	GOTX       = NewCode("GOTX")
	GPU        = NewCode("GPU")
	GRF        = NewCode("GRF")
	GRAM       = NewCode("GRAM")
	GRAV       = NewCode("GRAV")
	GBIT       = NewCode("GBIT")
	GREED      = NewCode("GREED")
	GE         = NewCode("GE")
	GREENF     = NewCode("GREENF")
	GRE        = NewCode("GRE")
	GREXIT     = NewCode("GREXIT")
	GMCX       = NewCode("GMCX")
	GROW       = NewCode("GROW")
	GSM        = NewCode("GSM")
	GT         = NewCode("GT")
	NLG        = NewCode("NLG")
	HKN        = NewCode("HKN")
	HAC        = NewCode("HAC")
	HALLO      = NewCode("HALLO")
	HAMS       = NewCode("HAMS")
	HPC        = NewCode("HPC")
	HAWK       = NewCode("HAWK")
	HAZE       = NewCode("HAZE")
	HZT        = NewCode("HZT")
	HDG        = NewCode("HDG")
	HEDG       = NewCode("HEDG")
	HEEL       = NewCode("HEEL")
	HMP        = NewCode("HMP")
	PLAY       = NewCode("PLAY")
	HXX        = NewCode("HXX")
	XHI        = NewCode("XHI")
	HVCO       = NewCode("HVCO")
	HTC        = NewCode("HTC")
	MINH       = NewCode("MINH")
	HODL       = NewCode("HODL")
	HON        = NewCode("HON")
	HOPE       = NewCode("HOPE")
	HQX        = NewCode("HQX")
	HSP        = NewCode("HSP")
	HTML5      = NewCode("HTML5")
	HYPERX     = NewCode("HYPERX")
	HPS        = NewCode("HPS")
	IOC        = NewCode("IOC")
	IBANK      = NewCode("IBANK")
	IBITS      = NewCode("IBITS")
	ICASH      = NewCode("ICASH")
	ICOB       = NewCode("ICOB")
	ICON       = NewCode("ICON")
	IETH       = NewCode("IETH")
	ILM        = NewCode("ILM")
	IMPS       = NewCode("IMPS")
	NKA        = NewCode("NKA")
	INCP       = NewCode("INCP")
	IN         = NewCode("IN")
	INC        = NewCode("INC")
	IMS        = NewCode("IMS")
	IFLT       = NewCode("IFLT")
	INFX       = NewCode("INFX")
	INGT       = NewCode("INGT")
	INPAY      = NewCode("INPAY")
	INSANE     = NewCode("INSANE")
	INXT       = NewCode("INXT")
	IFT        = NewCode("IFT")
	INV        = NewCode("INV")
	IVZ        = NewCode("IVZ")
	ILT        = NewCode("ILT")
	IONX       = NewCode("IONX")
	ISL        = NewCode("ISL")
	ITI        = NewCode("ITI")
	ING        = NewCode("ING")
	IEC        = NewCode("IEC")
	IW         = NewCode("IW")
	IXC        = NewCode("IXC")
	IXT        = NewCode("IXT")
	JPC        = NewCode("JPC")
	JANE       = NewCode("JANE")
	JWL        = NewCode("JWL")
	JIF        = NewCode("JIF")
	JOBS       = NewCode("JOBS")
	JOCKER     = NewCode("JOCKER")
	JW         = NewCode("JW")
	JOK        = NewCode("JOK")
	XJO        = NewCode("XJO")
	KGB        = NewCode("KGB")
	KARMC      = NewCode("KARMC")
	KARMA      = NewCode("KARMA")
	KASHH      = NewCode("KASHH")
	KAT        = NewCode("KAT")
	KC         = NewCode("KC")
	KIDS       = NewCode("KIDS")
	KIN        = NewCode("KIN")
	KISS       = NewCode("KISS")
	KOBO       = NewCode("KOBO")
	TP1        = NewCode("TP1")
	KRAK       = NewCode("KRAK")
	KGC        = NewCode("KGC")
	KTK        = NewCode("KTK")
	KR         = NewCode("KR")
	KUBO       = NewCode("KUBO")
	KURT       = NewCode("KURT")
	KUSH       = NewCode("KUSH")
	LANA       = NewCode("LANA")
	LTH        = NewCode("LTH")
	LAZ        = NewCode("LAZ")
	LEA        = NewCode("LEA")
	LEAF       = NewCode("LEAF")
	LENIN      = NewCode("LENIN")
	LEPEN      = NewCode("LEPEN")
	LIR        = NewCode("LIR")
	LVG        = NewCode("LVG")
	LGBTQ      = NewCode("LGBTQ")
	LHC        = NewCode("LHC")
	EXT        = NewCode("EXT")
	LBTC       = NewCode("LBTC")
	LSD        = NewCode("LSD")
	LIMX       = NewCode("LIMX")
	LTD        = NewCode("LTD")
	LINDA      = NewCode("LINDA")
	LKC        = NewCode("LKC")
	LBTCX      = NewCode("LBTCX")
	LCC        = NewCode("LCC")
	LTCU       = NewCode("LTCU")
	LTCR       = NewCode("LTCR")
	LDOGE      = NewCode("LDOGE")
	LTS        = NewCode("LTS")
	LIV        = NewCode("LIV")
	LIZI       = NewCode("LIZI")
	LOC        = NewCode("LOC")
	LOCX       = NewCode("LOCX")
	LOOK       = NewCode("LOOK")
	LOOT       = NewCode("LOOT")
	XLTCG      = NewCode("XLTCG")
	BASH       = NewCode("BASH")
	LUCKY      = NewCode("LUCKY")
	L7S        = NewCode("L7S")
	LDM        = NewCode("LDM")
	LUMI       = NewCode("LUMI")
	LUNA       = NewCode("LUNA")
	LC         = NewCode("LC")
	LUX        = NewCode("LUX")
	MCRN       = NewCode("MCRN")
	XMG        = NewCode("XMG")
	MMXIV      = NewCode("MMXIV")
	MAT        = NewCode("MAT")
	MAO        = NewCode("MAO")
	MAPC       = NewCode("MAPC")
	MRB        = NewCode("MRB")
	MXT        = NewCode("MXT")
	MARV       = NewCode("MARV")
	MARX       = NewCode("MARX")
	MCAR       = NewCode("MCAR")
	MM         = NewCode("MM")
	MVC        = NewCode("MVC")
	MAVRO      = NewCode("MAVRO")
	MAX        = NewCode("MAX")
	MAZE       = NewCode("MAZE")
	MBIT       = NewCode("MBIT")
	MCOIN      = NewCode("MCOIN")
	MPRO       = NewCode("MPRO")
	XMS        = NewCode("XMS")
	MLITE      = NewCode("MLITE")
	MLNC       = NewCode("MLNC")
	MENTAL     = NewCode("MENTAL")
	MERGEC     = NewCode("MERGEC")
	MTLMC3     = NewCode("MTLMC3")
	METAL      = NewCode("METAL")
	MUU        = NewCode("MUU")
	MILO       = NewCode("MILO")
	MND        = NewCode("MND")
	XMINE      = NewCode("XMINE")
	MNM        = NewCode("MNM")
	XNM        = NewCode("XNM")
	MIRO       = NewCode("MIRO")
	MIS        = NewCode("MIS")
	MMXVI      = NewCode("MMXVI")
	MOIN       = NewCode("MOIN")
	MOJO       = NewCode("MOJO")
	TAB        = NewCode("TAB")
	MONETA     = NewCode("MONETA")
	MUE        = NewCode("MUE")
	MONEY      = NewCode("MONEY")
	MRP        = NewCode("MRP")
	MOTO       = NewCode("MOTO")
	MULTI      = NewCode("MULTI")
	MST        = NewCode("MST")
	MVR        = NewCode("MVR")
	MYSTIC     = NewCode("MYSTIC")
	WISH       = NewCode("WISH")
	NKT        = NewCode("NKT")
	NAT        = NewCode("NAT")
	ENAU       = NewCode("ENAU")
	NEBU       = NewCode("NEBU")
	NEF        = NewCode("NEF")
	NBIT       = NewCode("NBIT")
	NETKO      = NewCode("NETKO")
	NTM        = NewCode("NTM")
	NETC       = NewCode("NETC")
	NRC        = NewCode("NRC")
	NTK        = NewCode("NTK")
	NTRN       = NewCode("NTRN")
	NEVA       = NewCode("NEVA")
	NIC        = NewCode("NIC")
	NKC        = NewCode("NKC")
	NYC        = NewCode("NYC")
	NZC        = NewCode("NZC")
	NICE       = NewCode("NICE")
	NDOGE      = NewCode("NDOGE")
	XTR        = NewCode("XTR")
	N2O        = NewCode("N2O")
	NIXON      = NewCode("NIXON")
	NOC        = NewCode("NOC")
	NODC       = NewCode("NODC")
	NODES      = NewCode("NODES")
	NODX       = NewCode("NODX")
	NLC        = NewCode("NLC")
	NLC2       = NewCode("NLC2")
	NOO        = NewCode("NOO")
	NVC        = NewCode("NVC")
	NPC        = NewCode("NPC")
	NUBIS      = NewCode("NUBIS")
	NUKE       = NewCode("NUKE")
	N7         = NewCode("N7")
	NUM        = NewCode("NUM")
	NMR        = NewCode("NMR")
	NXE        = NewCode("NXE")
	OBS        = NewCode("OBS")
	OCEAN      = NewCode("OCEAN")
	OCOW       = NewCode("OCOW")
	EIGHT88    = NewCode("888")
	OCC        = NewCode("OCC")
	OK         = NewCode("OK")
	ODNT       = NewCode("ODNT")
	FLAV       = NewCode("FLAV")
	OLIT       = NewCode("OLIT")
	OLYMP      = NewCode("OLYMP")
	OMA        = NewCode("OMA")
	OMC        = NewCode("OMC")
	ONEK       = NewCode("ONEK")
	ONX        = NewCode("ONX")
	XPO        = NewCode("XPO")
	OPAL       = NewCode("OPAL")
	OTN        = NewCode("OTN")
	OP         = NewCode("OP")
	OPES       = NewCode("OPES")
	OPTION     = NewCode("OPTION")
	ORLY       = NewCode("ORLY")
	OS76       = NewCode("OS76")
	OZC        = NewCode("OZC")
	P7C        = NewCode("P7C")
	PAC        = NewCode("PAC")
	PAK        = NewCode("PAK")
	PAL        = NewCode("PAL")
	PND        = NewCode("PND")
	PINKX      = NewCode("PINKX")
	POPPY      = NewCode("POPPY")
	DUO        = NewCode("DUO")
	PARA       = NewCode("PARA")
	PKB        = NewCode("PKB")
	GENE       = NewCode("GENE")
	PARTY      = NewCode("PARTY")
	PYN        = NewCode("PYN")
	XPY        = NewCode("XPY")
	CON        = NewCode("CON")
	PAYP       = NewCode("PAYP")
	GUESS      = NewCode("GUESS")
	PEN        = NewCode("PEN")
	PTA        = NewCode("PTA")
	PEO        = NewCode("PEO")
	PSB        = NewCode("PSB")
	XPD        = NewCode("XPD")
	PXL        = NewCode("PXL")
	PHR        = NewCode("PHR")
	PIE        = NewCode("PIE")
	PIO        = NewCode("PIO")
	PIPR       = NewCode("PIPR")
	SKULL      = NewCode("SKULL")
	PLANET     = NewCode("PLANET")
	PNC        = NewCode("PNC")
	XPTX       = NewCode("XPTX")
	PLNC       = NewCode("PLNC")
	XPS        = NewCode("XPS")
	POKE       = NewCode("POKE")
	PLBT       = NewCode("PLBT")
	POM        = NewCode("POM")
	PONZ2      = NewCode("PONZ2")
	PONZI      = NewCode("PONZI")
	XSP        = NewCode("XSP")
	XPC        = NewCode("XPC")
	PEX        = NewCode("PEX")
	TRON       = NewCode("TRON")
	POST       = NewCode("POST")
	POSW       = NewCode("POSW")
	PWR        = NewCode("PWR")
	POWER      = NewCode("POWER")
	PRE        = NewCode("PRE")
	PRS        = NewCode("PRS")
	PXI        = NewCode("PXI")
	PEXT       = NewCode("PEXT")
	PRIMU      = NewCode("PRIMU")
	PRX        = NewCode("PRX")
	PRM        = NewCode("PRM")
	PRIX       = NewCode("PRIX")
	XPRO       = NewCode("XPRO")
	PCM        = NewCode("PCM")
	PROC       = NewCode("PROC")
	NANOX      = NewCode("NANOX")
	VRP        = NewCode("VRP")
	PTY        = NewCode("PTY")
	PSI        = NewCode("PSI")
	PSY        = NewCode("PSY")
	PULSE      = NewCode("PULSE")
	PUPA       = NewCode("PUPA")
	PURE       = NewCode("PURE")
	VIDZ       = NewCode("VIDZ")
	PUTIN      = NewCode("PUTIN")
	PX         = NewCode("PX")
	QTM        = NewCode("QTM")
	QTZ        = NewCode("QTZ")
	QBC        = NewCode("QBC")
	XQN        = NewCode("XQN")
	RBBT       = NewCode("RBBT")
	RAC        = NewCode("RAC")
	RADI       = NewCode("RADI")
	RAD        = NewCode("RAD")
	RAI        = NewCode("RAI")
	XRA        = NewCode("XRA")
	RATIO      = NewCode("RATIO")
	REA        = NewCode("REA")
	RCX        = NewCode("RCX")
	REE        = NewCode("REE")
	REC        = NewCode("REC")
	RMS        = NewCode("RMS")
	RBIT       = NewCode("RBIT")
	RNC        = NewCode("RNC")
	REV        = NewCode("REV")
	RH         = NewCode("RH")
	XRL        = NewCode("XRL")
	RICE       = NewCode("RICE")
	RICHX      = NewCode("RICHX")
	RID        = NewCode("RID")
	RIDE       = NewCode("RIDE")
	RBT        = NewCode("RBT")
	RING       = NewCode("RING")
	RIO        = NewCode("RIO")
	RISE       = NewCode("RISE")
	ROCKET     = NewCode("ROCKET")
	RPC        = NewCode("RPC")
	ROS        = NewCode("ROS")
	ROYAL      = NewCode("ROYAL")
	RSGP       = NewCode("RSGP")
	RBIES      = NewCode("RBIES")
	RUBIT      = NewCode("RUBIT")
	RBY        = NewCode("RBY")
	RUC        = NewCode("RUC")
	RUPX       = NewCode("RUPX")
	RUP        = NewCode("RUP")
	RUST       = NewCode("RUST")
	SFE        = NewCode("SFE")
	SLS        = NewCode("SLS")
	SMSR       = NewCode("SMSR")
	RONIN      = NewCode("RONIN")
	STV        = NewCode("STV")
	HIFUN      = NewCode("HIFUN")
	MAD        = NewCode("MAD")
	SANDG      = NewCode("SANDG")
	STO        = NewCode("STO")
	SCAN       = NewCode("SCAN")
	SCITW      = NewCode("SCITW")
	SCRPT      = NewCode("SCRPT")
	SCRT       = NewCode("SCRT")
	SED        = NewCode("SED")
	SEEDS      = NewCode("SEEDS")
	B2X        = NewCode("B2X")
	SEL        = NewCode("SEL")
	SLFI       = NewCode("SLFI")
	SMBR       = NewCode("SMBR")
	SEN        = NewCode("SEN")
	SENT       = NewCode("SENT")
	SRNT       = NewCode("SRNT")
	SEV        = NewCode("SEV")
	SP         = NewCode("SP")
	SXC        = NewCode("SXC")
	GELD       = NewCode("GELD")
	SHDW       = NewCode("SHDW")
	SDC        = NewCode("SDC")
	SAK        = NewCode("SAK")
	SHRP       = NewCode("SHRP")
	SHELL      = NewCode("SHELL")
	SH         = NewCode("SH")
	SHORTY     = NewCode("SHORTY")
	SHREK      = NewCode("SHREK")
	SHRM       = NewCode("SHRM")
	SIB        = NewCode("SIB")
	SIGT       = NewCode("SIGT")
	SLCO       = NewCode("SLCO")
	SIGU       = NewCode("SIGU")
	SIX        = NewCode("SIX")
	SJW        = NewCode("SJW")
	SKB        = NewCode("SKB")
	SW         = NewCode("SW")
	SLEEP      = NewCode("SLEEP")
	SLING      = NewCode("SLING")
	SMART      = NewCode("SMART")
	SMC        = NewCode("SMC")
	SMF        = NewCode("SMF")
	SOCC       = NewCode("SOCC")
	SCL        = NewCode("SCL")
	SDAO       = NewCode("SDAO")
	SOLAR      = NewCode("SOLAR")
	SOLO       = NewCode("SOLO")
	SCT        = NewCode("SCT")
	SONG       = NewCode("SONG")
	ALTCOM     = NewCode("ALTCOM")
	SPHTX      = NewCode("SPHTX")
	SPC        = NewCode("SPC")
	SPACE      = NewCode("SPACE")
	SBT        = NewCode("SBT")
	SPEC       = NewCode("SPEC")
	SPX        = NewCode("SPX")
	SCS        = NewCode("SCS")
	SPORT      = NewCode("SPORT")
	SPT        = NewCode("SPT")
	SPR        = NewCode("SPR")
	SPEX       = NewCode("SPEX")
	SQL        = NewCode("SQL")
	SBIT       = NewCode("SBIT")
	STHR       = NewCode("STHR")
	STALIN     = NewCode("STALIN")
	STAR       = NewCode("STAR")
	STA        = NewCode("STA")
	START      = NewCode("START")
	STP        = NewCode("STP")
	PNK        = NewCode("PNK")
	STEPS      = NewCode("STEPS")
	STK        = NewCode("STK")
	STONK      = NewCode("STONK")
	STS        = NewCode("STS")
	STRP       = NewCode("STRP")
	STY        = NewCode("STY")
	XMT        = NewCode("XMT")
	SSTC       = NewCode("SSTC")
	SUPER      = NewCode("SUPER")
	SRND       = NewCode("SRND")
	STRB       = NewCode("STRB")
	M1         = NewCode("M1")
	SPM        = NewCode("SPM")
	BUCKS      = NewCode("BUCKS")
	TOKEN      = NewCode("TOKEN")
	SWT        = NewCode("SWT")
	SWEET      = NewCode("SWEET")
	SWING      = NewCode("SWING")
	CHSB       = NewCode("CHSB")
	SIC        = NewCode("SIC")
	SDP        = NewCode("SDP")
	XSY        = NewCode("XSY")
	SYNX       = NewCode("SYNX")
	SNRG       = NewCode("SNRG")
	TAG        = NewCode("TAG")
	TAGR       = NewCode("TAGR")
	TAJ        = NewCode("TAJ")
	TAK        = NewCode("TAK")
	TAKE       = NewCode("TAKE")
	TAM        = NewCode("TAM")
	XTO        = NewCode("XTO")
	TAP        = NewCode("TAP")
	TLE        = NewCode("TLE")
	TSE        = NewCode("TSE")
	TLEX       = NewCode("TLEX")
	TAXI       = NewCode("TAXI")
	TCN        = NewCode("TCN")
	TDFB       = NewCode("TDFB")
	TEAM       = NewCode("TEAM")
	TECH       = NewCode("TECH")
	TEC        = NewCode("TEC")
	TEK        = NewCode("TEK")
	TB         = NewCode("TB")
	TLX        = NewCode("TLX")
	TELL       = NewCode("TELL")
	TENNET     = NewCode("TENNET")
	TES        = NewCode("TES")
	TGS        = NewCode("TGS")
	XVE        = NewCode("XVE")
	TCR        = NewCode("TCR")
	GCC        = NewCode("GCC")
	MAY        = NewCode("MAY")
	THOM       = NewCode("THOM")
	TIA        = NewCode("TIA")
	TIDE       = NewCode("TIDE")
	TIE        = NewCode("TIE")
	TIT        = NewCode("TIT")
	TTC        = NewCode("TTC")
	TODAY      = NewCode("TODAY")
	TBX        = NewCode("TBX")
	TDS        = NewCode("TDS")
	TLOSH      = NewCode("TLOSH")
	TOKC       = NewCode("TOKC")
	TMRW       = NewCode("TMRW")
	TOOL       = NewCode("TOOL")
	TCX        = NewCode("TCX")
	TOT        = NewCode("TOT")
	TX         = NewCode("TX")
	TRANSF     = NewCode("TRANSF")
	TRAP       = NewCode("TRAP")
	TBCX       = NewCode("TBCX")
	TRICK      = NewCode("TRICK")
	TPG        = NewCode("TPG")
	TFL        = NewCode("TFL")
	TRUMP      = NewCode("TRUMP")
	TNG        = NewCode("TNG")
	TUR        = NewCode("TUR")
	TWERK      = NewCode("TWERK")
	TWIST      = NewCode("TWIST")
	TWO        = NewCode("TWO")
	UCASH      = NewCode("UCASH")
	UAE        = NewCode("UAE")
	XBU        = NewCode("XBU")
	UBQ        = NewCode("UBQ")
	U          = NewCode("U")
	UDOWN      = NewCode("UDOWN")
	GAIN       = NewCode("GAIN")
	USC        = NewCode("USC")
	UMC        = NewCode("UMC")
	UNF        = NewCode("UNF")
	UNIFY      = NewCode("UNIFY")
	USDE       = NewCode("USDE")
	UBTC       = NewCode("UBTC")
	UIS        = NewCode("UIS")
	UNIT       = NewCode("UNIT")
	UNI        = NewCode("UNI")
	UXC        = NewCode("UXC")
	URC        = NewCode("URC")
	XUP        = NewCode("XUP")
	UFR        = NewCode("UFR")
	URO        = NewCode("URO")
	UTLE       = NewCode("UTLE")
	VAL        = NewCode("VAL")
	VPRC       = NewCode("VPRC")
	VAPOR      = NewCode("VAPOR")
	VCOIN      = NewCode("VCOIN")
	VEC        = NewCode("VEC")
	VEC2       = NewCode("VEC2")
	VLT        = NewCode("VLT")
	VENE       = NewCode("VENE")
	VNTX       = NewCode("VNTX")
	VTN        = NewCode("VTN")
	CRED       = NewCode("CRED")
	VERS       = NewCode("VERS")
	VTX        = NewCode("VTX")
	VTY        = NewCode("VTY")
	VIP        = NewCode("VIP")
	VISIO      = NewCode("VISIO")
	VK         = NewCode("VK")
	VOL        = NewCode("VOL")
	VOYA       = NewCode("VOYA")
	VPN        = NewCode("VPN")
	XVS        = NewCode("XVS")
	VTL        = NewCode("VTL")
	VULC       = NewCode("VULC")
	VVI        = NewCode("VVI")
	WGR        = NewCode("WGR")
	WAM        = NewCode("WAM")
	WARP       = NewCode("WARP")
	WASH       = NewCode("WASH")
	WGO        = NewCode("WGO")
	WAY        = NewCode("WAY")
	WCASH      = NewCode("WCASH")
	WEALTH     = NewCode("WEALTH")
	WEEK       = NewCode("WEEK")
	WHO        = NewCode("WHO")
	WIC        = NewCode("WIC")
	WBB        = NewCode("WBB")
	WINE       = NewCode("WINE")
	WINK       = NewCode("WINK")
	WISC       = NewCode("WISC")
	WITCH      = NewCode("WITCH")
	WMC        = NewCode("WMC")
	WOMEN      = NewCode("WOMEN")
	WOK        = NewCode("WOK")
	WRT        = NewCode("WRT")
	XCO        = NewCode("XCO")
	X2         = NewCode("X2")
	XNX        = NewCode("XNX")
	XAU        = NewCode("XAU")
	XAV        = NewCode("XAV")
	XDE2       = NewCode("XDE2")
	XDE        = NewCode("XDE")
	XIOS       = NewCode("XIOS")
	XOC        = NewCode("XOC")
	XSSX       = NewCode("XSSX")
	XBY        = NewCode("XBY")
	YAC        = NewCode("YAC")
	YMC        = NewCode("YMC")
	YAY        = NewCode("YAY")
	YBC        = NewCode("YBC")
	YES        = NewCode("YES")
	YOB2X      = NewCode("YOB2X")
	YOVI       = NewCode("YOVI")
	ZYD        = NewCode("ZYD")
	ZECD       = NewCode("ZECD")
	ZEIT       = NewCode("ZEIT")
	ZENI       = NewCode("ZENI")
	ZET2       = NewCode("ZET2")
	ZET        = NewCode("ZET")
	ZMC        = NewCode("ZMC")
	ZIRK       = NewCode("ZIRK")
	ZLQ        = NewCode("ZLQ")
	ZNE        = NewCode("ZNE")
	ZONTO      = NewCode("ZONTO")
	ZOOM       = NewCode("ZOOM")
	ZRC        = NewCode("ZRC")
	ZUR        = NewCode("ZUR")
	ZB         = NewCode("ZB")
	QC         = NewCode("QC")
	HLC        = NewCode("HLC")
	SAFE       = NewCode("SAFE")
	BTN        = NewCode("BTN")
	CDC        = NewCode("CDC")
	DDM        = NewCode("DDM")
	HOTC       = NewCode("HOTC")
	BDS        = NewCode("BDS")
	AAA        = NewCode("AAA")
	XWC        = NewCode("XWC")
	PDX        = NewCode("PDX")
	SLT        = NewCode("SLT")
	HPY        = NewCode("HPY")
	XXRP       = NewCode("XXRP") // XRP
	XXBT       = NewCode("XXBT") // BTC, but XXBT instead
	XXDG       = NewCode("XXDG") // DOGE
	XDG        = NewCode("XDG")  // DOGE
	HKD        = NewCode("HKD")  // Hong Kong Dollar
	AUD        = NewCode("AUD")  // Australian Dollar
	USD        = NewCode("USD")  // United States Dollar
	ZUSD       = NewCode("ZUSD") // United States Dollar, but with a Z in front of it
	EUR        = NewCode("EUR")  // Euro
	ZEUR       = NewCode("ZEUR") // Euro, but with a Z in front of it
	CAD        = NewCode("CAD")  // Canadaian Dollar
	ZCAD       = NewCode("ZCAD") // Canadaian Dollar, but with a Z in front of it
	SGD        = NewCode("SGD")  // Singapore Dollar
	RUB        = NewCode("RUB")  // RUssian ruBle
	RUR        = NewCode("RUR")  // RUssian Ruble
	PLN        = NewCode("PLN")  // Polish złoty
	TRY        = NewCode("TRY")  // Turkish lira
	UAH        = NewCode("UAH")  // Ukrainian hryvnia
	JPY        = NewCode("JPY")  // Japanese yen
	ZJPY       = NewCode("ZJPY") // Japanese yen, but with a Z in front of it
	LCH        = NewCode("LCH")
	MYR        = NewCode("MYR")
	AFN        = NewCode("AFN")
	ARS        = NewCode("ARS")
	AWG        = NewCode("AWG")
	AZN        = NewCode("AZN")
	BSD        = NewCode("BSD")
	BBD        = NewCode("BBD")
	BYN        = NewCode("BYN")
	BZD        = NewCode("BZD")
	BMD        = NewCode("BMD")
	BOB        = NewCode("BOB")
	BAM        = NewCode("BAM")
	BWP        = NewCode("BWP")
	BGN        = NewCode("BGN")
	BRL        = NewCode("BRL")
	BND        = NewCode("BND")
	KHR        = NewCode("KHR")
	KYD        = NewCode("KYD")
	CLP        = NewCode("CLP")
	CNY        = NewCode("CNY")
	COP        = NewCode("COP")
	HRK        = NewCode("HRK")
	CUP        = NewCode("CUP")
	CZK        = NewCode("CZK")
	DKK        = NewCode("DKK")
	DOP        = NewCode("DOP")
	XCD        = NewCode("XCD")
	EGP        = NewCode("EGP")
	SVC        = NewCode("SVC")
	FKP        = NewCode("FKP")
	FJD        = NewCode("FJD")
	GIP        = NewCode("GIP")
	GTQ        = NewCode("GTQ")
	GGP        = NewCode("GGP")
	GYD        = NewCode("GYD")
	HNL        = NewCode("HNL")
	HUF        = NewCode("HUF")
	ISK        = NewCode("ISK")
	INR        = NewCode("INR")
	IDR        = NewCode("IDR")
	IRR        = NewCode("IRR")
	IMP        = NewCode("IMP")
	ILS        = NewCode("ILS")
	JMD        = NewCode("JMD")
	JEP        = NewCode("JEP")
	KZT        = NewCode("KZT")
	KPW        = NewCode("KPW")
	KGS        = NewCode("KGS")
	LAK        = NewCode("LAK")
	LBP        = NewCode("LBP")
	LRD        = NewCode("LRD")
	MKD        = NewCode("MKD")
	MUR        = NewCode("MUR")
	MXN        = NewCode("MXN")
	MNT        = NewCode("MNT")
	MZN        = NewCode("MZN")
	NAD        = NewCode("NAD")
	NPR        = NewCode("NPR")
	ANG        = NewCode("ANG")
	NZD        = NewCode("NZD")
	NIO        = NewCode("NIO")
	NGN        = NewCode("NGN")
	NOK        = NewCode("NOK")
	OMR        = NewCode("OMR")
	PKR        = NewCode("PKR")
	PAB        = NewCode("PAB")
	PYG        = NewCode("PYG")
	PHP        = NewCode("PHP")
	QAR        = NewCode("QAR")
	RON        = NewCode("RON")
	SHP        = NewCode("SHP")
	SAR        = NewCode("SAR")
	RSD        = NewCode("RSD")
	SCR        = NewCode("SCR")
	SOS        = NewCode("SOS")
	ZAR        = NewCode("ZAR")
	LKR        = NewCode("LKR")
	SEK        = NewCode("SEK")
	CHF        = NewCode("CHF")
	SRD        = NewCode("SRD")
	SYP        = NewCode("SYP")
	TWD        = NewCode("TWD")
	THB        = NewCode("THB")
	TTD        = NewCode("TTD")
	TVD        = NewCode("TVD")
	GBP        = NewCode("GBP")
	UYU        = NewCode("UYU")
	UZS        = NewCode("UZS")
	VEF        = NewCode("VEF")
	VND        = NewCode("VND")
	YER        = NewCode("YER")
	ZWD        = NewCode("ZWD")
	XETH       = NewCode("XETH")
	FX_BTC     = NewCode("FX_BTC") // nolint // Cryptocurrency code
	AAVE       = NewCode("AAVE")
	YFI        = NewCode("YFI")
	BAL        = NewCode("BAL")
	UMA        = NewCode("UMA")
	SNX        = NewCode("SNX")
	CRV        = NewCode("CRV")
	OXT        = NewCode("OXT")
	BUSD       = NewCode("BUSD")
	SRM        = NewCode("SRM")
	FTT        = NewCode("FTT")
	UST        = NewCode("UST")
)

Const declarations for individual currencies/tokens/fiat An ever growing list. Cares not for equivalence, just is

View Source
var (
	// ErrAssetAlreadyEnabled defines an error for the pairs management system
	// that declares the asset is already enabled.
	ErrAssetAlreadyEnabled = errors.New("asset already enabled")
	// ErrPairAlreadyEnabled returns when enabling a pair that is already enabled
	ErrPairAlreadyEnabled = errors.New("pair already enabled")
	// ErrPairNotFound is returned when a currency pair is not found
	ErrPairNotFound = errors.New("pair not found")
)

Functions

func ConvertCurrency

func ConvertCurrency(amount float64, from, to Code) (float64, error)

ConvertCurrency converts an amount from one currency to another

func GetSymbolByCurrencyName

func GetSymbolByCurrencyName(currency Code) (string, error)

GetSymbolByCurrencyName returns a currency symbol

func RunStorageUpdater

func RunStorageUpdater(o BotOverrides, m *MainConfiguration, filepath string) error

RunStorageUpdater runs a new foreign exchange updater instance

func SeedForeignExchangeData

func SeedForeignExchangeData(c Currencies) error

SeedForeignExchangeData seeds FX data with the currencies supplied

func ShutdownStorageUpdater

func ShutdownStorageUpdater() error

ShutdownStorageUpdater cleanly shuts down and saves to currency.json

func UpdateBaseCurrency

func UpdateBaseCurrency(c Code) error

UpdateBaseCurrency updates storage base currency

func UpdateCurrencies

func UpdateCurrencies(c Currencies, isCryptocurrency bool)

UpdateCurrencies updates the local cryptocurrency or fiat currency store

Types

type BaseCodes

type BaseCodes struct {
	Items          []*Item
	LastMainUpdate time.Time
	// contains filtered or unexported fields
}

BaseCodes defines a basket of bare currency codes

func (*BaseCodes) GetCurrencies

func (b *BaseCodes) GetCurrencies() Currencies

GetCurrencies gets the full currency list from the base code type available from the currency system

func (*BaseCodes) GetFullCurrencyData

func (b *BaseCodes) GetFullCurrencyData() (File, error)

GetFullCurrencyData returns a type that is read to dump to file

func (*BaseCodes) HasData

func (b *BaseCodes) HasData() bool

HasData returns true if the type contains data

func (*BaseCodes) LoadItem

func (b *BaseCodes) LoadItem(item *Item) error

LoadItem sets item data

func (*BaseCodes) Register

func (b *BaseCodes) Register(c string) Code

Register registers a currency from a string and returns a currency code

func (*BaseCodes) RegisterFiat

func (b *BaseCodes) RegisterFiat(c string) Code

RegisterFiat registers a fiat currency from a string and returns a currency code

func (*BaseCodes) UpdateCurrency

func (b *BaseCodes) UpdateCurrency(fullName, symbol, blockchain string, id int, r Role) error

UpdateCurrency updates or registers a currency/contract

type BotOverrides

type BotOverrides struct {
	Coinmarketcap       bool
	FxCurrencyConverter bool
	FxCurrencyLayer     bool
	FxFixer             bool
	FxOpenExchangeRates bool
	FxExchangeRateHost  bool
}

BotOverrides defines a bot overriding factor for quick running currency subsystems

type Code

type Code struct {
	Item      *Item
	UpperCase bool
}

Code defines an ISO 4217 fiat currency or unofficial cryptocurrency code string

func GetBaseCurrency

func GetBaseCurrency() Code

GetBaseCurrency returns the storage base currency

func GetDefaultBaseCurrency

func GetDefaultBaseCurrency() Code

GetDefaultBaseCurrency returns storage default base currency

func GetTotalMarketCryptocurrencies

func GetTotalMarketCryptocurrencies() ([]Code, error)

GetTotalMarketCryptocurrencies returns the full market cryptocurrencies

func GetTranslation

func GetTranslation(currency Code) Code

GetTranslation returns similar strings for a particular currency if not found returns the code back

func NewCode

func NewCode(c string) Code

NewCode returns a new currency registered code

func (Code) IsCryptocurrency

func (c Code) IsCryptocurrency() bool

IsCryptocurrency checks if the currency passed is an enabled CRYPTO currency.

func (Code) IsDefaultCryptocurrency

func (c Code) IsDefaultCryptocurrency() bool

IsDefaultCryptocurrency checks if the currency passed in matches the default cryptocurrency

func (Code) IsDefaultFiatCurrency

func (c Code) IsDefaultFiatCurrency() bool

IsDefaultFiatCurrency checks if the currency passed in matches the default fiat currency

func (Code) IsEmpty

func (c Code) IsEmpty() bool

IsEmpty returns true if the code is empty

func (Code) IsFiatCurrency

func (c Code) IsFiatCurrency() bool

IsFiatCurrency checks if the currency passed is an enabled fiat currency

func (Code) Lower

func (c Code) Lower() Code

Lower converts the code to lowercase formatting

func (Code) MarshalJSON

func (c Code) MarshalJSON() ([]byte, error)

MarshalJSON conforms type to the marshaler interface

func (Code) Match

func (c Code) Match(check Code) bool

Match returns if the code supplied is the same as the corresponding code

func (Code) String

func (c Code) String() string

String converts the code to string

func (*Code) UnmarshalJSON

func (c *Code) UnmarshalJSON(d []byte) error

UnmarshalJSON comforms type to the umarshaler interface

func (Code) Upper

func (c Code) Upper() Code

Upper converts the code to uppercase formatting

type CoinmarketcapSettings

type CoinmarketcapSettings coinmarketcap.Settings

CoinmarketcapSettings refers to settings

type Conversion

type Conversion struct {
	From Code
	To   Code
	// contains filtered or unexported fields
}

Conversion defines a specific currency conversion for a rate

func NewConversion

func NewConversion(from, to Code) (Conversion, error)

NewConversion returns a conversion rate object that allows for obtaining efficient rate values when needed

func NewConversionFromString

func NewConversionFromString(p string) (Conversion, error)

NewConversionFromString splits a string from a foreign exchange provider

func NewConversionFromStrings

func NewConversionFromStrings(from, to string) (Conversion, error)

NewConversionFromStrings assigns or finds a new conversion unit

func (Conversion) Convert

func (c Conversion) Convert(fromAmount float64) (float64, error)

Convert for example converts $1 USD to the equivalent Japanese Yen or vice versa.

func (Conversion) ConvertInverse

func (c Conversion) ConvertInverse(fromAmount float64) (float64, error)

ConvertInverse converts backwards if needed

func (Conversion) GetInversionRate

func (c Conversion) GetInversionRate() (float64, error)

GetInversionRate returns the rate of the inversion of the conversion pair

func (Conversion) GetRate

func (c Conversion) GetRate() (float64, error)

GetRate returns system rate if available

func (Conversion) IsFiat

func (c Conversion) IsFiat() bool

IsFiat checks to see if the from and to currency is a fiat e.g. EURUSD

func (Conversion) IsInvalid

func (c Conversion) IsInvalid() bool

IsInvalid returns true if both from and to currencies are the same

func (Conversion) String

func (c Conversion) String() string

String returns the stringed fields

type ConversionRates

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

ConversionRates defines protected conversion rate map for concurrent updating and retrieval of foreign exchange rates for mainly fiat currencies

func (*ConversionRates) GetFullRates

func (c *ConversionRates) GetFullRates() Conversions

GetFullRates returns the full conversion list

func (*ConversionRates) GetRate

func (c *ConversionRates) GetRate(from, to Code) (float64, error)

GetRate returns a rate from the conversion rate list

func (*ConversionRates) HasData

func (c *ConversionRates) HasData() bool

HasData returns if conversion rates are present

func (*ConversionRates) Register

func (c *ConversionRates) Register(from, to Code) (Conversion, error)

Register registers a new conversion rate if not found adds it and allows for quick updates

func (*ConversionRates) Update

func (c *ConversionRates) Update(m map[string]float64) error

Update updates the full conversion rate values including inversion and cross rates

type Conversions

type Conversions []Conversion

Conversions define a list of conversion data

func GetDefaultExchangeRates

func GetDefaultExchangeRates() (Conversions, error)

GetDefaultExchangeRates returns the currency exchange rates based off the default fiat values

func GetExchangeRates

func GetExchangeRates() (Conversions, error)

GetExchangeRates returns the full fiat currency exchange rates base off configuration parameters supplied to the currency storage

type Currencies

type Currencies []Code

Currencies define a range of supported currency codes

func GetCryptocurrencies

func GetCryptocurrencies() Currencies

GetCryptocurrencies returns the storage enabled cryptocurrencies

func GetDefaultCryptocurrencies

func GetDefaultCryptocurrencies() Currencies

GetDefaultCryptocurrencies returns a list of default cryptocurrencies

func GetDefaultFiatCurrencies

func GetDefaultFiatCurrencies() Currencies

GetDefaultFiatCurrencies returns a list of default fiat currencies

func GetFiatCurrencies

func GetFiatCurrencies() Currencies

GetFiatCurrencies returns the storage enabled fiat currencies

func NewCurrenciesFromStringArray

func NewCurrenciesFromStringArray(currencies []string) Currencies

NewCurrenciesFromStringArray returns a Currencies object from strings

func (Currencies) Contains

func (c Currencies) Contains(cc Code) bool

Contains checks to see if a currency code is contained in the currency list

func (Currencies) HasData

func (c Currencies) HasData() bool

HasData checks to see if Currencies type has actual currencies

func (Currencies) Join

func (c Currencies) Join() string

Join returns a comma serparated string

func (Currencies) MarshalJSON

func (c Currencies) MarshalJSON() ([]byte, error)

MarshalJSON conforms type to the marshaler interface

func (Currencies) Match

func (c Currencies) Match(other Currencies) bool

Match returns if the full list equals the supplied list

func (Currencies) Strings

func (c Currencies) Strings() []string

Strings returns an array of currency strings

func (*Currencies) UnmarshalJSON

func (c *Currencies) UnmarshalJSON(d []byte) error

UnmarshalJSON comforms type to the umarshaler interface

type FXSettings

type FXSettings struct {
	Name             string        `json:"name"`
	Enabled          bool          `json:"enabled"`
	Verbose          bool          `json:"verbose"`
	RESTPollingDelay time.Duration `json:"restPollingDelay"`
	APIKey           string        `json:"apiKey"`
	APIKeyLvl        int           `json:"apiKeyLvl"`
	PrimaryProvider  bool          `json:"primaryProvider"`
}

FXSettings defines foreign exchange requester settings

type File

type File struct {
	LastMainUpdate interface{} `json:"lastMainUpdate"`
	Cryptocurrency []Item      `json:"cryptocurrencies"`
	FiatCurrency   []Item      `json:"fiatCurrencies"`
	UnsetCurrency  []Item      `json:"unsetCurrencies"`
	Contracts      []Item      `json:"contracts"`
	Token          []Item      `json:"tokens"`
}

File defines a full currency file generated by the currency storage analysis system

type Item

type Item struct {
	ID         int    `json:"id,omitempty"`
	FullName   string `json:"fullName,omitempty"`
	Symbol     string `json:"symbol"`
	Role       Role   `json:"-"`
	AssocChain string `json:"associatedBlockchain,omitempty"`
}

Item defines a sub type containing the main attributes of a designated currency code pointer

func (*Item) String

func (i *Item) String() string

String conforms to the stringer interface

type MainConfiguration

type MainConfiguration struct {
	ForexProviders         []FXSettings
	CryptocurrencyProvider coinmarketcap.Settings
	Cryptocurrencies       Currencies
	CurrencyPairFormat     interface{}
	FiatDisplayCurrency    Code
	CurrencyDelay          time.Duration
	FxRateDelay            time.Duration
}

MainConfiguration is the main configuration from the config.json file

type Pair

type Pair struct {
	Delimiter string `json:"delimiter,omitempty"`
	Base      Code   `json:"base,omitempty"`
	Quote     Code   `json:"quote,omitempty"`
	Suffix    string `json:"suffix,omitempty"`
}

Pair holds currency pair information

func CopyPairFormat

func CopyPairFormat(p Pair, pairs []Pair, exact bool) Pair

CopyPairFormat copies the pair format from a list of pairs once matched

func MatchPairsWithNoDelimiter

func MatchPairsWithNoDelimiter(currencyPair string, pairs Pairs, pairFmt PairFormat) (Pair, error)

MatchPairsWithNoDelimiter will move along a predictable index on the provided currencyPair it will then split on that index and verify whether that currencypair exists in the supplied pairs this allows for us to match strange currencies with no delimiter where it is difficult to infer where the delimiter is located eg BETHERETH is BETHER ETH

func NewPair

func NewPair(baseCurrency, quoteCurrency Code) Pair

NewPair returns a currency pair from currency codes

func NewPairDelimiter

func NewPairDelimiter(currencyPair, delimiter string) (Pair, error)

NewPairDelimiter splits the desired currency string at delimeter, the returns a Pair struct

func NewPairFromFormattedPairs

func NewPairFromFormattedPairs(currencyPair string, pairs Pairs, pairFmt PairFormat) (Pair, error)

NewPairFromFormattedPairs matches a supplied currency pair to a list of pairs with a specific format. This is helpful for exchanges which provide currency pairs with no delimiter so we can match it with a list and apply the same format

func NewPairFromIndex

func NewPairFromIndex(currencyPair, index string) (Pair, error)

NewPairFromIndex returns a CurrencyPair via a currency string and specific index

func NewPairFromString

func NewPairFromString(currencyPair string) (Pair, error)

NewPairFromString converts currency string into a new CurrencyPair with or without delimeter

func NewPairFromStrings

func NewPairFromStrings(base, quote string) (Pair, error)

NewPairFromStrings returns a CurrencyPair without a delimiter

func NewPairWithDelimiter

func NewPairWithDelimiter(base, quote, delimiter string) Pair

NewPairWithDelimiter returns a CurrencyPair with a delimiter

func (Pair) ContainsCurrency

func (p Pair) ContainsCurrency(c Code) bool

ContainsCurrency checks to see if a pair contains a specific currency

func (Pair) Equal

func (p Pair) Equal(cPair Pair) bool

Equal compares two currency pairs and returns whether or not they are equal

func (Pair) EqualIncludeReciprocal

func (p Pair) EqualIncludeReciprocal(cPair Pair) bool

EqualIncludeReciprocal compares two currency pairs and returns whether or not they are the same including reciprocal currencies.

func (Pair) Format

func (p Pair) Format(delimiter string, uppercase bool) Pair

Format changes the currency based on user preferences overriding the default String() display

func (Pair) IsCryptoFiatPair

func (p Pair) IsCryptoFiatPair() bool

IsCryptoFiatPair checks to see if the pair is a crypto fiat pair e.g. BTCUSD

func (Pair) IsCryptoPair

func (p Pair) IsCryptoPair() bool

IsCryptoPair checks to see if the pair is a crypto pair e.g. BTCLTC

func (Pair) IsEmpty

func (p Pair) IsEmpty() bool

IsEmpty returns whether or not the pair is empty or is missing a currency code

func (Pair) IsFiatPair

func (p Pair) IsFiatPair() bool

IsFiatPair checks to see if the pair is a fiat pair e.g. EURUSD

func (Pair) IsInvalid

func (p Pair) IsInvalid() bool

IsInvalid checks invalid pair if base and quote are the same

func (Pair) Lower

func (p Pair) Lower() Pair

Lower converts the pair object to lowercase

func (Pair) MarshalJSON

func (p Pair) MarshalJSON() ([]byte, error)

MarshalJSON conforms type to the marshaler interface

func (Pair) String

func (p Pair) String() string

String returns a currency pair string

func (Pair) Swap

func (p Pair) Swap() Pair

Swap turns the currency pair into its reciprocal

func (*Pair) UnmarshalJSON

func (p *Pair) UnmarshalJSON(d []byte) error

UnmarshalJSON comforms type to the umarshaler interface

func (Pair) Upper

func (p Pair) Upper() Pair

Upper converts the pair object to uppercase

type PairFormat

type PairFormat struct {
	Uppercase bool   `json:"uppercase"`
	Delimiter string `json:"delimiter,omitempty"`
	Separator string `json:"separator,omitempty"`
	Index     string `json:"index,omitempty"`
}

PairFormat returns the pair format

func (*PairFormat) Format

func (f *PairFormat) Format(pair Pair) string

Format formats the given pair as a string

type PairStore

type PairStore struct {
	AssetEnabled  *bool       `json:"assetEnabled"`
	Enabled       Pairs       `json:"enabled"`
	Available     Pairs       `json:"available"`
	RequestFormat *PairFormat `json:"requestFormat,omitempty"`
	ConfigFormat  *PairFormat `json:"configFormat,omitempty"`
}

PairStore stores a currency pair store

type Pairs

type Pairs []Pair

Pairs defines a list of pairs

func FormatPairs

func FormatPairs(pairs []string, delimiter, index string) (Pairs, error)

FormatPairs formats a string array to a list of currency pairs with the supplied currency pair format

func NewPairsFromStrings

func NewPairsFromStrings(pairs []string) (Pairs, error)

NewPairsFromStrings takes in currency pair strings and returns a currency pair list

func (Pairs) Add

func (p Pairs) Add(pair Pair) Pairs

Add adds a specified pair to the list of pairs if it doesn't exist

func (Pairs) Contains

func (p Pairs) Contains(check Pair, exact bool) bool

Contains checks to see if a specified pair exists inside a currency pair array

func (Pairs) FindDifferences

func (p Pairs) FindDifferences(pairs Pairs) (newPairs, removedPairs Pairs)

FindDifferences returns pairs which are new or have been removed

func (Pairs) Format

func (p Pairs) Format(delimiter, index string, uppercase bool) Pairs

Format formats the pair list to the exchange format configuration

func (Pairs) GetRandomPair

func (p Pairs) GetRandomPair() Pair

GetRandomPair returns a random pair from a list of pairs

func (Pairs) Join

func (p Pairs) Join() string

Join returns a comma separated list of currency pairs

func (Pairs) MarshalJSON

func (p Pairs) MarshalJSON() ([]byte, error)

MarshalJSON conforms type to the marshaler interface

func (Pairs) Remove

func (p Pairs) Remove(pair Pair) Pairs

Remove removes the specified pair from the list of pairs if it exists

func (Pairs) RemovePairsByFilter

func (p Pairs) RemovePairsByFilter(filter Code) Pairs

RemovePairsByFilter checks to see if a pair contains a specific currency and removes it from the list of pairs

func (Pairs) Strings

func (p Pairs) Strings() []string

Strings returns a slice of strings referring to each currency pair

func (*Pairs) UnmarshalJSON

func (p *Pairs) UnmarshalJSON(d []byte) error

UnmarshalJSON comforms type to the umarshaler interface

func (Pairs) Upper

func (p Pairs) Upper() Pairs

Upper returns an upper formatted pair list

type PairsManager

type PairsManager struct {
	BypassConfigFormatUpgrades bool                      `json:"bypassConfigFormatUpgrades"`
	RequestFormat              *PairFormat               `json:"requestFormat,omitempty"`
	ConfigFormat               *PairFormat               `json:"configFormat,omitempty"`
	UseGlobalFormat            bool                      `json:"useGlobalFormat,omitempty"`
	LastUpdated                int64                     `json:"lastUpdated,omitempty"`
	Pairs                      map[asset.Item]*PairStore `json:"pairs"`
	// contains filtered or unexported fields
}

PairsManager manages asset pairs

func (*PairsManager) Delete

func (p *PairsManager) Delete(a asset.Item)

Delete deletes a map entry based on the supplied asset type

func (*PairsManager) DisablePair

func (p *PairsManager) DisablePair(a asset.Item, pair Pair) error

DisablePair removes the pair from the enabled pairs list if found

func (*PairsManager) EnablePair

func (p *PairsManager) EnablePair(a asset.Item, pair Pair) error

EnablePair adds a pair to the list of enabled pairs if it exists in the list of available pairs and isn't already added

func (*PairsManager) Get

func (p *PairsManager) Get(a asset.Item) (*PairStore, error)

Get gets the currency pair config based on the asset type

func (*PairsManager) GetAssetTypes

func (p *PairsManager) GetAssetTypes(enabled bool) asset.Items

GetAssetTypes returns a list of stored asset types

func (*PairsManager) GetPairs

func (p *PairsManager) GetPairs(a asset.Item, enabled bool) (Pairs, error)

GetPairs gets a list of stored pairs based on the asset type and whether they're enabled or not

func (*PairsManager) IsAssetEnabled

func (p *PairsManager) IsAssetEnabled(a asset.Item) error

IsAssetEnabled checks to see if an asset is enabled

func (*PairsManager) SetAssetEnabled

func (p *PairsManager) SetAssetEnabled(a asset.Item, enabled bool) error

SetAssetEnabled sets if an asset is enabled or disabled for first run

func (*PairsManager) Store

func (p *PairsManager) Store(a asset.Item, ps PairStore)

Store stores a new currency pair config based on its asset type

func (*PairsManager) StorePairs

func (p *PairsManager) StorePairs(a asset.Item, pairs Pairs, enabled bool)

StorePairs stores a list of pairs based on the asset type and whether they're enabled or not

type Role

type Role uint8

Role defines a bitmask for the full currency roles either; fiat, cryptocurrency, token, or contract

func (Role) MarshalJSON

func (r Role) MarshalJSON() ([]byte, error)

MarshalJSON conforms Role to the marshaller interface

func (Role) String

func (r Role) String() string

func (*Role) UnmarshalJSON

func (r *Role) UnmarshalJSON(d []byte) error

UnmarshalJSON conforms Role to the unmarshaller interface

type Storage

type Storage struct {
	Verbose bool
	// contains filtered or unexported fields
}

Storage contains the loaded storage currencies supported on available crypto or fiat marketplaces NOTE: All internal currencies are upper case

func (*Storage) ConvertCurrency

func (s *Storage) ConvertCurrency(amount float64, from, to Code) (float64, error)

ConvertCurrency for example converts $1 USD to the equivalent Japanese Yen or vice versa.

func (*Storage) FetchCurrencyAnalysisData

func (s *Storage) FetchCurrencyAnalysisData() error

FetchCurrencyAnalysisData fetches a new fresh batch of currency data and loads it into memory

func (*Storage) ForeignExchangeUpdater

func (s *Storage) ForeignExchangeUpdater()

ForeignExchangeUpdater is a routine that seeds foreign exchange rate and keeps updated as fast as possible

func (*Storage) GetBaseCurrency

func (s *Storage) GetBaseCurrency() Code

GetBaseCurrency returns the current storage base currency

func (*Storage) GetCryptocurrencies

func (s *Storage) GetCryptocurrencies() Currencies

GetCryptocurrencies returns the cryptocurrency list

func (*Storage) GetDefaultBaseCurrency

func (s *Storage) GetDefaultBaseCurrency() Code

GetDefaultBaseCurrency returns the default base currency

func (*Storage) GetDefaultCryptocurrencies

func (s *Storage) GetDefaultCryptocurrencies() Currencies

GetDefaultCryptocurrencies returns a list of default cryptocurrencies

func (*Storage) GetDefaultFiatCurrencies

func (s *Storage) GetDefaultFiatCurrencies() Currencies

GetDefaultFiatCurrencies returns the default fiat currencies list

func (*Storage) GetDefaultForeignExchangeRates

func (s *Storage) GetDefaultForeignExchangeRates() (Conversions, error)

GetDefaultForeignExchangeRates returns foreign exchange rates based off default fiat currencies.

func (*Storage) GetExchangeRates

func (s *Storage) GetExchangeRates() (Conversions, error)

GetExchangeRates returns storage seeded exchange rates

func (*Storage) GetFiatCurrencies

func (s *Storage) GetFiatCurrencies() Currencies

GetFiatCurrencies returns the fiat currencies list

func (*Storage) GetStorageRate

func (s *Storage) GetStorageRate(from, to Code) (float64, error)

GetStorageRate returns the rate of the conversion value

func (*Storage) GetTotalMarketCryptocurrencies

func (s *Storage) GetTotalMarketCryptocurrencies() (Currencies, error)

GetTotalMarketCryptocurrencies returns the total seeded market cryptocurrencies

func (*Storage) IsCryptocurrency

func (s *Storage) IsCryptocurrency(c Code) bool

IsCryptocurrency returns if a cryptocurrency is part of the enabled cryptocurrency list

func (*Storage) IsDefaultCryptocurrency

func (s *Storage) IsDefaultCryptocurrency(c Code) bool

IsDefaultCryptocurrency returns if a cryptocurrency is a default cryptocurrency

func (*Storage) IsDefaultCurrency

func (s *Storage) IsDefaultCurrency(c Code) bool

IsDefaultCurrency returns if a currency is a default currency

func (*Storage) IsFiatCurrency

func (s *Storage) IsFiatCurrency(c Code) bool

IsFiatCurrency returns if a currency is part of the enabled fiat currency list

func (*Storage) IsVerbose

func (s *Storage) IsVerbose() bool

IsVerbose returns if the storage is in verbose mode

func (*Storage) LoadFileCurrencyData

func (s *Storage) LoadFileCurrencyData(f *File) error

LoadFileCurrencyData loads currencies into the currency codes

func (*Storage) NewConversion

func (s *Storage) NewConversion(from, to Code) (Conversion, error)

NewConversion returns a new conversion object that has a pointer to a related rate with its inversion.

func (*Storage) RunUpdater

func (s *Storage) RunUpdater(overrides BotOverrides, settings *MainConfiguration, filePath string) error

RunUpdater runs the foreign exchange updater service. This will set up a JSON dump file and keep foreign exchange rates updated as fast as possible without triggering rate limiters, it will also run a full cryptocurrency check through coin market cap and expose analytics for exchange services

func (*Storage) SeedCurrencyAnalysisData

func (s *Storage) SeedCurrencyAnalysisData() error

SeedCurrencyAnalysisData sets a new instance of a coinmarketcap data.

func (*Storage) SeedDefaultForeignExchangeRates

func (s *Storage) SeedDefaultForeignExchangeRates() error

SeedDefaultForeignExchangeRates seeds the default foreign exchange rates

func (*Storage) SeedForeignExchangeRate

func (s *Storage) SeedForeignExchangeRate(from, to Code) (map[string]float64, error)

SeedForeignExchangeRate returns a singular exchange rate

func (*Storage) SeedForeignExchangeRates

func (s *Storage) SeedForeignExchangeRates() error

SeedForeignExchangeRates seeds the foreign exchange rates from storage config currencies

func (*Storage) SeedForeignExchangeRatesByCurrencies

func (s *Storage) SeedForeignExchangeRatesByCurrencies(c Currencies) error

SeedForeignExchangeRatesByCurrencies seeds the foreign exchange rates by currencies supplied

func (*Storage) SetDefaultCryptocurrencies

func (s *Storage) SetDefaultCryptocurrencies(c ...Code) error

SetDefaultCryptocurrencies assigns the default cryptocurrency list and adds it to the running list

func (*Storage) SetDefaultFiatCurrencies

func (s *Storage) SetDefaultFiatCurrencies(c ...Code) error

SetDefaultFiatCurrencies assigns the default fiat currency list and adds it to the running list

func (*Storage) SetDefaults

func (s *Storage) SetDefaults()

SetDefaults sets storage defaults for basic package functionality

func (*Storage) SetupConversionRates

func (s *Storage) SetupConversionRates()

SetupConversionRates sets default conversion rate values

func (*Storage) SetupCryptoProvider

func (s *Storage) SetupCryptoProvider(settings coinmarketcap.Settings) error

SetupCryptoProvider sets congiguration parameters and starts a new instance of the currency analyser

func (*Storage) SetupForexProviders

func (s *Storage) SetupForexProviders(setting ...base.Settings) error

SetupForexProviders sets up a new instance of the forex providers

func (*Storage) Shutdown

func (s *Storage) Shutdown() error

Shutdown shuts down the currency storage system and saves to currency.json

func (*Storage) UpdateBaseCurrency

func (s *Storage) UpdateBaseCurrency(c Code) error

UpdateBaseCurrency changes base currency

func (*Storage) UpdateCurrencies

func (s *Storage) UpdateCurrencies() error

UpdateCurrencies updates currency role and information using coin market cap

func (*Storage) UpdateEnabledCryptoCurrencies

func (s *Storage) UpdateEnabledCryptoCurrencies(c Currencies)

UpdateEnabledCryptoCurrencies appends new cryptocurrencies to the enabled currency list

func (*Storage) UpdateEnabledFiatCurrencies

func (s *Storage) UpdateEnabledFiatCurrencies(c Currencies)

UpdateEnabledFiatCurrencies appends new fiat currencies to the enabled currency list

func (*Storage) ValidateCode

func (s *Storage) ValidateCode(newCode string) Code

ValidateCode validates string against currency list and returns a currency code

func (*Storage) ValidateCryptoCode

func (s *Storage) ValidateCryptoCode(newCode string) Code

ValidateCryptoCode validates a cryptocurrency string and returns a currency code TODO: Update and add in RegisterCrypto member func

func (*Storage) ValidateFiatCode

func (s *Storage) ValidateFiatCode(newCode string) Code

ValidateFiatCode validates a fiat currency string and returns a currency code

func (*Storage) WriteCurrencyDataToFile

func (s *Storage) WriteCurrencyDataToFile(path string, mainUpdate bool) error

WriteCurrencyDataToFile writes the full currency data to a designated file

type SystemsSettings

type SystemsSettings struct {
	Coinmarketcap     coinmarketcap.Settings
	Currencyconverter FXSettings
	Currencylayer     FXSettings
	Fixer             FXSettings
	Openexchangerates FXSettings
}

SystemsSettings defines incoming system settings

Directories

Path Synopsis
Package coinmarketcap connects to a suite of high-performance RESTful JSON endpoints that are specifically designed to meet the mission-critical demands of application developers, data scientists, and enterprise business platforms.
Package coinmarketcap connects to a suite of high-performance RESTful JSON endpoints that are specifically designed to meet the mission-critical demands of application developers, data scientists, and enterprise business platforms.
Package forexprovider utilises foreign exchange API services to manage relational FIAT currencies
Package forexprovider utilises foreign exchange API services to manage relational FIAT currencies
currencyconverterapi
Package currencyconverter package https://free.currencyconverterapi.com/
Package currencyconverter package https://free.currencyconverterapi.com/
currencylayer
Package currencylayer provides a simple REST API with real-time and historical exchange rates for 168 world currencies, delivering currency pairs in universally usable JSON format - compatible with any of your applications.
Package currencylayer provides a simple REST API with real-time and historical exchange rates for 168 world currencies, delivering currency pairs in universally usable JSON format - compatible with any of your applications.

Jump to

Keyboard shortcuts

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