relayerServiceFee as a number

This commit is contained in:
Alexey 2019-11-28 22:04:21 +03:00
parent 7ca4715855
commit fd458d4b19
2 changed files with 2 additions and 2 deletions

@ -19,5 +19,5 @@ module.exports = {
port: process.env.APP_PORT, port: process.env.APP_PORT,
//dai //dai
tokens: ['0x6b175474e89094c44da98b954eedeac495271d0f'], tokens: ['0x6b175474e89094c44da98b954eedeac495271d0f'],
relayerServiceFee: process.env.RELAYER_FEE relayerServiceFee: Number(process.env.RELAYER_FEE)
} }

@ -58,7 +58,7 @@ function sleep(ms) {
function isEnoughFee({ gas, gasPrices, currency, amount, refund, ethPrices, fee }) { function isEnoughFee({ gas, gasPrices, currency, amount, refund, ethPrices, fee }) {
// TODO tokens can have less then 18 decimals // TODO tokens can have less then 18 decimals
const feePercent = toBN(toWei(amount)).mul(toBN(Number(relayerServiceFee) * 10)).div(toBN('1000')) const feePercent = toBN(toWei(amount)).mul(toBN(relayerServiceFee * 10)).div(toBN('1000'))
const expense = toBN(toWei(gasPrices.fast.toString(), 'gwei')).mul(toBN(gas)) const expense = toBN(toWei(gasPrices.fast.toString(), 'gwei')).mul(toBN(gas))
let desiredFee let desiredFee
switch (currency) { switch (currency) {