sendtoaddress

privex.rpcemulator.bitcoin.sendtoaddress(address, amount: Union[float, str, decimal.Decimal], comment='', comment_to='', subtractfee: bool = False)[source]

Sends amount BTC to address - generates a fake TX in internal transaction storage.

Example:

$ curl -v -s --data '{"method": "sendtoaddress",
    "params": ["1J2VishkhGviaEZA5dYgrqW1bjV8JGKFj", "0.001", "", "", false],
    "jsonrpc": "2.0", "id": 1}' http://127.0.0.1:5000

{"jsonrpc": "2.0", "result": "a4415c4013d2ba58106795ecb36a8694a3e93a4056e39ace4adde80d083c9641", "id": 1}
Parameters
  • address – The destination Bitcoin address

  • amount – The amount to send to address

  • comment (str) – A comment used to store what the transaction is for.

  • comment_to (str) – A comment, representing the name of the person or organization you’re sending to.

  • subtractfee (bool) – (Default False) If set to True, reduce the sending amount to cover the TX fee.

Returns