Skip to main content

HttpProvider <API>

Hierarchy

Index

Constructors

constructor

  • new HttpProvider<API>(clientUrl: string, httpProviderOptions?: HttpProviderOptions): default<API>
  • Type parameters

    Parameters

    • clientUrl: string
    • optionalhttpProviderOptions: HttpProviderOptions

    Returns default<API>

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

connect

  • connect(): void
  • Returns void

disconnect

  • disconnect(): void
  • Returns void

getStatus

on

  • on(): void
  • Returns void

once

  • once(): void
  • Returns void

reconnect

  • reconnect(): void
  • Returns void

removeAllListeners

  • removeAllListeners(): void
  • Returns void

removeListener

  • removeListener(): void
  • Returns void

request

reset

  • reset(): void
  • Returns void

send

  • @deprecated

    Please use .request instead.


    Type parameters

    Parameters

    Returns void

sendAsync

supportsSubscriptions

  • supportsSubscriptions(): boolean
  • Returns boolean

staticisWeb3Provider

  • isWeb3Provider(provider: unknown): boolean
  • Parameters

    • provider: unknown

    Returns boolean