Fix funds.toNumber is not a function
This commit is contained in:
parent
c7efc2b3bb
commit
91c3c9fa91
|
@ -91,10 +91,11 @@ export const getProviderInfo: Function = async (): Promise<ProviderProps> => {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getBalanceInEtherOf = async (safeAddress: string) => {
|
export const getBalanceInEtherOf = async (safeAddress: string) => {
|
||||||
const funds: BigNumber = await web3.eth.getBalance(safeAddress)
|
const funds: String = await web3.eth.getBalance(safeAddress)
|
||||||
if (!funds || funds === '0') {
|
|
||||||
|
if (!funds) {
|
||||||
return '0'
|
return '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
return web3.fromWei(funds.toNumber(), 'ether').toString()
|
return web3.utils.fromWei(funds, 'ether').toString()
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,4 @@ export const copyToClipboard = (text: string) => {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err.message)
|
console.error(err.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue