ethSendRawTransaction method

Future<TEthSendRawTransactionResponse> ethSendRawTransaction({
  1. required TEthSendRawTransactionBody input,
})

Submit a raw transaction (serialized and signed) for broadcasting to the network.

Sign the provided TEthSendRawTransactionBody with the client's stamp function and submit the request (POST /public/v1/submit/eth_send_raw_transaction).

See also: stampEthSendRawTransaction.

Implementation

Future<TEthSendRawTransactionResponse> ethSendRawTransaction({
  required TEthSendRawTransactionBody input,
}) async {
  final body = packActivityBody(
    bodyJson: input.toJson(),
    fallbackOrganizationId: input.organizationId ??
        config.organizationId ??
        (throw Exception(
            "Missing organization ID, please pass in a sub-organizationId or instantiate the client with one.")),
    activityType: 'ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION',
  );
  return await request<Map<String, dynamic>, TEthSendRawTransactionResponse>(
      "/public/v1/submit/eth_send_raw_transaction",
      body,
      (json) => TEthSendRawTransactionResponse.fromJson(
          transformActivityResponse(json, 'EthSendRawTransaction')));
}