monero 0.0.5-dev.2 copy "monero: ^0.0.5-dev.2" to clipboard
monero: ^0.0.5-dev.2 copied to clipboard

Monero Dart library. Uses Rust bound via FFI. Includes a separate optional commandline interface for building the latest Monero release from source (by default) and/or optionally managing and verify [...]

example/monero.dart

import 'package:monero/monero.dart' as monero;

void main() {
  // Test vector from https://xmrtests.llcoins.net/addresstests.html
  String mnemonic =
      "hemlock jubilee eden hacksaw boil superior inroads epoxy exhale orders cavernous second brunt saved richly lower upgrade hitched launching deepest mostly playful layout lower eden";
  print("Mnemonic: $mnemonic");

  // Generate address from the provided mnemonic.
  String address = monero.generateAddress(
      mnemonic: mnemonic, network: 0, account: 0, index: 0);
  print("Address: $address");

  // Generate subaddress.
  String subaddress = monero.generateAddress(
      mnemonic: mnemonic, network: 0, account: 0, index: 1);
  print("Subaddress: $subaddress");

  // Generate mnemonic.
  String generatedMnemonic = monero.generateMnemonic(language: 1);
  print("Generated mnemonic: $generatedMnemonic");

  // If needed, generate an address with the new mnemonic.
  String newAddress = monero.generateAddress(
      mnemonic: generatedMnemonic, network: 0, account: 0, index: 0);
  print("New address from generated mnemonic: $newAddress");

  // Generate subaddress with new mnemonic.
  String newSubaddress = monero.generateAddress(
      mnemonic: generatedMnemonic, network: 0, account: 0, index: 1);
  print("New subaddress from generated mnemonic: $newSubaddress");
}
1
likes
120
pub points
27%
popularity

Publisher

verified publishermanymath.com

Monero Dart library. Uses Rust bound via FFI. Includes a separate optional commandline interface for building the latest Monero release from source (by default) and/or optionally managing and verifying binary release archives (install with `dart pub global activate monero` and use as in `monero --help`).

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

crypto, ffi, ffigen, http, native_assets_cli, native_toolchain_rust_mirror, path

More

Packages that depend on monero