Hi. I would like to use 1inch plugin in my react application. I installed plugin for moralis server and I have I think latest version of moralis: 0.0.49 ⦠I wrote this code
const getDex = async () => {
await Moralis.initPlugins();
const dex = Moralis.Plugins.oneInch;
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);
};
but when I try to execute this getDex function I will receive this error
Uncaught (in promise) Error: Something went wrong
at MoralisWeb3.js:515
at tryCatch (runtime.js:63)
at Generator.invoke [as _invoke] (runtime.js:294)
at Generator.next (runtime.js:119)
at asyncGeneratorStep (asyncToGenerator.js:5)
at _next (asyncToGenerator.js:27)
am I doing something wrong or plugins are not supported yet for react ? or this cannot be used with testnet ? Thanks