convert json RPC request to byte array

Viewed 22

I am new to json RPC and Ethereum. I am trying to query 2 JSON RPC methods

eth_sendTransaction method

{
    "jsonrpc":"2.0",
    "method":"eth_sendTransaction",
    "params":[
        {
        "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
        "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
        "gas": "0x76c0",
        "gasPrice": "0x9184e72a000",
        "value": "0x9184e72a",
        "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    }],
    "id":1
}

this is working fine, similarly their is a eth_sendRawTransaction method this method accepts bytes as an parameter

{
    "jsonrpc":"2.0",
    "method":"eth_sendRawTransaction",
    "params":[""],
    "id":1
}

I am not sure how can I convert the params from eth_sendTransaction method to bytes such that it can be used in eth_sendRawTransaction?

Any help, pointer, clues are really appreciated.

0 Answers
Related