Bitcoin Core's RPC API call "getnewaddress" is documented here: https://bitcoincore.org/en/doc/0.18.0/rpc/wallet/getnewaddress/
It claims:
Result: "address" (string) The new bitcoin address
In other words, it is supposed to return an associative array containing only the element 'address' which is a string representing the new Bitcoin receive address.
However, it actually returns just an "untitled" string without an array/object. It's just a plain string immediately outputted, not wrapped in any array/object/container. Perhaps this is what they mean by "(string)", but it sure looks to me that the "address" part makes it an associative array with one element. This appears to be the case elsewhere in the API:
The "sendtoaddress" call does return an associative array with just a "txid" element, and it's documented just like "getnewaddress": https://bitcoincore.org/en/doc/0.18.0/rpc/wallet/sendtoaddress/
Result: "txid" (string) The transaction id.
(Or all my previous work was in vain and I have actually got that wrong. I cannot easily try sending Bitcoin.)
Should I assume that they won't change the behaviour of the program, but rather the documentation? Or will they really change the program to reflect the documentation? If they ever do, my code breaks since it expects the returned value to be a string and not an array with one element called 'address'.
This kind of thing gives me a great deal of stress, especially as money is involved and the slightest mistake could cause huge losses or (at best) a ton of nightmarish manual work to attempt to "restore the state" after something is messed up halfways.
Note: I cannot report bugs to their GitHub page because MS GitHub doesn't let me register an account. I gave up on even trying.
sendtoaddress
. It just returns the txid as a single string just likegetnewaddress
.