This commit is contained in:
Josh Harvey 2016-08-29 01:20:33 +03:00
parent 5ea37d4ec4
commit dfa873687a
3 changed files with 210 additions and 28 deletions

View file

@ -7,9 +7,10 @@ const psqlUrl = require('../lib/options').postgresql
const db = pgp(psqlUrl)
db.one('select data from user_config where type=$1', 'exchanges')
.then(data => {
const config = data.data
db.many('select data from user_config', 'exchanges')
.then(rows => {
const config = rows.filter(r => r.type === 'exchanges')[0].data
const brain = rows.filter(r => r.type === 'unit')[0].data
const settings = config.exchanges.settings
const compliance = settings.compliance
const newConfig = {
@ -21,7 +22,12 @@ db.one('select data from user_config where type=$1', 'exchanges')
idVerificationEnabled: compliance.idVerificationEnabled,
idVerificationLimit: compliance.idVerificationLimit,
lowBalanceMargin: settings.lowBalanceMargin,
zeroConfLimit: settings.zeroConfLimit
zeroConfLimit: settings.zeroConfLimit,
fiatCurrency: settings.currency,
topCashOutDenomination: settings.cartridges[0],
bottomCashOutDenomination: settings.cartridges[1],
virtualCashOutDenomination: settings.virtualCartridges[0],
machineLanguages: brain.locale.localeInfo.primaryLocales
}
}

View file

@ -1,42 +1,202 @@
[
{
"code": "cashInTransactionLimit",
"display": "Cash-in tx limit",
"type": "integer"
"group": {
"code": "commissions",
"display": "Commissions"
},
"crypto": "both",
"machines": "both",
"entries": [
{
"code": "cashInCommission",
"display": "Cash-in commission",
"type": "percentage"
},
{
"code": "cashOutCommission",
"display": "Cash-out commission",
"type": "percentage"
},
{
"code": "lowBalanceMargin",
"display": "Low balance margin",
"type": "percentage"
},
{
"code": "zeroConfLimit",
"display": "Zero conf limit",
"type": "integer"
}
]
},
{
"code": "cashOutTransactionLimit",
"display": "Cash-out tx limit",
"type": "integer"
"group": {
"code": "crypto-services",
"display": "Crypto services"
},
"crypto": "specific",
"machines": "both",
"entries": [
{
"code": "ticker",
"display": "Ticker",
"type": "plugin",
"pluginCode": "ticker"
},
{
"code": "wallet",
"display": "Wallet",
"type": "plugin",
"pluginCode": "wallet"
},
{
"code": "exchange",
"display": "Exchange",
"type": "plugin",
"pluginCode": "exchange"
}
]
},
{
"code": "cashInCommission",
"display": "Cash-in commission",
"type": "percentage"
"group": {
"code": "fiat",
"display": "Fiat"
},
"crypto": "global",
"machines": "both",
"entries": [
{
"code": "fiatCurrency",
"display": "Fiat Currency",
"type": "currency"
},
{
"code": "topCashOutDenomination",
"display": "Top cash-out denominations",
"type": "integer"
},
{
"code": "bottomCashOutDenomination",
"display": "Bottom cash-out denominations",
"type": "integer"
}
]
},
{
"code": "cashOutCommission",
"display": "Cash-out commission",
"type": "percentage"
"group": {
"code": "limits",
"display": "Limits"
},
"crypto": "global",
"machines": "both",
"entries": [
{
"code": "cashInTransactionLimit",
"display": "Cash-in tx limit",
"type": "integer"
},
{
"code": "cashOutTransactionLimit",
"display": "Cash-out tx limit",
"type": "integer"
}
]
},
{
"code": "idVerificationEnabled",
"display": "ID verification",
"type": "bool"
"group": {
"code": "compliance",
"display": "Compliance"
},
"crypto": "global",
"machines": "both",
"entries": [
{
"code": "idVerificationEnabled",
"display": "ID verification",
"type": "bool"
},
{
"code": "idVerificationLimit",
"display": "ID Verification Limit",
"type": "integer"
}
]
},
{
"code": "idVerificationLimit",
"display": "ID Verification Limit",
"type": "int"
"group": {
"code": "languages",
"display": "Languages"
},
"crypto": "global",
"machines": "both",
"entries": [
{
"code": "machineLanguages",
"display": "Languages",
"type": "languages"
}
]
},
{
"code": "lowBalanceMargin",
"display": "Low balance margin",
"type": "percentage"
"group": {
"code": "machines",
"display": "Machines"
},
"crypto": "global",
"machines": "specific",
"entries": [
{
"code": "machineName",
"display": "Name",
"type": "string"
},
{
"code": "machineLocation",
"display": "Location",
"type": "string"
},
{
"code": "machineLocationCoordinates",
"display": "Location (GPS)",
"type": "coordinates"
}
]
},
{
"code": "zeroConfLimit",
"display": "Zero conf limit",
"type": "int"
"group": {
"code": "notifications",
"display": "Notifications"
},
"crypto": "global",
"machines": "global",
"entries": [
{
"code": "notificationsEnabled",
"display": "Notifications",
"type": "onOff"
},
{
"code": "notificationsEmailEnabled",
"display": "Email notifications",
"type": "onOff"
},
{
"code": "notificationsSMSEnabled",
"display": "SMS notifications",
"type": "onOff"
},
{
"code": "email",
"display": "Email",
"type": "plugin",
"pluginCode": "email"
},
{
"code": "sms",
"display": "SMS",
"type": "plugin",
"pluginCode": "sms"
}
]
}
]

View file

@ -9,3 +9,19 @@
- add default configuration
- either remove lamassu-config or fix link in package.json
------------------------
schemas:
- global crypto / global machine
- global crypto / specific machine
- specific crypto / global machine
- specific crypto / specific machine
- We'll have one group for config that applies to all 4
- Machine config applies to only global crypto (machine config screen)
- Crypto config applies to only specific crypto
v update migrate-config to match lamassu.json schema
- update machine name