massa 1.9.7 copy "massa: ^1.9.7" to clipboard
massa: ^1.9.7 copied to clipboard

Massa package is an SDK that connects your Dart and Flutter applications to the Massa blockchain, create wallet, send transactions, and work with smart contracts.

example/main.dart

// ignore_for_file: avoid_print

import 'package:fixnum/fixnum.dart';
import 'package:massa/massa.dart';
import 'constants.dart' as c;

/// This example shows how to use massa library, e.g for listing stakers

void main() async {
  var grpc = GRPCPublicClient(c.ipAddress, c.port);
  final stakers = await grpc.getStakers(minRolls: Int64(10));
  if (stakers.isEmpty) {
    print('No stakers found');
    return;
  }

  final totalAddresses = stakers.length;
  Int64 totalRolls = Int64(0);
  for (var staker in stakers) {
    print('${staker.address}:${staker.rolls}');
    totalRolls += staker.rolls;
  }
  print('Total addresses: $totalAddresses');
  print('Total rolls: $totalRolls');
  await grpc.close();
}
4
likes
140
pub points
30%
popularity

Publisher

verified publishernafsi.world

Massa package is an SDK that connects your Dart and Flutter applications to the Massa blockchain, create wallet, send transactions, and work with smart contracts.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

base_codecs, binary, cryptography, fixnum, grpc, hex, http, pointycastle, protobuf, retry

More

Packages that depend on massa