Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add currencies #263

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 257 additions & 0 deletions src/currencies.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
interface Options {
code: string
name: string
}

const currencies: Array<Options> = [
{
code: "aud",
name: "Australian Dollar"
},
{
code: "hkd",
name: "Hong Kong Dollar"
},
{
code: "sgd",
name: "Singapore Dollar"
},
{
code: "idr",
name: "Indonesian Rupiah"
},
{
code: "inr",
name: "Indian Rupee"
},
{
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"
},
{
code: "dai",
name: "DAI"
},
{
code: "sai",
name: "SAI"
}
]

export default currencies;
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'isomorphic-fetch';
import * as util from './util';
import currencies from './currencies';

export * from './assets/AccountTrackerController';
export * from './user/AddressBookController';
Expand All @@ -20,4 +21,7 @@ export * from './assets/TokenRatesController';
export * from './transaction/TransactionController';
export * from './message-manager/PersonalMessageManager';
export * from './message-manager/TypedMessageManager';
export { util };
export {
util,
currencies
};
16 changes: 16 additions & 0 deletions tests/currencies.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import currencies from '../src/currencies';

const toCheck = [
"eur",
"etc",
"usd",
"sai"
];

describe('Test for some currencies', () => {
it('should have the important ones', () => {
toCheck.forEach(value => {
expect(currencies.some(currency => currency.code === value))
})
});
})