Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createEthClient (asset, wallet) {
const ethConfig = config.assets.eth
const ethClient = new Client()
ethClient.addProvider(new EthereumRpcProvider(
ethConfig.rpc.url
))
if (wallet === 'metamask') {
ethClient.addProvider(new EthereumMetaMaskProvider(web3.currentProvider, EthereumNetworks[ethConfig.network]))
} else if (wallet === 'ethereum_ledger') {
ethClient.addProvider(new EthereumLedgerProvider({network: EthereumNetworks[ethConfig.network]}))
}
ethClient.addProvider(new EthereumSwapProvider())
return ethClient
}