mirror of
https://github.com/fawazahmed0/exchange-api.git
synced 2025-06-29 18:21:14 +00:00
move files from currency-api to exchange-api
This commit is contained in:
parent
7dade59ea1
commit
7557f75410
84
.github/workflows/cleanup-repo.yml
vendored
Normal file
84
.github/workflows/cleanup-repo.yml
vendored
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
# Refer https://github.com/fawazahmed0/currency-api/issues/64
|
||||||
|
|
||||||
|
name: Reduce-git-repo-size
|
||||||
|
|
||||||
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||||
|
# events but only for branch 1 and on start directory, command.txt file changes or by manually running the workflow from actions tab
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '37 7 29 */3 *' # every n months
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|
||||||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
jobs:
|
||||||
|
# This workflow contains a single job called "build"
|
||||||
|
build:
|
||||||
|
# The type of runner that the job will run on
|
||||||
|
runs-on: macos-13
|
||||||
|
|
||||||
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '21'
|
||||||
|
|
||||||
|
- name: Install filter-repo and jsdelivr caching script
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl -L -o ../filter-repo.py https://raw.githubusercontent.com/fawazahmed0/currency-api/1/other/filter-repo.py
|
||||||
|
curl -L -o ../cache-jsdelivr-api.js https://raw.githubusercontent.com/fawazahmed0/currency-api/1/other/cache-jsdelivr-api.js
|
||||||
|
curl -L -o ../getdate-args.js https://raw.githubusercontent.com/fawazahmed0/currency-api/1/other/getdate-args.js
|
||||||
|
|
||||||
|
- name: Cache jsdelivr latest folder in background
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
node ../cache-jsdelivr-api.js &
|
||||||
|
|
||||||
|
# clone
|
||||||
|
- name: clone
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git config --global user.email github-actions@github.com
|
||||||
|
git config --global user.name github-actions
|
||||||
|
git config --global gc.auto 0
|
||||||
|
REPO="https://${GITHUB_ACTOR}:${{ secrets.WORKFLOW_TOKEN_FULL }}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
|
git clone --no-checkout --sparse $REPO .
|
||||||
|
git sparse-checkout reapply --no-cone
|
||||||
|
git sparse-checkout add 'latest/*'
|
||||||
|
git checkout
|
||||||
|
|
||||||
|
# Clean up files & Expire old data
|
||||||
|
- name: Clean up latest folder
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
python3 ../filter-repo.py --force --invert-paths --path latest
|
||||||
|
git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin
|
||||||
|
git reflog expire --expire=now --all
|
||||||
|
|
||||||
|
- name: Commit latest folder
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git commit -m "cleanup" latest
|
||||||
|
|
||||||
|
|
||||||
|
# Clean up dates & Expire old data
|
||||||
|
- name: Clean up dates
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
python3 ../filter-repo.py --force --invert-paths --path node_modules `node ../getdate-args.js`
|
||||||
|
#python3 ../filter-repo.py --force --invert-paths --path `git ls-tree 1 --name-only | sort | grep -E '[0-9]+\-[0-9]+\-[0-9]+' | head -n 1`
|
||||||
|
git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin
|
||||||
|
git reflog expire --expire=now --all
|
||||||
|
|
||||||
|
# Force pushing changes in chunks, 50 at a time, starting from 50000
|
||||||
|
- name: Force push in chunks
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
for i in $(seq 50000 -50 0)
|
||||||
|
do
|
||||||
|
git push origin 1~$i:1 --force || true
|
||||||
|
done
|
||||||
|
git push origin 1:1 --force || true
|
66
.github/workflows/run.yml
vendored
Normal file
66
.github/workflows/run.yml
vendored
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
name: Fetch-Currencies
|
||||||
|
|
||||||
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||||
|
# events but only for branch 1 and on start directory, command.txt file changes or by manually running the workflow from actions tab
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *' # every day at midnight
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env: # Or as an environment variable
|
||||||
|
currlink: ${{ secrets.CURRLINK }}
|
||||||
|
currlink2: ${{ secrets.CURRLINK2 }}
|
||||||
|
currlink3: ${{ secrets.CURRLINK3 }}
|
||||||
|
currlink3key: ${{ secrets.CURRLINK3KEY }}
|
||||||
|
cryptolink: ${{ secrets.CRYPTOLINK }}
|
||||||
|
|
||||||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
jobs:
|
||||||
|
# This workflow contains a single job called "build"
|
||||||
|
build:
|
||||||
|
# The type of runner that the job will run on
|
||||||
|
runs-on: macos-13
|
||||||
|
|
||||||
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
|
steps:
|
||||||
|
|
||||||
|
# Partial clone
|
||||||
|
- name: Partial clone
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
REPO="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
|
git clone --filter=blob:none --no-checkout --depth 1 --sparse $REPO .
|
||||||
|
git sparse-checkout reapply --no-cone
|
||||||
|
git sparse-checkout add 'latest/*'
|
||||||
|
git checkout
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '20.5.1'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
npm i
|
||||||
|
npx playwright install --with-deps
|
||||||
|
|
||||||
|
|
||||||
|
- name: Running the command
|
||||||
|
run: node currscript.js
|
||||||
|
|
||||||
|
- name: Rerun the command if previous failed
|
||||||
|
if: failure()
|
||||||
|
id: rerun
|
||||||
|
run: node currscript.js
|
||||||
|
|
||||||
|
# commiting and pushing changes
|
||||||
|
- name: commit and push
|
||||||
|
if: ${{ success() || steps.rerun.conclusion == 'failure' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git config --global user.email github-actions@github.com
|
||||||
|
git config --global user.name github-actions
|
||||||
|
git pull
|
||||||
|
git add --sparse -A
|
||||||
|
git commit -m 'Update Currencies'
|
||||||
|
git push
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.dccache
|
||||||
|
links.ini
|
||||||
|
node_modules/
|
1
allcurrencies.min.json
Normal file
1
allcurrencies.min.json
Normal file
File diff suppressed because one or more lines are too long
1962
country.json
Normal file
1962
country.json
Normal file
File diff suppressed because it is too large
Load Diff
222
currscript.js
Normal file
222
currscript.js
Normal file
@ -0,0 +1,222 @@
|
|||||||
|
const fs = require('fs-extra')
|
||||||
|
const path = require('path')
|
||||||
|
const { firefox, devices } = require('playwright')
|
||||||
|
|
||||||
|
|
||||||
|
// spaces to be used for prettify/json.stringify
|
||||||
|
const indent = 4
|
||||||
|
|
||||||
|
// By market capitalization
|
||||||
|
// Ref: https://coinmarketcap.com/all/views/all/
|
||||||
|
let topCryptoCurrency = ["BTC","ETH","ADA","BNB","USDT","XRP","SOL","DOT","DOGE","USDC","UNI","LUNA","LINK","AVAX","LTC","BUSD","AAVE","FRAX","HBAR",
|
||||||
|
"BCH","ALGO","WBTC","ICP","MATIC","FIL","TRX","FTT","XLM","VET","ATOM","ETC","THETA","DAI","XMR","MANA","ZEC","TUSD","EOS","AXS",
|
||||||
|
"ONE","EGLD","CHZ","GRT","1INCH","INJ","ENJ","KSM","CRO","SHIB","LEO","NEAR","BTCB","FLOW","XTZ","KCS", "SAND","KLAY","MKR",
|
||||||
|
"HT","DFI","TTT","WAVES","HNT","BSV","USDP","MIOTA","FTM","XEC","RUNE","QNT","NEO","CAKE","STX","LRC","OKB","NEXO","ZIL","DASH",
|
||||||
|
"PAXG","CELO","BAT","CVX","CRV","KAVA","GALA","DCR","GNO","AMP","XDC","WEMIX","XEM","MINA","HOT","AR","GT","FEI","COMP","QTUM",
|
||||||
|
"KNC","BTG","KDA","mBTC","uBTC","mETH","XCH","BSW","BAKE","KAS", "TON", "RVN","LDO","MNT","APT","ARB","OP","USDD","IMX","APE","SNX",
|
||||||
|
"RNDR","RPL","XAUt","FXS","PEPE","CFX","CSPR","BTT","SUI","LUNC","GUSD","TWT","GMX","AKT","NFT","FLR","DYDX","WOO","MBX","AGIX",
|
||||||
|
"ORDI","1000SATS"]
|
||||||
|
|
||||||
|
let currencyCodesToRemove = ["CLF"]
|
||||||
|
|
||||||
|
let currLink, currLink2, currLink3, currLink3Key, cryptoLink
|
||||||
|
if (process.env.CI) {
|
||||||
|
currLink = process.env.currlink
|
||||||
|
currLink2 = process.env.currlink2
|
||||||
|
currLink3 = process.env.currlink3
|
||||||
|
currLink3Key = process.env.currlink3key
|
||||||
|
cryptoLink = process.env.cryptolink
|
||||||
|
} else {
|
||||||
|
[currLink, currLink2, currLink3, currLink3Key, cryptoLink] = fs.readFileSync(path.join(__dirname, 'links.ini')).toString().split(/\r?\n/).map(e => e.trim())
|
||||||
|
}
|
||||||
|
// curr means currency
|
||||||
|
// stores consolidated currencies in currcode:currname format i.e USD:US Dollar
|
||||||
|
let allcurr = fs.readFileSync(path.join(__dirname, 'allcurrencies.min.json')).toString()
|
||||||
|
allcurr = JSON.parse(allcurr)
|
||||||
|
|
||||||
|
// Takes allcurr and have all the keys in uppercase
|
||||||
|
const allcurrKeyUpper = {}
|
||||||
|
for (const [key, value] of Object.entries(allcurr)) { allcurrKeyUpper[key.toUpperCase()] = value }
|
||||||
|
|
||||||
|
// Takes allcurr and store in lowercase currname:currcode format i.e. us dollar:usd
|
||||||
|
const allcurrLower = {}
|
||||||
|
for (const [key, value] of Object.entries(allcurr)) { allcurrLower[value.toLowerCase()] = key.toLowerCase() }
|
||||||
|
|
||||||
|
const dateToday = new Date().toISOString().substring(0, 10)
|
||||||
|
|
||||||
|
|
||||||
|
begin()
|
||||||
|
// Begins the program
|
||||||
|
async function begin() {
|
||||||
|
// launch the browser
|
||||||
|
// await launchBrowser()
|
||||||
|
|
||||||
|
const latestDir = path.join(__dirname, 'latest')
|
||||||
|
|
||||||
|
const currJSON = await getCurrencies()
|
||||||
|
// Get & Save All the available currencies in api
|
||||||
|
const availCurrListObj = await getAvailCurrencyJSON(currJSON)
|
||||||
|
fs.writeFileSync(path.join(latestDir, 'currencies.min.json'), JSON.stringify(availCurrListObj))
|
||||||
|
fs.writeFileSync(path.join(latestDir, 'currencies.json'), JSON.stringify(availCurrListObj, null, indent))
|
||||||
|
|
||||||
|
// Generate API files
|
||||||
|
await generateFiles(currJSON)
|
||||||
|
|
||||||
|
// Backup the latest currency files to today's date folder, for historical currency access
|
||||||
|
const dateDir = path.join(__dirname, dateToday)
|
||||||
|
fs.mkdirSync(dateDir, {
|
||||||
|
recursive: true
|
||||||
|
})
|
||||||
|
fs.copySync(latestDir, dateDir)
|
||||||
|
|
||||||
|
// Close the browser
|
||||||
|
// await browser.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Returns all the available currencies in the API
|
||||||
|
async function getAvailCurrencyJSON(CurrObj) {
|
||||||
|
const availCurrListObj = {}
|
||||||
|
for (const key of Object.keys(CurrObj)) {
|
||||||
|
availCurrListObj[key] = allcurrKeyUpper[key.toUpperCase()] || ""
|
||||||
|
if(!allcurrKeyUpper[key.toUpperCase()])
|
||||||
|
console.log(key,"currency code doesn't exist in allcurrencies.min.json")
|
||||||
|
}
|
||||||
|
|
||||||
|
return availCurrListObj
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getCurrencies() {
|
||||||
|
let currDataObj = await getCurrData(currLink)
|
||||||
|
currDataObj = toLowerCaseKeysBaseCurr(currDataObj)
|
||||||
|
|
||||||
|
let currDataObj2 = await getCurrData(currLink2)
|
||||||
|
// we need to convert base usd to eur
|
||||||
|
currDataObj2 = toLowerCaseKeysBaseCurr(currDataObj2, currDataObj['usd'])
|
||||||
|
|
||||||
|
let currDataObj3 = toLowerCaseKeysBaseCurr( (await getCurrData3()) )
|
||||||
|
// we need to convert base usd to eur
|
||||||
|
currDataObj3 = 'eur' in currDataObj3 ? toLowerCaseKeysBaseCurr(currDataObj3, 1/currDataObj3['eur']) : {}
|
||||||
|
|
||||||
|
let cryptoDataObj = await getCryptoData()
|
||||||
|
// we also need to convert base usd to eur
|
||||||
|
cryptoDataObj = toLowerCaseKeysBaseCurr(cryptoDataObj,currDataObj['usd'])
|
||||||
|
let CurrJSON = {...currDataObj2, ...currDataObj, ...cryptoDataObj, ...currDataObj3, eur: 1 }
|
||||||
|
currencyCodesToRemove.forEach(e=>delete CurrJSON?.[e.toLowerCase()])
|
||||||
|
// return sorted object
|
||||||
|
return sortObjByKeys(CurrJSON)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Euro as base rates
|
||||||
|
async function getCurrData(link){
|
||||||
|
let response = await fetch(link)
|
||||||
|
let data = await response.json()
|
||||||
|
return data.rates
|
||||||
|
}
|
||||||
|
|
||||||
|
// USD as base rates
|
||||||
|
async function getCryptoData(){
|
||||||
|
let response = await fetch(cryptoLink)
|
||||||
|
let data = await response.json()
|
||||||
|
let cleanJSON = {}
|
||||||
|
for(let value of data.data.reverse())
|
||||||
|
cleanJSON[value.symbol] = value.quote.USD.price
|
||||||
|
|
||||||
|
return Object.fromEntries( // Dividing value by 1 to convert to 1 USD as base rate
|
||||||
|
Object.entries(cleanJSON).filter(([k, v]) => topCryptoCurrency.includes(k)).map(([k,v])=>[k,1/v]) )
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getCurrData3(){
|
||||||
|
|
||||||
|
const browser = await firefox.launch({headless: true});
|
||||||
|
let arrRes = []
|
||||||
|
try{
|
||||||
|
|
||||||
|
const context = await browser.newContext({ ...devices['Desktop Firefox'] });
|
||||||
|
const page = await context.newPage();
|
||||||
|
|
||||||
|
const reg = new RegExp(currLink3Key, "gi")
|
||||||
|
page.on('response', async res => reg.test(res.url()) ? arrRes.push(await res.json().catch(console.error)) : '' );
|
||||||
|
for(let i=0;i<3;i++){
|
||||||
|
try{
|
||||||
|
await page.goto(currLink3)
|
||||||
|
break;
|
||||||
|
}catch(e){}
|
||||||
|
}
|
||||||
|
|
||||||
|
arrRes = arrRes.filter(e=>e?.rates?.USD == 1)
|
||||||
|
return arrRes.length > 0 ? arrRes[0].rates : {}
|
||||||
|
|
||||||
|
}catch(e){
|
||||||
|
console.error(e)
|
||||||
|
return {}
|
||||||
|
}finally{
|
||||||
|
await browser.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert object keys to lowercase and values to float
|
||||||
|
// tocurr parameter
|
||||||
|
// convert object having a base currency value to object of another base currency value
|
||||||
|
// For example: pass object with base currency as usd, pass tocurr as 1Eur to 1.17USD i.e 1.17 to convert object to base currency as EUR
|
||||||
|
function toLowerCaseKeysBaseCurr(obj, tocurr=1){
|
||||||
|
let newobj = {}
|
||||||
|
for(let [key,value] of Object.entries(obj)){
|
||||||
|
let tempValue = parseFloat(value)*parseFloat(tocurr)
|
||||||
|
if(Number.isFinite(tempValue))
|
||||||
|
newobj[key.toLowerCase()] = tempValue
|
||||||
|
}
|
||||||
|
return newobj
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Sorts an object by keys and returns the sorted object
|
||||||
|
function sortObjByKeys(obj) {
|
||||||
|
const sortedObj = {}
|
||||||
|
const sortedKeys = Object.keys(obj).sort()
|
||||||
|
for (const key of sortedKeys) { sortedObj[key] = obj[key] }
|
||||||
|
return sortedObj
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generates the api files
|
||||||
|
async function generateFiles(googBingCurrJSON) {
|
||||||
|
const currenciesDir = path.join(__dirname, 'latest', 'currencies')
|
||||||
|
for (const [fromKey, fromValue] of Object.entries(googBingCurrJSON)) {
|
||||||
|
const tempObj = {}
|
||||||
|
tempObj['date'] = dateToday;
|
||||||
|
tempObj[fromKey] = {}
|
||||||
|
const fromKeyDir = path.join(__dirname, 'latest', 'currencies', fromKey)
|
||||||
|
fs.mkdirSync(fromKeyDir, {
|
||||||
|
recursive: true
|
||||||
|
})
|
||||||
|
|
||||||
|
for (const [toKey, toValue] of Object.entries(googBingCurrJSON)) {
|
||||||
|
const tempSingleObj = {}
|
||||||
|
tempObj[fromKey][toKey] = currencyValue(fromValue, toValue)
|
||||||
|
tempSingleObj['date'] = dateToday;
|
||||||
|
tempSingleObj[toKey] = tempObj[fromKey][toKey]
|
||||||
|
fs.writeFileSync(path.join(fromKeyDir, toKey + '.min.json'), JSON.stringify(tempSingleObj))
|
||||||
|
fs.writeFileSync(path.join(fromKeyDir, toKey + '.json'), JSON.stringify(tempSingleObj, null, indent))
|
||||||
|
}
|
||||||
|
fs.writeFileSync(path.join(currenciesDir, fromKey + '.min.json'), JSON.stringify(tempObj))
|
||||||
|
fs.writeFileSync(path.join(currenciesDir, fromKey + '.json'), JSON.stringify(tempObj, null, indent))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// return 1 fromCurr as base currency for toCurr
|
||||||
|
// fromCurr & toCurr is against 1 USD or 1 EUR or something common
|
||||||
|
// For example, if you pass 74 INR & 0.84 EUR and 1 INR = 0.011 Eur
|
||||||
|
// It returns 0.011 , with numbers upto 20 decimal places
|
||||||
|
function currencyValue(fromCurr, toCurr) {
|
||||||
|
return getSignificantNum(toCurr / fromCurr)
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the value is very small, then return more significant digits
|
||||||
|
function getSignificantNum(num){
|
||||||
|
let minSignificantDigits = 8
|
||||||
|
if(num >= 0.1)
|
||||||
|
return parseFloat(num.toFixed(minSignificantDigits))
|
||||||
|
let strNum = num.toFixed(100)
|
||||||
|
let numOfZeros = strNum.match(/^0\.0+/i)[0].length-2
|
||||||
|
return parseFloat(num.toFixed(minSignificantDigits+numOfZeros))
|
||||||
|
}
|
1073
other/Common-Currency.json
Normal file
1073
other/Common-Currency.json
Normal file
File diff suppressed because it is too large
Load Diff
49
other/cache-jsdelivr-api.js
Normal file
49
other/cache-jsdelivr-api.js
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
// Fetch all latest & todays links to cache the data by jsdelivr
|
||||||
|
let url = "https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/"
|
||||||
|
let apiLinks = [url]
|
||||||
|
let extensions = [".min.json", ".json"]
|
||||||
|
|
||||||
|
|
||||||
|
async function begin() {
|
||||||
|
|
||||||
|
for (let dateValue of ['latest', new Date().toISOString().substring(0, 10)]) {
|
||||||
|
|
||||||
|
|
||||||
|
let data = await fetch(`${url}/${dateValue}/currencies.json`).then(res => res.json())
|
||||||
|
let currencies = Object.keys(data)
|
||||||
|
|
||||||
|
|
||||||
|
await multipleFetch(getURLs(`${url}/${dateValue}/currencies`))
|
||||||
|
|
||||||
|
for (let curr of currencies) {
|
||||||
|
let promiseHolder = []
|
||||||
|
|
||||||
|
promiseHolder.push(multipleFetch(getURLs(`${url}/${dateValue}/currencies/${curr}`)))
|
||||||
|
|
||||||
|
for (let curr2 of currencies)
|
||||||
|
promiseHolder.push(multipleFetch(getURLs(`${url}/${dateValue}/currencies/${curr}/${curr2}`)))
|
||||||
|
|
||||||
|
await Promise.allSettled(promiseHolder)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async function multipleFetch(links) {
|
||||||
|
for (let link of links)
|
||||||
|
await fetch(link, { method: 'HEAD' })
|
||||||
|
}
|
||||||
|
|
||||||
|
function getURLs(endpoint, links) {
|
||||||
|
links = links || apiLinks
|
||||||
|
return extensions.map(ext => links.map(e => e + endpoint + ext)).flat()
|
||||||
|
}
|
||||||
|
|
||||||
|
begin()
|
3760
other/cryptocurrencies.json
Normal file
3760
other/cryptocurrencies.json
Normal file
File diff suppressed because it is too large
Load Diff
172
other/currencies.json
Normal file
172
other/currencies.json
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
{
|
||||||
|
"AED": "United Arab Emirates Dirham",
|
||||||
|
"AFN": "Afghan Afghani",
|
||||||
|
"ALL": "Albanian Lek",
|
||||||
|
"AMD": "Armenian Dram",
|
||||||
|
"ANG": "Netherlands Antillean Guilder",
|
||||||
|
"AOA": "Angolan Kwanza",
|
||||||
|
"ARS": "Argentine Peso",
|
||||||
|
"AUD": "Australian Dollar",
|
||||||
|
"AWG": "Aruban Florin",
|
||||||
|
"AZN": "Azerbaijani Manat",
|
||||||
|
"BAM": "Bosnia-Herzegovina Convertible Mark",
|
||||||
|
"BBD": "Barbadian Dollar",
|
||||||
|
"BDT": "Bangladeshi Taka",
|
||||||
|
"BGN": "Bulgarian Lev",
|
||||||
|
"BHD": "Bahraini Dinar",
|
||||||
|
"BIF": "Burundian Franc",
|
||||||
|
"BMD": "Bermudan Dollar",
|
||||||
|
"BND": "Brunei Dollar",
|
||||||
|
"BOB": "Bolivian Boliviano",
|
||||||
|
"BRL": "Brazilian Real",
|
||||||
|
"BSD": "Bahamian Dollar",
|
||||||
|
"BTC": "Bitcoin",
|
||||||
|
"BTN": "Bhutanese Ngultrum",
|
||||||
|
"BWP": "Botswanan Pula",
|
||||||
|
"BYN": "Belarusian Ruble",
|
||||||
|
"BZD": "Belize Dollar",
|
||||||
|
"CAD": "Canadian Dollar",
|
||||||
|
"CDF": "Congolese Franc",
|
||||||
|
"CHF": "Swiss Franc",
|
||||||
|
"CLF": "Chilean Unit of Account (UF)",
|
||||||
|
"CLP": "Chilean Peso",
|
||||||
|
"CNH": "Chinese Yuan (Offshore)",
|
||||||
|
"CNY": "Chinese Yuan",
|
||||||
|
"COP": "Colombian Peso",
|
||||||
|
"CRC": "Costa Rican Colón",
|
||||||
|
"CUC": "Cuban Convertible Peso",
|
||||||
|
"CUP": "Cuban Peso",
|
||||||
|
"CVE": "Cape Verdean Escudo",
|
||||||
|
"CZK": "Czech Republic Koruna",
|
||||||
|
"DJF": "Djiboutian Franc",
|
||||||
|
"DKK": "Danish Krone",
|
||||||
|
"DOP": "Dominican Peso",
|
||||||
|
"DZD": "Algerian Dinar",
|
||||||
|
"EGP": "Egyptian Pound",
|
||||||
|
"ERN": "Eritrean Nakfa",
|
||||||
|
"ETB": "Ethiopian Birr",
|
||||||
|
"EUR": "Euro",
|
||||||
|
"FJD": "Fijian Dollar",
|
||||||
|
"FKP": "Falkland Islands Pound",
|
||||||
|
"GBP": "British Pound Sterling",
|
||||||
|
"GEL": "Georgian Lari",
|
||||||
|
"GGP": "Guernsey Pound",
|
||||||
|
"GHS": "Ghanaian Cedi",
|
||||||
|
"GIP": "Gibraltar Pound",
|
||||||
|
"GMD": "Gambian Dalasi",
|
||||||
|
"GNF": "Guinean Franc",
|
||||||
|
"GTQ": "Guatemalan Quetzal",
|
||||||
|
"GYD": "Guyanaese Dollar",
|
||||||
|
"HKD": "Hong Kong Dollar",
|
||||||
|
"HNL": "Honduran Lempira",
|
||||||
|
"HRK": "Croatian Kuna",
|
||||||
|
"HTG": "Haitian Gourde",
|
||||||
|
"HUF": "Hungarian Forint",
|
||||||
|
"IDR": "Indonesian Rupiah",
|
||||||
|
"ILS": "Israeli New Sheqel",
|
||||||
|
"IMP": "Manx pound",
|
||||||
|
"INR": "Indian Rupee",
|
||||||
|
"IQD": "Iraqi Dinar",
|
||||||
|
"IRR": "Iranian Rial",
|
||||||
|
"ISK": "Icelandic Króna",
|
||||||
|
"JEP": "Jersey Pound",
|
||||||
|
"JMD": "Jamaican Dollar",
|
||||||
|
"JOD": "Jordanian Dinar",
|
||||||
|
"JPY": "Japanese Yen",
|
||||||
|
"KES": "Kenyan Shilling",
|
||||||
|
"KGS": "Kyrgystani Som",
|
||||||
|
"KHR": "Cambodian Riel",
|
||||||
|
"KMF": "Comorian Franc",
|
||||||
|
"KPW": "North Korean Won",
|
||||||
|
"KRW": "South Korean Won",
|
||||||
|
"KWD": "Kuwaiti Dinar",
|
||||||
|
"KYD": "Cayman Islands Dollar",
|
||||||
|
"KZT": "Kazakhstani Tenge",
|
||||||
|
"LAK": "Laotian Kip",
|
||||||
|
"LBP": "Lebanese Pound",
|
||||||
|
"LKR": "Sri Lankan Rupee",
|
||||||
|
"LRD": "Liberian Dollar",
|
||||||
|
"LSL": "Lesotho Loti",
|
||||||
|
"LYD": "Libyan Dinar",
|
||||||
|
"MAD": "Moroccan Dirham",
|
||||||
|
"MDL": "Moldovan Leu",
|
||||||
|
"MGA": "Malagasy Ariary",
|
||||||
|
"MKD": "Macedonian Denar",
|
||||||
|
"MMK": "Myanma Kyat",
|
||||||
|
"MNT": "Mongolian Tugrik",
|
||||||
|
"MOP": "Macanese Pataca",
|
||||||
|
"MRO": "Mauritanian Ouguiya (pre-2018)",
|
||||||
|
"MRU": "Mauritanian Ouguiya",
|
||||||
|
"MUR": "Mauritian Rupee",
|
||||||
|
"MVR": "Maldivian Rufiyaa",
|
||||||
|
"MWK": "Malawian Kwacha",
|
||||||
|
"MXN": "Mexican Peso",
|
||||||
|
"MYR": "Malaysian Ringgit",
|
||||||
|
"MZN": "Mozambican Metical",
|
||||||
|
"NAD": "Namibian Dollar",
|
||||||
|
"NGN": "Nigerian Naira",
|
||||||
|
"NIO": "Nicaraguan Córdoba",
|
||||||
|
"NOK": "Norwegian Krone",
|
||||||
|
"NPR": "Nepalese Rupee",
|
||||||
|
"NZD": "New Zealand Dollar",
|
||||||
|
"OMR": "Omani Rial",
|
||||||
|
"PAB": "Panamanian Balboa",
|
||||||
|
"PEN": "Peruvian Nuevo Sol",
|
||||||
|
"PGK": "Papua New Guinean Kina",
|
||||||
|
"PHP": "Philippine Peso",
|
||||||
|
"PKR": "Pakistani Rupee",
|
||||||
|
"PLN": "Polish Zloty",
|
||||||
|
"PYG": "Paraguayan Guarani",
|
||||||
|
"QAR": "Qatari Rial",
|
||||||
|
"RON": "Romanian Leu",
|
||||||
|
"RSD": "Serbian Dinar",
|
||||||
|
"RUB": "Russian Ruble",
|
||||||
|
"RWF": "Rwandan Franc",
|
||||||
|
"SAR": "Saudi Riyal",
|
||||||
|
"SBD": "Solomon Islands Dollar",
|
||||||
|
"SCR": "Seychellois Rupee",
|
||||||
|
"SDG": "Sudanese Pound",
|
||||||
|
"SEK": "Swedish Krona",
|
||||||
|
"SGD": "Singapore Dollar",
|
||||||
|
"SHP": "Saint Helena Pound",
|
||||||
|
"SLL": "Sierra Leonean Leone",
|
||||||
|
"SOS": "Somali Shilling",
|
||||||
|
"SRD": "Surinamese Dollar",
|
||||||
|
"SSP": "South Sudanese Pound",
|
||||||
|
"STD": "São Tomé and Príncipe Dobra (pre-2018)",
|
||||||
|
"STN": "São Tomé and Príncipe Dobra",
|
||||||
|
"SVC": "Salvadoran Colón",
|
||||||
|
"SYP": "Syrian Pound",
|
||||||
|
"SZL": "Swazi Lilangeni",
|
||||||
|
"THB": "Thai Baht",
|
||||||
|
"TJS": "Tajikistani Somoni",
|
||||||
|
"TMT": "Turkmenistani Manat",
|
||||||
|
"TND": "Tunisian Dinar",
|
||||||
|
"TOP": "Tongan Pa'anga",
|
||||||
|
"TRY": "Turkish Lira",
|
||||||
|
"TTD": "Trinidad and Tobago Dollar",
|
||||||
|
"TWD": "New Taiwan Dollar",
|
||||||
|
"TZS": "Tanzanian Shilling",
|
||||||
|
"UAH": "Ukrainian Hryvnia",
|
||||||
|
"UGX": "Ugandan Shilling",
|
||||||
|
"USD": "United States Dollar",
|
||||||
|
"UYU": "Uruguayan Peso",
|
||||||
|
"UZS": "Uzbekistan Som",
|
||||||
|
"VEF": "Venezuelan Bolívar Fuerte",
|
||||||
|
"VND": "Vietnamese Dong",
|
||||||
|
"VUV": "Vanuatu Vatu",
|
||||||
|
"WST": "Samoan Tala",
|
||||||
|
"XAF": "CFA Franc BEAC",
|
||||||
|
"XAG": "Silver Ounce",
|
||||||
|
"XAU": "Gold Ounce",
|
||||||
|
"XCD": "East Caribbean Dollar",
|
||||||
|
"XDR": "Special Drawing Rights",
|
||||||
|
"XOF": "CFA Franc BCEAO",
|
||||||
|
"XPD": "Palladium Ounce",
|
||||||
|
"XPF": "CFP Franc",
|
||||||
|
"XPT": "Platinum Ounce",
|
||||||
|
"YER": "Yemeni Rial",
|
||||||
|
"ZAR": "South African Rand",
|
||||||
|
"ZMW": "Zambian Kwacha",
|
||||||
|
"ZWL": "Zimbabwean Dollar"
|
||||||
|
}
|
158
other/currencies2.json
Normal file
158
other/currencies2.json
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
[
|
||||||
|
{"cc":"AED","symbol":"\u062f.\u0625;","name":"UAE dirham"},
|
||||||
|
{"cc":"AFN","symbol":"Afs","name":"Afghan afghani"},
|
||||||
|
{"cc":"ALL","symbol":"L","name":"Albanian lek"},
|
||||||
|
{"cc":"AMD","symbol":"AMD","name":"Armenian dram"},
|
||||||
|
{"cc":"ANG","symbol":"NA\u0192","name":"Netherlands Antillean gulden"},
|
||||||
|
{"cc":"AOA","symbol":"Kz","name":"Angolan kwanza"},
|
||||||
|
{"cc":"ARS","symbol":"$","name":"Argentine peso"},
|
||||||
|
{"cc":"AUD","symbol":"$","name":"Australian dollar"},
|
||||||
|
{"cc":"AWG","symbol":"\u0192","name":"Aruban florin"},
|
||||||
|
{"cc":"AZN","symbol":"AZN","name":"Azerbaijani manat"},
|
||||||
|
{"cc":"BAM","symbol":"KM","name":"Bosnia and Herzegovina konvertibilna marka"},
|
||||||
|
{"cc":"BBD","symbol":"Bds$","name":"Barbadian dollar"},
|
||||||
|
{"cc":"BDT","symbol":"\u09f3","name":"Bangladeshi taka"},
|
||||||
|
{"cc":"BGN","symbol":"BGN","name":"Bulgarian lev"},
|
||||||
|
{"cc":"BHD","symbol":".\u062f.\u0628","name":"Bahraini dinar"},
|
||||||
|
{"cc":"BIF","symbol":"FBu","name":"Burundi franc"},
|
||||||
|
{"cc":"BMD","symbol":"BD$","name":"Bermudian dollar"},
|
||||||
|
{"cc":"BND","symbol":"B$","name":"Brunei dollar"},
|
||||||
|
{"cc":"BOB","symbol":"Bs.","name":"Bolivian boliviano"},
|
||||||
|
{"cc":"BRL","symbol":"R$","name":"Brazilian real"},
|
||||||
|
{"cc":"BSD","symbol":"B$","name":"Bahamian dollar"},
|
||||||
|
{"cc":"BTN","symbol":"Nu.","name":"Bhutanese ngultrum"},
|
||||||
|
{"cc":"BWP","symbol":"P","name":"Botswana pula"},
|
||||||
|
{"cc":"BYR","symbol":"Br","name":"Belarusian ruble"},
|
||||||
|
{"cc":"BZD","symbol":"BZ$","name":"Belize dollar"},
|
||||||
|
{"cc":"CAD","symbol":"$","name":"Canadian dollar"},
|
||||||
|
{"cc":"CDF","symbol":"F","name":"Congolese franc"},
|
||||||
|
{"cc":"CHF","symbol":"Fr.","name":"Swiss franc"},
|
||||||
|
{"cc":"CLP","symbol":"$","name":"Chilean peso"},
|
||||||
|
{"cc":"CNY","symbol":"\u00a5","name":"Chinese/Yuan renminbi"},
|
||||||
|
{"cc":"COP","symbol":"Col$","name":"Colombian peso"},
|
||||||
|
{"cc":"CRC","symbol":"\u20a1","name":"Costa Rican colon"},
|
||||||
|
{"cc":"CUC","symbol":"$","name":"Cuban peso"},
|
||||||
|
{"cc":"CVE","symbol":"Esc","name":"Cape Verdean escudo"},
|
||||||
|
{"cc":"CZK","symbol":"K\u010d","name":"Czech koruna"},
|
||||||
|
{"cc":"DJF","symbol":"Fdj","name":"Djiboutian franc"},
|
||||||
|
{"cc":"DKK","symbol":"Kr","name":"Danish krone"},
|
||||||
|
{"cc":"DOP","symbol":"RD$","name":"Dominican peso"},
|
||||||
|
{"cc":"DZD","symbol":"\u062f.\u062c","name":"Algerian dinar"},
|
||||||
|
{"cc":"EEK","symbol":"KR","name":"Estonian kroon"},
|
||||||
|
{"cc":"EGP","symbol":"\u00a3","name":"Egyptian pound"},
|
||||||
|
{"cc":"ERN","symbol":"Nfa","name":"Eritrean nakfa"},
|
||||||
|
{"cc":"ETB","symbol":"Br","name":"Ethiopian birr"},
|
||||||
|
{"cc":"EUR","symbol":"\u20ac","name":"European Euro"},
|
||||||
|
{"cc":"FJD","symbol":"FJ$","name":"Fijian dollar"},
|
||||||
|
{"cc":"FKP","symbol":"\u00a3","name":"Falkland Islands pound"},
|
||||||
|
{"cc":"GBP","symbol":"\u00a3","name":"British pound"},
|
||||||
|
{"cc":"GEL","symbol":"GEL","name":"Georgian lari"},
|
||||||
|
{"cc":"GHS","symbol":"GH\u20b5","name":"Ghanaian cedi"},
|
||||||
|
{"cc":"GIP","symbol":"\u00a3","name":"Gibraltar pound"},
|
||||||
|
{"cc":"GMD","symbol":"D","name":"Gambian dalasi"},
|
||||||
|
{"cc":"GNF","symbol":"FG","name":"Guinean franc"},
|
||||||
|
{"cc":"GQE","symbol":"CFA","name":"Central African CFA franc"},
|
||||||
|
{"cc":"GTQ","symbol":"Q","name":"Guatemalan quetzal"},
|
||||||
|
{"cc":"GYD","symbol":"GY$","name":"Guyanese dollar"},
|
||||||
|
{"cc":"HKD","symbol":"HK$","name":"Hong Kong dollar"},
|
||||||
|
{"cc":"HNL","symbol":"L","name":"Honduran lempira"},
|
||||||
|
{"cc":"HRK","symbol":"kn","name":"Croatian kuna"},
|
||||||
|
{"cc":"HTG","symbol":"G","name":"Haitian gourde"},
|
||||||
|
{"cc":"HUF","symbol":"Ft","name":"Hungarian forint"},
|
||||||
|
{"cc":"IDR","symbol":"Rp","name":"Indonesian rupiah"},
|
||||||
|
{"cc":"ILS","symbol":"\u20aa","name":"Israeli new sheqel"},
|
||||||
|
{"cc":"INR","symbol":"\u20B9","name":"Indian rupee"},
|
||||||
|
{"cc":"IQD","symbol":"\u062f.\u0639","name":"Iraqi dinar"},
|
||||||
|
{"cc":"IRR","symbol":"IRR","name":"Iranian rial"},
|
||||||
|
{"cc":"ISK","symbol":"kr","name":"Icelandic kr\u00f3na"},
|
||||||
|
{"cc":"JMD","symbol":"J$","name":"Jamaican dollar"},
|
||||||
|
{"cc":"JOD","symbol":"JOD","name":"Jordanian dinar"},
|
||||||
|
{"cc":"JPY","symbol":"\u00a5","name":"Japanese yen"},
|
||||||
|
{"cc":"KES","symbol":"KSh","name":"Kenyan shilling"},
|
||||||
|
{"cc":"KGS","symbol":"\u0441\u043e\u043c","name":"Kyrgyzstani som"},
|
||||||
|
{"cc":"KHR","symbol":"\u17db","name":"Cambodian riel"},
|
||||||
|
{"cc":"KMF","symbol":"KMF","name":"Comorian franc"},
|
||||||
|
{"cc":"KPW","symbol":"W","name":"North Korean won"},
|
||||||
|
{"cc":"KRW","symbol":"W","name":"South Korean won"},
|
||||||
|
{"cc":"KWD","symbol":"KWD","name":"Kuwaiti dinar"},
|
||||||
|
{"cc":"KYD","symbol":"KY$","name":"Cayman Islands dollar"},
|
||||||
|
{"cc":"KZT","symbol":"T","name":"Kazakhstani tenge"},
|
||||||
|
{"cc":"LAK","symbol":"KN","name":"Lao kip"},
|
||||||
|
{"cc":"LBP","symbol":"\u00a3","name":"Lebanese lira"},
|
||||||
|
{"cc":"LKR","symbol":"Rs","name":"Sri Lankan rupee"},
|
||||||
|
{"cc":"LRD","symbol":"L$","name":"Liberian dollar"},
|
||||||
|
{"cc":"LSL","symbol":"M","name":"Lesotho loti"},
|
||||||
|
{"cc":"LTL","symbol":"Lt","name":"Lithuanian litas"},
|
||||||
|
{"cc":"LVL","symbol":"Ls","name":"Latvian lats"},
|
||||||
|
{"cc":"LYD","symbol":"LD","name":"Libyan dinar"},
|
||||||
|
{"cc":"MAD","symbol":"MAD","name":"Moroccan dirham"},
|
||||||
|
{"cc":"MDL","symbol":"MDL","name":"Moldovan leu"},
|
||||||
|
{"cc":"MGA","symbol":"FMG","name":"Malagasy ariary"},
|
||||||
|
{"cc":"MKD","symbol":"MKD","name":"Macedonian denar"},
|
||||||
|
{"cc":"MMK","symbol":"K","name":"Myanma kyat"},
|
||||||
|
{"cc":"MNT","symbol":"\u20ae","name":"Mongolian tugrik"},
|
||||||
|
{"cc":"MOP","symbol":"P","name":"Macanese pataca"},
|
||||||
|
{"cc":"MRO","symbol":"UM","name":"Mauritanian ouguiya"},
|
||||||
|
{"cc":"MUR","symbol":"Rs","name":"Mauritian rupee"},
|
||||||
|
{"cc":"MVR","symbol":"Rf","name":"Maldivian rufiyaa"},
|
||||||
|
{"cc":"MWK","symbol":"MK","name":"Malawian kwacha"},
|
||||||
|
{"cc":"MXN","symbol":"$","name":"Mexican peso"},
|
||||||
|
{"cc":"MYR","symbol":"RM","name":"Malaysian ringgit"},
|
||||||
|
{"cc":"MZM","symbol":"MTn","name":"Mozambican metical"},
|
||||||
|
{"cc":"NAD","symbol":"N$","name":"Namibian dollar"},
|
||||||
|
{"cc":"NGN","symbol":"\u20a6","name":"Nigerian naira"},
|
||||||
|
{"cc":"NIO","symbol":"C$","name":"Nicaraguan c\u00f3rdoba"},
|
||||||
|
{"cc":"NOK","symbol":"kr","name":"Norwegian krone"},
|
||||||
|
{"cc":"NPR","symbol":"NRs","name":"Nepalese rupee"},
|
||||||
|
{"cc":"NZD","symbol":"NZ$","name":"New Zealand dollar"},
|
||||||
|
{"cc":"OMR","symbol":"OMR","name":"Omani rial"},
|
||||||
|
{"cc":"PAB","symbol":"B./","name":"Panamanian balboa"},
|
||||||
|
{"cc":"PEN","symbol":"S/.","name":"Peruvian nuevo sol"},
|
||||||
|
{"cc":"PGK","symbol":"K","name":"Papua New Guinean kina"},
|
||||||
|
{"cc":"PHP","symbol":"\u20b1","name":"Philippine peso"},
|
||||||
|
{"cc":"PKR","symbol":"Rs.","name":"Pakistani rupee"},
|
||||||
|
{"cc":"PLN","symbol":"z\u0142","name":"Polish zloty"},
|
||||||
|
{"cc":"PYG","symbol":"\u20b2","name":"Paraguayan guarani"},
|
||||||
|
{"cc":"QAR","symbol":"QR","name":"Qatari riyal"},
|
||||||
|
{"cc":"RON","symbol":"L","name":"Romanian leu"},
|
||||||
|
{"cc":"RSD","symbol":"din.","name":"Serbian dinar"},
|
||||||
|
{"cc":"RUB","symbol":"R","name":"Russian ruble"},
|
||||||
|
{"cc":"SAR","symbol":"SR","name":"Saudi riyal"},
|
||||||
|
{"cc":"SBD","symbol":"SI$","name":"Solomon Islands dollar"},
|
||||||
|
{"cc":"SCR","symbol":"SR","name":"Seychellois rupee"},
|
||||||
|
{"cc":"SDG","symbol":"SDG","name":"Sudanese pound"},
|
||||||
|
{"cc":"SEK","symbol":"kr","name":"Swedish krona"},
|
||||||
|
{"cc":"SGD","symbol":"S$","name":"Singapore dollar"},
|
||||||
|
{"cc":"SHP","symbol":"\u00a3","name":"Saint Helena pound"},
|
||||||
|
{"cc":"SLL","symbol":"Le","name":"Sierra Leonean leone"},
|
||||||
|
{"cc":"SOS","symbol":"Sh.","name":"Somali shilling"},
|
||||||
|
{"cc":"SRD","symbol":"$","name":"Surinamese dollar"},
|
||||||
|
{"cc":"SYP","symbol":"LS","name":"Syrian pound"},
|
||||||
|
{"cc":"SZL","symbol":"E","name":"Swazi lilangeni"},
|
||||||
|
{"cc":"THB","symbol":"\u0e3f","name":"Thai baht"},
|
||||||
|
{"cc":"TJS","symbol":"TJS","name":"Tajikistani somoni"},
|
||||||
|
{"cc":"TMT","symbol":"m","name":"Turkmen manat"},
|
||||||
|
{"cc":"TND","symbol":"DT","name":"Tunisian dinar"},
|
||||||
|
{"cc":"TRY","symbol":"TRY","name":"Turkish new lira"},
|
||||||
|
{"cc":"TTD","symbol":"TT$","name":"Trinidad and Tobago dollar"},
|
||||||
|
{"cc":"TWD","symbol":"NT$","name":"New Taiwan dollar"},
|
||||||
|
{"cc":"TZS","symbol":"TZS","name":"Tanzanian shilling"},
|
||||||
|
{"cc":"UAH","symbol":"UAH","name":"Ukrainian hryvnia"},
|
||||||
|
{"cc":"UGX","symbol":"USh","name":"Ugandan shilling"},
|
||||||
|
{"cc":"USD","symbol":"US$","name":"United States dollar"},
|
||||||
|
{"cc":"UYU","symbol":"$U","name":"Uruguayan peso"},
|
||||||
|
{"cc":"UZS","symbol":"UZS","name":"Uzbekistani som"},
|
||||||
|
{"cc":"VEB","symbol":"Bs","name":"Venezuelan bolivar"},
|
||||||
|
{"cc":"VND","symbol":"\u20ab","name":"Vietnamese dong"},
|
||||||
|
{"cc":"VUV","symbol":"VT","name":"Vanuatu vatu"},
|
||||||
|
{"cc":"WST","symbol":"WS$","name":"Samoan tala"},
|
||||||
|
{"cc":"XAF","symbol":"CFA","name":"Central African CFA franc"},
|
||||||
|
{"cc":"XCD","symbol":"EC$","name":"East Caribbean dollar"},
|
||||||
|
{"cc":"XDR","symbol":"SDR","name":"Special Drawing Rights"},
|
||||||
|
{"cc":"XOF","symbol":"CFA","name":"West African CFA franc"},
|
||||||
|
{"cc":"XPF","symbol":"F","name":"CFP franc"},
|
||||||
|
{"cc":"YER","symbol":"YER","name":"Yemeni rial"},
|
||||||
|
{"cc":"ZAR","symbol":"R","name":"South African rand"},
|
||||||
|
{"cc":"ZMK","symbol":"ZK","name":"Zambian kwacha"},
|
||||||
|
{"cc":"ZWR","symbol":"Z$","name":"Zimbabwean dollar"}
|
||||||
|
]
|
23
other/currencycountry.js
Normal file
23
other/currencycountry.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// data taken from https://www.iban.com/currency-codes
|
||||||
|
// https://www.iban.com/country-codes
|
||||||
|
|
||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
let countryArr = fs.readFileSync(path.join(__dirname, 'country.csv')).toString().trim().toLowerCase().split(/\r?\n/).slice(1).map(e=>e.split(',').map(e=>e.replaceAll('"','')))
|
||||||
|
let currencyArr = fs.readFileSync(path.join(__dirname, 'currency.csv')).toString().trim().toLowerCase().split(/\r?\n/).slice(1).map(e=>e.split(',').map(e=>e.replaceAll('"','')))
|
||||||
|
|
||||||
|
countryObj = Object.fromEntries(countryArr.map(e=>[e[0], e.slice(1)]))
|
||||||
|
let bigJSON = {}
|
||||||
|
for(let [countryName, currencyName, currencyCode, currencyNumber] of currencyArr){
|
||||||
|
try{
|
||||||
|
let [iso2,iso3,isoNumeric] = countryObj[countryName]
|
||||||
|
if(iso2 in bigJSON)
|
||||||
|
console.log(countryName)
|
||||||
|
else
|
||||||
|
bigJSON[iso2] = {"country_name": countryName, "country_iso3":iso3, "country_iso_numeric":isoNumeric ,"currency_name": currencyName, "currency_code": currencyCode, "currency_number": currencyNumber}
|
||||||
|
}catch(e){}
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(path.join(__dirname, 'bigJSON.json'), JSON.stringify(bigJSON, null, '\t'))
|
||||||
|
|
4005
other/filter-repo.py
Normal file
4005
other/filter-repo.py
Normal file
File diff suppressed because it is too large
Load Diff
10
other/getdate-args.js
Normal file
10
other/getdate-args.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
const startMonth = -2
|
||||||
|
const endMonths = -12
|
||||||
|
const dateToday = new Date()
|
||||||
|
dateToday.setMonth(dateToday.getMonth()+startMonth)
|
||||||
|
let datesArr = []
|
||||||
|
for(let i=startMonth;i>=endMonths;i--){
|
||||||
|
dateToday.setMonth(dateToday.getMonth()-1)
|
||||||
|
datesArr.push(`${dateToday.toLocaleString("sv-SE", { dateStyle: 'short'}).slice(0,7).replace('-','\\-')}\\-[0-9]+`)
|
||||||
|
}
|
||||||
|
console.log(datesArr.map(e=>`--path-regex ${e}`).join(' '))
|
22
other/makemergecurr.js
Normal file
22
other/makemergecurr.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
// Requires for md5 hash generations for fonts to check duplicates
|
||||||
|
const crypto = require('crypto')
|
||||||
|
|
||||||
|
currcodes = fs.readFileSync(path.join(__dirname, 'currencies2.json')).toString()
|
||||||
|
currcodes = JSON.parse(currcodes)
|
||||||
|
|
||||||
|
mergecodes = fs.readFileSync(path.join(__dirname, 'mergecurr4.json')).toString()
|
||||||
|
mergecodes = JSON.parse(mergecodes)
|
||||||
|
|
||||||
|
const newcurrobj = {}
|
||||||
|
|
||||||
|
for (const [key, value] of Object.entries(mergecodes)) {
|
||||||
|
// mergecodes[value.cc] = value.name
|
||||||
|
|
||||||
|
newcurrobj[key.toLowerCase()] = value.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(newcurrobj)
|
||||||
|
|
||||||
|
fs.writeFileSync('mergecurr5lower.json', JSON.stringify(newcurrobj))
|
1
other/mergecurr.json
Normal file
1
other/mergecurr.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"USD":"US Dollar","CAD":"Canadian Dollar","EUR":"Euro","AED":"United Arab Emirates Dirham","AFN":"Afghan Afghani","ALL":"Albanian Lek","AMD":"Armenian Dram","ARS":"Argentine Peso","AUD":"Australian Dollar","AZN":"Azerbaijani Manat","BAM":"Bosnia-Herzegovina Convertible Mark","BDT":"Bangladeshi Taka","BGN":"Bulgarian Lev","BHD":"Bahraini Dinar","BIF":"Burundian Franc","BND":"Brunei Dollar","BOB":"Bolivian Boliviano","BRL":"Brazilian Real","BWP":"Botswanan Pula","BYN":"Belarusian Ruble","BZD":"Belize Dollar","CDF":"Congolese Franc","CHF":"Swiss Franc","CLP":"Chilean Peso","CNY":"Chinese Yuan","COP":"Colombian Peso","CRC":"Costa Rican Colón","CVE":"Cape Verdean Escudo","CZK":"Czech Republic Koruna","DJF":"Djiboutian Franc","DKK":"Danish Krone","DOP":"Dominican Peso","DZD":"Algerian Dinar","EEK":"Estonian Kroon","EGP":"Egyptian Pound","ERN":"Eritrean Nakfa","ETB":"Ethiopian Birr","GBP":"British Pound Sterling","GEL":"Georgian Lari","GHS":"Ghanaian Cedi","GNF":"Guinean Franc","GTQ":"Guatemalan Quetzal","HKD":"Hong Kong Dollar","HNL":"Honduran Lempira","HRK":"Croatian Kuna","HUF":"Hungarian Forint","IDR":"Indonesian Rupiah","ILS":"Israeli New Sheqel","INR":"Indian Rupee","IQD":"Iraqi Dinar","IRR":"Iranian Rial","ISK":"Icelandic Króna","JMD":"Jamaican Dollar","JOD":"Jordanian Dinar","JPY":"Japanese Yen","KES":"Kenyan Shilling","KHR":"Cambodian Riel","KMF":"Comorian Franc","KRW":"South Korean Won","KWD":"Kuwaiti Dinar","KZT":"Kazakhstani Tenge","LBP":"Lebanese Pound","LKR":"Sri Lankan Rupee","LTL":"Lithuanian Litas","LVL":"Latvian Lats","LYD":"Libyan Dinar","MAD":"Moroccan Dirham","MDL":"Moldovan Leu","MGA":"Malagasy Ariary","MKD":"Macedonian Denar","MMK":"Myanma Kyat","MOP":"Macanese Pataca","MUR":"Mauritian Rupee","MXN":"Mexican Peso","MYR":"Malaysian Ringgit","MZN":"Mozambican Metical","NAD":"Namibian Dollar","NGN":"Nigerian Naira","NIO":"Nicaraguan Córdoba","NOK":"Norwegian Krone","NPR":"Nepalese Rupee","NZD":"New Zealand Dollar","OMR":"Omani Rial","PAB":"Panamanian Balboa","PEN":"Peruvian Nuevo Sol","PHP":"Philippine Peso","PKR":"Pakistani Rupee","PLN":"Polish Zloty","PYG":"Paraguayan Guarani","QAR":"Qatari Rial","RON":"Romanian Leu","RSD":"Serbian Dinar","RUB":"Russian Ruble","RWF":"Rwandan Franc","SAR":"Saudi Riyal","SDG":"Sudanese Pound","SEK":"Swedish Krona","SGD":"Singapore Dollar","SOS":"Somali Shilling","SYP":"Syrian Pound","THB":"Thai Baht","TND":"Tunisian Dinar","TOP":"Tongan Paʻanga","TRY":"Turkish Lira","TTD":"Trinidad and Tobago Dollar","TWD":"New Taiwan Dollar","TZS":"Tanzanian Shilling","UAH":"Ukrainian Hryvnia","UGX":"Ugandan Shilling","UYU":"Uruguayan Peso","UZS":"Uzbekistan Som","VEF":"Venezuelan Bolívar","VND":"Vietnamese Dong","XAF":"CFA Franc BEAC","XOF":"CFA Franc BCEAO","YER":"Yemeni Rial","ZAR":"South African Rand","ZMK":"Zambian Kwacha","ZWL":"Zimbabwean Dollar"}
|
1
other/mergecurr2.json
Normal file
1
other/mergecurr2.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"USD":"United States Dollar","CAD":"Canadian Dollar","EUR":"Euro","AED":"United Arab Emirates Dirham","AFN":"Afghan Afghani","ALL":"Albanian Lek","AMD":"Armenian Dram","ARS":"Argentine Peso","AUD":"Australian Dollar","AZN":"Azerbaijani Manat","BAM":"Bosnia-Herzegovina Convertible Mark","BDT":"Bangladeshi Taka","BGN":"Bulgarian Lev","BHD":"Bahraini Dinar","BIF":"Burundian Franc","BND":"Brunei Dollar","BOB":"Bolivian Boliviano","BRL":"Brazilian Real","BWP":"Botswanan Pula","BYN":"Belarusian Ruble","BZD":"Belize Dollar","CDF":"Congolese Franc","CHF":"Swiss Franc","CLP":"Chilean Peso","CNY":"Chinese Yuan","COP":"Colombian Peso","CRC":"Costa Rican Colón","CVE":"Cape Verdean Escudo","CZK":"Czech Republic Koruna","DJF":"Djiboutian Franc","DKK":"Danish Krone","DOP":"Dominican Peso","DZD":"Algerian Dinar","EEK":"Estonian Kroon","EGP":"Egyptian Pound","ERN":"Eritrean Nakfa","ETB":"Ethiopian Birr","GBP":"British Pound Sterling","GEL":"Georgian Lari","GHS":"Ghanaian Cedi","GNF":"Guinean Franc","GTQ":"Guatemalan Quetzal","HKD":"Hong Kong Dollar","HNL":"Honduran Lempira","HRK":"Croatian Kuna","HUF":"Hungarian Forint","IDR":"Indonesian Rupiah","ILS":"Israeli New Sheqel","INR":"Indian Rupee","IQD":"Iraqi Dinar","IRR":"Iranian Rial","ISK":"Icelandic Króna","JMD":"Jamaican Dollar","JOD":"Jordanian Dinar","JPY":"Japanese Yen","KES":"Kenyan Shilling","KHR":"Cambodian Riel","KMF":"Comorian Franc","KRW":"South Korean Won","KWD":"Kuwaiti Dinar","KZT":"Kazakhstani Tenge","LBP":"Lebanese Pound","LKR":"Sri Lankan Rupee","LTL":"Lithuanian Litas","LVL":"Latvian Lats","LYD":"Libyan Dinar","MAD":"Moroccan Dirham","MDL":"Moldovan Leu","MGA":"Malagasy Ariary","MKD":"Macedonian Denar","MMK":"Myanma Kyat","MOP":"Macanese Pataca","MUR":"Mauritian Rupee","MXN":"Mexican Peso","MYR":"Malaysian Ringgit","MZN":"Mozambican Metical","NAD":"Namibian Dollar","NGN":"Nigerian Naira","NIO":"Nicaraguan Córdoba","NOK":"Norwegian Krone","NPR":"Nepalese Rupee","NZD":"New Zealand Dollar","OMR":"Omani Rial","PAB":"Panamanian Balboa","PEN":"Peruvian Nuevo Sol","PHP":"Philippine Peso","PKR":"Pakistani Rupee","PLN":"Polish Zloty","PYG":"Paraguayan Guarani","QAR":"Qatari Rial","RON":"Romanian Leu","RSD":"Serbian Dinar","RUB":"Russian Ruble","RWF":"Rwandan Franc","SAR":"Saudi Riyal","SDG":"Sudanese Pound","SEK":"Swedish Krona","SGD":"Singapore Dollar","SOS":"Somali Shilling","SYP":"Syrian Pound","THB":"Thai Baht","TND":"Tunisian Dinar","TOP":"Tongan Pa'anga","TRY":"Turkish Lira","TTD":"Trinidad and Tobago Dollar","TWD":"New Taiwan Dollar","TZS":"Tanzanian Shilling","UAH":"Ukrainian Hryvnia","UGX":"Ugandan Shilling","UYU":"Uruguayan Peso","UZS":"Uzbekistan Som","VEF":"Venezuelan Bolívar Fuerte","VND":"Vietnamese Dong","XAF":"CFA Franc BEAC","XOF":"CFA Franc BCEAO","YER":"Yemeni Rial","ZAR":"South African Rand","ZMK":"Zambian Kwacha","ZWL":"Zimbabwean Dollar","ANG":"Netherlands Antillean Guilder","AOA":"Angolan Kwanza","AWG":"Aruban Florin","BBD":"Barbadian Dollar","BMD":"Bermudan Dollar","BSD":"Bahamian Dollar","BTC":"Bitcoin","BTN":"Bhutanese Ngultrum","CLF":"Chilean Unit of Account (UF)","CNH":"Chinese Yuan (Offshore)","CUC":"Cuban Convertible Peso","CUP":"Cuban Peso","FJD":"Fijian Dollar","FKP":"Falkland Islands Pound","GGP":"Guernsey Pound","GIP":"Gibraltar Pound","GMD":"Gambian Dalasi","GYD":"Guyanaese Dollar","HTG":"Haitian Gourde","IMP":"Manx pound","JEP":"Jersey Pound","KGS":"Kyrgystani Som","KPW":"North Korean Won","KYD":"Cayman Islands Dollar","LAK":"Laotian Kip","LRD":"Liberian Dollar","LSL":"Lesotho Loti","MNT":"Mongolian Tugrik","MRO":"Mauritanian Ouguiya (pre-2018)","MRU":"Mauritanian Ouguiya","MVR":"Maldivian Rufiyaa","MWK":"Malawian Kwacha","PGK":"Papua New Guinean Kina","SBD":"Solomon Islands Dollar","SCR":"Seychellois Rupee","SHP":"Saint Helena Pound","SLL":"Sierra Leonean Leone","SRD":"Surinamese Dollar","SSP":"South Sudanese Pound","STD":"São Tomé and Príncipe Dobra (pre-2018)","STN":"São Tomé and Príncipe Dobra","SVC":"Salvadoran Colón","SZL":"Swazi Lilangeni","TJS":"Tajikistani Somoni","TMT":"Turkmenistani Manat","VUV":"Vanuatu Vatu","WST":"Samoan Tala","XAG":"Silver Ounce","XAU":"Gold Ounce","XCD":"East Caribbean Dollar","XDR":"Special Drawing Rights","XPD":"Palladium Ounce","XPF":"CFP Franc","XPT":"Platinum Ounce","ZMW":"Zambian Kwacha"}
|
1
other/mergecurr3.json
Normal file
1
other/mergecurr3.json
Normal file
File diff suppressed because one or more lines are too long
1
other/mergecurr4.json
Normal file
1
other/mergecurr4.json
Normal file
File diff suppressed because one or more lines are too long
1
other/mergecurr5lower.json
Normal file
1
other/mergecurr5lower.json
Normal file
File diff suppressed because one or more lines are too long
20
other/symbols.json
Normal file
20
other/symbols.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"ADA": "₳",
|
||||||
|
"BCH": "Ƀ",
|
||||||
|
"BSV": "Ɓ",
|
||||||
|
"BTC": "₿",
|
||||||
|
"DAI": "◈",
|
||||||
|
"DOGE": "Ð",
|
||||||
|
"EOS": "ε",
|
||||||
|
"ETC": "ξ",
|
||||||
|
"ETH": "Ξ",
|
||||||
|
"LTC": "Ł",
|
||||||
|
"MKR": "Μ",
|
||||||
|
"REP": "Ɍ",
|
||||||
|
"STEEM": "ȿ",
|
||||||
|
"USDT": "₮",
|
||||||
|
"XMR": "ɱ",
|
||||||
|
"XRP": "✕",
|
||||||
|
"XTZ": "ꜩ",
|
||||||
|
"ZEC": "ⓩ"
|
||||||
|
}
|
19
package.json
Normal file
19
package.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"name": "currency-api",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "currscript.js",
|
||||||
|
"dependencies": {
|
||||||
|
"fs-extra": "^9.1.0",
|
||||||
|
"playwright": "^1.37.1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/fawazahmed0/currency-api.git"
|
||||||
|
},
|
||||||
|
"author": "Fawaz Ahmed fawazahmed0@hotmail.com",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/fawazahmed0/currency-api/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/fawazahmed0/currency-api#readme"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user