And here are two functions from front-end.
deposit(tokenAddress: string, amount: BigNumber, userAddress: string) {
const sendOptions: executeFunctionOptions = {
contractAddress: â0xxxxâ,
abi: xxx.abi,
functionName: âdeposit(address,unit256,address)â,
params: {
token: tokenAddress,
amount: amount,
to: userAddress
}
};
return from(Moralis.enableWeb3()).pipe(
concatMap(() => {
return from<ObservableInput>(Moralis.executeFunction(sendOptions));
})
);
}
depositAvax(amount: BigNumber) {
return from(Moralis.enableWeb3()).pipe(
concatMap(() => {
return from<ObservableInput>(Moralis.executeFunction({
contractAddress: â0xxxxâ,
abi: xxx.abi,
functionName: âdepositâ,
msgValue: amount.toString()
}));
})
);
}