cardano_flutter_sdk 2.5.4 copy "cardano_flutter_sdk: ^2.5.4" to clipboard
cardano_flutter_sdk: ^2.5.4 copied to clipboard

Targeting Flutter apps, the Cardano Wallet SDK is a high-level Dart library for parsing and signing transactions.

Cardano Dart SDK for Flutter #

Pub Version GitHub Repo

A high-level, cross-platform Dart SDK for Cardano wallet operations, targeting Flutter apps. This library enables parsing, address/key derivation, and transaction signing for Cardano, with a focus on security and performance.

Tested on: Android, iOS, and Web. Should work on all Dart/Flutter platforms.


Features #

  • BIP32-ED25519 HD wallet support (mnemonic/seed to keys/addresses)
  • Cardano Shelley, Byron, and multi-era address support
  • Transaction parsing, signing, and serialization
  • Data signing (including dRep and committee credentials)
  • Public key and address derivation (including xpub support)
  • UTXO parsing and manipulation
  • Web worker/wasm support for fast, non-blocking operations on web
  • Built on top of [cardano_dart_types] for Cardano primitives
  • Modern, null-safe Dart codebase

Supported Standards #


Installation #

Add the following to your pubspec.yaml:

dependencies:
  cardano_flutter_sdk: ^2.5.1
  cardano_dart_types:

Note: You must add a dependency to cardano_dart_types as well (do not specify a version; let pub resolve the compatible one).


Platform Support #

  • Android: Fully supported
  • iOS: Fully supported
  • Web: Fully supported (uses web workers/wasm for performance)
  • Other Dart/Flutter platforms: Should work, but not explicitly tested

Quick Start #

1. Create a Wallet from Mnemonic #

import 'package:cardano_flutter_sdk/cardano_flutter_sdk.dart';
import 'package:cardano_dart_types/cardano_dart_types.dart';

void main() async {
  const mnemonic =
    'chief fiber betray curve tissue output feature jungle adapt smile brown crane accuse gospel plate unlock pull arrow hard february tape soccer patrol fetch';
  final wallet = await WalletFactory.fromMnemonic(NetworkId.mainnet, mnemonic.split(' '));

  final addrKit = await wallet.getPaymentAddressKit(addressIndex: 0);
  print('Address: \\${addrKit.address.bech32Encoded}');
  print('Stake Address: \\${wallet.stakeAddress.bech32Encoded}');
}

2. Sign a Transaction #

import 'package:cardano_flutter_sdk/cardano_flutter_sdk.dart';
import 'package:cardano_dart_types/cardano_dart_types.dart';

void main() async {
  const mnemonic = 'chief fiber ... fetch';
  final wallet = await WalletFactory.fromMnemonic(NetworkId.testnet, mnemonic.split(' '));

  final txHex = '...'; // Your CBOR-encoded transaction hex
  final tx = CardanoTransaction.deserializeFromHex(txHex);

  final witnessSet = await wallet.signTransaction(
    tx: tx,
    witnessBech32Addresses: {'addr_test1...'},
  );

  final signedTx = tx.copyWithAdditionalSignatures(witnessSet);
  print(signedTx.serializeHexString());
}

3. Derive Addresses from xpub #

import 'package:cardano_flutter_sdk/cardano_flutter_sdk.dart';
import 'package:cardano_dart_types/cardano_dart_types.dart';

void main() async {
  const xpub = 'xpub1...';
  final acc = await CardanoPubAccountWorkerFactory.instance.fromBech32XPub(xpub);
  print(await acc.stakeAddress(NetworkId.mainnet));
  for (var i = 0; i < 5; i++) {
    print(await acc.paymentBech32Address(i, NetworkId.mainnet));
    print(await acc.changeBech32Address(i, NetworkId.mainnet));
  }
}

Example Projects #

See the example/ directory for more usage examples:


Contributing #

Contributions, issues, and feature requests are welcome! See issues.


License #

MIT


2
likes
140
points
214
downloads

Publisher

verified publishervespr.xyz

Weekly Downloads

Targeting Flutter apps, the Cardano Wallet SDK is a high-level Dart library for parsing and signing transactions.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

bip32_ed25519, bip39_plus, cardano_dart_types, cbor, collection, fast_base58, hex, pinenacl, squadron

More

Packages that depend on cardano_flutter_sdk