The module allows you to display different funding options in the widget. Currently, there are three options available: Fund from Exchange, Fund from Card or Bank Account, and Fund from EOA.

You can configure which Funding options you want to show in config

FKModule Interface

This is the main interface of FKModule type which you have to provide while defining config.

PropertyTypeDescription
exchangeExchangeModule (optional)The exchange module configuration. If undefined, the exchange module will be disabled.
onRampOnRampModule (optional)The on-ramp module configuration. If undefined, the on-ramp module will be disabled. If enabled, the onRampConfig must be provided.
bridgeAndSwapFKBridgeAndSwapModuleThe bridge and swap module configuration. If undefined, the bridge and swap module will be disabled.

ExchangeModule

By setting enabled true or false, you can enable or disable option to Fund from centralised exchanges.

PropertyTypeDescription
enabledboolean (optional)Whether the exchange module is enabled. Default is true.

OnRampModule

You can set enabled to true which enables option to fund from Bank Account or Card.

PropertyTypeDescription
enabledboolean | undefinedWhether the on-ramp module is enabled. Default is true.
onRampConfigOnRampBaseConfiguration for the on-ramp module.

OnRampConfig

PropertyTypeDescription
customerIdstringTo uniquely identify the user.
exchangeScreenTitlestring | undefinedCustom copy to show in widget.

FKBridgeAndSwapModule

Info: RouteType can be Value, Fee or Time. It helps to optimise route for bridging and swapping.

PropertyTypeDescription
enabledboolean (optional)Whether the bridge and swap module is enabled. Default is true.
fetchOnlyDestinationBalanceboolean (optional)Whether to fetch only the destination chain’s balance. Default is false.
routeType”Fee” | “Time” | “Value”The type of route to be used. Default is “Value”.
connectorsSourceConnectorName | SourceConnectorName[] | undefinedSpecifies source connector of the client.

Example

const config: FKConfig = {
    appName: "Aarc",
    module: {
      exchange: {
        enabled: false,
      },
      onRamp: {
        enabled: true,
        onRampConfig: {
          customerId: 123
        },
      },
      bridgeAndSwap: {
        enabled: true,
        fetchOnlyDestinationBalance: false,
        routeType: "Value",
        connectors: [SourceConnectorName.ETHEREUM],
      },
    },
    // remaining config...
  };