From 836ab07776775494e166a9c3ea969d480f1c9b24 Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Mon, 5 Dec 2016 17:15:32 +0200 Subject: [PATCH] moved l-a-s in here --- bin/lamassu-admin-server | 184 +++ bin/lamassu-register | 27 + currencies.json | 2576 +++++++++++++++++++++++++++++++++++++ languages.json | 253 ++++ lib/admin/accounts.js | 123 ++ lib/admin/config.js | 262 ++++ lib/admin/login.js | 48 + lib/admin/machines.js | 26 + lib/admin/pairing.js | 32 + lib/admin/server.js | 26 + lib/admin/transactions.js | 25 + lib/config-manager.js | 30 +- lib/plugins.js | 1 + package.json | 10 +- tools/currencies.js | 24 + tools/modify.js | 40 + tools/show.js | 22 + yarn.lock | 518 ++++---- 18 files changed, 3946 insertions(+), 281 deletions(-) create mode 100755 bin/lamassu-admin-server create mode 100755 bin/lamassu-register create mode 100644 currencies.json create mode 100644 languages.json create mode 100644 lib/admin/accounts.js create mode 100644 lib/admin/config.js create mode 100644 lib/admin/login.js create mode 100644 lib/admin/machines.js create mode 100644 lib/admin/pairing.js create mode 100644 lib/admin/server.js create mode 100644 lib/admin/transactions.js create mode 100644 tools/currencies.js create mode 100644 tools/modify.js create mode 100644 tools/show.js diff --git a/bin/lamassu-admin-server b/bin/lamassu-admin-server new file mode 100755 index 00000000..10869733 --- /dev/null +++ b/bin/lamassu-admin-server @@ -0,0 +1,184 @@ +#!/usr/bin/env node + +const os = require('os') +const fs = require('fs') +const path = require('path') +const express = require('express') +const app = express() +const https = require('https') +const http = require('http') +const bodyParser = require('body-parser') +const serveStatic = require('serve-static') +const cookieParser = require('cookie-parser') +const argv = require('minimist')(process.argv.slice(2)) +const got = require('got') +const morgan = require('morgan') + +const accounts = require('../lib/admin/accounts') +const machines = require('../lib/admin/machines') +const config = require('../lib/admin/config') +const login = require('../lib/admin/login') +const pairing = require('../lib/admin/pairing') +const server = require('../lib/admin/server') +const transactions = require('../lib/admin/transactions') + +const devMode = argv.dev + +let serverConfig + +try { + const homeConfigPath = path.resolve(os.homedir(), '.lamassu', 'lamassu.json') + serverConfig = JSON.parse(fs.readFileSync(homeConfigPath)) +} catch (_) { + try { + const globalConfigPath = path.resolve('/etc', 'lamassu', 'lamassu.json') + serverConfig = JSON.parse(fs.readFileSync(globalConfigPath)) + } catch (_) { + console.error("Couldn't open config file.") + process.exit(1) + } +} + +const hostname = serverConfig.hostname +if (!hostname) { + console.error('Error: no hostname specified.') + process.exit(1) +} + +function dbNotify () { + return got.post('http://localhost:3030/dbChange') + .catch(e => console.error('Error: lamassu-server not responding')) +} + +app.use(morgan('dev')) +app.use(cookieParser()) +app.use(register) +if (!devMode) app.use(authenticate) + +app.use(bodyParser.json()) + +app.get('/api/totem', (req, res) => { + const name = req.query.name + + if (!name) return res.status(400).send('Name is required') + + return pairing.totem(hostname, name) + .then(totem => res.send(totem)) +}) + +app.get('/api/accounts', (req, res) => { + accounts.selectedAccounts() + .then(accounts => res.json({accounts: accounts})) +}) + +app.get('/api/account/:account', (req, res) => { + accounts.getAccount(req.params.account) + .then(account => res.json(account)) +}) + +app.post('/api/account', (req, res) => { + return accounts.updateAccount(req.body) + .then(account => res.json(account)) + .then(() => dbNotify()) +}) + +app.get('/api/config/:config', (req, res) => + config.fetchConfigGroup(req.params.config).then(c => res.json(c))) + +app.post('/api/config', (req, res) => { + config.saveConfigGroup(req.body) + .then(c => res.json(c)) + .then(() => dbNotify()) +}) + +app.get('/api/accounts/account/:account', (req, res) => { + accounts.getAccount(req.params.account) + .then(r => res.send(r)) +}) + +app.get('/api/machines', (req, res) => { + machines.getMachines() + .then(r => res.send({machines: r})) +}) + +app.post('/api/machines', (req, res) => { + machines.setMachine(req.body) + .then(() => machines.getMachines()) + .then(r => res.send({machines: r})) + .then(() => dbNotify()) +}) + +app.get('/api/status', (req, res, next) => { + return Promise.all([server.status(), config.validateConfig()]) + .then(([serverStatus, invalidConfigGroups]) => res.send({ + server: serverStatus, + invalidConfigGroups + })) + .catch(next) +}) + +app.get('/api/transactions', (req, res, next) => { + return transactions.batch() + .then(r => res.send({transactions: r})) + .catch(next) +}) + +app.use((err, req, res, next) => { + console.error(err) + + return res.status(500).send(err.message) +}) + +const options = { + key: fs.readFileSync(serverConfig.keyPath), + cert: fs.readFileSync(serverConfig.certPath) +} + +app.use(serveStatic(path.resolve(__dirname, '..', 'public'))) + +function register (req, res, next) { + const otp = req.query.otp + + if (!otp) return next() + + return login.register(otp) + .then(r => { + if (r.expired) return res.status(401).send('OTP expired, generate new registration link') + if (!r.success) return res.status(401).send('Registration failed') + + const cookieOpts = { + httpOnly: true, + secure: true + } + + const token = r.token + req.token = token + res.cookie('token', token, cookieOpts) + next() + }) +} + +function authenticate (req, res, next) { + const token = req.token || req.cookies.token + + return login.authenticate(token) + .then(success => { + if (!success) return res.status(401).send('Authentication failed') + next() + }) +} + +process.on('unhandledRejection', err => { + console.error(err.stack) + process.exit(1) +}) + +if (devMode) { + http.createServer(app).listen(8070, () => { + console.log('lamassu-admin-server listening on port 8070') + }) +} else { + https.createServer(options, app).listen(443, () => { + console.log('lamassu-admin-server listening on port 443') + }) +} diff --git a/bin/lamassu-register b/bin/lamassu-register new file mode 100755 index 00000000..f0280453 --- /dev/null +++ b/bin/lamassu-register @@ -0,0 +1,27 @@ +#!/usr/bin/env node + +const login = require('../lib/admin/login') +const options = require('../lib/options') + +const name = process.argv[2] +const domain = options.hostname + +if (!domain) { + console.error('No hostname configured in lamassu.json') + process.exit(1) +} + +if (!name) { + console.log('Usage: lamassu-register ') + process.exit(2) +} + +login.generateOTP(name) +.then(otp => { + console.log(`https://${domain}?otp=${otp}`) + process.exit(0) +}) +.catch(err => { + console.log('Error: %s', err) + process.exit(3) +}) diff --git a/currencies.json b/currencies.json new file mode 100644 index 00000000..6261e780 --- /dev/null +++ b/currencies.json @@ -0,0 +1,2576 @@ +[ + { + "ENTITY": "AFGHANISTAN", + "Currency": "Afghani", + "Alphabetic Code": "AFN", + "Numeric Code": 971, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ÅLAND ISLANDS", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ALBANIA", + "Currency": "Lek", + "Alphabetic Code": "ALL", + "Numeric Code": 8, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ALGERIA", + "Currency": "Algerian Dinar", + "Alphabetic Code": "DZD", + "Numeric Code": 12, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "AMERICAN SAMOA", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ANDORRA", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ANGOLA", + "Currency": "Kwanza", + "Alphabetic Code": "AOA", + "Numeric Code": 973, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ANGUILLA", + "Currency": "East Caribbean Dollar", + "Alphabetic Code": "XCD", + "Numeric Code": 951, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ANTARCTICA", + "Currency": "No universal currency", + "Alphabetic Code": "", + "Numeric Code": "", + "Minor unit": "", + "Fund": "", + "": "" + }, + { + "ENTITY": "ANTIGUA AND BARBUDA", + "Currency": "East Caribbean Dollar", + "Alphabetic Code": "XCD", + "Numeric Code": 951, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ARGENTINA", + "Currency": "Argentine Peso", + "Alphabetic Code": "ARS", + "Numeric Code": 32, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ARMENIA", + "Currency": "Armenian Dram", + "Alphabetic Code": "AMD", + "Numeric Code": 51, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ARUBA", + "Currency": "Aruban Florin", + "Alphabetic Code": "AWG", + "Numeric Code": 533, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "AUSTRALIA", + "Currency": "Australian Dollar", + "Alphabetic Code": "AUD", + "Numeric Code": 36, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "AUSTRIA", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "AZERBAIJAN", + "Currency": "Azerbaijanian Manat", + "Alphabetic Code": "AZN", + "Numeric Code": 944, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BAHAMAS (THE)", + "Currency": "Bahamian Dollar", + "Alphabetic Code": "BSD", + "Numeric Code": 44, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BAHRAIN", + "Currency": "Bahraini Dinar", + "Alphabetic Code": "BHD", + "Numeric Code": 48, + "Minor unit": 3, + "Fund": "", + "": "" + }, + { + "ENTITY": "BANGLADESH", + "Currency": "Taka", + "Alphabetic Code": "BDT", + "Numeric Code": 50, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BARBADOS", + "Currency": "Barbados Dollar", + "Alphabetic Code": "BBD", + "Numeric Code": 52, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BELARUS", + "Currency": "Belarusian Ruble", + "Alphabetic Code": "BYN", + "Numeric Code": 933, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BELARUS", + "Currency": "Belarusian Ruble", + "Alphabetic Code": "BYR", + "Numeric Code": 974, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "BELGIUM", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BELIZE", + "Currency": "Belize Dollar", + "Alphabetic Code": "BZD", + "Numeric Code": 84, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BENIN", + "Currency": "CFA Franc BCEAO", + "Alphabetic Code": "XOF", + "Numeric Code": 952, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "BERMUDA", + "Currency": "Bermudian Dollar", + "Alphabetic Code": "BMD", + "Numeric Code": 60, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BHUTAN", + "Currency": "Indian Rupee", + "Alphabetic Code": "INR", + "Numeric Code": 356, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BHUTAN", + "Currency": "Ngultrum", + "Alphabetic Code": "BTN", + "Numeric Code": 64, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BOLIVIA (PLURINATIONAL STATE OF)", + "Currency": "Boliviano", + "Alphabetic Code": "BOB", + "Numeric Code": 68, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BOLIVIA (PLURINATIONAL STATE OF)", + "Currency": "Mvdol", + "Alphabetic Code": "BOV", + "Numeric Code": 984, + "Minor unit": 2, + "Fund": "TRUE", + "": "" + }, + { + "ENTITY": "BONAIRE, SINT EUSTATIUS AND SABA", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BOSNIA AND HERZEGOVINA", + "Currency": "Convertible Mark", + "Alphabetic Code": "BAM", + "Numeric Code": 977, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BOTSWANA", + "Currency": "Pula", + "Alphabetic Code": "BWP", + "Numeric Code": 72, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BOUVET ISLAND", + "Currency": "Norwegian Krone", + "Alphabetic Code": "NOK", + "Numeric Code": 578, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BRAZIL", + "Currency": "Brazilian Real", + "Alphabetic Code": "BRL", + "Numeric Code": 986, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BRITISH INDIAN OCEAN TERRITORY (THE)", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BRUNEI DARUSSALAM", + "Currency": "Brunei Dollar", + "Alphabetic Code": "BND", + "Numeric Code": 96, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BULGARIA", + "Currency": "Bulgarian Lev", + "Alphabetic Code": "BGN", + "Numeric Code": 975, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "BURKINA FASO", + "Currency": "CFA Franc BCEAO", + "Alphabetic Code": "XOF", + "Numeric Code": 952, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "BURUNDI", + "Currency": "Burundi Franc", + "Alphabetic Code": "BIF", + "Numeric Code": 108, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "CABO VERDE", + "Currency": "Cabo Verde Escudo", + "Alphabetic Code": "CVE", + "Numeric Code": 132, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CAMBODIA", + "Currency": "Riel", + "Alphabetic Code": "KHR", + "Numeric Code": 116, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CAMEROON", + "Currency": "CFA Franc BEAC", + "Alphabetic Code": "XAF", + "Numeric Code": 950, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "CANADA", + "Currency": "Canadian Dollar", + "Alphabetic Code": "CAD", + "Numeric Code": 124, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CAYMAN ISLANDS (THE)", + "Currency": "Cayman Islands Dollar", + "Alphabetic Code": "KYD", + "Numeric Code": 136, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CENTRAL AFRICAN REPUBLIC (THE)", + "Currency": "CFA Franc BEAC", + "Alphabetic Code": "XAF", + "Numeric Code": 950, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "CHAD", + "Currency": "CFA Franc BEAC", + "Alphabetic Code": "XAF", + "Numeric Code": 950, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "CHILE", + "Currency": "Chilean Peso", + "Alphabetic Code": "CLP", + "Numeric Code": 152, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "CHILE", + "Currency": "Unidad de Fomento", + "Alphabetic Code": "CLF", + "Numeric Code": 990, + "Minor unit": 4, + "Fund": "TRUE", + "": "" + }, + { + "ENTITY": "CHINA", + "Currency": "Yuan Renminbi", + "Alphabetic Code": "CNY", + "Numeric Code": 156, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CHRISTMAS ISLAND", + "Currency": "Australian Dollar", + "Alphabetic Code": "AUD", + "Numeric Code": 36, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "COCOS (KEELING) ISLANDS (THE)", + "Currency": "Australian Dollar", + "Alphabetic Code": "AUD", + "Numeric Code": 36, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "COLOMBIA", + "Currency": "Colombian Peso", + "Alphabetic Code": "COP", + "Numeric Code": 170, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "COLOMBIA", + "Currency": "Unidad de Valor Real", + "Alphabetic Code": "COU", + "Numeric Code": 970, + "Minor unit": 2, + "Fund": "TRUE", + "": "" + }, + { + "ENTITY": "COMOROS (THE)", + "Currency": "Comoro Franc", + "Alphabetic Code": "KMF", + "Numeric Code": 174, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "CONGO (THE DEMOCRATIC REPUBLIC OF THE)", + "Currency": "Congolese Franc", + "Alphabetic Code": "CDF", + "Numeric Code": 976, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CONGO (THE)", + "Currency": "CFA Franc BEAC", + "Alphabetic Code": "XAF", + "Numeric Code": 950, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "COOK ISLANDS (THE)", + "Currency": "New Zealand Dollar", + "Alphabetic Code": "NZD", + "Numeric Code": 554, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "COSTA RICA", + "Currency": "Costa Rican Colon", + "Alphabetic Code": "CRC", + "Numeric Code": 188, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CÔTE D'IVOIRE", + "Currency": "CFA Franc BCEAO", + "Alphabetic Code": "XOF", + "Numeric Code": 952, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "CROATIA", + "Currency": "Kuna", + "Alphabetic Code": "HRK", + "Numeric Code": 191, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CUBA", + "Currency": "Cuban Peso", + "Alphabetic Code": "CUP", + "Numeric Code": 192, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CUBA", + "Currency": "Peso Convertible", + "Alphabetic Code": "CUC", + "Numeric Code": 931, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CURAÇAO", + "Currency": "Netherlands Antillean Guilder", + "Alphabetic Code": "ANG", + "Numeric Code": 532, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CYPRUS", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "CZECH REPUBLIC (THE)", + "Currency": "Czech Koruna", + "Alphabetic Code": "CZK", + "Numeric Code": 203, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "DENMARK", + "Currency": "Danish Krone", + "Alphabetic Code": "DKK", + "Numeric Code": 208, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "DJIBOUTI", + "Currency": "Djibouti Franc", + "Alphabetic Code": "DJF", + "Numeric Code": 262, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "DOMINICA", + "Currency": "East Caribbean Dollar", + "Alphabetic Code": "XCD", + "Numeric Code": 951, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "DOMINICAN REPUBLIC (THE)", + "Currency": "Dominican Peso", + "Alphabetic Code": "DOP", + "Numeric Code": 214, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ECUADOR", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "EGYPT", + "Currency": "Egyptian Pound", + "Alphabetic Code": "EGP", + "Numeric Code": 818, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "EL SALVADOR", + "Currency": "El Salvador Colon", + "Alphabetic Code": "SVC", + "Numeric Code": 222, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "EL SALVADOR", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "EQUATORIAL GUINEA", + "Currency": "CFA Franc BEAC", + "Alphabetic Code": "XAF", + "Numeric Code": 950, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "ERITREA", + "Currency": "Nakfa", + "Alphabetic Code": "ERN", + "Numeric Code": 232, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ESTONIA", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ETHIOPIA", + "Currency": "Ethiopian Birr", + "Alphabetic Code": "ETB", + "Numeric Code": 230, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "EUROPEAN UNION", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "FALKLAND ISLANDS (THE) [MALVINAS]", + "Currency": "Falkland Islands Pound", + "Alphabetic Code": "FKP", + "Numeric Code": 238, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "FAROE ISLANDS (THE)", + "Currency": "Danish Krone", + "Alphabetic Code": "DKK", + "Numeric Code": 208, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "FIJI", + "Currency": "Fiji Dollar", + "Alphabetic Code": "FJD", + "Numeric Code": 242, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "FINLAND", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "FRANCE", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "FRENCH GUIANA", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "FRENCH POLYNESIA", + "Currency": "CFP Franc", + "Alphabetic Code": "XPF", + "Numeric Code": 953, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "FRENCH SOUTHERN TERRITORIES (THE)", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GABON", + "Currency": "CFA Franc BEAC", + "Alphabetic Code": "XAF", + "Numeric Code": 950, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "GAMBIA (THE)", + "Currency": "Dalasi", + "Alphabetic Code": "GMD", + "Numeric Code": 270, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GEORGIA", + "Currency": "Lari", + "Alphabetic Code": "GEL", + "Numeric Code": 981, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GERMANY", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GHANA", + "Currency": "Ghana Cedi", + "Alphabetic Code": "GHS", + "Numeric Code": 936, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GIBRALTAR", + "Currency": "Gibraltar Pound", + "Alphabetic Code": "GIP", + "Numeric Code": 292, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GREECE", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GREENLAND", + "Currency": "Danish Krone", + "Alphabetic Code": "DKK", + "Numeric Code": 208, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GRENADA", + "Currency": "East Caribbean Dollar", + "Alphabetic Code": "XCD", + "Numeric Code": 951, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GUADELOUPE", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GUAM", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GUATEMALA", + "Currency": "Quetzal", + "Alphabetic Code": "GTQ", + "Numeric Code": 320, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GUERNSEY", + "Currency": "Pound Sterling", + "Alphabetic Code": "GBP", + "Numeric Code": 826, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "GUINEA", + "Currency": "Guinea Franc", + "Alphabetic Code": "GNF", + "Numeric Code": 324, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "GUINEA-BISSAU", + "Currency": "CFA Franc BCEAO", + "Alphabetic Code": "XOF", + "Numeric Code": 952, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "GUYANA", + "Currency": "Guyana Dollar", + "Alphabetic Code": "GYD", + "Numeric Code": 328, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "HAITI", + "Currency": "Gourde", + "Alphabetic Code": "HTG", + "Numeric Code": 332, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "HAITI", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "HEARD ISLAND AND McDONALD ISLANDS", + "Currency": "Australian Dollar", + "Alphabetic Code": "AUD", + "Numeric Code": 36, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "HOLY SEE (THE)", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "HONDURAS", + "Currency": "Lempira", + "Alphabetic Code": "HNL", + "Numeric Code": 340, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "HONG KONG", + "Currency": "Hong Kong Dollar", + "Alphabetic Code": "HKD", + "Numeric Code": 344, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "HUNGARY", + "Currency": "Forint", + "Alphabetic Code": "HUF", + "Numeric Code": 348, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ICELAND", + "Currency": "Iceland Krona", + "Alphabetic Code": "ISK", + "Numeric Code": 352, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "INDIA", + "Currency": "Indian Rupee", + "Alphabetic Code": "INR", + "Numeric Code": 356, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "INDONESIA", + "Currency": "Rupiah", + "Alphabetic Code": "IDR", + "Numeric Code": 360, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "INTERNATIONAL MONETARY FUND (IMF)", + "Currency": "SDR (Special Drawing Right)", + "Alphabetic Code": "XDR", + "Numeric Code": 960, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "IRAN (ISLAMIC REPUBLIC OF)", + "Currency": "Iranian Rial", + "Alphabetic Code": "IRR", + "Numeric Code": 364, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "IRAQ", + "Currency": "Iraqi Dinar", + "Alphabetic Code": "IQD", + "Numeric Code": 368, + "Minor unit": 3, + "Fund": "", + "": "" + }, + { + "ENTITY": "IRELAND", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ISLE OF MAN", + "Currency": "Pound Sterling", + "Alphabetic Code": "GBP", + "Numeric Code": 826, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ISRAEL", + "Currency": "New Israeli Sheqel", + "Alphabetic Code": "ILS", + "Numeric Code": 376, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ITALY", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "JAMAICA", + "Currency": "Jamaican Dollar", + "Alphabetic Code": "JMD", + "Numeric Code": 388, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "JAPAN", + "Currency": "Yen", + "Alphabetic Code": "JPY", + "Numeric Code": 392, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "JERSEY", + "Currency": "Pound Sterling", + "Alphabetic Code": "GBP", + "Numeric Code": 826, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "JORDAN", + "Currency": "Jordanian Dinar", + "Alphabetic Code": "JOD", + "Numeric Code": 400, + "Minor unit": 3, + "Fund": "", + "": "" + }, + { + "ENTITY": "KAZAKHSTAN", + "Currency": "Tenge", + "Alphabetic Code": "KZT", + "Numeric Code": 398, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "KENYA", + "Currency": "Kenyan Shilling", + "Alphabetic Code": "KES", + "Numeric Code": 404, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "KIRIBATI", + "Currency": "Australian Dollar", + "Alphabetic Code": "AUD", + "Numeric Code": 36, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "KOREA (THE DEMOCRATIC PEOPLE’S REPUBLIC OF)", + "Currency": "North Korean Won", + "Alphabetic Code": "KPW", + "Numeric Code": 408, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "KOREA (THE REPUBLIC OF)", + "Currency": "Won", + "Alphabetic Code": "KRW", + "Numeric Code": 410, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "KUWAIT", + "Currency": "Kuwaiti Dinar", + "Alphabetic Code": "KWD", + "Numeric Code": 414, + "Minor unit": 3, + "Fund": "", + "": "" + }, + { + "ENTITY": "KYRGYZSTAN", + "Currency": "Som", + "Alphabetic Code": "KGS", + "Numeric Code": 417, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "LAO PEOPLE’S DEMOCRATIC REPUBLIC (THE)", + "Currency": "Kip", + "Alphabetic Code": "LAK", + "Numeric Code": 418, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "LATVIA", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "LEBANON", + "Currency": "Lebanese Pound", + "Alphabetic Code": "LBP", + "Numeric Code": 422, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "LESOTHO", + "Currency": "Loti", + "Alphabetic Code": "LSL", + "Numeric Code": 426, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "LESOTHO", + "Currency": "Rand", + "Alphabetic Code": "ZAR", + "Numeric Code": 710, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "LIBERIA", + "Currency": "Liberian Dollar", + "Alphabetic Code": "LRD", + "Numeric Code": 430, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "LIBYA", + "Currency": "Libyan Dinar", + "Alphabetic Code": "LYD", + "Numeric Code": 434, + "Minor unit": 3, + "Fund": "", + "": "" + }, + { + "ENTITY": "LIECHTENSTEIN", + "Currency": "Swiss Franc", + "Alphabetic Code": "CHF", + "Numeric Code": 756, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "LITHUANIA", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "LUXEMBOURG", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MACAO", + "Currency": "Pataca", + "Alphabetic Code": "MOP", + "Numeric Code": 446, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MACEDONIA (THE FORMER YUGOSLAV REPUBLIC OF)", + "Currency": "Denar", + "Alphabetic Code": "MKD", + "Numeric Code": 807, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MADAGASCAR", + "Currency": "Malagasy Ariary", + "Alphabetic Code": "MGA", + "Numeric Code": 969, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MALAWI", + "Currency": "Malawi Kwacha", + "Alphabetic Code": "MWK", + "Numeric Code": 454, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MALAYSIA", + "Currency": "Malaysian Ringgit", + "Alphabetic Code": "MYR", + "Numeric Code": 458, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MALDIVES", + "Currency": "Rufiyaa", + "Alphabetic Code": "MVR", + "Numeric Code": 462, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MALI", + "Currency": "CFA Franc BCEAO", + "Alphabetic Code": "XOF", + "Numeric Code": 952, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "MALTA", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MARSHALL ISLANDS (THE)", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MARTINIQUE", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MAURITANIA", + "Currency": "Ouguiya", + "Alphabetic Code": "MRO", + "Numeric Code": 478, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MAURITIUS", + "Currency": "Mauritius Rupee", + "Alphabetic Code": "MUR", + "Numeric Code": 480, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MAYOTTE", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MEMBER COUNTRIES OF THE AFRICAN DEVELOPMENT BANK GROUP", + "Currency": "ADB Unit of Account", + "Alphabetic Code": "XUA", + "Numeric Code": 965, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "MEXICO", + "Currency": "Mexican Peso", + "Alphabetic Code": "MXN", + "Numeric Code": 484, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MEXICO", + "Currency": "Mexican Unidad de Inversion (UDI)", + "Alphabetic Code": "MXV", + "Numeric Code": 979, + "Minor unit": 2, + "Fund": "TRUE", + "": "" + }, + { + "ENTITY": "MICRONESIA (FEDERATED STATES OF)", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MOLDOVA (THE REPUBLIC OF)", + "Currency": "Moldovan Leu", + "Alphabetic Code": "MDL", + "Numeric Code": 498, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MONACO", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MONGOLIA", + "Currency": "Tugrik", + "Alphabetic Code": "MNT", + "Numeric Code": 496, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MONTENEGRO", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MONTSERRAT", + "Currency": "East Caribbean Dollar", + "Alphabetic Code": "XCD", + "Numeric Code": 951, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MOROCCO", + "Currency": "Moroccan Dirham", + "Alphabetic Code": "MAD", + "Numeric Code": 504, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MOZAMBIQUE", + "Currency": "Mozambique Metical", + "Alphabetic Code": "MZN", + "Numeric Code": 943, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "MYANMAR", + "Currency": "Kyat", + "Alphabetic Code": "MMK", + "Numeric Code": 104, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NAMIBIA", + "Currency": "Namibia Dollar", + "Alphabetic Code": "NAD", + "Numeric Code": 516, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NAMIBIA", + "Currency": "Rand", + "Alphabetic Code": "ZAR", + "Numeric Code": 710, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NAURU", + "Currency": "Australian Dollar", + "Alphabetic Code": "AUD", + "Numeric Code": 36, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NEPAL", + "Currency": "Nepalese Rupee", + "Alphabetic Code": "NPR", + "Numeric Code": 524, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NETHERLANDS (THE)", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NEW CALEDONIA", + "Currency": "CFP Franc", + "Alphabetic Code": "XPF", + "Numeric Code": 953, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "NEW ZEALAND", + "Currency": "New Zealand Dollar", + "Alphabetic Code": "NZD", + "Numeric Code": 554, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NICARAGUA", + "Currency": "Cordoba Oro", + "Alphabetic Code": "NIO", + "Numeric Code": 558, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NIGER (THE)", + "Currency": "CFA Franc BCEAO", + "Alphabetic Code": "XOF", + "Numeric Code": 952, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "NIGERIA", + "Currency": "Naira", + "Alphabetic Code": "NGN", + "Numeric Code": 566, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NIUE", + "Currency": "New Zealand Dollar", + "Alphabetic Code": "NZD", + "Numeric Code": 554, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NORFOLK ISLAND", + "Currency": "Australian Dollar", + "Alphabetic Code": "AUD", + "Numeric Code": 36, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NORTHERN MARIANA ISLANDS (THE)", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "NORWAY", + "Currency": "Norwegian Krone", + "Alphabetic Code": "NOK", + "Numeric Code": 578, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "OMAN", + "Currency": "Rial Omani", + "Alphabetic Code": "OMR", + "Numeric Code": 512, + "Minor unit": 3, + "Fund": "", + "": "" + }, + { + "ENTITY": "PAKISTAN", + "Currency": "Pakistan Rupee", + "Alphabetic Code": "PKR", + "Numeric Code": 586, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "PALAU", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "PALESTINE, STATE OF", + "Currency": "No universal currency", + "Alphabetic Code": "", + "Numeric Code": "", + "Minor unit": "", + "Fund": "", + "": "" + }, + { + "ENTITY": "PANAMA", + "Currency": "Balboa", + "Alphabetic Code": "PAB", + "Numeric Code": 590, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "PANAMA", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "PAPUA NEW GUINEA", + "Currency": "Kina", + "Alphabetic Code": "PGK", + "Numeric Code": 598, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "PARAGUAY", + "Currency": "Guarani", + "Alphabetic Code": "PYG", + "Numeric Code": 600, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "PERU", + "Currency": "Sol", + "Alphabetic Code": "PEN", + "Numeric Code": 604, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "PHILIPPINES (THE)", + "Currency": "Philippine Peso", + "Alphabetic Code": "PHP", + "Numeric Code": 608, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "PITCAIRN", + "Currency": "New Zealand Dollar", + "Alphabetic Code": "NZD", + "Numeric Code": 554, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "POLAND", + "Currency": "Zloty", + "Alphabetic Code": "PLN", + "Numeric Code": 985, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "PORTUGAL", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "PUERTO RICO", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "QATAR", + "Currency": "Qatari Rial", + "Alphabetic Code": "QAR", + "Numeric Code": 634, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "RÉUNION", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ROMANIA", + "Currency": "Romanian Leu", + "Alphabetic Code": "RON", + "Numeric Code": 946, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "RUSSIAN FEDERATION (THE)", + "Currency": "Russian Ruble", + "Alphabetic Code": "RUB", + "Numeric Code": 643, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "RWANDA", + "Currency": "Rwanda Franc", + "Alphabetic Code": "RWF", + "Numeric Code": 646, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAINT BARTHÉLEMY", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA", + "Currency": "Saint Helena Pound", + "Alphabetic Code": "SHP", + "Numeric Code": 654, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAINT KITTS AND NEVIS", + "Currency": "East Caribbean Dollar", + "Alphabetic Code": "XCD", + "Numeric Code": 951, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAINT LUCIA", + "Currency": "East Caribbean Dollar", + "Alphabetic Code": "XCD", + "Numeric Code": 951, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAINT MARTIN (FRENCH PART)", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAINT PIERRE AND MIQUELON", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAINT VINCENT AND THE GRENADINES", + "Currency": "East Caribbean Dollar", + "Alphabetic Code": "XCD", + "Numeric Code": 951, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAMOA", + "Currency": "Tala", + "Alphabetic Code": "WST", + "Numeric Code": 882, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAN MARINO", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAO TOME AND PRINCIPE", + "Currency": "Dobra", + "Alphabetic Code": "STD", + "Numeric Code": 678, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SAUDI ARABIA", + "Currency": "Saudi Riyal", + "Alphabetic Code": "SAR", + "Numeric Code": 682, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SENEGAL", + "Currency": "CFA Franc BCEAO", + "Alphabetic Code": "XOF", + "Numeric Code": 952, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "SERBIA", + "Currency": "Serbian Dinar", + "Alphabetic Code": "RSD", + "Numeric Code": 941, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SEYCHELLES", + "Currency": "Seychelles Rupee", + "Alphabetic Code": "SCR", + "Numeric Code": 690, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SIERRA LEONE", + "Currency": "Leone", + "Alphabetic Code": "SLL", + "Numeric Code": 694, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SINGAPORE", + "Currency": "Singapore Dollar", + "Alphabetic Code": "SGD", + "Numeric Code": 702, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SINT MAARTEN (DUTCH PART)", + "Currency": "Netherlands Antillean Guilder", + "Alphabetic Code": "ANG", + "Numeric Code": 532, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SISTEMA UNITARIO DE COMPENSACION REGIONAL DE PAGOS \"SUCRE", + "Currency": "Sucre", + "Alphabetic Code": "XSU", + "Numeric Code": 994, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "SLOVAKIA", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SLOVENIA", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SOLOMON ISLANDS", + "Currency": "Solomon Islands Dollar", + "Alphabetic Code": "SBD", + "Numeric Code": 90, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SOMALIA", + "Currency": "Somali Shilling", + "Alphabetic Code": "SOS", + "Numeric Code": 706, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SOUTH AFRICA", + "Currency": "Rand", + "Alphabetic Code": "ZAR", + "Numeric Code": 710, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS", + "Currency": "No universal currency", + "Alphabetic Code": "", + "Numeric Code": "", + "Minor unit": "", + "Fund": "", + "": "" + }, + { + "ENTITY": "SOUTH SUDAN", + "Currency": "South Sudanese Pound", + "Alphabetic Code": "SSP", + "Numeric Code": 728, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SPAIN", + "Currency": "Euro", + "Alphabetic Code": "EUR", + "Numeric Code": 978, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SRI LANKA", + "Currency": "Sri Lanka Rupee", + "Alphabetic Code": "LKR", + "Numeric Code": 144, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SUDAN (THE)", + "Currency": "Sudanese Pound", + "Alphabetic Code": "SDG", + "Numeric Code": 938, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SURINAME", + "Currency": "Surinam Dollar", + "Alphabetic Code": "SRD", + "Numeric Code": 968, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SVALBARD AND JAN MAYEN", + "Currency": "Norwegian Krone", + "Alphabetic Code": "NOK", + "Numeric Code": 578, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SWAZILAND", + "Currency": "Lilangeni", + "Alphabetic Code": "SZL", + "Numeric Code": 748, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SWEDEN", + "Currency": "Swedish Krona", + "Alphabetic Code": "SEK", + "Numeric Code": 752, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SWITZERLAND", + "Currency": "Swiss Franc", + "Alphabetic Code": "CHF", + "Numeric Code": 756, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "SWITZERLAND", + "Currency": "WIR Euro", + "Alphabetic Code": "CHE", + "Numeric Code": 947, + "Minor unit": 2, + "Fund": "TRUE", + "": "" + }, + { + "ENTITY": "SWITZERLAND", + "Currency": "WIR Franc", + "Alphabetic Code": "CHW", + "Numeric Code": 948, + "Minor unit": 2, + "Fund": "TRUE", + "": "" + }, + { + "ENTITY": "SYRIAN ARAB REPUBLIC", + "Currency": "Syrian Pound", + "Alphabetic Code": "SYP", + "Numeric Code": 760, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TAIWAN (PROVINCE OF CHINA)", + "Currency": "New Taiwan Dollar", + "Alphabetic Code": "TWD", + "Numeric Code": 901, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TAJIKISTAN", + "Currency": "Somoni", + "Alphabetic Code": "TJS", + "Numeric Code": 972, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TANZANIA, UNITED REPUBLIC OF", + "Currency": "Tanzanian Shilling", + "Alphabetic Code": "TZS", + "Numeric Code": 834, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "THAILAND", + "Currency": "Baht", + "Alphabetic Code": "THB", + "Numeric Code": 764, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TIMOR-LESTE", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TOGO", + "Currency": "CFA Franc BCEAO", + "Alphabetic Code": "XOF", + "Numeric Code": 952, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "TOKELAU", + "Currency": "New Zealand Dollar", + "Alphabetic Code": "NZD", + "Numeric Code": 554, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TONGA", + "Currency": "Pa’anga", + "Alphabetic Code": "TOP", + "Numeric Code": 776, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TRINIDAD AND TOBAGO", + "Currency": "Trinidad and Tobago Dollar", + "Alphabetic Code": "TTD", + "Numeric Code": 780, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TUNISIA", + "Currency": "Tunisian Dinar", + "Alphabetic Code": "TND", + "Numeric Code": 788, + "Minor unit": 3, + "Fund": "", + "": "" + }, + { + "ENTITY": "TURKEY", + "Currency": "Turkish Lira", + "Alphabetic Code": "TRY", + "Numeric Code": 949, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TURKMENISTAN", + "Currency": "Turkmenistan New Manat", + "Alphabetic Code": "TMT", + "Numeric Code": 934, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TURKS AND CAICOS ISLANDS (THE)", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "TUVALU", + "Currency": "Australian Dollar", + "Alphabetic Code": "AUD", + "Numeric Code": 36, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "UGANDA", + "Currency": "Uganda Shilling", + "Alphabetic Code": "UGX", + "Numeric Code": 800, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "UKRAINE", + "Currency": "Hryvnia", + "Alphabetic Code": "UAH", + "Numeric Code": 980, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "UNITED ARAB EMIRATES (THE)", + "Currency": "UAE Dirham", + "Alphabetic Code": "AED", + "Numeric Code": 784, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND (THE)", + "Currency": "Pound Sterling", + "Alphabetic Code": "GBP", + "Numeric Code": 826, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "UNITED STATES MINOR OUTLYING ISLANDS (THE)", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "UNITED STATES OF AMERICA (THE)", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "UNITED STATES OF AMERICA (THE)", + "Currency": "US Dollar (Next day)", + "Alphabetic Code": "USN", + "Numeric Code": 997, + "Minor unit": 2, + "Fund": "TRUE", + "": "" + }, + { + "ENTITY": "URUGUAY", + "Currency": "Peso Uruguayo", + "Alphabetic Code": "UYU", + "Numeric Code": 858, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "URUGUAY", + "Currency": "Uruguay Peso en Unidades Indexadas (URUIURUI)", + "Alphabetic Code": "UYI", + "Numeric Code": 940, + "Minor unit": 0, + "Fund": "TRUE", + "": "" + }, + { + "ENTITY": "UZBEKISTAN", + "Currency": "Uzbekistan Sum", + "Alphabetic Code": "UZS", + "Numeric Code": 860, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "VANUATU", + "Currency": "Vatu", + "Alphabetic Code": "VUV", + "Numeric Code": 548, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "VENEZUELA (BOLIVARIAN REPUBLIC OF)", + "Currency": "Bolívar", + "Alphabetic Code": "VEF", + "Numeric Code": 937, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "VIET NAM", + "Currency": "Dong", + "Alphabetic Code": "VND", + "Numeric Code": 704, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "VIRGIN ISLANDS (BRITISH)", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "VIRGIN ISLANDS (U.S.)", + "Currency": "US Dollar", + "Alphabetic Code": "USD", + "Numeric Code": 840, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "WALLIS AND FUTUNA", + "Currency": "CFP Franc", + "Alphabetic Code": "XPF", + "Numeric Code": 953, + "Minor unit": 0, + "Fund": "", + "": "" + }, + { + "ENTITY": "WESTERN SAHARA", + "Currency": "Moroccan Dirham", + "Alphabetic Code": "MAD", + "Numeric Code": 504, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "YEMEN", + "Currency": "Yemeni Rial", + "Alphabetic Code": "YER", + "Numeric Code": 886, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ZAMBIA", + "Currency": "Zambian Kwacha", + "Alphabetic Code": "ZMW", + "Numeric Code": 967, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ZIMBABWE", + "Currency": "Zimbabwe Dollar", + "Alphabetic Code": "ZWL", + "Numeric Code": 932, + "Minor unit": 2, + "Fund": "", + "": "" + }, + { + "ENTITY": "ZZ01_Bond Markets Unit European_EURCO", + "Currency": "Bond Markets Unit European Composite Unit (EURCO)", + "Alphabetic Code": "XBA", + "Numeric Code": 955, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "ZZ02_Bond Markets Unit European_EMU-6", + "Currency": "Bond Markets Unit European Monetary Unit (E.M.U.-6)", + "Alphabetic Code": "XBB", + "Numeric Code": 956, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "ZZ03_Bond Markets Unit European_EUA-9", + "Currency": "Bond Markets Unit European Unit of Account 9 (E.U.A.-9)", + "Alphabetic Code": "XBC", + "Numeric Code": 957, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "ZZ04_Bond Markets Unit European_EUA-17", + "Currency": "Bond Markets Unit European Unit of Account 17 (E.U.A.-17)", + "Alphabetic Code": "XBD", + "Numeric Code": 958, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "ZZ06_Testing_Code", + "Currency": "Codes specifically reserved for testing purposes", + "Alphabetic Code": "XTS", + "Numeric Code": 963, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "ZZ07_No_Currency", + "Currency": "The codes assigned for transactions where no currency is involved", + "Alphabetic Code": "XXX", + "Numeric Code": 999, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "ZZ08_Gold", + "Currency": "Gold", + "Alphabetic Code": "XAU", + "Numeric Code": 959, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "ZZ09_Palladium", + "Currency": "Palladium", + "Alphabetic Code": "XPD", + "Numeric Code": 964, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "ZZ10_Platinum", + "Currency": "Platinum", + "Alphabetic Code": "XPT", + "Numeric Code": 962, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "ZZ11_Silver", + "Currency": "Silver", + "Alphabetic Code": "XAG", + "Numeric Code": 961, + "Minor unit": "N.A.", + "Fund": "", + "": "" + }, + { + "ENTITY": "", + "Currency": "", + "Alphabetic Code": "", + "Numeric Code": "", + "Minor unit": "", + "Fund": "", + "": "" + }, + { + "ENTITY": "", + "Currency": "", + "Alphabetic Code": "", + "Numeric Code": "", + "Minor unit": "", + "Fund": "", + "": "" + }, + { + "ENTITY": "", + "Currency": "", + "Alphabetic Code": "", + "Numeric Code": "", + "Minor unit": "", + "Fund": "", + "": "" + }, + { + "ENTITY": "", + "Currency": "", + "Alphabetic Code": "", + "Numeric Code": "", + "Minor unit": "", + "Fund": "", + "": "" + }, + { + "ENTITY": "", + "Currency": "", + "Alphabetic Code": "", + "Numeric Code": "", + "Minor unit": "", + "Fund": "", + "": "" + }, + { + "ENTITY": "", + "Currency": "", + "Alphabetic Code": "", + "Numeric Code": "", + "Minor unit": "", + "Fund": "", + "": "" + }, + { + "ENTITY": "", + "Currency": "", + "Alphabetic Code": "", + "Numeric Code": "", + "Minor unit": "", + "Fund": "", + "": "" + } +] diff --git a/languages.json b/languages.json new file mode 100644 index 00000000..878c8dc4 --- /dev/null +++ b/languages.json @@ -0,0 +1,253 @@ +{ +"attribute": {"name":0, "nativeName":1}, +"rtl": {"ar":1,"dv":1,"fa":1,"ha":1,"he":1,"ks":1,"ku":1,"ps":1,"ur":1,"yi":1}, +"lang": { +"aa":["Afar","Afar"], +"ab":["Abkhazian","Аҧсуа"], +"af":["Afrikaans","Afrikaans"], +"ak":["Akan","Akana"], +"am":["Amharic","አማርኛ"], +"an":["Aragonese","Aragonés"], +"ar":["Arabic","العربية"], +"as":["Assamese","অসমীয়া"], +"av":["Avar","Авар"], +"ay":["Aymara","Aymar"], +"az":["Azerbaijani","Azərbaycanca / آذربايجان"], +"ba":["Bashkir","Башҡорт"], +"be":["Belarusian","Беларуская"], +"bg":["Bulgarian","Български"], +"bh":["Bihari","भोजपुरी"], +"bi":["Bislama","Bislama"], +"bm":["Bambara","Bamanankan"], +"bn":["Bengali","বাংলা"], +"bo":["Tibetan","བོད་ཡིག / Bod skad"], +"br":["Breton","Brezhoneg"], +"bs":["Bosnian","Bosanski"], +"ca":["Catalan","Català"], +"ce":["Chechen","Нохчийн"], +"ch":["Chamorro","Chamoru"], +"co":["Corsican","Corsu"], +"cr":["Cree","Nehiyaw"], +"cs":["Czech","Česky"], +"cu":["Old Church Slavonic / Old Bulgarian","словѣньскъ / slověnĭskŭ"], +"cv":["Chuvash","Чăваш"], +"cy":["Welsh","Cymraeg"], +"da":["Danish","Dansk"], +"de":["German","Deutsch"], +"dv":["Divehi","ދިވެހިބަސް"], +"dz":["Dzongkha","ཇོང་ཁ"], +"ee":["Ewe","Ɛʋɛ"], +"el":["Greek","Ελληνικά"], +"en":["English","English"], +"eo":["Esperanto","Esperanto"], +"es":["Spanish","Español"], +"et":["Estonian","Eesti"], +"eu":["Basque","Euskara"], +"fa":["Persian","فارسی"], +"ff":["Peul","Fulfulde"], +"fi":["Finnish","Suomi"], +"fj":["Fijian","Na Vosa Vakaviti"], +"fo":["Faroese","Føroyskt"], +"fr":["French","Français"], +"fy":["West Frisian","Frysk"], +"ga":["Irish","Gaeilge"], +"gd":["Scottish Gaelic","Gàidhlig"], +"gl":["Galician","Galego"], +"gn":["Guarani","Avañe'ẽ"], +"gu":["Gujarati","ગુજરાતી"], +"gv":["Manx","Gaelg"], +"ha":["Hausa","هَوُسَ"], +"he":["Hebrew","עברית"], +"hi":["Hindi","हिन्दी"], +"ho":["Hiri Motu","Hiri Motu"], +"hr":["Croatian","Hrvatski"], +"ht":["Haitian","Krèyol ayisyen"], +"hu":["Hungarian","Magyar"], +"hy":["Armenian","Հայերեն"], +"hz":["Herero","Otsiherero"], +"ia":["Interlingua","Interlingua"], +"id":["Indonesian","Bahasa Indonesia"], +"ie":["Interlingue","Interlingue"], +"ig":["Igbo","Igbo"], +"ii":["Sichuan Yi","ꆇꉙ / 四川彝语"], +"ik":["Inupiak","Iñupiak"], +"io":["Ido","Ido"], +"is":["Icelandic","Íslenska"], +"it":["Italian","Italiano"], +"iu":["Inuktitut","ᐃᓄᒃᑎᑐᑦ"], +"ja":["Japanese","日本語"], +"jv":["Javanese","Basa Jawa"], +"ka":["Georgian","ქართული"], +"kg":["Kongo","KiKongo"], +"ki":["Kikuyu","Gĩkũyũ"], +"kj":["Kuanyama","Kuanyama"], +"kk":["Kazakh","Қазақша"], +"kl":["Greenlandic","Kalaallisut"], +"km":["Cambodian","ភាសាខ្មែរ"], +"kn":["Kannada","ಕನ್ನಡ"], +"ko":["Korean","한국어"], +"kr":["Kanuri","Kanuri"], +"ks":["Kashmiri","कश्मीरी / كشميري"], +"ku":["Kurdish","Kurdî / كوردی"], +"kv":["Komi","Коми"], +"kw":["Cornish","Kernewek"], +"ky":["Kirghiz","Kırgızca / Кыргызча"], +"la":["Latin","Latina"], +"lb":["Luxembourgish","Lëtzebuergesch"], +"lg":["Ganda","Luganda"], +"li":["Limburgian","Limburgs"], +"ln":["Lingala","Lingála"], +"lo":["Laotian","ລາວ / Pha xa lao"], +"lt":["Lithuanian","Lietuvių"], +"lv":["Latvian","Latviešu"], +"mg":["Malagasy","Malagasy"], +"mh":["Marshallese","Kajin Majel / Ebon"], +"mi":["Maori","Māori"], +"mk":["Macedonian","Македонски"], +"ml":["Malayalam","മലയാളം"], +"mn":["Mongolian","Монгол"], +"mo":["Moldovan","Moldovenească"], +"mr":["Marathi","मराठी"], +"ms":["Malay","Bahasa Melayu"], +"mt":["Maltese","bil-Malti"], +"my":["Burmese","Myanmasa"], +"na":["Nauruan","Dorerin Naoero"], +"nd":["North Ndebele","Sindebele"], +"ne":["Nepali","नेपाली"], +"ng":["Ndonga","Oshiwambo"], +"nl":["Dutch","Nederlands"], +"nn":["Norwegian Nynorsk","Norsk (nynorsk)"], +"no":["Norwegian","Norsk (bokmål / riksmål)"], +"nr":["South Ndebele","isiNdebele"], +"nv":["Navajo","Diné bizaad"], +"ny":["Chichewa","Chi-Chewa"], +"oc":["Occitan","Occitan"], +"oj":["Ojibwa","ᐊᓂᔑᓈᐯᒧᐎᓐ / Anishinaabemowin"], +"om":["Oromo","Oromoo"], +"or":["Oriya","ଓଡ଼ିଆ"], +"os":["Ossetian / Ossetic","Иронау"], +"pa":["Panjabi / Punjabi","ਪੰਜਾਬੀ / पंजाबी / پنجابي"], +"pi":["Pali","Pāli / पाऴि"], +"pl":["Polish","Polski"], +"ps":["Pashto","پښتو"], +"pt":["Portuguese","Português"], +"qu":["Quechua","Runa Simi"], +"rm":["Raeto Romance","Rumantsch"], +"rn":["Kirundi","Kirundi"], +"ro":["Romanian","Română"], +"ru":["Russian","Русский"], +"rw":["Rwandi","Kinyarwandi"], +"sa":["Sanskrit","संस्कृतम्"], +"sc":["Sardinian","Sardu"], +"sd":["Sindhi","सिनधि"], +"se":["Northern Sami","Sámegiella"], +"sg":["Sango","Sängö"], +"sh":["Serbo-Croatian","Srpskohrvatski / Српскохрватски"], +"si":["Sinhalese","සිංහල"], +"sk":["Slovak","Slovenčina"], +"sl":["Slovenian","Slovenščina"], +"sm":["Samoan","Gagana Samoa"], +"sn":["Shona","chiShona"], +"so":["Somalia","Soomaaliga"], +"sq":["Albanian","Shqip"], +"sr":["Serbian","Српски"], +"ss":["Swati","SiSwati"], +"st":["Southern Sotho","Sesotho"], +"su":["Sundanese","Basa Sunda"], +"sv":["Swedish","Svenska"], +"sw":["Swahili","Kiswahili"], +"ta":["Tamil","தமிழ்"], +"te":["Telugu","తెలుగు"], +"tg":["Tajik","Тоҷикӣ"], +"th":["Thai","ไทย / Phasa Thai"], +"ti":["Tigrinya","ትግርኛ"], +"tk":["Turkmen","Туркмен / تركمن"], +"tl":["Tagalog / Filipino","Tagalog"], +"tn":["Tswana","Setswana"], +"to":["Tonga","Lea Faka-Tonga"], +"tr":["Turkish","Türkçe"], +"ts":["Tsonga","Xitsonga"], +"tt":["Tatar","Tatarça"], +"tw":["Twi","Twi"], +"ty":["Tahitian","Reo Mā`ohi"], +"ug":["Uyghur","Uyƣurqə / ئۇيغۇرچە"], +"uk":["Ukrainian","Українська"], +"ur":["Urdu","اردو"], +"uz":["Uzbek","Ўзбек"], +"ve":["Venda","Tshivenḓa"], +"vi":["Vietnamese","Tiếng Việt"], +"vo":["Volapük","Volapük"], +"wa":["Walloon","Walon"], +"wo":["Wolof","Wollof"], +"xh":["Xhosa","isiXhosa"], +"yi":["Yiddish","ייִדיש"], +"yo":["Yoruba","Yorùbá"], +"za":["Zhuang","Cuengh / Tôô / 壮语"], +"zh":["Chinese","中文"], +"zu":["Zulu","isiZulu"] +}, +"supported": [ + "en-US", + "en-CA", + "fr-QC", + "ach-UG", + "af-ZA", + "ar-SA", + "bg-BG", + "ca-ES", + "cs-CZ", + "cy-GB", + "de-DE", + "de-AT", + "de-CH", + "da-DK", + "el-GR", + "en-GB", + "en-AU", + "en-HK", + "en-IE", + "en-NZ", + "en-PR", + "es-ES", + "es-MX", + "et-EE", + "fi-FI", + "fr-FR", + "fr-CH", + "fur-IT", + "ga-IE", + "gd-GB", + "he-IL", + "hr-HR", + "hu-HU", + "id-ID", + "it-CH", + "it-IT", + "ja-JP", + "ko-KR", + "ky-KG", + "lt-LT", + "nb-NO", + "nl-BE", + "nl-NL", + "pt-PT", + "pt-BR", + "pl-PL", + "ro-RO", + "ru-RU", + "sco-GB", + "sh-HR", + "sk-SK", + "sl-SI", + "sr-SP", + "sv-SE", + "th-TH", + "tr-TR", + "uk-UA", + "vi-VN", + "zh-CN", + "zh-HK", + "zh-SG", + "zh-TW" +] +} diff --git a/lib/admin/accounts.js b/lib/admin/accounts.js new file mode 100644 index 00000000..163a5435 --- /dev/null +++ b/lib/admin/accounts.js @@ -0,0 +1,123 @@ +const R = require('ramda') +const fs = require('fs') +const path = require('path') + +const options = require('../options') +const db = require('../db') + +const accountRoot = options.pluginPath +const schemas = {} + +function fetchSchemas () { + const files = fs.readdirSync(accountRoot) + + files.forEach(file => { + if (file.indexOf('lamassu-') !== 0) return + + try { + const schema = JSON.parse(fs.readFileSync(path.resolve(accountRoot, file, 'schema.json'))) + schemas[schema.code] = schema + } catch (_) { + } + }) +} + +function fetchAccounts () { + return db.oneOrNone('select data from user_config where type=$1', ['accounts']) + .then(row => { + return row + ? Promise.resolve(row.data.accounts) + : db.none('insert into user_config (type, data) values ($1, $2)', ['accounts', {accounts: []}]) + .then(fetchAccounts) + }) +} + +function selectedAccounts () { + const mapAccount = v => v.fieldLocator.fieldType === 'account' && + v.fieldValue.value + + const mapSchema = code => schemas[code] + return db.oneOrNone('select data from user_config where type=$1', ['config']) + .then(row => row && row.data) + .then(data => { + if (!data) return [] + + const accountCodes = R.uniq(data.config.map(mapAccount) + .filter(R.identity)) + + return R.sortBy(R.prop('display'), accountCodes.map(mapSchema) + .filter(R.identity)) + }) +} + +function fetchAccountSchema (account) { + return schemas[account] +} + +function mergeAccount (oldAccount, newAccount) { + if (!newAccount) return oldAccount + + const newFields = newAccount.fields + + const updateWithData = oldField => { + const newField = R.find(r => r.code === oldField.code, newFields) + const newValue = newField ? newField.value : null + return R.assoc('value', newValue, oldField) + } + + const updatedFields = oldAccount.fields.map(updateWithData) + + return R.assoc('fields', updatedFields, oldAccount) +} + +function getAccounts (accountCode) { + const schema = fetchAccountSchema(accountCode) + if (!schema) return Promise.reject(new Error('No schema for: ' + accountCode)) + + return fetchAccounts() + .then(accounts => { + if (R.isEmpty(accounts)) return [schema] + const account = R.find(r => r.code === accountCode, accounts) + const mergedAccount = mergeAccount(schema, account) + + return updateAccounts(mergedAccount, accounts) + }) +} + +function getAccount (accountCode) { + return getAccounts(accountCode) + .then(accounts => R.find(r => r.code === accountCode, accounts)) +} + +function save (accounts) { + return db.none('update user_config set data=$1 where type=$2', [{accounts: accounts}, 'accounts']) +} + +function updateAccounts (newAccount, accounts) { + const accountCode = newAccount.code + const isPresent = R.any(R.propEq('code', accountCode), accounts) + const updateAccount = r => r.code === accountCode + ? newAccount + : r + + return isPresent + ? R.map(updateAccount, accounts) + : R.append(newAccount, accounts) +} + +function updateAccount (account) { + return getAccounts(account.code) + .then(accounts => { + const merged = mergeAccount(R.find(R.propEq('code', account.code), accounts), account) + return save(updateAccounts(merged, accounts)) + }) + .then(() => getAccount(account.code)) +} + +fetchSchemas() + +module.exports = { + selectedAccounts, + getAccount, + updateAccount +} diff --git a/lib/admin/config.js b/lib/admin/config.js new file mode 100644 index 00000000..a9cce79a --- /dev/null +++ b/lib/admin/config.js @@ -0,0 +1,262 @@ +const pify = require('pify') +const fs = pify(require('fs')) +const path = require('path') +const R = require('ramda') + +const currencies = require('../../currencies.json') +const languageRec = require('../../languages.json') + +const db = require('../db') +const options = require('../options') +const configManager = require('../config-manager') + +const machines = require('./machines') + +function fetchSchema () { + const schemaPath = path.resolve(options.lamassuServerPath, 'lamassu-schema.json') + + return fs.readFile(schemaPath) + .then(JSON.parse) +} + +function dbFetchConfig () { + return db.oneOrNone('select data from user_config where type=$1', ['config']) + .then(row => row && row.data) +} + +function allScopes (cryptoScopes, machineScopes) { + const scopes = [] + cryptoScopes.forEach(c => { + machineScopes.forEach(m => scopes.push([c, m])) + }) + + return scopes +} + +function allCryptoScopes (cryptos, cryptoScope) { + const cryptoScopes = [] + + if (cryptoScope === 'global' || cryptoScope === 'both') cryptoScopes.push('global') + if (cryptoScope === 'specific' || cryptoScope === 'both') cryptos.forEach(r => cryptoScopes.push(r)) + + return cryptoScopes +} + +function allMachineScopes (machineList, machineScope) { + const machineScopes = [] + + if (machineScope === 'global' || machineScope === 'both') machineScopes.push('global') + if (machineScope === 'specific' || machineScope === 'both') machineList.forEach(r => machineScopes.push(r)) + + return machineScopes +} + +function satisfiesRequire (config, cryptos, machineList, field, refFields) { + const fieldCode = field.code + + const scopes = allScopes( + allCryptoScopes(cryptos, field.cryptoScope), + allMachineScopes(machineList, field.machineScope) + ) + + return scopes.every(scope => { + const isEnabled = () => refFields.some(refField => { + return isScopeEnabled(config, cryptos, machineList, refField, scope) + }) + + const isBlank = () => R.isNil(configManager.scopedValue(scope[0], scope[1], fieldCode, config)) + const isRequired = refFields.length === 0 || isEnabled() + + return isRequired ? !isBlank() : true + }) +} + +function isScopeEnabled (config, cryptos, machineList, refField, scope) { + const [cryptoScope, machineScope] = scope + const candidateCryptoScopes = cryptoScope === 'global' + ? allCryptoScopes(cryptos, refField.cryptoScope) + : [cryptoScope] + + const candidateMachineScopes = machineScope === 'global' + ? allMachineScopes(machineList, refField.machineScope) + : [ machineScope ] + + const allRefCandidateScopes = allScopes(candidateCryptoScopes, candidateMachineScopes) + const getFallbackValue = scope => configManager.scopedValue(scope[0], scope[1], refField.code, config) + const values = allRefCandidateScopes.map(getFallbackValue) + + return values.some(r => r) +} + +function getCryptos (config, machineList) { + const scopes = allScopes(['global'], allMachineScopes(machineList, 'both')) + const scoped = scope => configManager.scopedValue(scope[0], scope[1], 'cryptoCurrencies', config) + return scopes.reduce((acc, scope) => R.union(acc, scoped(scope)), []) +} + +function getGroup (schema, fieldCode) { + return schema.groups.find(group => group.fields.find(R.equals(fieldCode))) +} + +function getField (schema, group, fieldCode) { + if (!group) group = getGroup(schema, fieldCode) + const field = schema.fields.find(r => r.code === fieldCode) + return R.merge(R.pick(['cryptoScope', 'machineScope'], group), field) +} + +const fetchMachines = () => machines.getMachines() +.then(machineList => machineList.map(r => r.deviceId)) + +function validateConfig () { + return Promise.all([fetchSchema(), dbFetchConfig(), fetchMachines()]) + .then(([schema, configRec, machineList]) => { + const config = configRec ? configRec.config : [] + const cryptos = getCryptos(config, machineList) + return schema.groups.filter(group => { + return group.fields.some(fieldCode => { + const field = getField(schema, group, fieldCode) + if (!field.fieldValidation.find(r => r.code === 'required')) return false + + const refFields = (field.enabledIf || []).map(R.curry(getField)(schema, null)) + return !satisfiesRequire(config, cryptos, machineList, field, refFields) + }) + }) + }) + .then(arr => arr.map(r => r.code)) +} + +function fetchConfigGroup (code) { + const fieldLocatorCodeEq = R.pathEq(['fieldLocator', 'code']) + return Promise.all([fetchSchema(), fetchData(), dbFetchConfig(), fetchMachines()]) + .then(([schema, data, config, machineList]) => { + const configValues = config ? config.config : [] + const groupSchema = schema.groups.find(r => r.code === code) + + if (!groupSchema) throw new Error('No such group schema: ' + code) + + const schemaFields = groupSchema.fields + .map(R.curry(getField)(schema, groupSchema)) + + const candidateFields = [ + schemaFields.map(R.prop('requiredIf')), + schemaFields.map(R.prop('enabledIf')), + groupSchema.fields + ] + const configFields = R.uniq(R.flatten(candidateFields)).filter(R.identity) + + const values = configFields + .reduce((acc, configField) => acc.concat(configValues.filter(fieldLocatorCodeEq(configField))), []) + + groupSchema.fields = undefined + groupSchema.entries = schemaFields + + return { + schema: groupSchema, + values: values, + selectedCryptos: getCryptos(config.config, machineList), + data: data + } + }) +} + +function massageCurrencies (currencies) { + const convert = r => ({ + code: r['Alphabetic Code'], + display: r['Currency'] + }) + const top5Codes = ['USD', 'EUR', 'GBP', 'CAD', 'AUD'] + const mapped = R.map(convert, currencies) + const codeToRec = code => R.find(R.propEq('code', code), mapped) + const top5 = R.map(codeToRec, top5Codes) + const raw = R.uniqBy(R.prop('code'), R.concat(top5, mapped)) + return raw.filter(r => r.code[0] !== 'X' && r.display.indexOf('(') === -1) +} + +const mapLanguage = lang => { + const arr = lang.split('-') + const code = arr[0] + const country = arr[1] + const langNameArr = languageRec.lang[code] + if (!langNameArr) return null + const langName = langNameArr[0] + if (!country) return {code: lang, display: langName} + return {code: lang, display: `${langName} [${country}]`} +} + +const supportedLanguages = languageRec.supported +const languages = supportedLanguages.map(mapLanguage).filter(r => r) + +function fetchData () { + return machines.getMachines() + .then(machineList => ({ + currencies: massageCurrencies(currencies), + cryptoCurrencies: [{crypto: 'BTC', display: 'Bitcoin'}, {crypto: 'ETH', display: 'Ethereum'}], + languages: languages, + accounts: [ + {code: 'bitpay', display: 'Bitpay', class: 'ticker', cryptos: ['BTC']}, + {code: 'kraken', display: 'Kraken', class: 'ticker', cryptos: ['BTC', 'ETH']}, + {code: 'bitstamp', display: 'Bitstamp', class: 'ticker', cryptos: ['BTC']}, + {code: 'coinbase', display: 'Coinbase', class: 'ticker', cryptos: ['BTC', 'ETH']}, + {code: 'bitcoind', display: 'bitcoind', class: 'wallet', cryptos: ['BTC']}, + {code: 'bitgo', display: 'BitGo', class: 'wallet', cryptos: ['BTC']}, + {code: 'geth', display: 'geth', class: 'wallet', cryptos: ['ETH']}, + {code: 'mock-wallet', display: 'Mock wallet', class: 'wallet', cryptos: ['BTC', 'ETH']}, + {code: 'mock-sms', display: 'Mock SMS', class: 'sms'}, + {code: 'mock-id-verify', display: 'Mock ID verifier', class: 'idVerifier'}, + {code: 'twilio', display: 'Twilio', class: 'sms'}, + {code: 'mailjet', display: 'Mailjet', class: 'email'} + ], + machines: machineList.map(machine => ({machine: machine.deviceId, display: machine.name})) + })) +} + +function dbSaveConfig (config) { + return db.none('update user_config set data=$1 where type=$2', [config, 'config']) +} + +function saveConfigGroup (results) { + return dbFetchConfig() + .then(config => { + return config + ? Promise.resolve(config) + : db.none('insert into user_config (type, data) values ($1, $2)', ['config', {config: []}]) + .then(dbFetchConfig) + }) + .then(config => { + const oldValues = config.config + + results.values.forEach(newValue => { + const oldValueIndex = oldValues + .findIndex(old => old.fieldLocator.code === newValue.fieldLocator.code && + old.fieldLocator.fieldScope.crypto === newValue.fieldLocator.fieldScope.crypto && + old.fieldLocator.fieldScope.machine === newValue.fieldLocator.fieldScope.machine + ) + + const existingValue = oldValueIndex > -1 && + oldValues[oldValueIndex] + + if (existingValue) { + // Delete value record + if (R.isNil(newValue.fieldValue)) { + oldValues.splice(oldValueIndex, 1) + return + } + + existingValue.fieldValue = newValue.fieldValue + return + } + + if (!R.isNil(newValue.fieldValue)) oldValues.push(newValue) + }) + + return dbSaveConfig(config) + .then(() => fetchConfigGroup(results.groupCode)) + }) + .catch(e => console.error(e.stack)) +} + +module.exports = { + fetchConfigGroup, + saveConfigGroup, + validateConfig +} diff --git a/lib/admin/login.js b/lib/admin/login.js new file mode 100644 index 00000000..5d3b6444 --- /dev/null +++ b/lib/admin/login.js @@ -0,0 +1,48 @@ +const crypto = require('crypto') + +const db = require('../db') + +function generateOTP (name) { + const otp = crypto.randomBytes(32).toString('hex') + + const sql = 'insert into one_time_passes (token, name) values ($1, $2)' + + return db.none(sql, [otp, name]) + .then(() => otp) +} + +function validateOTP (otp) { + const sql = `delete from one_time_passes + where token=$1 + returning name, created < now() - interval '1 hour' as expired` + + return db.one(sql, [otp]) + .then(r => ({success: !r.expired, expired: r.expired, name: r.name})) + .catch(() => ({success: false, expired: false})) +} + +function register (otp) { + return validateOTP(otp) + .then(r => { + if (!r.success) return r + + const token = crypto.randomBytes(32).toString('hex') + const sql = 'insert into user_tokens (token, name) values ($1, $2)' + + return db.none(sql, [token, r.name]) + .then(() => ({success: true, token: token})) + }) + .catch(() => ({success: false, expired: false})) +} + +function authenticate (token) { + const sql = 'select token from user_tokens where token=$1' + + return db.one(sql, [token]).then(() => true).catch(() => false) +} + +module.exports = { + generateOTP, + register, + authenticate +} diff --git a/lib/admin/machines.js b/lib/admin/machines.js new file mode 100644 index 00000000..672d30c9 --- /dev/null +++ b/lib/admin/machines.js @@ -0,0 +1,26 @@ +const db = require('../db') + +function getMachines () { + return db.any('select * from devices where display=TRUE order by name') + .then(rr => rr.map(r => ({ + deviceId: r.device_id, + name: r.name, + cashbox: r.cashbox, + cassette1: r.cassette1, + cassette2: r.cassette2, + paired: r.paired + }))) +} + +function resetCashOutBills (rec) { + const sql = 'update devices set cassette1=$1, cassette2=$2 where device_id=$3' + return db.none(sql, [rec.cassettes[0], rec.cassettes[1], rec.deviceId]) +} + +function setMachine (rec) { + switch (rec.action) { + case 'resetCashOutBills': return resetCashOutBills(rec) + } +} + +module.exports = {getMachines, setMachine} diff --git a/lib/admin/pairing.js b/lib/admin/pairing.js new file mode 100644 index 00000000..d08e6508 --- /dev/null +++ b/lib/admin/pairing.js @@ -0,0 +1,32 @@ +const fs = require('fs') +const pify = require('pify') +const readFile = pify(fs.readFile) +const crypto = require('crypto') + +const options = require('../options') +const db = require('../db') + +function unpair (deviceId) { + const sql = 'update devices set paired=FALSE where device_id=$1' + + return db.none(sql, [deviceId]) +} + +function totem (hostname, name) { + const caPath = options.caPath + + return readFile(caPath) + .then(data => { + const caHash = crypto.createHash('sha256').update(data).digest() + const token = crypto.randomBytes(32) + const hexToken = token.toString('hex') + const caHexToken = crypto.createHash('sha256').update(hexToken).digest('hex') + const buf = Buffer.concat([caHash, token, Buffer.from(hostname)]) + const sql = 'insert into pairing_tokens (token, name) values ($1, $3), ($2, $3)' + + return db.none(sql, [hexToken, caHexToken, name]) + .then(() => buf.toString('base64')) + }) +} + +module.exports = {totem, unpair} diff --git a/lib/admin/server.js b/lib/admin/server.js new file mode 100644 index 00000000..6f37b9dd --- /dev/null +++ b/lib/admin/server.js @@ -0,0 +1,26 @@ +const moment = require('moment') + +const db = require('../db') + +const CONSIDERED_UP = 30000 + +function status () { + const sql = `select extract(epoch from (now() - created)) as age + from server_events + where event_type=$1 + order by created desc + limit 1` + + return db.oneOrNone(sql, ['ping']) + .then(row => { + if (!row) return {up: false, lastPing: null} + + const age = moment.duration(row.age, 'seconds') + const up = age.asMilliseconds() < CONSIDERED_UP + const lastPing = age.humanize() + + return {up, lastPing} + }) +} + +module.exports = {status} diff --git a/lib/admin/transactions.js b/lib/admin/transactions.js new file mode 100644 index 00000000..e2f613c8 --- /dev/null +++ b/lib/admin/transactions.js @@ -0,0 +1,25 @@ +const _ = require('lodash/fp') + +const db = require('../db') + +const NUM_RESULTS = 20 + +function batch () { + const camelize = _.mapKeys(_.camelCase) + const packager = _.flow(_.flatten, _.orderBy(_.property('created'), ['desc']), _.take(NUM_RESULTS), _.map(camelize)) + + const cashInSql = `select 'cashIn' as tx_class, devices.name as machine_name, cash_in_txs.* + from cash_in_txs, devices + where devices.device_id=cash_in_txs.device_id + order by created desc limit $1` + + const cashOutSql = `select 'cashOut' as tx_class, devices.name as machine_name, cash_out_txs.* + from cash_out_txs, devices + where devices.device_id=cash_out_txs.device_id + order by created desc limit $1` + + return Promise.all([db.any(cashInSql, [NUM_RESULTS]), db.any(cashOutSql, [NUM_RESULTS])]) + .then(packager) +} + +module.exports = {batch} diff --git a/lib/config-manager.js b/lib/config-manager.js index 33a73c35..35a656a6 100644 --- a/lib/config-manager.js +++ b/lib/config-manager.js @@ -1,10 +1,11 @@ -const R = require('ramda') +const _ = require('lodash/fp') module.exports = { unscoped, cryptoScoped, machineScoped, - scoped + scoped, + scopedValue } function matchesValue (crypto, machine, instance) { @@ -13,7 +14,7 @@ function matchesValue (crypto, machine, instance) { } function permutations (crypto, machine) { - return R.uniq([ + return _.uniq([ [crypto, machine], [crypto, 'global'], ['global', machine], @@ -22,21 +23,26 @@ function permutations (crypto, machine) { } function fallbackValue (crypto, machine, instances) { - const notNil = R.pipe(R.isNil, R.not) - const pickValue = arr => R.find(instance => matchesValue(arr[0], arr[1], instance), instances) - const fallbackRec = R.find(notNil, R.map(pickValue, permutations(crypto, machine))) + const notNil = _.negate(_.isNil) + const pickValue = arr => _.find(instance => matchesValue(arr[0], arr[1], instance), instances) + const fallbackRec = _.find(notNil, _.map(pickValue, permutations(crypto, machine))) return fallbackRec && fallbackRec.fieldValue.value } +function scopedValue (crypto, machine, fieldCode, config) { + const allScopes = config.filter(_.pathEq(['fieldLocator', 'code'], fieldCode)) + + return fallbackValue(crypto, machine, allScopes) +} + function generalScoped (crypto, machine, config) { - const scopedValue = (key, instances) => - fallbackValue(crypto, machine, instances) + const localScopedValue = key => + scopedValue(crypto, machine, key, config) - const allScopes = key => config.filter(R.pathEq(['fieldLocator', 'code'], key)) - const keys = R.uniq(R.map(r => r.fieldLocator.code, config)) - const keyedValues = keys.map(key => scopedValue(key, allScopes(key))) + const keys = _.uniq(_.map(r => r.fieldLocator.code, config)) + const keyedValues = keys.map(localScopedValue) - return R.zipObj(keys, keyedValues) + return _.zipObject(keys, keyedValues) } function machineScoped (machine, config) { diff --git a/lib/plugins.js b/lib/plugins.js index a2fa6ed9..f398cf82 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -397,6 +397,7 @@ function executeTrades () { const fiatCode = config.fiatCurrency const cryptoCodes = config.cryptoCurrencies + console.log('DEBUG99: %j', config) return cryptoCodes.map(cryptoCode => ({fiatCode, cryptoCode})) }) diff --git a/package.json b/package.json index 837eaa27..0c82fc7d 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,12 @@ "ramda": "^0.22.1", "reoccur": "^1.0.0", "uuid": "^3.0.0", - "winston": "^2.3.0" + "winston": "^2.3.0", + "cookie-parser": "^1.4.3", + "got": "^6.6.3", + "lodash": "^4.17.2", + "moment": "^2.17.0", + "serve-static": "^1.11.1" }, "repository": { "type": "git", @@ -43,6 +48,9 @@ "bin": { "lamassu-server": "./bin/lamassu-server", "lamassu-migrate": "./bin/lamassu-migrate", + "lamassu-register": "./bin/lamassu-register", + "lamassu-domain": "./bin/lamassu-domain", + "lamassu-admin-server": "./bin/lamassu-admin-server", "hkdf": "./bin/hkdf" }, "scripts": {}, diff --git a/tools/currencies.js b/tools/currencies.js new file mode 100644 index 00000000..9acf407d --- /dev/null +++ b/tools/currencies.js @@ -0,0 +1,24 @@ +// Pull latest from: http://www.currency-iso.org/en/home/tables/table-a1.html +// Convert to JSON at: http://www.csvjson.com/csv2json + +const R = require('ramda') +const currencies = require('../currencies.json') + +function goodCurrency (currency) { + const code = currency.code + return code.length === 3 && code[0] !== 'X' +} + +function simplify (currency) { + return { + code: currency['Alphabetic Code'], + display: currency['Currency'] + } +} + +function toElmItem (currency) { + return `{ code = "${currency.code}" +, display = "${currency.display}" +, searchWords = [] +}` +} diff --git a/tools/modify.js b/tools/modify.js new file mode 100644 index 00000000..7878c224 --- /dev/null +++ b/tools/modify.js @@ -0,0 +1,40 @@ +'use strict' + +const R = require('ramda') +const db = require('../db') + +function pp (o) { + console.log(require('util').inspect(o, {depth: null, colors: true})) +} + +function dbFetchConfig () { + return db.oneOrNone('select data from user_config where type=$1', ['config']) + .then(row => row && row.data) +} + +dbFetchConfig() +.then(c => { + const groups = c.groups + .filter(g => g.code !== 'fiat') + .map(g => { + if (g.code === 'currencies') { + const values = g.values.filter(v => v.fieldLocator.code !== 'cryptoCurrencies') + return R.assoc('values', values, g) + } + + return g + }) + + return {groups: groups} +}) +.then(config => { + pp(config) + return db.none('update user_config set data=$1 where type=$2', [config, 'config']) +}) +.then(() => { + process.exit(0) +}) +.catch(e => { + console.log(e) + process.exit(1) +}) diff --git a/tools/show.js b/tools/show.js new file mode 100644 index 00000000..260adb77 --- /dev/null +++ b/tools/show.js @@ -0,0 +1,22 @@ +'use strict' + +const db = require('../lib/db') + +function pp (o) { + console.log(require('util').inspect(o, {depth: null, colors: true})) +} + +function dbFetchConfig () { + return db.oneOrNone('select data from user_config where type=$1', ['config']) + .then(row => row && row.data) +} + +dbFetchConfig() +.then(config => { + pp(config) + process.exit(0) +}) +.catch(e => { + console.log(e) + process.exit(1) +}) diff --git a/yarn.lock b/yarn.lock index e3bbee3a..586cf52f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,5 +1,7 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 + + accepts@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.3.tgz#c3ca7434938648c3e0d9c1e328dd68b622c284ca" @@ -19,8 +21,8 @@ agent-base@2: semver "~5.0.1" ajv@^4.9.0: - version "4.9.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.9.0.tgz#5a358085747b134eb567d6d15e015f1d7802f45c" + version "4.9.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.9.1.tgz#08e1b0a5fddc8b844d28ca7b03510e78812ee3a0" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" @@ -110,10 +112,6 @@ async@^2.0.1: dependencies: lodash "^4.14.0" -async@~0.2.10: - version "0.2.10" - resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" - async@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9" @@ -127,20 +125,24 @@ aws4@^1.2.1: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755" axios@^0.15.2: - version "0.15.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.15.2.tgz#496f50980b2ce1ad2e195af93c2d03b4d035e90d" + version "0.15.3" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.15.3.tgz#2c9d638b2e191a08ea1d6cc988eadd6ba5bdc053" dependencies: - follow-redirects "0.0.7" + follow-redirects "1.0.0" balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" +base-x@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-1.1.0.tgz#42d3d717474f9ea02207f6d1aa1f426913eeb7ac" + base64-url@^1.2.1: version "1.3.3" resolved "https://registry.yarnpkg.com/base64-url/-/base64-url-1.3.3.tgz#f8b6c537f09a4fc58c99cb86e0b0e9c61461a20f" -base64url@^2.0.0, base64url@2.0.0: +base64url@2.0.0, base64url@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/base64url/-/base64url-2.0.0.tgz#eac16e03ea1438eff9423d69baa36262ed1f70bb" @@ -158,15 +160,11 @@ big.js@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.1.3.tgz#4cada2193652eb3ca9ec8e55c9015669c9806978" -bigi@^1.1.0, bigi@^1.4.0: - version "1.4.2" - resolved "https://registry.yarnpkg.com/bigi/-/bigi-1.4.2.tgz#9c665a95f88b8b08fc05cfd731f561859d725825" - -bigi@1.4.0: +bigi@1.4.0, bigi@^1.1.0, bigi@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/bigi/-/bigi-1.4.0.tgz#90ac1aeac0a531216463bdb58f42c1e05c8407ac" -bignumber.js@^2.3.0, bignumber.js@^2.4.0: +bignumber.js@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-2.4.0.tgz#838a992da9f9d737e0f4b2db0be62bb09dd0c5e8" @@ -178,13 +176,13 @@ bindings@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11" -bip66@^1.1.0, bip66@^1.1.3: +bip66@^1.1.0: version "1.1.4" resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.4.tgz#8a59f8ae16eccb94681c3c2a7b224774605aadfb" -bitcoind-rpc@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/bitcoind-rpc/-/bitcoind-rpc-0.6.0.tgz#b1132c04dcdce6d353d520c8f02ddaf8f981fb34" +bitcoind-rpc@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/bitcoind-rpc/-/bitcoind-rpc-0.7.0.tgz#dbf6249267ee328be48de57787042980092c8bf2" bitcoinjs-lib@2.1.4: version "2.1.4" @@ -203,8 +201,8 @@ bitcoinjs-lib@2.1.4: wif "^1.1.0" bitgo@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/bitgo/-/bitgo-2.0.4.tgz#83757c8cbb8481b5011c50b1eea4769d52ebabf6" + version "2.0.5" + resolved "https://registry.yarnpkg.com/bitgo/-/bitgo-2.0.5.tgz#886715a376ea16fbc862aaeae248b4421001ce5d" dependencies: argparse "^0.1.16" assert "0.4.9" @@ -242,7 +240,7 @@ bluebird@^3.3.5: version "3.4.6" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.6.tgz#01da8d821d87813d158967e743d5fe6c62cf8c0f" -bn.js@^4.10.0, bn.js@^4.11.3, bn.js@^4.4.0, bn.js@^4.8.0: +bn.js@^4.10.0, bn.js@^4.4.0, bn.js@^4.8.0: version "4.11.6" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" @@ -298,16 +296,15 @@ browserify-sha3@^0.0.1: dependencies: js-sha3 "^0.3.1" -bs58@^2.0.1, bs58@2.0.1: +bs58@2.0.1, bs58@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-2.0.1.tgz#55908d58f1982aba2008fa1bed8f91998a29bf8d" -bs58check@^1.0.5, bs58check@^1.0.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-1.2.0.tgz#a2f975072c5252589f1c2531c617b86b378eb228" +bs58@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-3.1.0.tgz#d4c26388bf4804cac714141b1945aa47e5eb248e" dependencies: - bs58 "^2.0.1" - create-hash "^1.1.0" + base-x "^1.1.0" bs58check@1.0.4: version "1.0.4" @@ -315,6 +312,13 @@ bs58check@1.0.4: dependencies: bs58 "^2.0.1" +bs58check@^1.0.5, bs58check@^1.0.6: + version "1.3.1" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-1.3.1.tgz#e3ea89514b6baa239038a777dc952ae04a808e3a" + dependencies: + bs58 "^3.1.0" + create-hash "^1.1.0" + buffer-equal-constant-time@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" @@ -327,10 +331,6 @@ buffer-reverse@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/buffer-reverse/-/buffer-reverse-1.0.1.tgz#49283c8efa6f901bc01fa3304d06027971ae2f60" -buffer-shims@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" - buffer-writer@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/buffer-writer/-/buffer-writer-1.0.1.tgz#22a936901e3029afcd7547eb4487ceb697a3bf08" @@ -366,6 +366,10 @@ camelize@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b" +capture-stack-trace@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" + caseless@~0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" @@ -470,6 +474,13 @@ content-type@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.2.tgz#b7d113aee7a8dd27bd21133c4dc2529df1721eed" +cookie-parser@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/cookie-parser/-/cookie-parser-1.4.3.tgz#0fe31fa19d000b95f4aadf1f53fdc2b8a203baa5" + dependencies: + cookie "0.3.1" + cookie-signature "1.0.6" + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" @@ -478,18 +489,24 @@ cookie@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" -cookiejar@^2.0.6: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.0.tgz#86549689539b6d0e269b6637a304be508194d898" - cookiejar@2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.0.6.tgz#0abf356ad00d1c5a219d88d44518046dd026acfe" -core-util-is@~1.0.0, core-util-is@1.0.2: +cookiejar@^2.0.6: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.0.tgz#86549689539b6d0e269b6637a304be508194d898" + +core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" +create-error-class@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" + dependencies: + capture-stack-trace "^1.0.0" + create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad" @@ -547,13 +564,7 @@ dateformat@^1.0.12: get-stdin "^4.0.1" meow "^3.3.0" -debug@^2.2.0, debug@2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.3.3.tgz#40c453e67e6e13c901ddec317af8986cda9eff8c" - dependencies: - ms "0.7.2" - -debug@~2.2.0: +debug@2, debug@^2.2.0, debug@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" dependencies: @@ -629,7 +640,7 @@ dont-sniff-mimetype@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dont-sniff-mimetype/-/dont-sniff-mimetype-1.0.0.tgz#5932890dc9f4e2f19e5eb02a20026e5e5efc8f58" -drbg.js@^1.0.0, drbg.js@^1.0.1: +drbg.js@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" dependencies: @@ -637,6 +648,10 @@ drbg.js@^1.0.0, drbg.js@^1.0.1: create-hash "^1.1.2" create-hmac "^1.1.4" +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" @@ -705,14 +720,14 @@ esprima-fb@~15001.1001.0-dev-harmony-fb: version "15001.1001.0-dev-harmony-fb" resolved "https://registry.yarnpkg.com/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz#43beb57ec26e8cf237d3dd8b33e42533577f2659" +esprima@3.x.x, esprima@~3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.2.tgz#954b5d19321ca436092fa90f06d6798531fe8184" + esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" -esprima@~3.1.0, esprima@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.2.tgz#954b5d19321ca436092fa90f06d6798531fe8184" - estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" @@ -787,7 +802,7 @@ express@^4.11.1, express@^4.13.4: utils-merge "1.0.0" vary "~1.1.0" -extend@^3.0.0, extend@~3.0.0, extend@3, extend@3.0.0: +extend@3, extend@3.0.0, extend@^3.0.0, extend@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" @@ -795,7 +810,7 @@ extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" -eyes@>=0.1.6, eyes@0.1.x: +eyes@0.1.x, eyes@>=0.1.6: version "0.1.8" resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" @@ -833,25 +848,16 @@ find-up@^1.0.0: path-exists "^2.0.0" pinkie-promise "^2.0.0" -follow-redirects@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-0.0.7.tgz#34b90bab2a911aa347571da90f22bd36ecd8a919" +follow-redirects@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37" dependencies: debug "^2.2.0" - stream-consume "^0.1.0" forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" -form-data@~1.0.0-rc4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-1.0.1.tgz#ae315db9a4907fa065502304a66d7733475ee37c" - dependencies: - async "^2.0.1" - combined-stream "^1.0.5" - mime-types "^2.1.11" - form-data@1.0.0-rc3: version "1.0.0-rc3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-1.0.0-rc3.tgz#d35bc62e7fbc2937ae78f948aaa0d38d90607577" @@ -868,6 +874,14 @@ form-data@1.0.0-rc4: combined-stream "^1.0.5" mime-types "^2.1.10" +form-data@~1.0.0-rc4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-1.0.1.tgz#ae315db9a4907fa065502304a66d7733475ee37c" + dependencies: + async "^2.0.1" + combined-stream "^1.0.5" + mime-types "^2.1.11" + formidable@^1.0.17, formidable@~1.0.14: version "1.0.17" resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.0.17.tgz#ef5491490f9433b705faa77249c99029ae348559" @@ -909,6 +923,13 @@ get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" +get-stream@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + get-uri@1: version "1.1.0" resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-1.1.0.tgz#7375d04daf7fcb584b3632679cbdf339b51bb149" @@ -936,6 +957,22 @@ glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" +got@^6.6.3: + version "6.6.3" + resolved "https://registry.yarnpkg.com/got/-/got-6.6.3.tgz#ff72c56d7f040eb8918ffb80fb62bcaf489d4eec" + dependencies: + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^2.3.0" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + node-status-codes "^2.0.0" + timed-out "^3.0.0" + unzip-response "^2.0.1" + url-parse-lax "^1.0.0" + graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -1062,11 +1099,7 @@ https-proxy-agent@1: debug "2" extend "3" -iconv-lite@^0.4.5: - version "0.4.15" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" - -iconv-lite@0.4.13: +iconv-lite@0.4.13, iconv-lite@^0.4.5: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" @@ -1087,7 +1120,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.1, inherits@~2.0.1, inherits@2, inherits@2.0.3: +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -1140,6 +1173,18 @@ is-property@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" +is-redirect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + +is-retry-allowed@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + +is-stream@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -1148,15 +1193,15 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" -isstream@~0.1.2, isstream@0.1.x: +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isstream@0.1.x, isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -1249,21 +1294,18 @@ kind-of@^3.0.2: "lamassu-bitcoind@https://github.com/lamassu/lamassu-bitcoind/tarball/alpha": version "1.1.1" - resolved "https://github.com/lamassu/lamassu-bitcoind/tarball/alpha#1ab40cce45d829db91a78838efee84bc6285c3fa" + resolved "https://github.com/lamassu/lamassu-bitcoind/tarball/alpha#c784ecf51a83c4a0bf63e0c847392ea1b99271dd" dependencies: - async "~0.2.10" - bignumber.js "^2.3.0" - bitcoind-rpc "^0.6.0" - lodash "^2.4.1" + bignumber.js "^3.0.1" + bitcoind-rpc "^0.7.0" pify "^2.3.0" "lamassu-bitgo@https://github.com/lamassu/lamassu-bitgo/tarball/alpha": version "0.2.2" - resolved "https://github.com/lamassu/lamassu-bitgo/tarball/alpha#c8057065d2754e1e595e9d07dd33e8349e98e1b7" + resolved "https://github.com/lamassu/lamassu-bitgo/tarball/alpha#d320634253bc9e3ee260039f0703b39ffbc0b498" dependencies: bignumber.js "^3.0.1" bitgo "^2.0.4" - lamassu-config "^0.4.4" lodash "^4.17.2" "lamassu-bitpay@https://github.com/lamassu/lamassu-bitpay/tarball/alpha": @@ -1275,19 +1317,12 @@ kind-of@^3.0.2: "lamassu-bitstamp@https://github.com/lamassu/lamassu-bitstamp/tarball/alpha": version "1.0.4" - resolved "https://github.com/lamassu/lamassu-bitstamp/tarball/alpha#bf19094bbd5eba8204792968ee480667bde3470d" + resolved "https://github.com/lamassu/lamassu-bitstamp/tarball/alpha#4e55b2d4c87c9a615d511f40a2a5ef154d64fe74" dependencies: axios "^0.15.2" bignumber.js "^3.0.1" lodash "^4.17.2" -lamassu-config@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/lamassu-config/-/lamassu-config-0.4.4.tgz#013923537c4cc132e6704da6854cc2cdb9945ca8" - dependencies: - lodash "^2.4.1" - pg "^4.5.5" - "lamassu-mailjet@https://github.com/lamassu/lamassu-mailjet/tarball/master": version "1.0.0" resolved "https://github.com/lamassu/lamassu-mailjet/tarball/master#77e4f2af8a6127a6962d000908e8872476b18c0f" @@ -1305,6 +1340,8 @@ lamassu-config@^0.4.4: "lamassu-mock-wallet@https://github.com/lamassu/lamassu-mock-wallet/tarball/master": version "1.1.0" resolved "https://github.com/lamassu/lamassu-mock-wallet/tarball/master#6c5505cf1f288bfff2200671169769683a5636fd" + dependencies: + bignumber.js "^3.0.1" "lamassu-twilio@https://github.com/lamassu/lamassu-twilio/tarball/master": version "1.1.3" @@ -1344,18 +1381,14 @@ lodash.reduce@4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.reduce/-/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b" -lodash@^2.4.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e" +lodash@4.13.1: + version "4.13.1" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.13.1.tgz#83e4b10913f48496d4d16fec4a560af2ee744b68" lodash@^4.14.0, lodash@^4.17.2: version "4.17.2" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" -lodash@4.13.1: - version "4.13.1" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.13.1.tgz#83e4b10913f48496d4d16fec4a560af2ee744b68" - longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -1367,6 +1400,10 @@ loud-rejection@^1.0.0: currently-unhandled "^0.4.1" signal-exit "^3.0.0" +lowercase-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" + lru-cache@~2.6.5: version "2.6.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.6.5.tgz#e56d6354148ede8d7707b58d143220fd08df0fd5" @@ -1383,7 +1420,7 @@ media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" -mem: +mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" dependencies: @@ -1428,7 +1465,7 @@ mime-types@^2.1.10, mime-types@^2.1.11, mime-types@^2.1.3, mime-types@~2.1.11, m dependencies: mime-db "~1.25.0" -mime@^1.3.4, mime@1.3.4: +mime@1.3.4, mime@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" @@ -1442,10 +1479,6 @@ mimic-fn@^1.0.0: dependencies: brace-expansion "^1.0.0" -minimist@^1.1.3, minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" @@ -1454,15 +1487,28 @@ minimist@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.0.tgz#4dffe525dae2b864c66c2e23c6271d7afdecefce" +minimist@^1.1.3, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + mkdirp@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -moment@^2.11.2: - version "2.17.0" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.17.0.tgz#a4c292e02aac5ddefb29a6eed24f51938dd3b74f" +moment@^2.11.2, moment@^2.17.0: + version "2.17.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.17.1.tgz#fed9506063f36b10f066c8b59a144d7faebe1d82" + +morgan@1.5.3: + version "1.5.3" + resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.5.3.tgz#8adb4e72f9e5c5436e5d93f42910835f79da9fdf" + dependencies: + basic-auth "~1.0.1" + debug "~2.2.0" + depd "~1.0.1" + on-finished "~2.2.1" morgan@^1.7.0: version "1.7.0" @@ -1474,24 +1520,11 @@ morgan@^1.7.0: on-finished "~2.3.0" on-headers "~1.0.1" -morgan@1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.5.3.tgz#8adb4e72f9e5c5436e5d93f42910835f79da9fdf" - dependencies: - basic-auth "~1.0.1" - debug "~2.2.0" - depd "~1.0.1" - on-finished "~2.2.1" - -ms@^0.7.1, ms@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" - -ms@0.7.1: +ms@0.7.1, ms@^0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" -nan@^2.0.5, nan@^2.2.0, nan@^2.2.1: +nan@^2.0.5, nan@^2.2.0: version "2.4.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.4.0.tgz#fb3c59d45fe4effe215f0b890f8adf6eb32d2232" @@ -1523,6 +1556,10 @@ node-mailjet@^3.0.6: superagent "^2.0.0" superagent-proxy "^1.0.1" +node-status-codes@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-2.0.1.tgz#298067659cb68a2b4670abbefde02a3819981f5b" + node-uuid@~1.4.7: version "1.4.7" resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.7.tgz#6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f" @@ -1548,7 +1585,7 @@ oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" -object-assign@^4.0.1, object-assign@4.1.0: +object-assign@4.1.0, object-assign@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" @@ -1659,24 +1696,24 @@ pg-connection-string@0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-0.1.3.tgz#da1847b20940e42ee1492beaf65d49d91b245df7" -pg-minify@0.3: - version "0.3.5" - resolved "https://registry.yarnpkg.com/pg-minify/-/pg-minify-0.3.5.tgz#f90fc142ae769b932103c09c646f48256292f54c" +pg-minify@0.4: + version "0.4.1" + resolved "https://registry.yarnpkg.com/pg-minify/-/pg-minify-0.4.1.tgz#a642c6bd256c7da833066590b1e414334a1f6e19" pg-pool@1.*: - version "1.5.0" - resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-1.5.0.tgz#d789756ccb90cd389fc5a395e0ca9f2d2c558d48" + version "1.6.0" + resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-1.6.0.tgz#2e300199927b6d7db6be71e2e3435dddddf07b41" dependencies: generic-pool "2.4.2" object-assign "4.1.0" -pg-promise: - version "5.4.4" - resolved "https://registry.yarnpkg.com/pg-promise/-/pg-promise-5.4.4.tgz#9c8ba780734981cb83d11aeda9fc70a3d66449b5" +pg-promise@^5.4.4: + version "5.4.7" + resolved "https://registry.yarnpkg.com/pg-promise/-/pg-promise-5.4.7.tgz#e74469937f459c733aa5e444565583173b106357" dependencies: manakin "0.4" pg "5.1" - pg-minify "0.3" + pg-minify "0.4" spex "1.1" pg-types@1.*: @@ -1689,30 +1726,6 @@ pg-types@1.*: postgres-date "~1.0.0" postgres-interval "~1.0.0" -pg@^4.5.5: - version "4.5.6" - resolved "https://registry.yarnpkg.com/pg/-/pg-4.5.6.tgz#a1de4878afa5cb208a25815f5ff89d2e0ebf52f8" - dependencies: - buffer-writer "1.0.1" - generic-pool "2.4.2" - packet-reader "0.2.0" - pg-connection-string "0.1.3" - pg-types "1.*" - pgpass "0.0.3" - semver "^4.1.0" - -pg@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/pg/-/pg-6.1.0.tgz#4ebc58100a79187b6b98fa5caf1675d669926b41" - dependencies: - buffer-writer "1.0.1" - packet-reader "0.2.0" - pg-connection-string "0.1.3" - pg-pool "1.*" - pg-types "1.*" - pgpass "1.x" - semver "4.3.2" - pg@5.1: version "5.1.0" resolved "https://registry.yarnpkg.com/pg/-/pg-5.1.0.tgz#073b9b36763ad8a5478dbb85effef45e739ba9d8" @@ -1725,11 +1738,17 @@ pg@5.1: pgpass "0.0.6" semver "4.3.2" -pgpass@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/pgpass/-/pgpass-0.0.3.tgz#12e67e343b3189c2f31206ebc9cc0befffcf9140" +pg@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/pg/-/pg-6.1.0.tgz#4ebc58100a79187b6b98fa5caf1675d669926b41" dependencies: - split "~0.3" + buffer-writer "1.0.1" + packet-reader "0.2.0" + pg-connection-string "0.1.3" + pg-pool "1.*" + pg-types "1.*" + pgpass "1.x" + semver "4.3.2" pgpass@0.0.6: version "0.0.6" @@ -1787,6 +1806,10 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" +prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + pretty-ms@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-2.1.0.tgz#4257c256df3fb0b451d6affaab021884126981dc" @@ -1827,38 +1850,26 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -q@^1.1.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" - q@0.9.7: version "0.9.7" resolved "https://registry.yarnpkg.com/q/-/q-0.9.7.tgz#4de2e6cb3b29088c9e4cbc03bf9d42fb96ce2f75" -q@1.1.2: +q@1.1.2, q@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/q/-/q-1.1.2.tgz#6357e291206701d99f197ab84e57e8ad196f2a89" -qs@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-4.0.0.tgz#c31d9b74ec27df75e543a86c78728ed8d4623607" - -qs@^6.1.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" - -qs@~6.2.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.1.tgz#ce03c5ff0935bc1d9d69a9f14cbd18e568d67625" - qs@2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/qs/-/qs-2.3.3.tgz#e9e85adbe75da0bbe4c8e0476a086290f863b404" -qs@6.2.0: +qs@6.2.0, qs@^6.1.0, qs@~6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.0.tgz#3b7848c03c2dece69a9522b0fae8c4126d745f3b" +qs@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-4.0.0.tgz#c31d9b74ec27df75e543a86c78728ed8d4623607" + ramda@^0.21.0: version "0.21.0" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.21.0.tgz#a001abedb3ff61077d4ff1d577d44de77e8d0a35" @@ -1898,29 +1909,6 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -readable-stream@^2.0.5, readable-stream@2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" - dependencies: - buffer-shims "^1.0.0" - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readable-stream@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - readable-stream@1.0.27-1: version "1.0.27-1" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.27-1.tgz#6b67983c20357cefd07f0165001a16d710d91078" @@ -1939,14 +1927,16 @@ readable-stream@1.1.x: isarray "0.0.1" string_decoder "~0.10.x" -recast@^0.11.17: - version "0.11.17" - resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.17.tgz#67e829df49ef8ea822381cc516d305411e60bad8" +readable-stream@2, readable-stream@^2.0.5, readable-stream@~2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" dependencies: - ast-types "0.9.2" - esprima "~3.1.0" - private "~0.1.5" - source-map "~0.5.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" recast@0.10.33: version "0.10.33" @@ -1957,6 +1947,15 @@ recast@0.10.33: private "~0.1.5" source-map "~0.5.0" +recast@^0.11.17: + version "0.11.18" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.18.tgz#07af6257ca769868815209401d4d60eef1b5b947" + dependencies: + ast-types "0.9.2" + esprima "~3.1.0" + private "~0.1.5" + source-map "~0.5.0" + redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -2054,19 +2053,7 @@ scmp@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/scmp/-/scmp-0.0.3.tgz#3648df2d7294641e7f78673ffc29681d9bad9073" -secp256k1@^3.0.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.2.2.tgz#2103620789ca2c9b79650cdf8cfc9c542be36597" - dependencies: - bindings "^1.2.1" - bip66 "^1.1.3" - bn.js "^4.11.3" - create-hash "^1.1.2" - drbg.js "^1.0.1" - elliptic "^6.2.3" - nan "^2.2.1" - -secp256k1@3.0.1: +secp256k1@3.0.1, secp256k1@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.0.1.tgz#1e9205135a4ed3503150dd00e7a4eb219f2900b3" dependencies: @@ -2076,22 +2063,14 @@ secp256k1@3.0.1: elliptic "^6.2.3" nan "^2.2.0" -semver@^4.1.0: - version "4.3.6" - resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" +"semver@2 || 3 || 4 || 5", semver@4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.2.tgz#c7a07158a80bedd052355b770d82d6640f803be7" semver@~5.0.1: version "5.0.3" resolved "https://registry.yarnpkg.com/semver/-/semver-5.0.3.tgz#77466de589cd5d3c95f138aa78bc569a3cb5d27a" -"semver@2 || 3 || 4 || 5": - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" - -semver@4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.2.tgz#c7a07158a80bedd052355b770d82d6640f803be7" - send@0.14.1: version "0.14.1" resolved "https://registry.yarnpkg.com/send/-/send-0.14.1.tgz#a954984325392f51532a7760760e459598c89f7a" @@ -2110,7 +2089,7 @@ send@0.14.1: range-parser "~1.2.0" statuses "~1.3.0" -serve-static@~1.11.1: +serve-static@^1.11.1, serve-static@~1.11.1: version "1.11.1" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.11.1.tgz#d6cce7693505f733c759de57befc1af76c0f0805" dependencies: @@ -2136,8 +2115,8 @@ sha3@^1.1.0: nan "^2.0.5" signal-exit@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.1.tgz#5a4c884992b63a7acd9badb7894c3ee9cfccad81" + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" simple-fmt@~0.1.0: version "0.1.0" @@ -2197,8 +2176,8 @@ spdx-license-ids@^1.0.2: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" spex@1.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/spex/-/spex-1.1.0.tgz#d72176438bc238933fd62e010deb26bb4bb006d0" + version "1.1.1" + resolved "https://registry.yarnpkg.com/spex/-/spex-1.1.1.tgz#ceede36b128e7dcb26100b89e2b049a5f4477d50" split@^1.0.0: version "1.0.0" @@ -2206,12 +2185,6 @@ split@^1.0.0: dependencies: through "2" -split@~0.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" - dependencies: - through "2" - sshpk@^1.7.0: version "1.10.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.1.tgz#30e1a5d329244974a1af61511339d595af6638b0" @@ -2239,10 +2212,6 @@ stack-trace@0.0.x: version "1.3.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" -stream-consume@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f" - stream-to-buffer@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/stream-to-buffer/-/stream-to-buffer-0.1.0.tgz#26799d903ab2025c9bd550ac47171b00f8dd80a9" @@ -2253,14 +2222,14 @@ stream-to@~0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/stream-to/-/stream-to-0.2.2.tgz#84306098d85fdb990b9fa300b1b3ccf55e8ef01d" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - string.prototype.startswith@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/string.prototype.startswith/-/string.prototype.startswith-0.2.0.tgz#da68982e353a4e9ac4a43b450a2045d1c445ae7b" +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + stringmap@~0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/stringmap/-/stringmap-0.2.2.tgz#556c137b258f942b8776f5b2ef582aa069d7d1b1" @@ -2333,7 +2302,7 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -through@~2.3.8, through@2: +through@2, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -2341,6 +2310,10 @@ thunkify@~2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d" +timed-out@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-3.0.0.tgz#ff88de96030ce960eabd42487db61d3add229273" + tough-cookie@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" @@ -2360,8 +2333,8 @@ tunnel-agent@~0.4.1: resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.3.tgz#3da382f670f25ded78d7b3d1792119bca0b7132d" + version "0.14.4" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.4.tgz#8c9dbfb52795686f166cd2023794bcf103d13c2b" twilio@^2.11.1: version "2.11.1" @@ -2389,27 +2362,37 @@ type-is@~1.6.13: mime-types "~2.1.13" typeforce@^1.5.5: - version "1.9.2" - resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.9.2.tgz#c4047183c354f6441ecff1853d61dbea81bc377b" + version "1.9.4" + resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.9.4.tgz#cee1fd6eb58ece15e23c8d7b0c83874bc79dbc45" dependencies: inherits "^2.0.1" -underscore.string@~2.4.0, underscore.string@2.4.0: +underscore.string@2.4.0, underscore.string@~2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.4.0.tgz#8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b" -underscore@~1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" - underscore@1.x: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" -unpipe@~1.0.0, unpipe@1.0.0: +underscore@~1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" + +unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + dependencies: + prepend-http "^1.0.1" + util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -2425,8 +2408,8 @@ utils-merge@1.0.0: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" uuid@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.0.tgz#6728fc0459c450d796a99c31837569bdf672d728" + version "3.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" validate-npm-package-license@^3.0.1: version "3.0.1" @@ -2472,14 +2455,14 @@ winston@^2.3.0: isstream "0.1.x" stack-trace "0.0.x" -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -2510,4 +2493,3 @@ yargs@~3.27.0: os-locale "^1.4.0" window-size "^0.1.2" y18n "^3.2.0" -