Constructors

  • Constructs a new instance of the CheckoutModule class.

    Parameters

    Returns Checkout

Properties

fiatRampService: FiatRampService
availability: AvailabilityService
passport?: Passport

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>

  • Creates a provider using the given parameters.

    Parameters

    Returns Promise<CreateProviderResult>

    A promise that resolves to the created provider.

  • Returns a list of EIP-6963 injected providers and their metadata.

    Returns readonly EIP6963ProviderDetail[]

  • Finds an injected provider by its RDNS.

    Parameters

    • args: {
          rdns: string;
      }

      The parameters for finding the injected provider.

      • rdns: string

    Returns undefined | EIP6963ProviderDetail

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

    Parameters

    Returns (() => void)

      • (): void
      • Returns void

  • Returns void

  • Checks if a wallet is connected to the specified provider.

    Parameters

    Returns Promise<CheckConnectionResult>

    • A promise that resolves to the result of the check.
  • Checks if an address is sanctioned.

    Parameters

    • address: string

      The address to check.

    • environment: Environment

      The environment to check.

    Returns Promise<boolean>

    • A promise that resolves to the result of the check.
  • Connects to a blockchain network using the specified provider.

    Parameters

    • params: ConnectParams

      The parameters for connecting to the network.

    Returns Promise<ConnectResult>

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

    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.
  • Switches the network for the current wallet provider.

    Parameters

    Returns Promise<SwitchNetworkResult>

    • A promise that resolves to the result of switching 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<TokenInfo>

    • A promise that resolves to the token info request.
  • Retrieves the balance of a wallet address.

    Parameters

    Returns Promise<GetBalanceResult>

    • A promise that resolves to the balance result.
  • Retrieves the balances of all tokens for a given wallet address on a specific chain.

    Parameters

    Returns Promise<GetAllBalancesResult>

    • A promise that resolves to the result of retrieving the balances.
  • Retrieves the supported networks based on the provided parameters.

    Parameters

    Returns Promise<GetNetworkAllowListResult>

    • A promise that resolves to the network allow list result.
  • Retrieves the supported tokens based on the provided parameters.

    Parameters

    Returns Promise<GetTokenAllowListResult>

    • A promise that resolves to the token allow list result.
  • Retrieves the default supported wallets based on the provided parameters.

    Parameters

    Returns Promise<GetWalletAllowListResult>

    • A promise that resolves to the wallet allow list result.
  • Sends a transaction using the specified provider and transaction parameters.

    Parameters

    Returns Promise<SendTransactionResult>

    A promise that resolves to the result of the transaction.

  • 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: 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<NetworkInfo>

    A promise that resolves to the network information.

  • Determines the requirements for performing a buy.

    Parameters

    • params: BuyParams

      The parameters for the buy.

    Returns Promise<BuyResult>

    Please use orderbook.fulfillOrder or orderbook.fulfillBulkOrders instead. The smartCheckout method can still be used to ensure the transaction requirements are met before preparing the order fulfillment

  • Determines the requirements for performing a sell.

    Parameters

    • params: 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<SellResult>

    Please use orderbook.prepareListing or orderbook.prepareBulkListing instead. The smartCheckout method can still be used to ensure the transaction requirements are met before preparing the listing

  • Cancels a sell.

    Parameters

    Returns Promise<CancelResult>

    Please use orderbook.prepareOrderCancellations instead.

  • Determines the transaction requirements to complete a purchase.

    Parameters

    Returns Promise<SmartCheckoutResult>

    params - The parameters for smart checkout.

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

    Parameters

    Returns Promise<string>

    • A promise that resolves to a string url.
  • Fetches fiat ramp fee estimations.

    Returns Promise<OnRampProviderFees>

    • A promise that resolves to OnRampProviderFees.
  • Fetches Swap widget availability.

    Returns Promise<boolean>

    • A promise that resolves to a boolean.
  • Fetches a quote and then performs the approval and swap transaction.

    Parameters

    • params: SwapParams

      The parameters for the swap.

    Returns Promise<SwapResult>

    • A promise that resolves to the swap result (swap tx, swap tx receipt, quote used in the swap).
  • Fetches a quote for the swap.

    Parameters

    • params: SwapParams

      The parameters for the swap.

    Returns Promise<SwapQuoteResult>

    • A promise that resolves to the swap quote result.