I can't understand well. What is transactionBytes and how can I calculate this?
transactionBytes
and transactionJSON
are representations of a transaction in JSON and binary form. You can build those yourself (very hard) or you can just let the server generate those for you just by using any of the multiple transaction APIs.
There are some low level APIs like calculateFee
, signTransaction
, broadcastTransaction
and sendTransaction
that are useful if you are handling the building of the transaction yourself or signing locally.
Otherwise, if you just want to send a transaction using any of the APIs like sendMoney
or sendMessage
but you don't know which fee to set then it's easier to let the server calculate that for you.
First invoke the API without anything set as the feeNQT
parameter and with the rest of parameters set as desired. The server will parse and prepare a transaction, and it will return the best current fee for that transaction in the same feeNQT
response field. You can just use that value to invoke the API again and you're good to go.