simulateTransaction method

Future<SimulateTransactionResponse> simulateTransaction(
  1. SimulateTransactionRequest request
)
inherited

Submit a trial contract invocation to get back return values, expected ledger footprint, and expected costs. See: https://developers.stellar.org/network/soroban-rpc/api-reference/methods/simulateTransaction

Implementation

Future<SimulateTransactionResponse> simulateTransaction(
    SimulateTransactionRequest request) async {
  JsonRpcMethod getAccount =
      JsonRpcMethod("simulateTransaction", args: request.getRequestArgs());
  dio.Response response = await _dio.post(_serverUrl,
      data: json.encode(getAccount), options: dio.Options(headers: _headers));
  if (enableLogging) {
    print("simulateTransaction response: $response");
  }
  return SimulateTransactionResponse.fromJson(response.data);
}