IONIC is a pure Dart package allowing you to easily integrate your Dart-based project with the IONIC Network blockchain.
dependencies: IONIC: "<version>"
dependencies: IONIC: git: url: "git://github.com/IONICNetwork/ionic.dart.git" ref: "<branch or tag>"
Send your first transaction from Dart
import 'package:ionic/ionic.dart';import 'package:ionic/proto/cosmos/bank/v1beta1/export.dart' as bank; final networkInfo = NetworkInfo.fromSingleHost( bech32Hrp: 'ionic', host: 'https://grpc.my_ionic_grpc_node', httpHost: 'https://lcd.my_ionic_lcd_node', grpcPort: 9090, httpPort: 1317,);final mnemonic = 'federal injury annual melt near scan daughter before nut catalog spend decade';final wallet = HdWallet.fromMnemonic( mnemonic, prefix: networkInfo.bech32Hrp,); final recipient = '0x70207819eC28FB8cc692A4327C80282006E6476A';final message = bank.MsgSend.create() ..fromAddress = wallet.accounts[0].bech32Address ..toAddress = hexToBech32Address( networkInfo.bech32Hrp, recipient) ..amount.add(Coin.create() ..denom = 'attoionic' ..amount = '1000000000000000000');final fee = Fee() ..gasLimit = 200000.toInt64() ..amount.add(Coin.create() ..denom = 'attoionic' ..amount = '200000000000000'); final signer = TxSigner.fromNetworkInfo(networkInfo);final tx = await signer.createAndSign( wallet, wallet.accounts[0].bech32Address, [message], fee: fee); final txSender = TxSender.fromNetworkInfo(networkInfo);final response = await txSender.broadcastTx(tx, mode: BroadcastMode.BROADCAST_MODE_BLOCK); if (response.isSuccessful) { print('Tx sent successfully. Response: ${response}');} else { print('Tx errored: ${response}');}