2020-09-30 18:35:48 +03:00
|
|
|
const queue = require('./queue')
|
|
|
|
const { GasPriceOracle } = require('gas-price-oracle')
|
|
|
|
const gasPriceOracle = new GasPriceOracle()
|
2020-10-05 20:15:18 +03:00
|
|
|
const { netId, tornadoServiceFee, miningServiceFee, instances } = require('../config')
|
2020-09-30 18:35:48 +03:00
|
|
|
const { version } = require('../package.json')
|
2020-09-28 05:28:34 +03:00
|
|
|
|
|
|
|
async function status(req, res) {
|
2020-09-30 18:35:48 +03:00
|
|
|
const ethPrices = {
|
|
|
|
dai: '6700000000000000', // 0.0067
|
|
|
|
cdai: '157380000000000',
|
|
|
|
cusdc: '164630000000000',
|
|
|
|
usdc: '7878580000000000',
|
|
|
|
usdt: '7864940000000000',
|
2020-09-28 05:28:34 +03:00
|
|
|
}
|
|
|
|
res.json({
|
2020-09-30 18:35:48 +03:00
|
|
|
relayerAddress: require('../config').rewardAccount,
|
|
|
|
instances: instances.netId42,
|
2020-09-28 05:28:34 +03:00
|
|
|
gasPrices: await gasPriceOracle.gasPrices(),
|
|
|
|
netId,
|
|
|
|
ethPrices,
|
2020-10-05 20:15:18 +03:00
|
|
|
tornadoServiceFee,
|
|
|
|
miningServiceFee,
|
2020-09-30 18:35:48 +03:00
|
|
|
nonce: 123,
|
2020-09-28 05:28:34 +03:00
|
|
|
version,
|
2020-09-30 18:35:48 +03:00
|
|
|
latestBlock: 12312312,
|
2020-09-28 05:28:34 +03:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
function index(req, res) {
|
2020-09-30 18:35:48 +03:00
|
|
|
res.send(
|
|
|
|
'This is <a href=https://tornado.cash>tornado.cash</a> Relayer service. Check the <a href=/v1/status>/status</a> for settings',
|
|
|
|
)
|
2020-09-28 05:28:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
async function getJob(req, res) {
|
|
|
|
const status = await queue.getJobStatus(req.params.id)
|
2020-10-01 16:08:33 +03:00
|
|
|
return res.json(status)
|
2020-09-28 05:28:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
status,
|
|
|
|
index,
|
|
|
|
getJob,
|
|
|
|
}
|