Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function getERC20Balance(
address: string,
tokenAddress: string,
inWei: boolean = false
): Promise {
const contract = await getERC20(requestManager, tokenAddress)
const balance = await contract.balanceOf(address)
if (inWei) {
return balance
}
return fromWei(balance as any, 'ether') as any
}