simulateTransaction method

  1. @override
Future<CallResult> simulateTransaction({
  1. required String transactionRequestHexOrJson,
})
override

Takes hex string on mobile and json tx request on web

Implementation

@override
Future<CallResult> simulateTransaction(
    {required String transactionRequestHexOrJson}) async {
  final bytes = hex.decode(removeHexPrefix(transactionRequestHexOrJson));
  final List<fuels.Receipt> receipts = await _rustWalletUnlocked
      .simulateTransaction(encodedTx: Uint8List.fromList(bytes));

  return CallResult(receipts: receipts.map(parseRustReceipt).toList());
}