@@ -1,5 +1,6 @@
11import Tx from 'ethereumjs-tx';
2−import { toWei, fromWei, toHex, toBN } from 'web3-utils';
2+import { toHex } from 'web3-utils';
3+import { safeFromWei, safeToWei } from './lib';
34import retry from 'async-retry';
45
56import { NETWORK_TYPES } from './network';
@@ -31,7 +32,7 @@ const signTransaction = async ({
3132 // TODO: require these in txn object
3233 nonce = toHex(nonce);
3334 chainId = toHex(chainId);
34− gasPrice = toHex(toWei(gasPrice, 'gwei'));
35+ gasPrice = toHex(safeToWei(gasPrice, 'gwei'));
3536 gasLimit = toHex(gasLimit);
3637
3738 const txParams = { nonce, chainId, gasPrice, gasLimit };
@@ -193,7 +194,7 @@ const getTxnInfo = async (web3, addr) => {
193194 return {
194195 nonce: nonce,
195196 chainId: chainId,
196− gasPrice: fromWei(toBN(gasPrice), 'gwei'),
197+ gasPrice: safeFromWei(gasPrice, 'gwei'),
197198 };
198199};
199200