web3CurrentProvider.js 703 B

12345678910111213141516171819202122
  1. /**
  2. Sets the ethereum provider, as well as "web3" for backwards compatibility.
  3. @module ethereumProvider
  4. */
  5. const Web3 = require('web3');
  6. const BigNumber = require('bignumber.js');
  7. const ipcProviderWrapper = require('../../ipc/ipcProviderWrapper.js');
  8. const LegacyWeb3IpcProvider = require('./legacyWeb3IpcProvider.js');
  9. // SET ETHEREUM PROVIDER
  10. // window.ethereumProvider = new Web3.providers.IpcProvider('', ipcProviderWrapper);
  11. // LEGACY
  12. window.BigNumber = BigNumber;
  13. window.web3 = {
  14. currentProvider: new LegacyWeb3IpcProvider('', ipcProviderWrapper)
  15. };
  16. // for now still add this too: WILL BE REMOVED with web3 1.0
  17. window.web3 = new Web3(new Web3.providers.IpcProvider('', ipcProviderWrapper));