UNPKG

@gateway.fm/gtw-dvf-client-js

Version:

DVF client js lib with gateway.fm rpc endpoints

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 ) }