Class ContractFactory<Abi>

A ContractFactory is used to deploy a Contract to the blockchain.

Type Parameters

  • Abi extends ContractAbi

Hierarchy

  • Web3Context
    • ContractFactory

Constructors

Properties

_accountProvider?: Web3AccountProvider<Web3BaseWalletAccount>
_requestManager: Web3RequestManager<unknown>
_subscriptionManager: Web3SubscriptionManager<unknown, any>
_wallet?: Web3BaseWallet<Web3BaseWalletAccount>
abi: Abi

The Contract Interface.

bytecode: string

The Contract deployment bytecode. Often called the initcode.

config: Web3ConfigOptions
contractToBeDeployed: Contract<Abi>
deploymentType: DeploymentType

The deployment type that is currently in use.

providers: {
    HttpProvider: Web3BaseProviderConstructor;
    WebsocketProvider: Web3BaseProviderConstructor;
}
givenProvider?: SupportedProviders<never>
providers: {
    HttpProvider: Web3BaseProviderConstructor;
    WebsocketProvider: Web3BaseProviderConstructor;
}

Accessors

  • get accountProvider(): undefined | Web3AccountProvider<Web3BaseWalletAccount>
  • Returns undefined | Web3AccountProvider<Web3BaseWalletAccount>

  • get BatchRequest(): (new () => Web3BatchRequest)
  • Will return the Web3BatchRequest constructor.

    Returns (new () => Web3BatchRequest)

      • new (): Web3BatchRequest
      • Returns Web3BatchRequest

  • get blockHeaderTimeout(): number
  • The blockHeaderTimeout is used over socket-based connections. This option defines the amount seconds it should wait for 'newBlockHeaders' event before falling back to polling to fetch transaction receipt. Default is 10 seconds.

    Returns number

  • set blockHeaderTimeout(val): void
  • Will set the blockHeaderTimeout

    Parameters

    • val: number

    Returns void

  • get contractDataInputFill(): "input" | "data" | "both"
  • The contractDataInputFill options property will allow you to set the hash of the method signature and encoded parameters to the property either data, input or both within your contract. This will affect the contracts send, call and estimateGas methods Default is data.

    Returns "input" | "data" | "both"

  • set contractDataInputFill(val): void
  • Will set the contractDataInputFill

    Parameters

    • val: "input" | "data" | "both"

    Returns void

  • get currentProvider(): undefined | Web3BaseProvider<API>
  • Will return the current provider. (The same as provider)

    Returns undefined | Web3BaseProvider<API>

    Returns the current provider

    const web3Context = new Web3Context("http://localhost:8545");
    console.log(web3Context.provider);
    > HttpProvider {
    clientUrl: 'http://localhost:8545',
    httpProviderOptions: undefined
    }
  • set currentProvider(provider): void
  • Will set the current provider. (The same as provider)

    Parameters

    • provider: undefined | string | SupportedProviders<API>

      SupportedProviders The provider to set

    Returns void

     const web3Context = new Web3Context("http://localhost:8545");
    web3Context.currentProvider = "ws://localhost:8545";
    console.log(web3Context.provider);
    > WebSocketProvider {
    _eventEmitter: EventEmitter {
    _events: [Object: null prototype] {},
    _eventsCount: 0,
    ...
    }
  • get defaultAccount(): undefined | string
  • This default address is used as the default from property, if no from property is specified in for the following methods:

    • web3.eth.sendTransaction()
    • web3.eth.call()
    • myContract.methods.myMethod().call()
    • myContract.methods.myMethod().send()

    Returns undefined | string

  • set defaultAccount(val): void
  • Will set the default account.

    Parameters

    • val: undefined | string

    Returns void

  • get defaultBlock(): BlockNumberOrTag
  • The default block is used for certain methods. You can override it by passing in the defaultBlock as last parameter. The default value is "latest".

    • web3.eth.getBalance()
    • web3.eth.getCode()
    • web3.eth.getTransactionCount()
    • web3.eth.getStorageAt()
    • web3.eth.call()
    • myContract.methods.myMethod().call()

    Returns BlockNumberOrTag

  • set defaultBlock(val): void
  • Will set the default block.

    • A block number
    • "earliest" - String: The genesis block
    • "latest" - String: The latest block (current head of the blockchain)
    • "pending" - String: The currently mined block (including pending transactions)
    • "finalized" - String: (For POS networks) The finalized block is one which has been accepted as canonical by greater than 2/3 of validators
    • "safe" - String: (For POS networks) The safe head block is one which under normal network conditions, is expected to be included in the canonical chain. Under normal network conditions the safe head and the actual tip of the chain will be equivalent (with safe head trailing only by a few seconds). Safe heads will be less likely to be reorged than the proof of work network`s latest blocks.

    Parameters

    • val: BlockNumberOrTag

    Returns void

  • get defaultChain(): string
  • Returns string

  • set defaultChain(val): void
  • Parameters

    • val: string

    Returns void

  • get defaultCommon(): undefined | Common
  • Will get the default common property The default common property does contain the following Common object:

    • customChain - Object: The custom chain properties
      • name - string: (optional) The name of the chain
      • networkId - number: Network ID of the custom chain
      • chainId - number: Chain ID of the custom chain
    • baseChain - string: (optional) mainnet, goerli, kovan, rinkeby, or ropsten
    • hardfork - string: (optional) chainstart, homestead, dao, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg, istanbul, berlin, or london Default is undefined.

    Returns undefined | Common

  • set defaultCommon(val): void
  • Will set the default common property

    Parameters

    • val: undefined | Common

    Returns void

  • get defaultHardfork(): string
  • Will return the default hardfork. Default is london The default hardfork property can be one of the following:

    • chainstart
    • homestead
    • dao
    • tangerineWhistle
    • spuriousDragon
    • byzantium
    • constantinople
    • petersburg
    • istanbul
    • berlin
    • london
    • 'arrowGlacier',
    • 'tangerineWhistle',
    • 'muirGlacier'

    Returns string

  • set defaultHardfork(val): void
  • Will set the default hardfork.

    Parameters

    • val: string

    Returns void

  • get defaultMaxPriorityFeePerGas(): Numbers
  • Returns Numbers

  • set defaultMaxPriorityFeePerGas(val): void
  • Parameters

    Returns void

  • get defaultNetworkId(): undefined | Numbers
  • Returns undefined | Numbers

  • set defaultNetworkId(val): void
  • Parameters

    Returns void

  • get defaultReturnFormat(): DataFormat
  • Returns DataFormat

  • set defaultReturnFormat(val): void
  • Parameters

    • val: DataFormat

    Returns void

  • get defaultTransactionType(): Numbers
  • Returns Numbers

  • set defaultTransactionType(val): void
  • Parameters

    Returns void

  • get enableExperimentalFeatures(): {
        useRpcCallSpecification: boolean;
        useSubscriptionWhenCheckingBlockTimeout: boolean;
    }
  • The enableExperimentalFeatures is used to enable trying new experimental features that are still not fully implemented or not fully tested or still have some related issues. Default is false for every feature.

    Returns {
        useRpcCallSpecification: boolean;
        useSubscriptionWhenCheckingBlockTimeout: boolean;
    }

    • useRpcCallSpecification: boolean
    • useSubscriptionWhenCheckingBlockTimeout: boolean
  • set enableExperimentalFeatures(val): void
  • Will set the enableExperimentalFeatures

    Parameters

    • val: {
          useRpcCallSpecification: boolean;
          useSubscriptionWhenCheckingBlockTimeout: boolean;
      }
      • useRpcCallSpecification: boolean
      • useSubscriptionWhenCheckingBlockTimeout: boolean

    Returns void

  • get givenProvider(): undefined | SupportedProviders<never>
  • Will return the givenProvider if available.

    When using web3.js in an Ethereum compatible browser, it will set with the current native provider by that browser. Will return the given provider by the (browser) environment, otherwise undefined.

    Returns undefined | SupportedProviders<never>

  • get handleRevert(): boolean
  • The handleRevert options property returns the revert reason string if enabled for the following methods:

    • web3.eth.sendTransaction()
    • web3.eth.call()
    • myContract.methods.myMethod().call()
    • myContract.methods.myMethod().send() Default is false.

    Note: At the moment handleRevert is only supported for sendTransaction and not for sendSignedTransaction

    Returns boolean

  • set handleRevert(val): void
  • Will set the handleRevert

    Parameters

    • val: boolean

    Returns void

  • get maxListenersWarningThreshold(): number
  • Returns number

  • set maxListenersWarningThreshold(val): void
  • Parameters

    • val: number

    Returns void

  • get provider(): undefined | Web3BaseProvider<API>
  • Will return the current provider.

    Returns undefined | Web3BaseProvider<API>

    Returns the current provider

    const web3 = new Web3Context("http://localhost:8545");
    console.log(web3.provider);
    > HttpProvider {
    clientUrl: 'http://localhost:8545',
    httpProviderOptions: undefined
    }
  • set provider(provider): void
  • Will set the current provider.

    Parameters

    • provider: undefined | string | SupportedProviders<API>

      The provider to set

      Accepted providers are of type SupportedProviders

    Returns void

     const web3Context = new web3ContextContext("http://localhost:8545");
    web3Context.provider = "ws://localhost:8545";
    console.log(web3Context.provider);
    > WebSocketProvider {
    _eventEmitter: EventEmitter {
    _events: [Object: null prototype] {},
    _eventsCount: 0,
    ...
    }
  • get requestManager(): Web3RequestManager<API>
  • Returns Web3RequestManager<API>

  • get subscriptionManager(): Web3SubscriptionManager<API, RegisteredSubs>
  • Will return the current subscriptionManager (Web3SubscriptionManager)

    Returns Web3SubscriptionManager<API, RegisteredSubs>

  • get transactionBlockTimeout(): number
  • The transactionBlockTimeout is used over socket-based connections. This option defines the amount of new blocks it should wait until the first confirmation happens, otherwise the PromiEvent rejects with a timeout error. Default is 50.

    Returns number

  • set transactionBlockTimeout(val): void
  • Will set the transactionBlockTimeout.

    Parameters

    • val: number

    Returns void

  • get transactionBuilder(): undefined | TransactionBuilder<unknown>
  • Returns undefined | TransactionBuilder<unknown>

  • set transactionBuilder(val): void
  • Parameters

    • val: undefined | TransactionBuilder<unknown>

    Returns void

  • get transactionConfirmationBlocks(): number
  • This defines the number of blocks it requires until a transaction is considered confirmed. Default is 24.

    Returns number

  • set transactionConfirmationBlocks(val): void
  • Will set the transactionConfirmationBlocks.

    Parameters

    • val: number

    Returns void

  • get transactionConfirmationPollingInterval(): undefined | number
  • Returns undefined | number

  • set transactionConfirmationPollingInterval(val): void
  • Parameters

    • val: undefined | number

    Returns void

  • get transactionPollingInterval(): number
  • Used over HTTP connections. This option defines the number of seconds between Web3 calls for a receipt which confirms that a transaction was mined by the network. Default is 1000 ms.

    Returns number

  • set transactionPollingInterval(val): void
  • Will set the transactionPollingInterval.

    Parameters

    • val: number

    Returns void

  • get transactionPollingTimeout(): number
  • Used over HTTP connections. This option defines the number of seconds Web3 will wait for a receipt which confirms that a transaction was mined by the network. Note: If this method times out, the transaction may still be pending. Default is 750 seconds (12.5 minutes).

    Returns number

  • set transactionPollingTimeout(val): void
  • Will set the transactionPollingTimeout.

    Parameters

    • val: number

    Returns void

  • get transactionReceiptPollingInterval(): undefined | number
  • The transactionPollingInterval is used over HTTP connections. This option defines the number of seconds between Web3 calls for a receipt which confirms that a transaction was mined by the network. Default is undefined

    Returns undefined | number

  • set transactionReceiptPollingInterval(val): void
  • Will set the transactionReceiptPollingInterval

    Parameters

    • val: undefined | number

    Returns void

  • get transactionSendTimeout(): number
  • The time used to wait for Ethereum Node to return the sent transaction result. Note: If the RPC call stuck at the Node and therefor timed-out, the transaction may still be pending or even mined by the Network. We recommend checking the pending transactions in such a case. Default is 750 seconds (12.5 minutes).

    Returns number

  • set transactionSendTimeout(val): void
  • Will set the transactionSendTimeout.

    Parameters

    • val: number

    Returns void

  • get transactionTypeParser(): undefined | TransactionTypeParser
  • Returns undefined | TransactionTypeParser

  • set transactionTypeParser(val): void
  • Parameters

    • val: undefined | TransactionTypeParser

    Returns void

  • get wallet(): undefined | Web3BaseWallet<Web3BaseWalletAccount>
  • Returns undefined | Web3BaseWallet<Web3BaseWalletAccount>

Methods

  • Checks if the provided overrides are appropriately configured for a specific deployment type.

    Parameters

    • Optionaloverrides: Overrides

      The overrides to be checked.

    Returns void

    If:

    • overrides.customData.salt is not provided for Create2 deployment type.
    • Provided overrides.customData.salt is not 32 bytes in hex format.
    • overrides.customData.factoryDeps is not array of bytecodes.
  • Deploys a new contract or account instance on the L2 blockchain.

    Parameters

    • Optionalargs: ContractConstructorArgs<Abi>

      Constructor arguments for the contract

    • Optionaloverrides: Overrides

      Used for providing salt to create2 and create2Account deployment types and for providing custom factoryDeps

    Returns Promise<Contract<Abi> & {
        deploymentTransaction(): TransactionReceipt;
    }>

    const deployedContract = await contractFactory.deploy(arg1, arg2, ...);
    
    const deployedContractWithSaltAndDeps = await contractFactory.deploy(arg1, arg2, ..., {
    customData: {
    factoryDeps: ['0x...']
    }
    });
    const deployedContractWithSalt = await contractFactory.deploy(arg1, arg2, ..., {
    customData: {
    salt: '0x...'
    }
    });
    const deployedContractWithSaltAndDeps = await contractFactory.deploy(arg1, arg2, ..., {
    customData: {
    salt: '0x...',
    factoryDeps: ['0x...']
    }
    });
  • Type Parameters

    • K extends Web3ConfigEvent

    Parameters

    • eventName: K
    • params: {
          CONFIG_CHANGE:
              | {
                  name: "handleRevert";
                  newValue: boolean;
                  oldValue: boolean;
              }
              | {
                  name: "defaultAccount";
                  newValue: undefined | string;
                  oldValue: undefined | string;
              }
              | {
                  name: "defaultBlock";
                  newValue: BlockNumberOrTag;
                  oldValue: BlockNumberOrTag;
              }
              | {
                  name: "transactionSendTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionBlockTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionConfirmationBlocks";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionPollingInterval";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionPollingTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionReceiptPollingInterval";
                  newValue: undefined | number;
                  oldValue: undefined | number;
              }
              | {
                  name: "transactionConfirmationPollingInterval";
                  newValue: undefined | number;
                  oldValue: undefined | number;
              }
              | {
                  name: "blockHeaderTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "maxListenersWarningThreshold";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "contractDataInputFill";
                  newValue: "input" | "data" | "both";
                  oldValue: "input" | "data" | "both";
              }
              | {
                  name: "defaultNetworkId";
                  newValue: undefined | Numbers;
                  oldValue: undefined | Numbers;
              }
              | {
                  name: "defaultChain";
                  newValue: string;
                  oldValue: string;
              }
              | {
                  name: "defaultHardfork";
                  newValue: string;
                  oldValue: string;
              }
              | {
                  name: "defaultCommon";
                  newValue: undefined | Common;
                  oldValue: undefined | Common;
              }
              | {
                  name: "defaultTransactionType";
                  newValue: Numbers;
                  oldValue: Numbers;
              }
              | {
                  name: "defaultMaxPriorityFeePerGas";
                  newValue: Numbers;
                  oldValue: Numbers;
              }
              | {
                  name: "enableExperimentalFeatures";
                  newValue: {
                      useRpcCallSpecification: boolean;
                      useSubscriptionWhenCheckingBlockTimeout: boolean;
                  };
                  oldValue: {
                      useRpcCallSpecification: boolean;
                      useSubscriptionWhenCheckingBlockTimeout: boolean;
                  };
              }
              | {
                  name: "transactionBuilder";
                  newValue: undefined | TransactionBuilder;
                  oldValue: undefined | TransactionBuilder;
              }
              | {
                  name: "transactionTypeParser";
                  newValue: undefined | TransactionTypeParser;
                  oldValue: undefined | TransactionTypeParser;
              }
              | {
                  name: "defaultReturnFormat";
                  newValue: DataFormat;
                  oldValue: DataFormat;
              };
      }[K]

    Returns void

  • Returns (string | symbol)[]

  • This method allows extending the web3 modules. Note: This method is only for backward compatibility, and It is recommended to use Web3 v4 Plugin feature for extending web3.js functionality if you are developing something new.

    Parameters

    • extendObj: ExtensionObject

    Returns this

  • Returns Web3ContextObject<unknown, any>

  • Returns number

  • Link current context to another context.

    Type Parameters

    • T extends Web3Context<unknown, any>

    Parameters

    • parentContext: T

    Returns void

  • Type Parameters

    • K extends Web3ConfigEvent

    Parameters

    • eventName: K

    Returns number

  • Type Parameters

    • K extends Web3ConfigEvent

    Parameters

    • eventName: K

    Returns ((...args: any[]) => void)[]

  • Type Parameters

    • K extends Web3ConfigEvent

    Parameters

    • eventName: K
    • fn: Web3EventCallback<{
          CONFIG_CHANGE:
              | {
                  name: "handleRevert";
                  newValue: boolean;
                  oldValue: boolean;
              }
              | {
                  name: "defaultAccount";
                  newValue: undefined | string;
                  oldValue: undefined | string;
              }
              | {
                  name: "defaultBlock";
                  newValue: BlockNumberOrTag;
                  oldValue: BlockNumberOrTag;
              }
              | {
                  name: "transactionSendTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionBlockTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionConfirmationBlocks";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionPollingInterval";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionPollingTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionReceiptPollingInterval";
                  newValue: undefined | number;
                  oldValue: undefined | number;
              }
              | {
                  name: "transactionConfirmationPollingInterval";
                  newValue: undefined | number;
                  oldValue: undefined | number;
              }
              | {
                  name: "blockHeaderTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "maxListenersWarningThreshold";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "contractDataInputFill";
                  newValue: "input" | "data" | "both";
                  oldValue: "input" | "data" | "both";
              }
              | {
                  name: "defaultNetworkId";
                  newValue: undefined | Numbers;
                  oldValue: undefined | Numbers;
              }
              | {
                  name: "defaultChain";
                  newValue: string;
                  oldValue: string;
              }
              | {
                  name: "defaultHardfork";
                  newValue: string;
                  oldValue: string;
              }
              | {
                  name: "defaultCommon";
                  newValue: undefined | Common;
                  oldValue: undefined | Common;
              }
              | {
                  name: "defaultTransactionType";
                  newValue: Numbers;
                  oldValue: Numbers;
              }
              | {
                  name: "defaultMaxPriorityFeePerGas";
                  newValue: Numbers;
                  oldValue: Numbers;
              }
              | {
                  name: "enableExperimentalFeatures";
                  newValue: {
                      useRpcCallSpecification: boolean;
                      useSubscriptionWhenCheckingBlockTimeout: boolean;
                  };
                  oldValue: {
                      useRpcCallSpecification: boolean;
                      useSubscriptionWhenCheckingBlockTimeout: boolean;
                  };
              }
              | {
                  name: "transactionBuilder";
                  newValue: undefined | TransactionBuilder;
                  oldValue: undefined | TransactionBuilder;
              }
              | {
                  name: "transactionTypeParser";
                  newValue: undefined | TransactionTypeParser;
                  oldValue: undefined | TransactionTypeParser;
              }
              | {
                  name: "defaultReturnFormat";
                  newValue: DataFormat;
                  oldValue: DataFormat;
              };
      }[K]>

    Returns void

  • Type Parameters

    • K extends Web3ConfigEvent

    Parameters

    • eventName: K
    • fn: Web3EventCallback<{
          CONFIG_CHANGE:
              | {
                  name: "handleRevert";
                  newValue: boolean;
                  oldValue: boolean;
              }
              | {
                  name: "defaultAccount";
                  newValue: undefined | string;
                  oldValue: undefined | string;
              }
              | {
                  name: "defaultBlock";
                  newValue: BlockNumberOrTag;
                  oldValue: BlockNumberOrTag;
              }
              | {
                  name: "transactionSendTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionBlockTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionConfirmationBlocks";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionPollingInterval";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionPollingTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionReceiptPollingInterval";
                  newValue: undefined | number;
                  oldValue: undefined | number;
              }
              | {
                  name: "transactionConfirmationPollingInterval";
                  newValue: undefined | number;
                  oldValue: undefined | number;
              }
              | {
                  name: "blockHeaderTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "maxListenersWarningThreshold";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "contractDataInputFill";
                  newValue: "input" | "data" | "both";
                  oldValue: "input" | "data" | "both";
              }
              | {
                  name: "defaultNetworkId";
                  newValue: undefined | Numbers;
                  oldValue: undefined | Numbers;
              }
              | {
                  name: "defaultChain";
                  newValue: string;
                  oldValue: string;
              }
              | {
                  name: "defaultHardfork";
                  newValue: string;
                  oldValue: string;
              }
              | {
                  name: "defaultCommon";
                  newValue: undefined | Common;
                  oldValue: undefined | Common;
              }
              | {
                  name: "defaultTransactionType";
                  newValue: Numbers;
                  oldValue: Numbers;
              }
              | {
                  name: "defaultMaxPriorityFeePerGas";
                  newValue: Numbers;
                  oldValue: Numbers;
              }
              | {
                  name: "enableExperimentalFeatures";
                  newValue: {
                      useRpcCallSpecification: boolean;
                      useSubscriptionWhenCheckingBlockTimeout: boolean;
                  };
                  oldValue: {
                      useRpcCallSpecification: boolean;
                      useSubscriptionWhenCheckingBlockTimeout: boolean;
                  };
              }
              | {
                  name: "transactionBuilder";
                  newValue: undefined | TransactionBuilder;
                  oldValue: undefined | TransactionBuilder;
              }
              | {
                  name: "transactionTypeParser";
                  newValue: undefined | TransactionTypeParser;
                  oldValue: undefined | TransactionTypeParser;
              }
              | {
                  name: "defaultReturnFormat";
                  newValue: DataFormat;
                  oldValue: DataFormat;
              };
      }[K]>

    Returns void

  • Type Parameters

    • K extends Web3ConfigEvent

    Parameters

    • eventName: K
    • fn: Web3EventCallback<{
          CONFIG_CHANGE:
              | {
                  name: "handleRevert";
                  newValue: boolean;
                  oldValue: boolean;
              }
              | {
                  name: "defaultAccount";
                  newValue: undefined | string;
                  oldValue: undefined | string;
              }
              | {
                  name: "defaultBlock";
                  newValue: BlockNumberOrTag;
                  oldValue: BlockNumberOrTag;
              }
              | {
                  name: "transactionSendTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionBlockTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionConfirmationBlocks";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionPollingInterval";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionPollingTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "transactionReceiptPollingInterval";
                  newValue: undefined | number;
                  oldValue: undefined | number;
              }
              | {
                  name: "transactionConfirmationPollingInterval";
                  newValue: undefined | number;
                  oldValue: undefined | number;
              }
              | {
                  name: "blockHeaderTimeout";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "maxListenersWarningThreshold";
                  newValue: number;
                  oldValue: number;
              }
              | {
                  name: "contractDataInputFill";
                  newValue: "input" | "data" | "both";
                  oldValue: "input" | "data" | "both";
              }
              | {
                  name: "defaultNetworkId";
                  newValue: undefined | Numbers;
                  oldValue: undefined | Numbers;
              }
              | {
                  name: "defaultChain";
                  newValue: string;
                  oldValue: string;
              }
              | {
                  name: "defaultHardfork";
                  newValue: string;
                  oldValue: string;
              }
              | {
                  name: "defaultCommon";
                  newValue: undefined | Common;
                  oldValue: undefined | Common;
              }
              | {
                  name: "defaultTransactionType";
                  newValue: Numbers;
                  oldValue: Numbers;
              }
              | {
                  name: "defaultMaxPriorityFeePerGas";
                  newValue: Numbers;
                  oldValue: Numbers;
              }
              | {
                  name: "enableExperimentalFeatures";
                  newValue: {
                      useRpcCallSpecification: boolean;
                      useSubscriptionWhenCheckingBlockTimeout: boolean;
                  };
                  oldValue: {
                      useRpcCallSpecification: boolean;
                      useSubscriptionWhenCheckingBlockTimeout: boolean;
                  };
              }
              | {
                  name: "transactionBuilder";
                  newValue: undefined | TransactionBuilder;
                  oldValue: undefined | TransactionBuilder;
              }
              | {
                  name: "transactionTypeParser";
                  newValue: undefined | TransactionTypeParser;
                  oldValue: undefined | TransactionTypeParser;
              }
              | {
                  name: "defaultReturnFormat";
                  newValue: DataFormat;
                  oldValue: DataFormat;
              };
      }[K]>

    Returns void

  • Parameters

    • plugin: Web3PluginBase<unknown>

    Returns void

  • Returns EventEmitter

  • Parameters

    • options: Partial<Web3ConfigOptions>

    Returns void

  • Parameters

    • maxListenersWarningThreshold: number

    Returns void

  • Will set the provider.

    Parameters

    • Optionalprovider: string | SupportedProviders<unknown>

      SupportedProviders The provider to set

    Returns boolean

    Returns true if the provider was set

  • Parameters

    • requestManagerMiddleware: RequestManagerMiddleware<unknown>

    Returns void

  • Use to create new object of any type extended by Web3Context and link it to current context. This can be used to initiate a global context object and then use it to create new objects of any type extended by Web3Context.

    Type Parameters

    • T extends Web3Context<unknown, any>
    • T2 extends unknown[]

    Parameters

    • ContextRef: Web3ContextConstructor<T, T2>
    • Rest...args: [...T2[]]

    Returns T

  • Type Parameters

    • T extends Web3Context<unknown, any>
    • T3 extends unknown[]

    Parameters

    • this: Web3ContextConstructor<T, T3>
    • Rest...args: [Web3ContextObject<unknown, any>, ...T3[]]

    Returns T