Bitcoin Forum
June 26, 2024, 12:26:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Api  (Read 932 times)
bachel (OP)
Sr. Member
****
Offline Offline

Activity: 261
Merit: 250


View Profile
May 17, 2016, 12:25:00 PM
 #1

Hi

Does any one know who to use the deduct fee from sending amount via api or bitcoin-cli ? cant figure it out I want to use floating fees instead of a fixed value

danda
Full Member
***
Offline Offline

Activity: 202
Merit: 157


View Profile WWW
May 18, 2016, 12:58:50 AM
 #2

With bitcoin-cli you just call sendtoaddress or sendmany with the tx amount and the software will automatically calculate the necessary fee.  You can retrieve the amount afterward with gettransaction if you need to record it.

Also you can call estimatefee before to get an estimate, but it could be different from the actual amount used due to changing network conditions, etc.

If you absolutely insist to control the exact fee amount yourself you would need to use createrawtransaction, signrawtransaction, sendrawtransaction.

mybitprices.info - wallet auditing   |  hd-wallet-derive - derive keys locally |  hd-wallet-addrs - find used addrs
lightning-nodes - list of LN nodes  |  coinparams - params for 300+ alts  |  jsonrpc-cli - cli jsonrpc client
subaddress-derive-xmr - monero offline wallet tool
bachel (OP)
Sr. Member
****
Offline Offline

Activity: 261
Merit: 250


View Profile
May 18, 2016, 06:48:57 AM
 #3

With bitcoin-cli you just call sendtoaddress or sendmany with the tx amount and the software will automatically calculate the necessary fee.  You can retrieve the amount afterward with gettransaction if you need to record it.

Also you can call estimatefee before to get an estimate, but it could be different from the actual amount used due to changing network conditions, etc.

If you absolutely insist to control the exact fee amount yourself you would need to use createrawtransaction, signrawtransaction, sendrawtransaction.

yeah I do that right now but I used the gui yesterday and saw that you can set the deduct from amount option in the gui but I cant figure out how to use it via api

I only use my node to redistribute my mining income automaticly and allways keep around 0.015 in the walle for fees but I like the deduct from amount future way more

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!