How to use the web3-eth function in web3-eth

To help you get started, we’ve selected a few web3-eth 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 embark-framework / subspace / src / subspace.js View on Github external
constructor(provider, options = {}) {
    if (provider.constructor.name !== "WebsocketProvider") {
      console.warn("subspace: it's recommended to use a websocket provider to react to new events");
    }

    this.events = new Events();
    this.web3 = new Web3Eth(provider);

    this.options = {};
    this.options.refreshLastNBlocks = options.refreshLastNBlocks || 12;
    this.options.callInterval = options.callInterval || 0;
    this.options.dbFilename = options.dbFilename || 'subspace.db';
    this.latestBlockNumber = undefined;
    this.disableDatabase = options.disableDatabase;
    this.networkId = undefined;

    this.newBlocksSubscription = null;
    this.intervalTracker = null;
    this.callables = [];
  }
github aragon / radspec / src / helpers / lib / methodRegistry.js View on Github external
constructor (opts = {}) {
    this.eth = opts.eth || new Eth(DEFAULT_ETH_NODE)
    this.network = opts.network || '1'
  }
github aragon / radspec / src / helpers / lib / methodRegistry.js View on Github external
async initRegistry () {
    if (await this.eth.net.getId() !== '1') {
      this.eth = new Eth(DEFAULT_ETH_NODE)
    }

    const address = REGISTRY_MAP[this.network]

    if (!address) {
      throw new Error('No method registry found on the requested network.')
    }

    this.registry = new this.eth.Contract(REGISTRY_LOOKUP_ABI, address)
  }
github adibas03 / online-ethereum-abi-encoder-decoder / src / pages / index.js View on Github external
constructor(props) {
    super(props);

    try {
      if (window.ethereum) {
        this.eth = new Eth(window.ethereum);
      } else {
        this.eth = new Eth(Eth.givenProvider || "http://localhost:8545");
      }
    } catch (e) {
      this.eth = new Eth("wss://mainnet.infura.io/ws");
    }

    //Hanle binds
    this.handleActionChange = this.handleActionChange.bind(this);
    this.handleChange = this.handleChange.bind(this);

    const history = createBrowserHistory();
    const hash = history.location.hash;
    const action = hash && hash.substring(hash.indexOf("/")+1, hash.length);

    if (hash !== "#/" && allowedActions.includes(action)) {

web3-eth

Web3 module to interact with the Ethereum blockchain and smart contracts.

LGPL-3.0
Latest version published 17 days ago

Package Health Score

98 / 100
Full package analysis

Similar packages