@@ -1,4 +1,4 @@
1−import { fromWei } from 'web3-utils';
1+import { fromWei, toBN } from 'web3-utils';
22
33const BRIDGE_ERROR = {
44 MISSING_WEB3: 'no web3 object found',
@@ -18,13 +18,13 @@ const BRIDGE_ERROR = {
1818const renderTxnError = (web3, msg) => {
1919 const txnCost = (web3, msg) => {
2020 const costWei = msg.match(/upfront cost is: ([0-9]+)/);
21− const costEth = fromWei(costWei[1], 'ether');
21+ const costEth = fromWei(toBN(costWei[1]), 'ether');
2222 return parseFloat(costEth).toFixed(4);
2323 };
2424
2525 const acctBalance = (web3, msg) => {
2626 const balWei = msg.match(/sender's account only has: ([0-9]+)/);
27− const balEth = fromWei(balWei[1], 'ether');
27+ const balEth = fromWei(toBN(balWei[1]), 'ether');
2828 return parseFloat(balEth).toFixed(4);
2929 };
3030