mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
* Attempts to update orderbook so it doesn't need to sort * Reverts the ws ob stuff. Gets rid of sorting because it happens later. Adds some exchange features * update existing feature lists. Expands list definition to match my emotions * Adds bithumb bitmex and bitstamp. adds a couple more types * Features for you, features for me, features for bittrex, btcmarkets, btse, coinbasepro, coinut, exmo, gateio and gemini * Features for hitbtc, huobi, itbit, kraken, lakebtc, lbank, localbitcoins, okcoin, okex, poloniex, yobit, zb * Who can forget good old alphapoint? * Adds btcmarksets websocket :glitch_crab: fixes alphapoint features * Adds extra data not in the documentation :/ * Replaces websocket features by using protocol features. However, it breaks it due to import cycles. I'm not sure what I'll do just yet * Removes import cycle via duplicate structs. * Increases coverage of config with `TestCheckCurrencyConfigValues`. Moves all currency pair package types into their own files or places it at the bottom of files if necessary * Increase coverage in code.go * One way of determining a test has failed, is when to it fails. Removed redundant explanation * Increases code coverage of conversion * Lint fixes * Fixes orderbook tests * Re-adds sorting because its important to still have the internal pre-processed orderbook to be representative of a real orderbook * Secret lints that did not show up via Windows linting * Adds protocol package to contain exchange features * Fixes protocol implementation * Fixes ws tests * Addresses the following: Removes st-st-stutters in config types, changes GetAvailableForexProviders -> GetSupportedForexProviders, removes errors from tests where error is nil, removes orderbook setup when not necessary, removes import newlines, removes false bools from declaration, changes should of to should have * imports and casing * Fixes two more nil error checks
128 lines
2.3 KiB
Go
128 lines
2.3 KiB
Go
package currency
|
|
|
|
import "errors"
|
|
|
|
// GetSymbolByCurrencyName returns a currency symbol
|
|
func GetSymbolByCurrencyName(currency Code) (string, error) {
|
|
result, ok := symbols[currency.Item]
|
|
if !ok {
|
|
return "", errors.New("currency symbol not found")
|
|
}
|
|
return result, nil
|
|
}
|
|
|
|
// symbols map holds the currency name and symbol mappings
|
|
var symbols = map[*Item]string{
|
|
ALL.Item: "Lek",
|
|
AFN.Item: "؋",
|
|
ARS.Item: "$",
|
|
AWG.Item: "ƒ",
|
|
AUD.Item: "$",
|
|
AZN.Item: "ман",
|
|
BSD.Item: "$",
|
|
BBD.Item: "$",
|
|
BYN.Item: "Br",
|
|
BZD.Item: "BZ$",
|
|
BMD.Item: "$",
|
|
BOB.Item: "$b",
|
|
BAM.Item: "KM",
|
|
BWP.Item: "P",
|
|
BGN.Item: "лв",
|
|
BRL.Item: "R$",
|
|
BND.Item: "$",
|
|
KHR.Item: "៛",
|
|
CAD.Item: "$",
|
|
KYD.Item: "$",
|
|
CLP.Item: "$",
|
|
CNY.Item: "¥",
|
|
COP.Item: "$",
|
|
CRC.Item: "₡",
|
|
HRK.Item: "kn",
|
|
CUP.Item: "₱",
|
|
CZK.Item: "Kč",
|
|
DKK.Item: "kr",
|
|
DOP.Item: "RD$",
|
|
XCD.Item: "$",
|
|
EGP.Item: "£",
|
|
SVC.Item: "$",
|
|
EUR.Item: "€",
|
|
FKP.Item: "£",
|
|
FJD.Item: "$",
|
|
GHS.Item: "¢",
|
|
GIP.Item: "£",
|
|
GTQ.Item: "Q",
|
|
GGP.Item: "£",
|
|
GYD.Item: "$",
|
|
HNL.Item: "L",
|
|
HKD.Item: "$",
|
|
HUF.Item: "Ft",
|
|
ISK.Item: "kr",
|
|
INR.Item: "₹",
|
|
IDR.Item: "Rp",
|
|
IRR.Item: "﷼",
|
|
IMP.Item: "£",
|
|
ILS.Item: "₪",
|
|
JMD.Item: "J$",
|
|
JPY.Item: "¥",
|
|
JEP.Item: "£",
|
|
KZT.Item: "лв",
|
|
KPW.Item: "₩",
|
|
KRW.Item: "₩",
|
|
KGS.Item: "лв",
|
|
LAK.Item: "₭",
|
|
LBP.Item: "£",
|
|
LRD.Item: "$",
|
|
MKD.Item: "ден",
|
|
MYR.Item: "RM",
|
|
MUR.Item: "₨",
|
|
MXN.Item: "$",
|
|
MNT.Item: "₮",
|
|
MZN.Item: "MT",
|
|
NAD.Item: "$",
|
|
NPR.Item: "₨",
|
|
ANG.Item: "ƒ",
|
|
NZD.Item: "$",
|
|
NIO.Item: "C$",
|
|
NGN.Item: "₦",
|
|
NOK.Item: "kr",
|
|
OMR.Item: "﷼",
|
|
PKR.Item: "₨",
|
|
PAB.Item: "B/.",
|
|
PYG.Item: "Gs",
|
|
PEN.Item: "S/.",
|
|
PHP.Item: "₱",
|
|
PLN.Item: "zł",
|
|
QAR.Item: "﷼",
|
|
RON.Item: "lei",
|
|
RUB.Item: "₽",
|
|
RUR.Item: "₽",
|
|
SHP.Item: "£",
|
|
SAR.Item: "﷼",
|
|
RSD.Item: "Дин.",
|
|
SCR.Item: "₨",
|
|
SGD.Item: "$",
|
|
SBD.Item: "$",
|
|
SOS.Item: "S",
|
|
ZAR.Item: "R",
|
|
LKR.Item: "₨",
|
|
SEK.Item: "kr",
|
|
CHF.Item: "CHF",
|
|
SRD.Item: "$",
|
|
SYP.Item: "£",
|
|
TWD.Item: "NT$",
|
|
THB.Item: "฿",
|
|
TTD.Item: "TT$",
|
|
TRY.Item: "₺",
|
|
TVD.Item: "$",
|
|
UAH.Item: "₴",
|
|
GBP.Item: "£",
|
|
USD.Item: "$",
|
|
USDT.Item: "$",
|
|
UYU.Item: "$U",
|
|
UZS.Item: "лв",
|
|
VEF.Item: "Bs",
|
|
VND.Item: "₫",
|
|
YER.Item: "﷼",
|
|
ZWD.Item: "Z$",
|
|
}
|