UNPKG

dvf-client-js

Version:

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

13 lines (11 loc) 325 B
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 }