From fd458d4b19aa9aec01a46aa9bcbc19d453c35e7b Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 28 Nov 2019 22:04:21 +0300 Subject: [PATCH] relayerServiceFee as a number --- config.js | 2 +- src/utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.js b/config.js index f64012d..e85cc29 100644 --- a/config.js +++ b/config.js @@ -19,5 +19,5 @@ module.exports = { port: process.env.APP_PORT, //dai tokens: ['0x6b175474e89094c44da98b954eedeac495271d0f'], - relayerServiceFee: process.env.RELAYER_FEE + relayerServiceFee: Number(process.env.RELAYER_FEE) } \ No newline at end of file diff --git a/src/utils.js b/src/utils.js index f903f37..54d555f 100644 --- a/src/utils.js +++ b/src/utils.js @@ -58,7 +58,7 @@ function sleep(ms) { function isEnoughFee({ gas, gasPrices, currency, amount, refund, ethPrices, fee }) { // 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)) let desiredFee switch (currency) {