simulateTransaction method

Future simulateTransaction(
  1. TransactionRequest transaction, {
  2. bool estimateGasUnitPrice = false,
  3. bool estimateMaxGasAmount = false,
  4. bool estimatePrioritizedGasUnitPrice = false,
})

Implementation

Future<dynamic> simulateTransaction(
  TransactionRequest transaction,
  { 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 resp = await http.post(path, data: transaction.toJson(), queryParameters: params);
  return resp.data;
}