handcash_connect_sdk 0.1.3-dev
handcash_connect_sdk: ^0.1.3-dev copied to clipboard

A Flutter plugin to integrate nanopayments into Apps and Games with HandCash.

HandCash Connect SDK #

Tests Coverage pub package Github stars

Getting Started #

 handcash_connect_sdk: last_version

Configure Android an iOS apps to handle links tutorial

Follow the implementation in example app #

Go to example/android/app/src/main/AndroidManifest.xml

   android:scheme="https" />

For your domain

   android:scheme="https" />

Initialize the SDK #

To start, you need to initializate the SDK, call initialize method passing your app ID.

  HandCashConnect.initialize(appId: '5fd93c56cdaa280ea43bdd66');

Then, you will need to create an instance of HandCashCloudAccount. This object allows you to access users account and interact with the SDK.

final account = HandCashConnect.getAccountFromAuthToken(authToken);

A HandCashCloudAccount requires an authToken that you get from users later they authorize your app.

You can find more about the user authorization process.

Listen for new authTokens #

⚠️ Not supported for Flutter web

HandCashAuthTokenListener().listen((String authToken) => {
  // You got it!

Your first payment #

The following code shows how to make a simple payment:

HandCashConnect.initialize(appId: '5fd93c56cdaa280ea43bdd66')

final cloudAccount = HandCashConnect.getAccountFromAuthToken('98a8ca...7702aac1');

final paymentParameters = PaymentParameters(
      description: 'Hold my beer!🍺',
      appAction: 'drink',
      receivers: [
          destination: 'eyeone',
          currencyCode: 'USD',
          sendAmount: 0.005,
          destination: 'apagut',
          currencyCode: 'EUR',
          sendAmount: 0.05,
          destination: 'satoshi',
          currencyCode: 'SAT',
          sendAmount: 50000,

final paymentResult = await cloudAccount.wallet.pay(paymentParameters);
   "note":"Hold my beer!🍺",
         "displayName":"Eye One",
         "displayName":"Satoshi Nakamoto",