UNPKG

dvf-client-js

Version:

<img src="https://avatars1.githubusercontent.com/u/56512535?s=200&v=4" align="right" />

16 lines (13 loc) 456 B
const getTokenAddressFromTokenInfoOrThrow = require('../../lib/dvf/token/getTokenAddressFromTokenInfoOrThrow') module.exports = (dvf, token, chain = 'ETHEREUN') => { const tokenInfo = dvf.token.getTokenInfo(token) const action = 'balanceOf' const args = [dvf.get('account')] const tokenAddress = getTokenAddressFromTokenInfoOrThrow(tokenInfo, chain) return dvf.eth.call( dvf.contract.abi.token, tokenAddress, action, args ) }