UNPKG

dvf-client-js

Version:

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

16 lines (13 loc) 424 B
module.exports = async (dvf, abi, address, action, args, options = {}) => { const web3 = dvf.eth.getWeb3ForChain(options.chain) const contract = new web3.eth.Contract(abi, address) // using eth.call // parseInt( response, 16 ) to convert int /** return dvf.web3.eth.call({ to: address, data: contract.methods[action](...args).encodeABI() }) **/ return contract.methods[action](...args).call() }