Giter Club home page Giter Club logo

transak's Introduction

Transak Flutter Plugin

The Transak Flutter Plugin allows developers to integrate Transak's on-ramp and off-ramp functionality seamlessly into their Flutter applications.

Installation

To use this plugin, add transak as a dependency in your pubspec.yaml file.

dependencies:
  transak: ^1.0.0

Getting Started

  1. Import the Transak plugin in your Dart code:
import 'package:transak/transak.dart';
  1. Configure the Transak plugin with your API key and other necessary parameters:
import 'package:transak/transak.dart';
final transakPlugin = Transak();

// Configure Transak with your API key and other settings
transakPlugin.config(
  apiKey: 'YOUR_API_KEY',
  environment: TransakEnvironment.production,
  // Add other configuration parameters as needed
).init();
  1. Initiate a transaction to buy or sell crypto:

Buy Crypto

try {
  // Initiate a transaction to buy crypto
  final response = await transakPlugin.initiateTransaction(
    payload: TransactionParams.forBuy(
      fiatAmount: 32.50,
      email: '[email protected]',
      walletAddress: '0xYourWalletAddress',
      fiatCurrency: 'USD',
      cryptoCurrencyCode: 'ETH',
    ),
  );

  // Handle the response as needed
} on TransakException catch (e) {
  print('Transak Error: ${e.errorMessage}');
} catch (e) {
  print('Unexpected error: $e');
}

Sell Crypto

try {
  // Initiate a transaction to sell crypto
  final response = await transakPlugin.initiateTransaction(
    payload: TransactionParams.forSell(
      cryptoAmount: 0, // Set to the amount of crypto to sell
      defaultCryptoAmount: 10, // Set a default crypto amount
      email: '[email protected]',
      network: 'polygon', // Set the blockchain network
      fiatCurrency: 'USD',
      cryptoCurrencyCode: 'ETH',
    ),
  );

  // Handle the response as needed
} on TransakException catch (e) {
  print('Transak Error: ${e.errorMessage}');
} catch (e) {
  print('Unexpected error: $e');
}

Features

  • Buy Crypto: Enable users to buy crypto from fiat currencies.
  • Sell Crypto: Allow users to sell crypto and receive fiat.
  • Customizable: Highly customizable SDKs for all major platforms and languages.
  • Event Handling: Stream transaction events for real-time updates.

transak's People

Contributors

oyen-bright avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.