massa 1.3.1
massa: ^1.3.1 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.
massa #
Massa is a public blockchain and protocol that aims to deliver decentralization, scale and security for many people. It uses PROOF OF STAKE consensus mechanism to ensures full participation, protection, and high transaction throughput.
Introduction #
Massa-dart is an SDK that is able to connect your Dart and Flutter applications to the Massa blockchain, create wallet, send transactions, and work with smart contracts.
Features #
This package will allows you to interact with massa blockchain using the folloiwng public and privated methods.
Public API (node_ip:33035) #
- ❌ execute_read_only_bytecode
- ❌ execute_read_only_call
- ✅ get_addresses
- ✅ get_block
- ✅ get_cliques
- ❌ get_datastore_entries
- ✅ get_endorsements
- ❌ get_filtered_sc_output_event
- ✅ get_graph_interval
- ✅ get_stakers
- ✅ get_status
- ✅ get_operations
- ✅ send_operations - send transaction
- ✅ send_operations - buy rolls
- ✅ send_operations - sell rolls
- ❌ send_operations - execute smart contract
- ❌ send_operations - call smart contract
Private API (node_ip:33034) #
- ❌ add_staking_secret_keys
- ❌ get_staking_addresses
- ❌ node_add_to_bootstrap_blacklist
- ❌ node_add_to_bootstrap_whitelist
- ❌ node_add_to_peers_whitelist
- ❌ node_ban_by_id
- ❌ node_ban_by_ip
- ❌ node_bootstrap_blacklist
- ❌ node_bootstrap_whitelist
- ❌ node_bootstrap_whitelist_allow_all
- ❌ node_peers_whitelist
- ❌ node_remove_from_bootstrap_blacklist
- ❌ node_remove_from_bootstrap_whitelist
- ❌ node_remove_from_peers_whitelist
- ❌ node_remove_from_whitelist
- ❌ remove_staking_addresses
- ❌ node_sign_message
- ❌ stop_node
- ❌ node_unban_by_id
- ❌ node_unban_by_ip
- ❌ node_whitelist
GRPC API (node_ip:33037) #
- ✅ getBlocksBySlots
- ✅ getDataStoreEntries
- ✅ getNextBlockBestParent
- ✅ getSelectorDraw
- ✅ getTransactionsThroughput
- ✅ getVersion
- ✅ newBlocks
- ✅ newBlockHeaders
- ✅ newFilledBlocks
- ✅ newOperations
- ✅ sendBlock
- ✅ sendEndorsement
- ✅ sendOperations
- ✅ transactionThroughput
Getting started #
Check usage in /test
folder.
Usage #
View more examples in /example
folder.
The example below shows how to get list of stakers
import 'package:massa/massa.dart';
Future<void> main() async {
final Uri pubUri = Uri.https('test.massa.net', 'api/v2');
PublicApi api = PublicApi(pubUri);
Stakers stakers = await api.getStakers();
if (stakers.stakers.isEmpty) {
print('No stakers found');
return;
}
final totalAddresses = stakers.stakers.length;
int totalRolls = 0;
for (var staker in stakers.stakers) {
print('${staker.address}:${staker.roles}');
totalRolls += staker.roles;
}
print('Total addresses: $totalAddresses');
print('Total rolls: $totalRolls');
}
Additional information #
You can get more information about massa by visiting the links below.
Links #
- Massa: Massa main website
- Testnet: Massa testnet
- Massa Github: Massa official github repository
- Massa API: Massa official api documentation
- Massa OpenRPC: Massa official openrpc
- Massa Web3: massa-dart will have similar functionalities as massa-web3
Contribute #
You can contribute to this package, request new features or report any bug by visiting the package repository at massa-dart
License #
The MIT License (MIT). Please see License File for more information.