Token transfer from server using private key

Please how can I transfer tokens to users from the servers using the private key of my wallet on Moralis??

Hi you would just use something like ethers.js where you create a new wallet/signer using your private key. From there you can make transactions/transfers.

Wallets and Signers — ethers.js 4.0.0 documentation

E.g. Web3 Provider - Moralis

1 Like

Thanks so much.
But please do you have an example code or snippet that can help me

where do you want to run the code, on your own server or in cloud code in a Moralis Server?

asking because we don’t encourage the usage of hardcoded private keys in cloud code

in nodejs you can use something like this

but for now it will work only on some networks like bsc because you can not set the gas price parameter to Moralis.transfer

Wow… Thanks… Worked perfectly