Open tolgaand opened 1 year ago
I understand your point... However, I disagree on the way to solve the problem.
Let's say there is a merchant receiving the token. It has first to create the token he wants to receive, once and for all. When the customer is paying, he only needs to pay his own transaction fee, not to create the token for the merchant.
Otherwise, it could be like a tax if after receiving a payment, the merchant delete his token account (and receive some sol for closing the account). Then next customer create again the merchant token account, etc.
I understand your point... However, I disagree on the way to solve the problem.
Let's say there is a merchant receiving the token. It has first to create the token he wants to receive, once and for all.
When the customer is paying, he only needs to pay his own transaction fee, not to create the token for the merchant.
Otherwise, it could be like a tax if after receiving a payment, the merchant delete his token account (and receive some sol for closing the account). Then next customer create again the merchant token account, etc.
I hadn't thought of that, thank you.
You're welcome. Happy to have been of some help :-)
What if the merchant provides a TokenAccount instead of a wallet address? this is our case and it fails since the recipient is already a token account
Hey There, great question! My advice would be that you go on Solscan (or any other Solana explorer) by typing https://solscan.io/account/MerchantTokenAccount. From there, you can easily spot the account owner and set it up. (eg : https://solscan.io/account/AAhtuv3wpwNSQFzBCKGnb4fhSxX4LY4VgRjEH9tqK52k where the account owner is [BNnncdQZ9YokyQJX8of4K2YGw3pvLt2SVkXK131E1nFy]) Hope it helps :-)
It uses this package to send tokens to users and verify transactions. But when I send tokens to a user who has never had a token account, I get a "TokenAccountNotFoundError" error.
To solve this problem, the
createTransfer
file used in; How to convert the function "getAssociatedTokenAddress" to the function "getOrCreateAssociatedTokenAccount"?