Metamask swap does only show ETH native token when using swagger API and not erc20

hi all,

I am implementing the 1inch api on my dapp. I use metamask and ethers.
swapping native tokens goes well. When I try swap from an ERC20 token to native token, I don’t get the right suggestion from metamask. It shows the correct amount, but not the erc20 token but ETH.

I included the approval step before.

Any idea what causes this?

thanks!

const url =   (`https://api.1inch.io/v4.0/1/swap?fromTokenAddress=${fromTokenAddress}&toTokenAddress=${toTokenAddress}&amount=${fromTokenAmount}&fromAddress=${fromAddress}&slippage=1&referrerAddress${}&fee=1&disableEstimate=true&allowPartialFill=true`);
1 Like

Hello! Thanks for reaching out to the 1inch team. This forum is not for general support questions. Please see this article for direction on where to ask for help: Where to get customer support? | 1inch.io - Help Center


Alternatively, you can try reaching out on our Discord server – 1inch Network

1 Like