The Core Module
does provide the AbstractWeb3Module
to implement Web3 compatible modules.
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 defaultoptions
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
Thenet.Socket
object of the NodeJS net module. (optional)
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: