I had assumed that the following code would open MetaMask with the amount of ETH requested to send so that the user could confirm the transaction. Is this still possible?
javascript
import { Moralis } from "@moralisweb3/next";
const options = {
type: "native",
amount: Moralis.Units.ETH("0.5"),
receiver: "0x807546A7cfE7140cd8ef92c9949FDFc7Bc9ac92f"
};
let result = await Moralis.transfer(options);
Iām using the Moralis library to interact with MetaMask for a transaction. However, when executing the code, I encountered an error: āTypeError: moralisweb3_next__WEBPACK_IMPORTED_MODULE_20_.Moralis is undefinedā. It seems that the Moralis
object is not properly defined or imported.
I have already installed the @moralisweb3/next
package and imported the Moralis
object as shown in the code. Is there something Iām missing or any additional steps required to open MetaMask and prompt the user to confirm the transaction?
Any guidance or insight would be greatly appreciated. Thank you!