sendTransaction method

  1. @override
Future<String> sendTransaction(
  1. Transaction transaction
)

SendTransaction

Implementation

@override
Future<String> sendTransaction(Transaction transaction) {
  final param = {
    "from": (transaction.from ?? address).hex,
    "to": transaction.to?.hex,
    "gasPrice": _bigIntToQuantity(transaction.gasPrice?.getInWei),
    "gas": _intToQuantity(transaction.maxGas),
    "value": _bigIntToQuantity(transaction.value?.getInWei),
    "data": _bytesToData(transaction.data)
  };

  return _makeRPCCall<String>('eth_sendTransaction', [param]);
}