Config

FKConfig

Configuration object which contains all information about widget. You can learn about sub types in each other their sections.

Name
Type
Description

appName

string

Application name

apiKeys

ApiKeys

API keys for services

appearance

Visual customisation options

destination

Transaction destination details

events

Event callback functions

module

Module configurations

origin

string (URL)

Origin URL

Example

  const config: FKConfig = {
    appName: "Dapp Name",
    module: {
      exchange: {
        enabled: false,
      },
      onRamp: {
        enabled: true,
        onRampConfig: {
          customerId: "123", // replace with any unique id for the user
          exchangeScreenTitle: "Deposit funds in your wallet", // replace with custom copy 
        },
      },
      bridgeAndSwap: {
        enabled: true,
        fetchOnlyDestinationBalance: false,
        routeType: "Value",
        connectors: [SourceConnectorName.ETHEREUM],
      },
    },
    destination: {
      walletAddress: "0xeDa8Dec60B6C2055B61939dDA41E9173Bab372b2",
    },
    appearance: {
      roundness: 42,
      theme: ThemeName.DARK,
    },

    apiKeys: {
      aarcSDK: "YOUR_API_KEY",
    },
    events: {
      onTransactionSuccess: (data: TransactionSuccessData) => {
        console.log("onTransactionSuccess", data);
      },
      onTransactionError: (data: TransactionErrorData) => {
        console.log("onTransactionError", data);
      },
      onWidgetClose: () => {
        console.log("onWidgetClose");
      },
      onWidgetOpen: () => {
        console.log("onWidgetOpen");
      },
    },
    origin: window.location.origin
  };

Last updated