Buy Crypto with Fiat enabled via Transak

Safle users can buy crypto using fiat with over 70+ fiat currencies supported inside the safle app. This eliminates the need to buy crypto from an exchange and transfer to a wallet.

Safle leverages Transak’s widget offering to enable seamless on-ramp inside the application.

Sample usage

import {
  TransakWebView, Environments, Events, TransakConfig, EventTypes, Order,
} from '@transak/react-native-sdk';

function TransakWebViewIntegration() {
  const transakConfig: TransakConfig = {
    apiKey: '<your-api-key>', // Required
    environment: Environments.STAGING/Environments.PRODUCTION, // Required
    partnerOrderId: '<unique-order-id-generated-by-your-system>', // Required to receive order events
    // .....
    // For the full list of query params refer Props section below
  };
  const onTransakEventHandler = (event: EventTypes, data: Order) => {
    switch(event) {
      case Events.ORDER_CREATED:
        console.log(event, data);
        break;

      case Events.ORDER_PROCESSING:
        console.log(event, data);
        break;

      case Events.ORDER_COMPLETED:
        console.log(event, data);
        break;

      default:
        console.log(event, data);
    }
  };

  return (
    <TransakWebView
      transakConfig={transakConfig}
      onTransakEvent={onTransakEventHandler}
      // .....
      // For the full list of react-native-webview props refer Props section below
    />
  );
}

Last updated