mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 17:57:36 +00:00
fe2e26f146
* fixes * refactors * fixes * more fixes * fixes for monero.com * update confirmed balance to receivable balance * fix balance display bug * remove print statements * prevent unnecessary writes * review fixes * forgot to add pubspec changes * fix * fix sync status desyncing on rpc fail * fix * update translations + txDetails fixes * squash balance bug * add source address on tx info * fix
40 lines
1.1 KiB
Dart
40 lines
1.1 KiB
Dart
import 'package:cw_core/pending_transaction.dart';
|
|
import 'package:cw_nano/nano_client.dart';
|
|
import 'package:nanoutil/nanoutil.dart';
|
|
|
|
class PendingNanoTransaction with PendingTransaction {
|
|
PendingNanoTransaction({
|
|
required this.nanoClient,
|
|
required this.amount,
|
|
required this.id,
|
|
required this.blocks,
|
|
});
|
|
|
|
final NanoClient nanoClient;
|
|
final BigInt amount;
|
|
final String id;
|
|
final List<Map<String, String>> blocks;
|
|
String hex = "unused";
|
|
|
|
@override
|
|
String get amountFormatted {
|
|
final String amt = NanoAmounts.getRawAsUsableString(amount.toString(), NanoAmounts.rawPerNano);
|
|
return amt;
|
|
}
|
|
|
|
String get accurateAmountFormatted {
|
|
final String amt = NanoAmounts.getRawAsUsableString(amount.toString(), NanoAmounts.rawPerNano);
|
|
final String acc = NanoAmounts.getRawAccuracy(amount.toString(), NanoAmounts.rawPerNano);
|
|
return "$acc$amt";
|
|
}
|
|
|
|
@override
|
|
String get feeFormatted => "0";
|
|
|
|
@override
|
|
Future<void> commit() async {
|
|
for (var block in blocks) {
|
|
await nanoClient.processBlock(block, "send");
|
|
}
|
|
}
|
|
}
|