Hi, I think that the functionality was added, can you try now?
i have exactly the same issue. the call functions all work. but the send functions donāt with walletconnect.
const receipt = await Moralis.executeFunction(options);
console.log(receipt)
this code just executes nothing for meā¦
I think that you should use events, events should work in latest Moralis sdk version, but that code should still send the transaction.
what do you mean? what events should i be using?
const tx = await Moralis.executeFunction(options);
tx.on("transactionHash", (hash) => { console.log(hash) })
.on("receipt", (receipt) => { console.log(receipt) })
.on("confirmation", (confirmationNumber, receipt) => { console.log(confirmationNumber,receipt) })
.on("error", (error) => { console.log(error) });
Can you try this and see if any of these events fire and print to console (transactionHash, receipt etc)
It shows nothing in the consoleā¦ when I use walletconnect with either metamast or trustwallet. I can connect. It does perform a read call. But when I make a transaction. Mrtamask/trustwallet doesnāt even open. Just nothing happens when I click the button. With normal mrtamask login. Everything does work.
I used https://docs.moralis.io/moralis-server/web3/web3 to make the dapp
can you share what you passed as options? did you use awaitReceipt = false
?
const options = {
contractAddress: "0xf684a651674046ce211b4956235ac001a96b3333",
functionName: "mintForUser",
abi: ABI,
params: {
user: address
},
};
const tx = await Moralis.executeFunction(options);
tx.on("transactionHash", (hash) => { console.log(hash) })
.on("receipt", (receipt) => { console.log(receipt) })
.on("confirmation", (confirmationNumber, receipt) => { console.log(confirmationNumber,receipt) })
.on("error", (error) => { console.log(error) });
This is the code i used. (ABI is the whole ABI)
For metamask login it works perfectly. But with walletconnect, the wallet doesnāt even open when I start this function.
can you try a syntax similar to this one?
mainly using awaitReceipt = false
and using Moralis.enableWeb3({ provider: 'walletconnect' })
Yup. Same thing with awaitReceipt: false. Nothing shows up in console. And trustwallet doesnāt open with the transaction. Just a button and nothing happensā¦
Iāll need some time to test it, can you share a minimal html + js example that doesnāt work for you?
Wait i think I found something. Is there a function on how to check which provider is used?
So I can make an if function. If provider of connected = trustwallet. Do this
Else do this
I think that you can identify if it is wallet connect or not: Moralis authenticate ios/ android / trustwallet and more
for trust wallet in particular, you may get in another problem later: Wallet connect takes me to trust wallet page
const provider = window.localStorage.walletconnect ? "walletconnect": "Metamask";
if i first connect with walletconnect. and then disconnect and connect with metamask. it gives me walletconnect as outputā¦
when i clear my cookies and i use metamask. it returns metamask. but when i first use walletconnect. then refresh and connect with metamask (without clearing cookies) i only get walletconnect as output.
you could try to remove that item from localStorage before connecting:
window.localStorage.removeItem('walletconnect');
window.localStorage.removeItem(
'WALLETCONNECT_DEEPLINK_CHOICE'
);
yeah i got it working by using a public variable for the address. that was the problem. but when i use
tx.on("transactionHash", (hash) => { console.log(hash) })
.on("receipt", (receipt) => { console.log(receipt) })
.on("confirmation", (confirmationNumber, receipt) => { console.log(confirmationNumber,receipt) })
.on("error", (error) => { console.log(error) });
with awaitReceipt: false
i only get the transactionHash in console. nothing elseā¦ although the transaction has already completed
Great that it works!!
Hey @tcvdh
Iāve done some tests and I have the same problem. Iāll let you know when we will find a solution
Thatās why there is a rule : āOne problem - one threadā.
Iām speaking about receipts from WalletConnect