I want to mint my token ICPACK to a user when the token’s canister receives ICP payment.
To make inbound payments reliable, I am going to first move the ICP to a special subaccount, then do the transfer from this subaccount to itself and only then pay ICPACK token to the user. This way, if the subaccount has non-zero balance, the UI can show the message that (due to e.g. high network congestion) the operation has been not finished and propose the user to repeat it.
But how can I reliably check whether the back payment of ICPACK token to the user finish or not finish, to allow the user to repeat it only if it was interrupted? icrc1_transfer
is an async operation, therefore it may be done or not done, and I see no way to check it.