How to create metod withdraw or clain tokek

Hello all

I’m studying and trying to create an NFT game

I’m studying moralis and the basic transactions that will be done in my game, like deposit token, connect metamesk, player balance, contract creation.

I am using the BSC contract, the user will deposit their in-game token to purchase in-game items with a “dummy” currency so that no gas is charged for each transaction and will also receive a dummy token in-game as a reward. After he accumulates X amount of fictitious token he will be able to claim

I wanted to understand which function I should use so that the user can claim his tokens, transforming this fictitious currency into a real token and sending it to the player’s metamesk.

If you have tutorials/videos, it helps me a lot, since I’m a little beginner in this crypto world

Thanks

1 Like

What you ask is not quite easy to do, you will need to learn some things to do that properly.

As an idea of how to do it, you can do it by signing yourself the transaction that makes the transfer/conversion on your server (you will pay for the gas fees in this case, and you will need to have the private key on server) or you can sign the transaction parameters on your server and let the user make the final transaction (in this case the user will pay for the gas, but you will still need a private key on your server).

could you give an example of how to do this I also need