How to use the @nomiclabs/buidler-ethers/dist/ethers-provider-wrapper.EthersProviderWrapper function in @nomiclabs/buidler-ethers

To help you get started, we’ve selected a few @nomiclabs/buidler-ethers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github EthWorks / Waffle / lib / buidlerProvider.ts View on Github external
export const createBuidlerProvider = (buidlerOptionsOrPathToConfig: string | BuidlerNetworkConfig = {}) => {
  let createProvider;
  let EthersProviderWrapper;

  try {
    createProvider = require('@nomiclabs/buidler/internal/core/providers/construction').createProvider;
    EthersProviderWrapper = require('@nomiclabs/buidler-ethers/dist/ethers-provider-wrapper').EthersProviderWrapper;
  } catch (error) {
    console.error('To use createBuidlerProvider method you need to have the following packages installed: @nomiclabs/buidler, @nomiclabs/buidler-ethers');
    throw new Error('Missing packages');
  }

  const buidlerOptions = getBuidlerOptions(buidlerOptionsOrPathToConfig);
  const options = {...defaultBuidlerOptions, ...buidlerOptions };
  return  new EthersProviderWrapper(createProvider('buidlerevm', options));
};

@nomiclabs/buidler-ethers

Buidler plugin for ethers

MIT
Latest version published 4 years ago

Package Health Score

70 / 100
Full package analysis