I'm working on a TG bot used for exchange of crypto <-> fiat.
Each customer is assigned a wallets which he is to send coins to, however he wants to, priour to receiving fiat. The same wallet then gets used by a user for all future transactions.
One customer = one wallet for all the TXs, that is.
A bot, on the other hands, is supposed to identify whether or not a wallet has been topped up for a certain deal or trade. Once topped up, an operator gets notified and gives fiat to a customer.
Issue: how to identify if a certain incoming transaction corresponds to a particular trade?
Namely:
Customer could, theoretically, open a deal and abandon it.
Customer could also open 5 subsequent deals, abandon first 4, and then proceed only with the latest one -- send coins to a wallet.
Customer could open a deal, send coins, receive fiat and then open a new deal for the same amount right away.
And I can't force a customer to attach a special deal ID to a transfer because not all the wallets, nor even blockchains, support this.
The sum of a deal may not be used because it's not unique.
How would a bot identify which transaction on blockchain, in a wallet, belongs to which deal of a user? And whether there's even been any transaction for the current deal at all?
Note that it works the way I've described - in Telegram. There're no smart contracts, nor web3 wallets on a website, and this is a requirement.