4. Pay transaction fees in the newly issued asset
We will now spend the new asset whilst paying transaction fees directly in this new asset.
Let’s send the asset we created to a new address (GENERATED_ADDRESS_3)
In the following commands, replace GENERATED_ADDRESS_3 and ASSET, submit the transactions and create a new block as shown below:
Take note of the transaction ID (txid), which is the string that the interface will show you when you run the sendtoaddress command (if it’s executed correctly). This txid will also be used later for another test in the next section (Replace By Fee).
You can also transfer TEST while paying fees in the newly issued asset. To do so, use TEST as the assetlabel, set subtractfeefromamount=false and then add fee_asset_label=<ASSET> with the label or asset id of the newly issued asset. For example:
Then, create a block:
Since we set “subtractfeefromamount=true” the payment used the new asset that is transferred with the payment to also pay for transaction fees
If you sent 100 tokens in the Asset you issued to GENERATED_ADDRESS_3, given the fee paid subtracted from the amount, you will see an amount transferred of about 99.99999864.
We have now demonstrated how the node handles payments using two different assets, TEST and a new asset you issued, as transaction fees.
Let’s move forward with something even more interesting!
Last updated