format for latest standard
This commit is contained in:
parent
4108efd9c7
commit
c2af183911
77 changed files with 1697 additions and 1693 deletions
|
|
@ -7,44 +7,44 @@ var db = pgp(psqlUrl)
|
|||
|
||||
db.manyOrNone(`select * from transactions where incoming=false
|
||||
and stage='final_request' and authority='machine'`)
|
||||
.then(rs =>
|
||||
db.tx(t =>
|
||||
t.batch(rs.map(r => db.none(`insert into cash_in_txs (session_id,
|
||||
.then(rs =>
|
||||
db.tx(t =>
|
||||
t.batch(rs.map(r => db.none(`insert into cash_in_txs (session_id,
|
||||
device_fingerprint, to_address, crypto_atoms, crypto_code, fiat,
|
||||
currency_code, fee, tx_hash, error, created) values ($1, $2, $3, $4, $5,
|
||||
$6, $7, $8, $9, $10, $11)`, [r.session_id, r.device_fingerprint,
|
||||
r.to_address, r.satoshis, r.crypto_code, r.fiat, r.currency_code, r.fee,
|
||||
r.tx_hash, r.error, r.created]))
|
||||
r.to_address, r.satoshis, r.crypto_code, r.fiat, r.currency_code, r.fee,
|
||||
r.tx_hash, r.error, r.created]))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
.then(() => db.manyOrNone(`select * from transactions where incoming=true
|
||||
.then(() => db.manyOrNone(`select * from transactions where incoming=true
|
||||
and stage='initial_request' and authority='pending'`))
|
||||
.then(rs =>
|
||||
db.tx(t =>
|
||||
t.batch(rs.map(r => db.none(`insert into cash_out_txs (session_id,
|
||||
.then(rs =>
|
||||
db.tx(t =>
|
||||
t.batch(rs.map(r => db.none(`insert into cash_out_txs (session_id,
|
||||
device_fingerprint, to_address, crypto_atoms, crypto_code, fiat,
|
||||
currency_code, tx_hash, phone, error, created) values ($1, $2, $3, $4, $5,
|
||||
$6, $7, $8, $9, $10, $11)`, [r.session_id, r.device_fingerprint,
|
||||
r.to_address, r.satoshis, r.crypto_code, r.fiat, r.currency_code,
|
||||
r.tx_hash, r.phone, r.error, r.created]))
|
||||
r.to_address, r.satoshis, r.crypto_code, r.fiat, r.currency_code,
|
||||
r.tx_hash, r.phone, r.error, r.created]))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
.then(() => db.manyOrNone(`select * from transactions where incoming=true
|
||||
.then(() => db.manyOrNone(`select * from transactions where incoming=true
|
||||
and stage='dispense' and authority='authorized'`))
|
||||
.then(rs =>
|
||||
db.tx(t =>
|
||||
t.batch(rs.map(r =>
|
||||
db.none(`update cash_out_txs set dispensed=true where session_id=$1`, [r.session_id])
|
||||
.then(() => db.none(`insert into cash_out_actions (session_id, action,
|
||||
.then(rs =>
|
||||
db.tx(t =>
|
||||
t.batch(rs.map(r =>
|
||||
db.none(`update cash_out_txs set dispensed=true where session_id=$1`, [r.session_id])
|
||||
.then(() => db.none(`insert into cash_out_actions (session_id, action,
|
||||
created) values ($1, $2, $3)`, [r.session_id, 'dispensed', r.created]))
|
||||
))
|
||||
))
|
||||
)
|
||||
)
|
||||
)
|
||||
.then(() => pgp.end())
|
||||
.then(() => console.log('Success.'))
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
pgp.end()
|
||||
})
|
||||
.then(() => pgp.end())
|
||||
.then(() => console.log('Success.'))
|
||||
.catch(e => {
|
||||
console.log(e)
|
||||
pgp.end()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ const settingsLoader = require('../lib/settings-loader')
|
|||
const pp = require('../lib/pp')
|
||||
|
||||
settingsLoader.loadLatest()
|
||||
.then(r => {
|
||||
pp('config')(r)
|
||||
process.exit(0)
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e.stack)
|
||||
process.exit(1)
|
||||
})
|
||||
.then(r => {
|
||||
pp('config')(r)
|
||||
process.exit(0)
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e.stack)
|
||||
process.exit(1)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -8,38 +8,38 @@ const psqlUrl = require('../lib/options').postgresql
|
|||
const db = pgp(psqlUrl)
|
||||
|
||||
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 = {
|
||||
global: {
|
||||
cashInTransactionLimit: compliance.maximum.limit,
|
||||
cashOutTransactionLimit: settings.fiatTxLimit,
|
||||
cashInCommission: settings.commission,
|
||||
cashOutCommission: settings.fiatCommission || settings.commission,
|
||||
idVerificationEnabled: compliance.idVerificationEnabled,
|
||||
idVerificationLimit: compliance.idVerificationLimit,
|
||||
lowBalanceMargin: settings.lowBalanceMargin,
|
||||
zeroConfLimit: settings.zeroConfLimit,
|
||||
fiatCurrency: settings.currency,
|
||||
topCashOutDenomination: settings.cartridges[0],
|
||||
bottomCashOutDenomination: settings.cartridges[1],
|
||||
virtualCashOutDenomination: settings.virtualCartridges[0],
|
||||
machineLanguages: brain.locale.localeInfo.primaryLocales,
|
||||
coins: settings.coins
|
||||
},
|
||||
accounts: settings.plugins.settings
|
||||
}
|
||||
.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 = {
|
||||
global: {
|
||||
cashInTransactionLimit: compliance.maximum.limit,
|
||||
cashOutTransactionLimit: settings.fiatTxLimit,
|
||||
cashInCommission: settings.commission,
|
||||
cashOutCommission: settings.fiatCommission || settings.commission,
|
||||
idVerificationEnabled: compliance.idVerificationEnabled,
|
||||
idVerificationLimit: compliance.idVerificationLimit,
|
||||
lowBalanceMargin: settings.lowBalanceMargin,
|
||||
zeroConfLimit: settings.zeroConfLimit,
|
||||
fiatCurrency: settings.currency,
|
||||
topCashOutDenomination: settings.cartridges[0],
|
||||
bottomCashOutDenomination: settings.cartridges[1],
|
||||
virtualCashOutDenomination: settings.virtualCartridges[0],
|
||||
machineLanguages: brain.locale.localeInfo.primaryLocales,
|
||||
coins: settings.coins
|
||||
},
|
||||
accounts: settings.plugins.settings
|
||||
}
|
||||
|
||||
db.none('insert into user_config (type, data) values ($1, $2)', ['global', newConfig])
|
||||
.then(() => {
|
||||
console.log('Success.')
|
||||
process.exit(0)
|
||||
db.none('insert into user_config (type, data) values ($1, $2)', ['global', newConfig])
|
||||
.then(() => {
|
||||
console.log('Success.')
|
||||
process.exit(0)
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Error: %s', err)
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Error: %s', err)
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue