ton_ai_tools 0.0.1 copy "ton_ai_tools: ^0.0.1" to clipboard
ton_ai_tools: ^0.0.1 copied to clipboard

AI-callable Flutter/Dart SDK powered by ton_dart for TONAPI and TonCenter wallet/blockchain tooling.

ton_ai_tools #

ton_ai_tools is an open-source Flutter/Dart SDK that turns TON data operations into AI-callable tools.

It is built on top of ton_dart 2.2.0 and uses its native TONAPI and TonCenter request models instead of implementing a custom TONAPI client.

What You Get #

  • Wallet insights (TONAPI + TonCenter)
  • Blockchain queries (transactions, traces, masterchain head)
  • Event explanation (action-level summaries for LLM output)
  • Safe transaction preparation (wallet emulation + risk grading)
  • JSON-schema tool definitions ready for LLM function/tool calling

Install #

dependencies:
  ton_ai_tools: <your-version>

Quick Start #

import 'package:ton_ai_tools/ton_ai_tools.dart';

final client = TonDataClient.forNetwork(
  TonNetwork.mainnet,
  tonApiBearerToken: 'YOUR_TONAPI_BEARER',
  tonCenterApiKey: 'YOUR_TONCENTER_API_KEY',
);

final toolkit = TonAiToolkit(gateway: client);

final tools = toolkit.openAiToolDefinitions; // Pass to your LLM runtime.

final walletInsights = await toolkit.invoke(
  TonAiToolkit.walletInsightsTool,
  {'account_id': '0:...'},
);

final safePrep = await toolkit.invoke(
  TonAiToolkit.prepareWalletTxTool,
  {'boc': 'te6cck...'},
);

flutter_ai_toolkit Integration #

You can use TON tools directly with flutter_ai_toolkit's FirebaseProvider function-calling flow:

import 'package:firebase_ai/firebase_ai.dart';
import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
import 'package:ton_ai_tools/ton_ai_tools.dart';

final tonClient = TonDataClient.forNetwork(
  TonNetwork.mainnet,
  tonApiBearerToken: 'YOUR_TONAPI_BEARER',
  tonCenterApiKey: 'YOUR_TONCENTER_API_KEY',
);
final tonToolkit = TonAiToolkit(gateway: tonClient);
final bridge = TonFlutterAiToolkitBridge(toolkit: tonToolkit);

final model = FirebaseAI.googleAI().generativeModel(
  model: 'gemini-2.5-flash',
  tools: bridge.firebaseTools(),
);

final provider = FirebaseProvider(
  model: model,
  onFunctionCall: bridge.onFunctionCall,
);

Direct Gateway Usage #

final head = await client.getBlockchainMasterchainHead();
final event = await client.getEvent(eventId: '...');
final seqno = await client.getAccountSeqno('0:...');

Built-In Tool Names #

  • ton_wallet_insights
  • ton_wallet_assets
  • ton_wallet_events
  • ton_blockchain_masterchain_head
  • ton_blockchain_transaction
  • ton_blockchain_account_transactions
  • ton_trace_lookup
  • ton_event_explain
  • ton_prepare_wallet_transaction
  • ton_emulate_event
  • ton_decode_boc_message
0
likes
110
points
11
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

AI-callable Flutter/Dart SDK powered by ton_dart for TONAPI and TonCenter wallet/blockchain tooling.

License

MIT (license)

Dependencies

blockchain_utils, firebase_ai, firebase_core, flutter, flutter_ai_toolkit, http, ton_dart

More

Packages that depend on ton_ai_tools