mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-22 08:24:21 +01:00
Remove tokio runtime (#239)
* Remove obsolete Tokio runtime dependency on bindings * Apply changes on example app * Update "Getting Started" on README * Update pubspec.lock
This commit is contained in:
@@ -19,7 +19,7 @@ class Balance extends StatelessWidget {
|
||||
return const Center(child: Text('Loading...'));
|
||||
}
|
||||
|
||||
if (walletInfoSnapshot.requireData.balanceSat.isNaN) {
|
||||
if (walletInfoSnapshot.requireData.balanceSat != BigInt.zero) {
|
||||
return const Center(child: Text('No balance.'));
|
||||
}
|
||||
final walletInfo = walletInfoSnapshot.data!;
|
||||
@@ -34,13 +34,13 @@ class Balance extends StatelessWidget {
|
||||
"${walletInfo.balanceSat} sats",
|
||||
style: Theme.of(context).textTheme.headlineLarge?.copyWith(color: Colors.blue),
|
||||
),
|
||||
if (walletInfo.pendingReceiveSat != 0) ...[
|
||||
if (walletInfo.pendingReceiveSat != BigInt.zero) ...[
|
||||
Text(
|
||||
"Pending Receive: ${walletInfo.pendingReceiveSat} sats",
|
||||
style: Theme.of(context).textTheme.labelSmall?.copyWith(color: Colors.blueGrey),
|
||||
),
|
||||
],
|
||||
if (walletInfo.pendingSendSat != 0) ...[
|
||||
if (walletInfo.pendingSendSat != BigInt.zero) ...[
|
||||
Text(
|
||||
"Pending Send: ${walletInfo.pendingSendSat} sats",
|
||||
style: Theme.of(context).textTheme.labelSmall?.copyWith(color: Colors.blueGrey),
|
||||
|
||||
@@ -38,7 +38,7 @@ class _HomePageDrawerState extends State<HomePageDrawer> {
|
||||
try {
|
||||
debugPrint("Creating backup.");
|
||||
// TODO: Backup API should return backup file or it's filepath
|
||||
await widget.liquidSDK.backup();
|
||||
widget.liquidSDK.backup(req: const BackupRequest());
|
||||
debugPrint("Created backup.");
|
||||
} catch (e) {
|
||||
final errMsg = "Failed to create backup. $e";
|
||||
@@ -61,7 +61,7 @@ class _HomePageDrawerState extends State<HomePageDrawer> {
|
||||
debugPrint("Restoring backup.");
|
||||
// TODO: Select backup file to restore
|
||||
RestoreRequest req = const RestoreRequest();
|
||||
await widget.liquidSDK.restore(req: req);
|
||||
widget.liquidSDK.restore(req: req);
|
||||
debugPrint("Restored backup.");
|
||||
} catch (e) {
|
||||
final errMsg = "Failed to restore backup. $e";
|
||||
@@ -80,7 +80,7 @@ class _HomePageDrawerState extends State<HomePageDrawer> {
|
||||
onTap: () async {
|
||||
try {
|
||||
debugPrint("Emptying wallet cache.");
|
||||
await widget.liquidSDK.emptyWalletCache();
|
||||
widget.liquidSDK.emptyWalletCache();
|
||||
debugPrint("Emptied wallet cache.");
|
||||
} catch (e) {
|
||||
final errMsg = "Failed to empty wallet cache. $e";
|
||||
|
||||
@@ -131,12 +131,13 @@ class _ReceivePaymentDialogState extends State<ReceivePaymentDialog> {
|
||||
setState(() => creatingInvoice = true);
|
||||
int amountSat = int.parse(payerAmountController.text);
|
||||
PrepareReceiveRequest prepareReceiveReq =
|
||||
PrepareReceiveRequest(payerAmountSat: amountSat);
|
||||
PrepareReceiveResponse req =
|
||||
await widget.liquidSDK.prepareReceivePayment(req: prepareReceiveReq);
|
||||
PrepareReceiveRequest(payerAmountSat: BigInt.from(amountSat));
|
||||
PrepareReceiveResponse req = await widget.liquidSDK.prepareReceivePayment(
|
||||
req: prepareReceiveReq,
|
||||
);
|
||||
setState(() {
|
||||
payerAmountSat = req.payerAmountSat;
|
||||
feesSat = req.feesSat;
|
||||
payerAmountSat = req.payerAmountSat.toInt();
|
||||
feesSat = req.feesSat.toInt();
|
||||
});
|
||||
ReceivePaymentResponse resp = await widget.liquidSDK.receivePayment(req: req);
|
||||
debugPrint(
|
||||
|
||||
Reference in New Issue
Block a user