I'm working on a TG bot used for exchange of crypto <-> fiat.
Each customer gets assigned a single wallet, once, which he is to send coins to, however he wants to, priour to receiving fiat.
telegram_user_id -> one_wallet. The same wallet then gets used by a user for all future transactions
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?
A customer could, theoretically, open a deal and abandon it.
A customer could also open 5 subsequent deals, abandon first 4, and then proceed only with the latest one -- send coins to a wallet.
A 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.