Use this prompt to get started quickly.
Prerequisites
- Dart SDK 3.10+, or Flutter 3.38.1+
- Rust, installed with rustup
protoc, the Protocol Buffers compiler, on yourPATH
protoc for your platform:
- macOS
- Debian and Ubuntu
- Windows
Getting started
1
Install the SDK
In your project directory, run:
- Dart
- Flutter
2
Create a wallet
Generate a BIP39 mnemonic, configure the signet endpoints, and open the wallet in a data directory.
Wallet.open() creates the wallet on the first launch and reopens it on later ones.- Dart
- Flutter
Save this program as
bin/main.dart:3
Get a receiving address
Generate an Ark address to receive bitcoin. Add these lines at the end of Run the program from your project directory:The first run compiles Bark’s Rust core, which can take about 15 minutes. Your terminal then shows the Ark address. Send some signet sats to this address using the faucet.
main() in Dart. In Flutter, add them to main(), after wallet = await openWallet(); and before runApp():- Dart
- Flutter
4
Check your balance
Bark syncs the wallet in the background while it’s open. Call Run Balance amounts are
sync_() when you need an up-to-date balance right away. Add these lines after the previous ones:- Dart
- Flutter
dart run bin/main.dart again.int values.The second run reopens the same wallet and prints your spendable balance in sats.Next steps
Source code
Dart bindings source on GitLab.
How Ark works
Learn about the protocol powering your wallet.