@@ -389,19 +389,20 @@ class VTTCreateBloc extends Bloc<VTTCreateEvent, VTTCreateState> {
389
389
390
390
/// sign the [VTTransaction]
391
391
Future <VTTransaction > _signTransaction (
392
- {required VTTransactionBody transactionBody,
392
+ {
393
393
required Wallet currentWallet}) async {
394
394
/// Read the encrypted XPRV string stored in the database
395
395
Wallet walletStorage = currentWallet;
396
396
ApiCrypto apiCrypto = Locator .instance <ApiCrypto >();
397
397
try {
398
+ buildTransactionBody (currentWallet.balanceNanoWit ().availableNanoWit);
398
399
List <KeyedSignature > signatures = await apiCrypto.signTransaction (
399
400
selectedUtxos,
400
401
walletStorage,
401
- bytesToHex (transactionBody .hash),
402
+ bytesToHex (VTTransactionBody (inputs : inputs, outputs : outputs) .hash),
402
403
);
403
404
404
- return VTTransaction (body: transactionBody , signatures: signatures);
405
+ return VTTransaction (body: VTTransactionBody (inputs : inputs, outputs : outputs) , signatures: signatures);
405
406
} catch (e) {
406
407
rethrow ;
407
408
}
@@ -478,8 +479,8 @@ class VTTCreateBloc extends Bloc<VTTCreateEvent, VTTCreateState> {
478
479
SignTransactionEvent event, Emitter <VTTCreateState > emit) async {
479
480
emit (state.copyWith (status: VTTCreateStatus .signing));
480
481
try {
482
+
481
483
VTTransaction vtTransaction = await _signTransaction (
482
- transactionBody: event.vtTransactionBody,
483
484
currentWallet: event.currentWallet);
484
485
emit (VTTCreateState (
485
486
vtTransaction: vtTransaction,
@@ -637,6 +638,7 @@ class VTTCreateBloc extends Bloc<VTTCreateEvent, VTTCreateState> {
637
638
receivers.clear ();
638
639
selectedTimelock = null ;
639
640
timelockSet = false ;
641
+ feeNanoWit = 0 ;
640
642
emit (state.copyWith (status: VTTCreateStatus .initial));
641
643
}
642
644
0 commit comments