Skip to main content

aviary_dart 1.1.1 copy "aviary_dart: ^1.1.1" to clipboard
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();
}
0
likes
160
points
807
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

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.

Repository (GitHub)
View/report issues

Topics

#blockchain #ffi #consensus #ledger #web3

License

MIT (license)

Dependencies

code_assets, ffi, hooks

More

Packages that depend on aviary_dart