Skip to content

Latest commit

 

History

History
71 lines (45 loc) · 2.04 KB

README.md

File metadata and controls

71 lines (45 loc) · 2.04 KB

ton

Flutter Ton Project

Ton Sdk for Flutter. This project uses org.ton:ton-kotlin:0.2.15 for native android calls and https://github.com/toncenter/tonweb-mnemonic for web support and does not support linux and windows yet.

Buy me a pizza

If you love this library and want to support its development you can donate any amount of coins to this TON address ☺️:

UQDKcML9_qEz_YsiUtxxIzaEBwCfAiCfKnM1oHIw5qIVO67S

You can also send your donations through my PizzaTon campaign

Getting Started

First of all initiate a Ton variable

final _tonPlugin = Ton();

Generating a random mnemonic:

_tonPlugin.randomMnemonic();

This function will return a Future of List of Strings which are the seed to your wallet.

Generating a random mnemonic with password:

For doing this you have to pass the password as a String parameter.

_tonPlugin.randomMnemonic(password: "YOU_WALLET_PASSWORD");

This function will also return a Future of List of Strings which are the seed to your ton wallet.

Check if a mnemonic is valid:

mnemonic = <String>['a', 'b', ...];
_tonPlugin.isMnemonicValid(mnemonic)

You can also pass your mnemonic's password if it has one.

Web Configuration

Add the files in example project under web directory to your project and then add the script below to your index.html file

  <script src="ton-mnemonic/web/index.js"></script>

The files can be found here: Web Mnemonic Library

Ton Connect

You can find docs about ton-connect here

How to implement TonConnect Wallet connection?

  1. Wrap your application with TonConnectUiProvider.
  2. Use TonConnectButton in any inner widget.

Links