bcoin-org.github.io
bcoin-org.github.io copied to clipboard
All buffers should be sent as hex strings
In general we should probably improve documentation to detail the data types of what is sent in the API, but one problem in particular is for when sending tx information (e.g. for the sign
endpoint), error messages indicate that tx should be a buffer, but since JSON doesn't really recognize Buffers and just stringifies the object, what is actually expected is the hex version of the transaction. So whenever an endpoint expects a Buffer, it should actually be sent as a hex.