Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.7 KB

web3-core.rst

File metadata and controls

53 lines (36 loc) · 1.7 KB

Core Module

The Core Module does provide the AbstractWeb3Module to implement Web3 compatible modules.

AbstractWeb3Module

Source: AbstractWeb3Module

The AbstractWeb3Module does have the following constructor parameters:

  • provider - AbstractSocketProvider | HttpProvider | CustomProvider | String The provider class or string.
  • options - Web3ModuleOptions These are the default options of a Web3 module. (optional)
  • methodFactory - AbstractMethodFactory The :ref:`AbstractMethodFactory <web3-abstract-method-factory>` will be used in the module proxy for the JSON-RPC method calls. (optional)
  • net - net.Socket The net.Socket object of the NodeJS net module. (optional)

Example

import {AbstractWeb3Module} from 'web3-core';

class Example extends AbstractWeb3Module {
    /**
     * @param {AbstractSocketProvider|HttpProvider|CustomProvider|String} provider
     * @param {AbstractMethodFactory} methodFactory
     * @param {Web3ModuleOptions} options
     * @param {Net.Socket} nodeNet
     *
     * @constructor
     */
    constructor(provider, net, methodFactory, options) {
        super(provider, net, methodFactory, options;
    }
}

Interface of the AbstractWeb3Module class: