Custom message to MetaMask with executeFunction

Hello, is there any way to send a custom message to be shown in MetaMask popup while executing this?

await Moralis.executeFunction({
            functionName: "functionName",
            msgValue: Moralis.Units.ETH(price),
            ...contractOptions,
  });

Thank you

Not sure if we can pass a custom message through executeFunction.
You can try it in this way. It will first show the message and then execute the contract function.

Moralis.authenticate({signingMessage:"My custom message"}).then(() => {
await Moralis.executeFunction({
            functionName: "functionName",
            msgValue: Moralis.Units.ETH(price),
            ...contractOptions,
  });
})
1 Like

Yes I think it’s not possible in another way without the “authenticate”, or at least I didn’t find any other example. But this approach would force the user to sign at every call of the transaction.

The use case is because the user would send with the transaction a specific amount of a stable coin to a contract, and in that case MetaMask doesn’t show the amount your are sending in the pop up window. I specify it before the user is opening MetaMask, but would be useful to have a confirmation in the pop up as well.

Anyway thank you