Because of this line:
https://github.com/bcoin-org/bclient/blob/master/bin/bwallet-cli#L278
...for any send using bwallet-cli send the value is interpreted as WHOLE BTC and is exponentiated by ^8 to get a satoshis value, which is then sent to the actual wallet for composing a transaction.
So, when sending a value=1000 from cURL or from Javascript WalletClient, you will send 0.00001000 BTC. If you send the same value=1000 from bwallet-cli you will send 1,000 BTC (1000.00000000) !!
Because of this line: https://github.com/bcoin-org/bclient/blob/master/bin/bwallet-cli#L278 ...for any send using
bwallet-cli send
thevalue
is interpreted as WHOLE BTC and is exponentiated by ^8 to get a satoshis value, which is then sent to the actual wallet for composing a transaction.This is VERY DIFFERENT from using
curl
: https://github.com/bcoin-org/bcoin/blob/c7d844ea3785c939cd546ce2fe7ff0e03f27197a/lib/wallet/http.js#L450 ...where thevalue
is interpreted literally as satoshis. This is the same behavior when using the JavascriptWalletClient
frombclient
Currently the documentation does not distinguish between the two formats: http://localhost:4567/?shell--cli#send-a-transaction
So, when sending a
value=1000
fromcURL
or from JavascriptWalletClient
, you will send 0.00001000 BTC. If you send the samevalue=1000
frombwallet-cli
you will send 1,000 BTC (1000.00000000) !!