Skip to main content

abstractEip1193Provider <API>

This is an abstract class, which extends Web3BaseProvider class. This class is used to implement a provider that adheres to the EIP-1193 standard for Ethereum providers.

Hierarchy

Index

Constructors

constructor

Accessors

[symbol]

  • get [symbol](): boolean
  • Returns boolean

Methods

asEIP1193Provider

  • Modify the return type of the request method to be fully compatible with EIP-1193

    [deprecated] In the future major releases (&gt;= v5) all providers are supposed to be fully compatible with EIP-1193. So this method will not be needed and would not be available in the future.

    @example
    const provider = new Web3HttpProvider('http://localhost:8545');
    const fullyCompatibleProvider = provider.asEIP1193Provider();
    const result = await fullyCompatibleProvider.request({ method: 'eth_getBalance' });
    console.log(result); // '0x0234c8a3397aab58' or something like that

    Returns Eip1193Compatible<API>

    A new instance of the provider with the request method fully compatible with EIP-1193

abstractconnect

  • connect(): void
  • Returns void

abstractdisconnect

  • disconnect(code?: number, data?: string): void
  • Parameters

    • optionalcode: number
    • optionaldata: string

    Returns void

abstractgetStatus

abstracton

abstractonce

optionalabstractremoveAllListeners

  • removeAllListeners(type: string): void
  • Parameters

    • type: string

    Returns void

abstractremoveListener

abstractrequest

abstractreset

  • reset(): void
  • Returns void

send

sendAsync

abstractsupportsSubscriptions

  • supportsSubscriptions(): boolean
  • Returns boolean

staticisWeb3Provider

  • isWeb3Provider(provider: unknown): boolean
  • Parameters

    • provider: unknown

    Returns boolean