how to subtract fee from amount like bitcoin?

+1 vote


I have 100 native currency .I want send all to other and fee from the 100.

The other address can receive less 100.

asked May 14, 2019 by mcuser

1 Answer

0 votes

MultiChain sets the transaction fee automatically based on the transaction size and the relevant blockchain parameters.

If you want to set the fee manually for a transaction, you can use the createrawtransaction API to explicitly state how much goes to the destination address, and the rest will automatically be considered as a fee.

To make life easier you might want to use preparelockunspent(from) first, to have the total amount you need ready in a single output for spending in createrawtransaction.

answered May 15, 2019 by MultiChain