Skip to main content

cashucard 0.4.0 copy "cashucard: ^0.4.0" to clipboard
cashucard: ^0.4.0 copied to clipboard

Accept Cashu Card NFC payments and settle merchant proceeds in a Flutter wallet with the Cashu Card 3.1 Rust reader.

Cashu Card for Flutter #

Use a Cashu Card 3.0 or 3.1 with a Flutter wallet on Android or iOS. This package connects Dart to the Rust reader using flutter_rust_bridge. The wallet supplies its NFC transport, payment journal and payout destination. The reader handles the card protocol and settlement with the mint.

Install #

dependencies:
  cashucard:
    git:
      url: https://github.com/cashucard/dart-sdk
      ref: v0.4.0

Use Flutter with Dart 3.13.7 or newer in the 3.x series. Run flutter pub get. The Android and iOS builds use CargoKit and Rust and download the pinned public Rust core when the package first builds.

Use the reader #

import 'package:cashucard/cashucard.dart';

Future<void> startReader() async {
  await RustLib.init();
}

Open the reader with your durable journal, payout and platform callbacks. Keep one active reader per journal and keep its generation counter in a separate durable store. To accept a card, open a sale with a stable ID and price, supply the platform NFC callback, and show the holder the price, fees and change before they confirm. Run settlement after a take, at startup and when connectivity returns. Apply each merchant payout exactly once.

Amounts use Dart BigInt. The giveBackToCard and owedToCard APIs let the wallet return change to the original card. More protocol and integration documentation is on the Cashu Card developer site.

Test the binding #

Build the host library with cargo build --locked --manifest-path rust/Cargo.toml, then run flutter test. You can point the test at an existing build using CASHUCARD_TEST_LIBRARY.

License #

MIT. Developed by Cashu Card contributors including getfoxy and Island Bitcoin. The vendored build tool includes its license.

0
likes
150
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Accept Cashu Card NFC payments and settle merchant proceeds in a Flutter wallet with the Cashu Card 3.1 Rust reader.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, flutter_rust_bridge, freezed_annotation

More

Packages that depend on cashucard

Packages that implement cashucard