How to send tx as string with websocket RPC?

Tendermint RPC API seems to be allowing string values in GET. For example,

GET http://myserver:46657/broadcast_tx_commit?tx="hello"

How to send string values for tx when using websockets (JSON RPC)? When doing something like below:

rpcClient.broadcastTxSync({ tx: "Hello World" });

TM returns error

 {
  code: -32603,
  message: 'Internal error',
  data: 'error converting json params to arguments: illegal base64 data at input byte 5'
}

Would like to use CBOR encoding of tx and store it as utf8 string (rather than having to convert to base64). It makes the tx more readable and concise. How to achieve it?

1 Like