Skip to content

Commit

Permalink
Backport "Clean up list of available currencies (#7667)" (#8454)
Browse files Browse the repository at this point in the history
This is backported to make it easier to backport #7986

Co-authored-by: Whymarrh Whitby <whymarrh.whitby@gmail.com>
  • Loading branch information
Gudahtt and whymarrh authored Apr 29, 2020
1 parent 08fd6cf commit 50b48b7
Show file tree
Hide file tree
Showing 4 changed files with 246 additions and 661 deletions.
6 changes: 3 additions & 3 deletions test/unit/balance-formatter-test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const assert = require('assert')
const currencyFormatter = require('currency-formatter')
const infuraConversion = require('../../ui/app/helpers/constants/infura-conversion.json')
const availableCurrencies = require('../../ui/app/helpers/constants/available-conversions.json')

describe('currencyFormatting', function () {
it('be able to format any infura currency', function (done) {
const number = 10000

infuraConversion.objects.forEach((conversion) => {
const code = conversion.quote.code.toUpperCase()
availableCurrencies.forEach((conversion) => {
const code = conversion.code.toUpperCase()
const result = currencyFormatter.format(number, { code })

switch (code) {
Expand Down
238 changes: 238 additions & 0 deletions ui/app/helpers/constants/available-conversions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
[
{
"code": "aud",
"name": "Australian Dollar"
},
{
"code": "hkd",
"name": "Hong Kong Dollar"
},
{
"code": "sgd",
"name": "Singapore Dollar"
},
{
"code": "idr",
"name": "Indonesian Rupiah"
},
{
"code": "php",
"name": "Philippine Peso"
},
{
"code": "1st",
"name": "FirstBlood"
},
{
"code": "adt",
"name": "adToken"
},
{
"code": "adx",
"name": "AdEx"
},
{
"code": "ant",
"name": "Aragon"
},
{
"code": "bat",
"name": "Basic Attention Token"
},
{
"code": "bnt",
"name": "Bancor"
},
{
"code": "btc",
"name": "Bitcoin"
},
{
"code": "cad",
"name": "Canadian Dollar"
},
{
"code": "cfi",
"name": "Cofound.it"
},
{
"code": "crb",
"name": "CreditBit"
},
{
"code": "cvc",
"name": "Civic"
},
{
"code": "dash",
"name": "Dash"
},
{
"code": "dgd",
"name": "DigixDAO"
},
{
"code": "etc",
"name": "Ethereum Classic"
},
{
"code": "eur",
"name": "Euro"
},
{
"code": "fun",
"name": "FunFair"
},
{
"code": "gbp",
"name": "Pound Sterling"
},
{
"code": "gno",
"name": "Gnosis"
},
{
"code": "gnt",
"name": "Golem"
},
{
"code": "gup",
"name": "Matchpool"
},
{
"code": "hmq",
"name": "Humaniq"
},
{
"code": "jpy",
"name": "Japanese Yen"
},
{
"code": "lgd",
"name": "Legends Room"
},
{
"code": "lsk",
"name": "Lisk"
},
{
"code": "ltc",
"name": "Litecoin"
},
{
"code": "lun",
"name": "Lunyr"
},
{
"code": "mco",
"name": "Monaco"
},
{
"code": "mtl",
"name": "Metal"
},
{
"code": "myst",
"name": "Mysterium"
},
{
"code": "nmr",
"name": "Numeraire"
},
{
"code": "omg",
"name": "OmiseGO"
},
{
"code": "pay",
"name": "TenX"
},
{
"code": "ptoy",
"name": "Patientory"
},
{
"code": "qrl",
"name": "Quantum-Resistant Ledger"
},
{
"code": "qtum",
"name": "Qtum"
},
{
"code": "rep",
"name": "Augur"
},
{
"code": "rlc",
"name": "iEx.ec"
},
{
"code": "rub",
"name": "Russian Ruble"
},
{
"code": "sc",
"name": "Siacoin"
},
{
"code": "sngls",
"name": "SingularDTV"
},
{
"code": "snt",
"name": "Status"
},
{
"code": "steem",
"name": "Steem"
},
{
"code": "storj",
"name": "Storj"
},
{
"code": "time",
"name": "ChronoBank"
},
{
"code": "tkn",
"name": "TokenCard"
},
{
"code": "trst",
"name": "WeTrust"
},
{
"code": "uah",
"name": "Ukrainian Hryvnia"
},
{
"code": "usd",
"name": "United States Dollar"
},
{
"code": "wings",
"name": "Wings"
},
{
"code": "xem",
"name": "NEM"
},
{
"code": "xlm",
"name": "Stellar Lumen"
},
{
"code": "xmr",
"name": "Monero"
},
{
"code": "xrp",
"name": "Ripple"
},
{
"code": "zec",
"name": "Zcash"
}
]
Loading

0 comments on commit 50b48b7

Please sign in to comment.