lyra 0.0.3 copy "lyra: ^0.0.3" to clipboard
lyra: ^0.0.3 copied to clipboard

outdated

Lyra blockchain library for Flutter package project. Generate wallet, send coin/token, receive coin/token, monitor balance changes, etc.

example/example.dart

// @dart=2.9

import 'package:lyra/lyra.dart';

void main(List<String> arguments) async {
  await testApi();
}

Future<void> testApi() async {
  const pvk = '2gbESTeBHsgt8um1aNN2dC9jajEDk3CoEupwmN6TRJQckyRbHa';
  //const pub = 'LUTkgGP9tb4iAFAFXv7i83N4GreEUakWbaDrUbUFnKHpPp46n9KF1QzCtvUwZRBCQz6yqerkWvvGXtCTkz4knzeKRmqid';

  //final api = LyraAPI('devnet', pvk, 'wss://192.168.3.77:4504/api/v1/socket');
  final api = LyraAPI('testnet', pvk, null);
  await api.init();

  var balance = await api.balance();
  print(balance);
  //expect(balance, isNotNull);

  if (balance['unreceived']) {
    print('receiving...');
    var balance2 = await api.receive();
    print(balance2);
    //expect(balance2, isNotNull);
  }

  // send
  var destAddr =
      'LT8din6wm6SyfnqmmJN7jSnyrQjqAaRmixe2kKtTY4xpDBRtTxBmuHkJU9iMru5yqcNyL3Q21KDvHK45rkUS4f8tkXBBS3';
  var balance3 = await api.send(5.0, destAddr, 'LYR');
  print(balance3);

  api.close();
}
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Lyra blockchain library for Flutter package project. Generate wallet, send coin/token, receive coin/token, monitor balance changes, etc.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, convert, fast_base58, flutter, json_rpc_2, pedantic, pointycastle, web_socket_channel

More

Packages that depend on lyra