I would like to know why the code is not working
is there an updated code?
github file: https://github.com/ivan-liljeqvist/tutorials/blob/main/1inch/index.html
code
<script>
// connect to Moralis server
Moralis.initialize("ppKsJ87zo59ln2WnmJm3n66TM9mq06I4GYGqLxRq");
Moralis.serverURL = "https://5naflsgtclgx.moralisweb3.com:2053/server";
let dex;
(async function(){
await Moralis.initPlugins();
dex = Moralis.Plugins.oneInch;
await Moralis.enable();
if(!Moralis.User.current())
await Moralis.authenticate();
})();
async function swap(){
const NATIVE_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const ONEINCH_ADDRESS = "0x111111111117dc0aa78b770fa6a738034120c302";
const options = {chain:"eth",
fromTokenAddress:NATIVE_ADDRESS,
toTokenAddress:ONEINCH_ADDRESS,
amount: Number(Moralis.Units.ETH("0.01")),
fromAddress: Moralis.User.current().get("ethAddress"),
slippage: 1
}
var receipt = await dex.swap(options);
console.log(receipt)
}
</script>