@gateway.fm/gtw-dvf-client-js
Version:
DVF client js lib with gateway.fm rpc endpoints
13 lines (11 loc) • 325 B
JavaScript
const DVFError = require('../../lib/dvf/DVFError')
module.exports = (dvf, chain = 'DEFAULT') => {
if (chain === 'DEFAULT') {
return dvf.web3
}
const web3ForChain = dvf.web3PerChain && dvf.web3PerChain[chain]
if (!web3ForChain) {
throw new DVFError('NO_WEB3_FOR_CHAIN', { chain })
}
return web3ForChain
}