WIP
This commit is contained in:
parent
5ea37d4ec4
commit
dfa873687a
3 changed files with 210 additions and 28 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
[
|
||||
{
|
||||
"code": "cashInTransactionLimit",
|
||||
"display": "Cash-in tx limit",
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"code": "cashOutTransactionLimit",
|
||||
"display": "Cash-out tx limit",
|
||||
"type": "integer"
|
||||
"group": {
|
||||
"code": "commissions",
|
||||
"display": "Commissions"
|
||||
},
|
||||
"crypto": "both",
|
||||
"machines": "both",
|
||||
"entries": [
|
||||
{
|
||||
"code": "cashInCommission",
|
||||
"display": "Cash-in commission",
|
||||
|
|
@ -19,16 +17,6 @@
|
|||
"display": "Cash-out commission",
|
||||
"type": "percentage"
|
||||
},
|
||||
{
|
||||
"code": "idVerificationEnabled",
|
||||
"display": "ID verification",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"code": "idVerificationLimit",
|
||||
"display": "ID Verification Limit",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"code": "lowBalanceMargin",
|
||||
"display": "Low balance margin",
|
||||
|
|
@ -37,6 +25,178 @@
|
|||
{
|
||||
"code": "zeroConfLimit",
|
||||
"display": "Zero conf limit",
|
||||
"type": "int"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": {
|
||||
"code": "languages",
|
||||
"display": "Languages"
|
||||
},
|
||||
"crypto": "global",
|
||||
"machines": "both",
|
||||
"entries": [
|
||||
{
|
||||
"code": "machineLanguages",
|
||||
"display": "Languages",
|
||||
"type": "languages"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
16
todo.txt
16
todo.txt
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue