tokenbridge/monitor/getShortEventStats.js
2019-05-31 15:35:50 -03:00

23 lines
605 B
JavaScript

require('dotenv').config()
const eventsInfo = require('./utils/events')
async function main(bridgeMode) {
const { foreignDeposits, homeDeposits, homeWithdrawals, foreignWithdrawals } = await eventsInfo(
bridgeMode
)
return {
depositsDiff: homeDeposits.length - foreignDeposits.length,
withdrawalDiff: homeWithdrawals.length - foreignWithdrawals.length,
home: {
deposits: homeDeposits.length,
withdrawals: homeWithdrawals.length
},
foreign: {
deposits: foreignDeposits.length,
withdrawals: foreignWithdrawals.length
}
}
}
module.exports = main