Hi, I am trying to use LOCAL Ledger Transfer operation to transfer some ICP.
Able to get run it but somehow the transfer fee are not deducted from transfer amount but it’s being deducted from the account balance itself? is it suppose to work this way?
the flow,
i make 3 accounts = buyer (1000 ICP), seller (1000 ICP), broker (0 ICP)
buyer buy 3 items = item A (1 ICP), item B (2 ICP), item C (3 ICP)
buyer makes 3 transactions per item, 0.0001 ICP fee per tx, so 0.0003 ICP per item
so total fee would be
after all transactions are done
I expect buyer’s balance would be 1000 ICP - 1 - 2 - 3 = 994 ICP
but it’s not. the wallet balance becomes 993.9991.
and my cross calculation is right too
i remember transferring ICP from the CEX to NNS, or NNS to CEX, the transfers would deduct the fee from the ICP that is being transferred, not the wallet. Is this only happening on local ledger? couldnt be right? so do I have to deduct the fee from the amount before I transfer (i dont want the buyer to pay more than the agreed amount)? both remote ledger and local ledger should work similarly yes?
right now my implementation (js) is like below:
let me know if I should change the above to amount: { e8s: receiver.amount - transferFee.transfer_fee.e8s }
so the buyer balance would be 994 after spending 6 ICP.
Thank you.