Provides a connection to the L1 chain.

Hierarchy

  • Web3ZkSync
    • Web3ZKsyncL1

Constructors

  • Parameters

    • OptionalproviderOrContext: string | SupportedProviders<any> | Web3ContextInitOptions

    Returns Web3ZKsyncL1

Properties

_accountProvider?: Web3AccountProvider<Web3BaseWalletAccount>
_contractAddresses: {
    baseToken?: string;
    bridgehubContract?: string;
    erc20BridgeL1?: string;
    erc20BridgeL2?: string;
    mainContract?: string;
    sharedBridgeL1?: string;
    sharedBridgeL2?: string;
    wethBridgeL1?: string;
    wethBridgeL2?: string;
}
_requestManager: Web3RequestManager<EthExecutionAPI>
_subscriptionManager: Web3SubscriptionManager<EthExecutionAPI, RegisteredSubscription>
_wallet?: Web3BaseWallet<Web3BaseWalletAccount>
config: Web3ConfigOptions
eth: Web3EthInterface
providers: {
    HttpProvider: Web3BaseProviderConstructor;
    WebsocketProvider: Web3BaseProviderConstructor;
}
utils: __module
ZKsync: ZKsyncPlugin
givenProvider?: SupportedProviders<never>
modules: {
    ENS: typeof ENS;
    Iban: typeof Iban;
    Net: typeof Net;
    Personal: typeof Personal;
    Web3Eth: typeof Web3Eth;
}
onNewProviderDiscovered: ((callback: ((providerEvent: EIP6963AnnounceProviderEvent<unknown>) => void)) => void)
providers: {
    HttpProvider: Web3BaseProviderConstructor;
    WebsocketProvider: Web3BaseProviderConstructor;
}
requestEIP6963Providers: (() => Promise<unknown>)
utils: __module
version: string

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

  • Returns {
        baseToken?: string;
        bridgehubContract?: string;
        erc20BridgeL1?: string;
        erc20BridgeL2?: string;
        mainContract?: string;
        sharedBridgeL1?: string;
        sharedBridgeL2?: string;
        wethBridgeL1?: string;
        wethBridgeL2?: string;
    }

    • OptionalbaseToken?: string
    • OptionalbridgehubContract?: string
    • Optionalerc20BridgeL1?: string
    • Optionalerc20BridgeL2?: string
    • OptionalmainContract?: string
    • OptionalsharedBridgeL1?: string
    • OptionalsharedBridgeL2?: string
    • OptionalwethBridgeL1?: string
    • OptionalwethBridgeL2?: string
  • 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

  • Parameters

    • address: string
    • OptionalblockTag: BlockNumberOrTag
    • OptionaltokenAddress: string

    Returns Promise<bigint>

  • Returns Web3ContextObject<EthExecutionAPI, RegisteredSubscription>

  • Returns number

  • Parameters

    • token: string
    • walletAddress: string

    Returns Promise<bigint>

  • 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

    • transaction: Eip712TxData
    • returnFormat: DataFormat = DEFAULT_RETURN_FORMAT

    Returns {
        accessList?: null | [string | Uint8Array, (string | Uint8Array)[]][] | {
            address: string;
            storageKeys: string[];
        }[];
        chainId?: string | number | bigint;
        customData?: null | {
            customSignature?: string | Uint8Array;
            factoryDeps?: (string | Uint8Array)[];
            gasPerPubdata?: string | number | bigint;
            paymasterParams?: {
                paymaster: string;
                paymasterInput: string | Uint8Array;
            };
        };
        data?:
            | string
            | number
            | bigint
            | number[]
            | Uint8Array;
        eip712Meta?: null | {
            customSignature?: string | Uint8Array;
            factoryDeps?: (string | Uint8Array)[];
            gasPerPubdata?: string | number | bigint;
            paymasterParams?: {
                paymaster: string;
                paymasterInput: string | Uint8Array;
            };
        };
        from?: string;
        gasLimit?:
            | string
            | number
            | bigint
            | Uint8Array;
        gasPrice?:
            | null
            | string
            | number
            | bigint
            | Uint8Array;
        hash?: string;
        maxFeePerGas?:
            | string
            | number
            | bigint
            | Uint8Array;
        maxPriorityFeePerGas?:
            | string
            | number
            | bigint
            | Uint8Array;
        nonce?:
            | string
            | number
            | bigint
            | Uint8Array;
        r?:
            | string
            | number
            | bigint
            | Uint8Array;
        s?:
            | string
            | number
            | bigint
            | Uint8Array;
        signature?: string;
        to?: string | Uint8Array | Address;
        type?: string | number | bigint;
        v?:
            | string
            | number
            | bigint
            | Uint8Array;
        value?:
            | string
            | number
            | bigint
            | Uint8Array;
    }

    • OptionalaccessList?: null | [string | Uint8Array, (string | Uint8Array)[]][] | {
          address: string;
          storageKeys: string[];
      }[]

      The access list which contains the addresses/storage slots which the transaction wishes to access

    • OptionalchainId?: string | number | bigint

      The transaction's chain ID

    • OptionalcustomData?: null | {
          customSignature?: string | Uint8Array;
          factoryDeps?: (string | Uint8Array)[];
          gasPerPubdata?: string | number | bigint;
          paymasterParams?: {
              paymaster: string;
              paymasterInput: string | Uint8Array;
          };
      }
    • Optionaldata?:
          | string
          | number
          | bigint
          | number[]
          | Uint8Array

      This will contain the data of the message or the init of a contract.

    • Optionaleip712Meta?: null | {
          customSignature?: string | Uint8Array;
          factoryDeps?: (string | Uint8Array)[];
          gasPerPubdata?: string | number | bigint;
          paymasterParams?: {
              paymaster: string;
              paymasterInput: string | Uint8Array;
          };
      }

      The custom data for EIP712 transaction metadata.

    • Optionalfrom?: string
    • OptionalgasLimit?:
          | string
          | number
          | bigint
          | Uint8Array

      The transaction's gas limit.

    • OptionalgasPrice?:
          | null
          | string
          | number
          | bigint
          | Uint8Array

      The transaction's gas price. To be used if maxPriorityFeePerGas and maxFeePerGas were not provided

    • Optionalhash?: string
    • OptionalmaxFeePerGas?:
          | string
          | number
          | bigint
          | Uint8Array

      The maximum total fee

    • OptionalmaxPriorityFeePerGas?:
          | string
          | number
          | bigint
          | Uint8Array

      The maximum inclusion fee per gas (this fee is given to the miner)

    • Optionalnonce?:
          | string
          | number
          | bigint
          | Uint8Array

      The transaction's nonce.

    • Optionalr?:
          | string
          | number
          | bigint
          | Uint8Array

      EC signature parameter.

    • Optionals?:
          | string
          | number
          | bigint
          | Uint8Array

      EC signature parameter.

    • Optionalsignature?: string
    • Optionalto?: string | Uint8Array | Address

      The transaction's the address is sent to.

    • Optionaltype?: string | number | bigint

      The transaction type

    • Optionalv?:
          | string
          | number
          | bigint
          | Uint8Array

      EC recovery ID.

    • Optionalvalue?:
          | string
          | number
          | bigint
          | Uint8Array

      The amount of Ether sent.

  • Parameters

    • plugin: Web3PluginBase<unknown>

    Returns void

  • Returns EventEmitter

  • Parameters

    • signedTx: string

    Returns Promise<string>

  • Parameters

    Returns Promise<TransactionReceipt>

  • Parameters

    • options: Partial<Web3ConfigOptions>

    Returns void

  • Parameters

    • maxListenersWarningThreshold: number

    Returns void

  • Will set the provider.

    Parameters

    • Optionalprovider: string | SupportedProviders<EthExecutionAPI>

      SupportedProviders The provider to set

    Returns boolean

    Returns true if the provider was set

  • Parameters

    • requestManagerMiddleware: RequestManagerMiddleware<EthExecutionAPI>

    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