Hierarchy

  • Checkout

Constructors

Properties

readOnlyProviders: any
httpClient: any
fiatRampService: FiatRampService
availability: AvailabilityService
passport?: passport.Passport
loadUmdBundle: any
loadEsModules: any

Methods

  • Checks if the given object is a Web3 provider.

    Parameters

    • web3Provider: Web3Provider

      The object to check.

    Returns boolean

    • True if the object is a Web3 provider, false otherwise.
  • Loads the widgets bundle and initiate the widgets factory.

    Parameters

    • init: WidgetsInit

      The initialisation parameters for loading the widgets bundle and applying configuration

    Returns Promise<WidgetsFactory>

  • Finds an injected provider by its RDNS.

    Parameters

    • args: {
          rdns: string;
      }

      The parameters for finding the injected provider.

      • rdns: string

    Returns undefined | checkout.EIP6963ProviderDetail

    • The found provider and metadata or undefined.
  • Subscribes to changes in the injected providers.

    Parameters

    • listener: ((providers) => void)

      The listener to be called when the injected providers change.

    Returns (() => void)

      • (): void
      • Subscribes to changes in the injected providers.

        Returns void

  • Connects to a blockchain network using the specified provider.

    Parameters

    Returns Promise<checkout.ConnectResult>

    A promise that resolves to an object containing the provider and network information.

    Throws

    If the provider is not valid or if there is an error connecting to the network.

  • Adds the network for the current wallet provider.

    Parameters

    • params: AddNetworkParams

      The parameters for adding the network.

    Returns Promise<any>

    • A promise that resolves to the result of adding the network.
  • Retrieves the token information given the token address. This function makes RPC calls to ERC20 contracts to fetch the main contract information (e.g. symbol).

    Parameters

    Returns Promise<checkout.TokenInfo>

    • A promise that resolves to the token info request.
  • Wraps a Web3Provider call to validate the provider and handle errors.

    Type Parameters

    • T

    Parameters

    • web3Provider: Web3Provider

      The provider to connect to the network.

    • block: ((web3Provider) => Promise<T>)

      The block executing the provider call.

        • (web3Provider): Promise<T>
        • Parameters

          • web3Provider: Web3Provider

          Returns Promise<T>

    Returns Promise<T>

    Returns the result of the provided block param.

  • Retrieves network information using the specified provider.

    Parameters

    Returns Promise<checkout.NetworkInfo>

    A promise that resolves to the network information.

  • Determines the requirements for performing a sell.

    Parameters

    • params: checkout.SellParams

      The parameters for the sell. Only currently actions the first order in the array until we support batch processing. Only currently actions the first fee in the fees array of each order until we support multiple fees.

    Returns Promise<checkout.SellResult>

  • Creates and returns a URL for the fiat ramp widget.

    Parameters

    Returns Promise<string>

    • A promise that resolves to a string url.
  • Fetches Swap widget availability.

    Returns Promise<boolean>

    • A promise that resolves to a boolean.

Generated using TypeDoc