sendRawTransaction method

Future<EthereumData?> sendRawTransaction(
  1. EthereumData? signedTransaction
)

Send raw transaction Creates new message call transaction or a contract creation for signed transactions. Takes the signed transaction data. Returns the transaction hash, or the zero hash if the transaction is not yet available.

Implementation

Future<EthereumData?> sendRawTransaction(
    EthereumData? signedTransaction) async {
  if (signedTransaction == null) {
    throw ArgumentError.notNull(
        'Ethereum::sendRawTransaction - signedTransaction');
  }
  const method = EthereumRpcMethods.sendRawTransaction;
  final dynamic params = <String?>[signedTransaction.asString];
  final dynamic res = await _client.rpcClient.request(method, params);
  if (res != null && res.containsKey(EthereumConstants.ethResultKey)) {
    return EthereumData.fromString(res[EthereumConstants.ethResultKey]);
  }
  _client.processError(method, res);
  return null;
}