ton_connect_ui 0.1.0 copy "ton_connect_ui: ^0.1.0" to clipboard
ton_connect_ui: ^0.1.0 copied to clipboard

Flutter UI for TON Connect: a wallet-picker modal backed by the public wallet registry, QR and deep-link connect flows, and ready-made connect widgets.

ton_connect_ui #

Flutter UI for TON Connect: a wallet-picker modal backed by the public wallet registry, QR and deep-link connect flows, and the widgets around them.

Status: 0.1.0. Proven end-to-end against Tonkeeper on testnet. The API can still change while the version is 0.x. See the repository README for the roadmap.

Demo #

Charging 0.05 TON at a counter, on testnet, against Tonkeeper. One tap on Take payment: the picker connects the wallet, the terminal sends the transaction and brings Tonkeeper forward for the second confirmation, and the receipt shows the signed message the wallet returned. The terminal is this package's example.

A merchant terminal charges 0.05 TON: the cashier enters the amount, picks Tonkeeper, approves the connection and then the transaction in the wallet, and the terminal shows the receipt.

final connection = await showWalletPicker(context: context, ton: ton);
if (connection != null) {
  print('Connected ${connection.account.address}');
}

The sheet lists the wallets available on this device, starts the connect, and either opens the wallet app or shows a QR code depending on where the wallet is likely to be. Inside a Telegram Mini App or a wallet's own browser it offers the injected wallet first and connects with no link at all.

Testing against it #

Widget tests that drive TonConnect must close it inside the test body, because the bridge keeps a heartbeat watchdog armed and the test binding asserts on any timer that outlives the widget tree. Close it through tester.runAsync: a testWidgets body runs under fake async, where awaiting a future that completes off the widget pipeline never progresses.

await tester.runAsync(() => ton.close());

package:ton_connect/testing.dart provides the fakes for driving a scripted wallet without a network.

License #

MIT

1
likes
160
points
272
downloads

Documentation

API reference

Publisher

verified publishertreamz.me

Weekly Downloads

Flutter UI for TON Connect: a wallet-picker modal backed by the public wallet registry, QR and deep-link connect flows, and ready-made connect widgets.

Repository (GitHub)
View/report issues

Topics

#ton #blockchain #wallet #crypto

License

MIT (license)

Dependencies

flutter, qr, ton_connect, url_launcher

More

Packages that depend on ton_connect_ui