aviary_dart 1.1.1
aviary_dart: ^1.1.1 copied to clipboard
Embeddable ledger engine for Dart: signed app records with proofs, instant BFT finality, transfers, light clients, P2P consensus, key custody and Ethereum, Bitcoin, Solana interop.
example/aviary_dart_example.dart
import 'package:aviary_dart/aviary.dart';
/// Funds two accounts, moves value between them, seals a block and proves
/// the receiver's balance to a light client.
void main() {
final bc = Aviary.instance;
final node = bc.createNode(7);
final alice = node.fundAccount(1000);
final bob = node.fundAccount(0);
node.sendTo(alice, bob, 250);
node.commit();
print('alice ${node.balance(alice.address)} at ${alice.addressHex}');
print('bob ${node.balance(bob.address)} at ${bob.address.shortHex}');
final proof = node.proveAccount(bob.address);
print('proof verifies: ${node.verifyAccountProof(proof)}');
print('state root ${node.stateRoot().hex}');
for (final event in node.events()) {
print('event $event');
}
node.dispose();
}