Module

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

exchange

ExchangeModule (optional)

The exchange module configuration. If undefined, the exchange module will be disabled.

onRamp

OnRampModule (optional)

The on-ramp module configuration. If undefined, the on-ramp module will be disabled. If enabled, the onRampConfig must be provided.

bridgeAndSwap

FKBridgeAndSwapModule

The 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

enabled

boolean (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

enabled

boolean | undefined

Whether the on-ramp module is enabled. Default is true.

onRampConfig

OnRampConfig

Configuration for the on-ramp module.

OnRampConfig

PropertyTypeDescription

enabled

boolean (optional)

Whether the on-ramp module is enabled. Default is true.

onRampConfig

OnRampConfig

Configuration for the on-ramp module. Required if the module is enabled.

FKBridgeAndSwapModule

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

PropertyTypeDescription

enabled

boolean (optional)

Whether the bridge and swap module is enabled. Default is true.

fetchOnlyDestinationBalance

boolean (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".

Example

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

Last updated