Monero: Add an RPC call to preview/calculate transaction fee

Created on 11 Sep 2017  路  3Comments  路  Source: monero-project/monero

Hello team,

Calculating transaction fee is relatively concentrated topic - some answers even has plots attached.
And at the same time it's a very basic piece of functionality for everyone who want to have his service under control.

Example use case: make designated counter-party pay the transaction fee. The most obvious example is that I want to see how much I should pay to receive N XMR, not N - tx_fee XMR.

For that to work we need to have ability to obtain exact transaction fee in a no-brainer way. Couple of possible options:

I think the best option will be to introduce two additional Wallet RPC calls:

  • get_transfer_fee - accepts destinations, mixin, unlock_time and priority that are equal to those in transfer call and returns fee

  • get_split_transfer_fees - accepts destinations, unlock_time, priority and new_algorithm that are equal to those in transfer_split call and returns fee_list and returns amount_list

p.s. Why transfer doesn't have new_algorithm option?

Most helpful comment

You do that by seting "do_not_relay" and "get_tx_hex" to true. The tx is then only made, not relayed to the network. You get it back, and the fee. You can then relay it if you like the fee. transfer is old, do not use.

All 3 comments

You do that by seting "do_not_relay" and "get_tx_hex" to true. The tx is then only made, not relayed to the network. You get it back, and the fee. You can then relay it if you like the fee. transfer is old, do not use.

thanks @moneromooo-monero, I will add do_not_relay to the docs

@moneromooo-monero basically it is the same in bitcoin, but they have send_raw_transaction in rpc, but in moner-wallet rpc this is absent, so I must to support 2 rpc apis, daemon and wallet. Is it intentional?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loldlm1 picture loldlm1  路  5Comments

timolson picture timolson  路  4Comments

radfish picture radfish  路  3Comments

zeshanvirk picture zeshanvirk  路  6Comments

Gingeropolous picture Gingeropolous  路  5Comments