submitBCSSimulate method

Future submitBCSSimulate(
  1. Uint8List signedTxn, {
  2. bool estimateGasUnitPrice = false,
  3. bool estimateMaxGasAmount = false,
  4. bool estimatePrioritizedGasUnitPrice = false,
})

Implementation

Future<dynamic> submitBCSSimulate(
  Uint8List signedTxn,
  {
    bool estimateGasUnitPrice = false,
    bool estimateMaxGasAmount = false,
    bool estimatePrioritizedGasUnitPrice = false
  }
) async {
  final params = <String, bool>{
    "estimate_gas_unit_price": estimateGasUnitPrice,
    "estimate_max_gas_amount": estimateMaxGasAmount,
    "estimate_prioritized_gas_unit_price": estimatePrioritizedGasUnitPrice
  };
  final path = "$endpoint/transactions/simulate";
  final file = MultipartFile.fromBytes(signedTxn).finalize();
  final options = Options(
    contentType: "application/x.aptos.signed_transaction+bcs",
    headers: {"content-length": signedTxn.length},
  );
  final resp = await http.post(path,
      data: file, options: options, queryParameters: params);
  return resp.data;
}