class Eth::Client

def send_command(command, args)

Prepares parameters and sends the command to the client.
def send_command(command, args)
  args << "latest" if ["eth_getBalance", "eth_call"].include? command
  payload = {
    jsonrpc: "2.0",
    method: command,
    params: marshal(args),
    id: next_id,
  }
  output = JSON.parse(send(payload.to_json))
  raise IOError, output["error"]["message"] unless output["error"].nil?
  return output
end