bbaas 3.1.5
bbaas: ^3.1.5 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';
copied to clipboard
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',
gatewayOptions: CGOptions(
login: '12345-TEST',
password: 'abcdefghijklmnopqrstuvwxyz',
merchantWebsiteId: '12345-TEST',
pixCashInRedirectUrl: 'https://exemplo.mysite.com',
pixCashInOnSuccessUrl: '10.40.20.30:300/webhook',
pixCashInOnThreeDSecureUrl: '10.40.20.30:300/webhook',
pixCashInOnFailUrl: '10.20.30:300/webhook',
pixCashOutOnSuccessUrl: '10.20.30:300/webhook',
pixCashOutOnFailUrl: '10.20.30:300/webhook',
upstreamDestination: 123,
),
);
copied to clipboard
Instance your client #
CollectionClient collectionClient = bbaas.client(bbaas.clientName);
copied to clipboard
Instance Wallet User #
CollectionClient collectionClient = bbaas.client(bbaas.clientName);
copied to clipboard
Get Hathor HashWords #
HashWords seed = await walletUser.newWallet();
print(seed.words);
copied to clipboard
Start Wallet Hathor #
bool result;
Map<String, dynamic> response;
(result, response) = await walletUser.start(seed);
print(result);
print(response);
copied to clipboard
Get Balance Methods #
String balance = await walletUser.balance(); // To get balance from wallet
String balanceTokenX = await walletUser.balance(tokenX); // To get Balance of the token from wallet
String balanceTokenY = await walletUser.balance(tokenY); // If there was other token
copied to clipboard
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
copied to clipboard
Get newAddress mark last as used #
String address = await walletUser.getNewAddress(); // To get new Address
print(address);
copied to clipboard
Send Token Methods #
// //* Hathor
String success = '';
String message = '';
(success, message) = await walletUser.send(addressTo, amount, 'HTR'); // To send Hathor
print(success);
print(message);
// //* TokenX
String success = '';
String message = '';
(success, message) = await walletUser.send(addressTo, amount, tokenCode); // To send Token
print(success);
print(message)
copied to clipboard
Stop Hathor Wallet #
String resultStop = await walletUser.stop(); // To Stop Wallet
copied to clipboard
Instance CG #
CG cg = CG(collectionClient.payMethod(), collectionClient);
bool result;
Map<String, dynamic> response;
*CG Pix CashIn
(result, response) =
await cg.pixCashIn(description: "description", amountCentsInt: 100);
*CG Balance
(result, response) = await cg.getBalance();
*CG Pix Cashout
(result, response) = await cg.pixCashOut(
pixOperationDictKey: "21999999999",
description: "description",
amountCentsInt: 100); // min 100
print(result);
print(response);
copied to clipboard