| 1 | import 'package:cw_core/amount/money.dart'; |
| 2 | import 'package:cw_core/pending_transaction.dart'; |
| 3 | import 'package:web3dart/crypto.dart'; |
| 4 | |
| 5 | class PendingTronTransaction with PendingTransaction { |
| 6 | final Function sendTransaction; |
| 7 | final List<int> signedTransaction; |
| 8 | |
| 9 | PendingTronTransaction({ |
| 10 | required this.sendTransaction, |
| 11 | required this.signedTransaction, |
| 12 | required this.fee, |
| 13 | required this.amount, |
| 14 | required this.id, |
| 15 | }); |
| 16 | |
| 17 | @override |
| 18 | final Money amount; |
| 19 | |
| 20 | @override |
| 21 | final Money fee; |
| 22 | |
| 23 | @override |
| 24 | String get amountFormatted => amount.toString(); |
| 25 | |
| 26 | @override |
| 27 | Future<void> commit() async => await sendTransaction(); |
| 28 | |
| 29 | @override |
| 30 | String get hex => bytesToHex(signedTransaction); |
| 31 | |
| 32 | @override |
| 33 | String id; |
| 34 | |
| 35 | @override |
| 36 | Future<Map<String, String>> commitUR() { |
| 37 | throw UnimplementedError(); |
| 38 | } |
| 39 | } |