ton
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?
- Wrap your application with
TonConnectUiProvider
. - Use
TonConnectButton
in any inner widget.
Links
Libraries
- ton
- ton_method_channel
- ton_platform_interface
- ton_web
- ton_web_js/ton_web_js
- tonconnect/crypto/session_crypto
- tonconnect/exceptions
- tonconnect/logger
- tonconnect/models/account
- tonconnect/models/chain
- tonconnect/models/device_info
- tonconnect/models/ton_proof
- tonconnect/models/transaction
- tonconnect/models/wallet_app
- tonconnect/models/wallet_info
- tonconnect/parsers/connect_event
- tonconnect/parsers/rpc_parser
- tonconnect/parsers/send_transaction
- tonconnect/provider/base_provider
- tonconnect/provider/bridge_gateway
- tonconnect/provider/bridge_provider
- tonconnect/provider/bridge_session
- tonconnect/storage/default_storage
- tonconnect/storage/storage_interface
- tonconnect/tonconnect
- tonconnect/types
- tonconnect/wallet_list_manager
- tonconnect_ui/components/tonconnect_state
- tonconnect_ui/components/tonconnect_ui_provider