Transferring A Specific Token

Hello, I need some help to transfer of a specific token “ULTBNB” (BSC) using “BEP2” to the receiver. The code I have used so far:

const options = {
type: “native”,
amount: Moralis.Units.Token(parseInt(ceilPrice), “0”),
receiver: user.get(“bscAddress”),
contractAddress: contract, // Contract of ULTBNB TOKEN I WANT TO SEND
awaitReceipt: true
}
let resultTransfer = await Moralis.transfer(options);

MetaMask shows a BNB Transfer only, I want it to send the token I have provided “ULTBNB” in my case.

In short: How can I send a specific TOKEN like “ULTBNB”, “FlashX Ultra” ON BEP2.

I think that you have to use type: “erc20”

https://docs.moralis.io/moralis-server/sending-assets#transferring-erc20-tokens

You can use “erc20” when you want to transfer bep20 too

I updated the code:

const options = {type: "erc20",
                 amount: Moralis.Units.Token("45", "0"), // I want to send only 45  tokens
                 receiver: user.get("ethAddress"),
                 contractAddress: contract,
                 awaitReceipt: false 
                }
    let resultTransfer = await Moralis.transfer(options)

Nothing changed, meta mask is showing this: Capture

Plus how can change the gas fee from code?

I’ll check later, you want to send to user address from user address?

I am using the same account to send tokens (plus i’ts an empty account), just for testing, does that matter? Even the gas fee on Ethereum token is way too high!lyxe gas fee

It matters if it is an empty account, gas estimation may not work because of that

Okay, thank you. I will try on a different account. I’ll report some feedback!