how to create the ability to deposit/withdraw USDT TRC20 in website?

324 views Asked by At

I want to create a gaming platform with Python/Django backend. I need to create the USDT TRC20 deposit/withdraw ability, so I came up with this:

  • create a Tron wallet for each user upon registration using the Tronpy library :

    from tronpy import Tron
    
    def create_wallet():
        client = Tron()
        account = client.generate_address()

  • Then send a small amount of TRX to that from a TRX pool, so the wallet is activated and listed on the mainnet chain now users can deposit USDT.

  • when each user deposits, I first save the asset amount in the database. then send some TRX to the wallet for the transaction fee and send all USDTs to a central wallet.

  • Now each user wants to withdraw I check the database and if it's ok I will send the amount from the central wallet to its given USDT TRC20 address.

is there a better way to do this? can I somehow receive USDTs straight to the central wallet and track each user transaction so I don't need to pay that many fees?

0

There are 0 answers