Hi all,
I am trying to integrate the 1inch swagger API in my dapp with javascript. I have not that much experience so I might do something wrong. Fetching the 1inch API goes fine.
But when I want to use the following code, I get either high gas fees or the swap doesnt execute at all. I attached also a picture of the data format, which seems odd to me.
let result = await window.ethereum.request({method: “eth_sendTransaction”,
params: [
{
from: tx.from,
to: tx.to,
gas: Number(2100000).toString(16),
gasPrice: Number(2500000).toString(16),
value: Number(500000000000000).toString(16),
data : tx.data,
},
],
})
.catch((err)=>{
console.log(err)
})
}
does anybody know what I do wrong? It might be a rookie mistake.
thanks!