bbaas 3.0.3 bbaas: ^3.0.3 copied to clipboard
BBaaS Dart Package - a simple way to build a new tokenized world
Blockchain and Banking as a Service by BBaaS.org #
A Dart package that provides a BBaaS.
Dart | |
---|---|
Support | SDK >=3.2.0 |
Usage #
To use this package, add bbaas as a dependency in your pubspec.yaml file. Contact BBaaS.org to validate your secure key of service.
import 'package:bbaas/bbaas.dart';
Instance your BBaaS api package #
BBaaS bbaas = BBaaS(
scheme: 'https',
host: 'api.bbaas.com.br',
clientName: 'mycompany',
authentication: 'authentication-token',
privateKey: 'rsa-privatekey',
network: 'hathor',
gateway: 'iugu', // IUGU or ASAAS
// If it's Iugu
iuguApiToken:
'iuguApiToken',
iuguApiTokenCriptografado:
'iuguApiTokenCriptografado',
//If it's Asaas
asaasAccessToken:
'\$aact_AsaasAccessToken==',
asaasAddressKey: "asaasAddressKey",
);
Instance your client #
CollectionClient collectionClient = bbaas.client(bbaas.clientName);
Instance Wallet User #
WalletUser walletUser = collectionClient.user(clientUid);
Get Hathor HashWords #
HashWords seed = await walletUser.newWallet();
print(seed.words);
Start Wallet Hathor #
bool result;
Map<String, dynamic> response;
(result, response) = await walletUser.start(seed);
print(result);
print(response);
Get Balance Methods #
String balance = await walletUser.balance(); // To balance the wallet
String balanceTokenX = await walletUser.balance(tokenX); // To Balance the Token
String balanceTokenY = await walletUser.balance(tokenY); // If there was more than one token
Get Balance Methods #
String balance = await walletUser.balance(); // To balance the wallet
String balanceTokenX = await walletUser.balance(tokenX); // To Balance the Token
String balanceTokenY = await walletUser.balance(tokenY); // If there was more than one token
Get Balance from Address Methods #
String address = await walletUser.getAddress(); // To getAddress
String balanceAddress = await walletUser.address(address).balance(); // To get balance from address
String balanceAddressTokenX =
await walletUser.address(address).balance(tokenX); // To get balance of the token from address
Get newAddress mark last as used #
String address = await walletUser.getNewAddress(); // To get new Address
print(address);
Send Token Methods #
// //* Hathor
String success = '';
String message = '';
(success, message) = await walletUser.send(addressTo, amount, 'HTR'); // For send Hathor
print(success);
print(message);
// //* TokenX
String success = '';
String message = '';
(success, message) = await walletUser.send(addressTo, amount, tokenCode); // For send Token
print(success);
print(message)
Stop Hathor Wallet #
String resultStop = await walletUser.stop(); // For Stop Wallet