-
Notifications
You must be signed in to change notification settings - Fork 229
Description
Your Question
Hi,
I'm developing a Telegram miniapp with react. I need users to send toncoin to my wallet, using the Telegram TON wallet, and I need to verify the transactions was really happened in the backend. Using tonConnect in the frontend, I can do a transaction using sendTransaction, but then I don't know how to verify this transaction in the backend, to check if it is correctly happened. I'll try to do my best to explain clearly, but it is a bit tricky.
I know I can poll the blockchain to retrieve all the transactions to my wallet, but how to identify univoquely the transaction? The function sendTransaction only returns the boc, but for what I understood it seems not useful to poll the blockchain, I mean, I can loop over all my transactions and check the inMessage as in your example, but I cannot directly use it as a parameter into the GET to filter the transaction univocally (as i could do with the hash for example). It seems very inefficient.
I saw the modals and the notifications ['before', 'success', 'error'] for the method sendTransactions, and during my tests i received "success", but I don't know what this really means. This means the transactions was accepted, so the toncoin arrived correctly to my wallet (the target wallet of sendTransaction), or just the message was sent to the blockchain, and so the toncoin are not yet in my wallet, and the transaction may fail? In the first case, this means tonConnect received a useful response in the frontend, from the user side, how to get it in the backend, from my side?
Another idea is if I can use tonConnect and my wallet connected in the backend to check if there are incoming transactions. Is there any way using the connected wallet to check if there are incoming transactions to this wallet?
I think that if nothing of this is possible, the only way to do it is to poll the blockchain keeping track of the last lt checked and update it every time, checking every transactions with lt > last_lt.
Please let me know if there is something more efficient.
Thanks.
Context
No response
What have you tried so far?
No response
Relevant Code or Commands
No response
Documentation Check
- Yes, I have checked the documentation.