Skip to content

kinnytips/kin-flutter-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kin Flutter SDK

Kin flutter SDK CI

NOTE - Kin Agora service is no longer operational. This SDK can be used along with the open source Agora components to host your own Agora for a feeless UX

Flutter Package for using Kin Cryptocurrency. Based on the Kin Android SDK.

Library                              Path Description                    
kin_base /base The foundation library used by all other libraries in the system to support basic Kin operations:
  • Wallet creation and management
  • Send and receive Kin
  • Metrics interfaces
design (WIP) /design Shared library components for creating consistent Kin user experiences. When creating a custom Kin experience, this library can be used to include standard UI components for displaying Kin prices, transactions, etc.
spend (WIP) /spend The :spend library provides an out of the box model UI for spending Kin within an Android application. Specificy what you're buying, your account, tap confirm. Success.
backup_restore /backup_restore The :backup-restore library provides an out of the box model UI for backing up and restoring wallets with a variety of implementations.

How to use the SDK

Initiate the sdk

var kin = Kin(production, appIndex, 'Example App',
    onBalanceChange: _onBalanceChange,
    onPayment: _onPayment,
    onAccountContext: _onResolveAccountContext,
    credentialUser: credentialUser,
    credentialPass: credentialPass);

    await kin.waitReady();

Now, this instance can be used to perform all the operations on the kin blockchain.

Creating a new account

var accountId = kin.createAccount();

Adding an existing account

var kinBackupRestore = KinBackupRestore();
var backupKeyPair = kinBackupRestore.importWallet(accountBackup, backupPass);

Fetching account info

var kinContext = kin.getKinContext();

var account = await kinContext.getAccount(forceUpdate: true);

Import account from backup

var accountId = await kin.importWallet(walletBackupJson, walletBackupPassword);

Fetching account history

var transactions = await kinContext.getAllTransactionsHistory();