Unity webGL How to wait for transaction confirmation

Hi

I use this function to execute smart contract function in Unity WebGL

string resp = await MoralisInterface.ExecuteContractFunction(Constants.ADDRESS, Constants.ABI, Constants.Func_Mint_Token, pars, v, gas, gas);

no error but it return a transaction hash string. not wait for transaction confirmation.
There is nothing response when the transaction have confirmed or failed.

I found that React can do this but I’m not found how to do in unity

So if resp only returns a string, then await resp.wait() won’t work in the same way. Can you post this in this thread as well? They may know how to do this.

The resp is just a string. cannot await resp.wait()

Ok, i will post in that thread.

Hello did you find any solution? I have the same issue. MoralisInterface.ExecuteContractFunction gives no response on Webgl

I didn’t see an answer posted in that thread yet.

If resp returns a transaction hash, as an alternative, you could probably repeatedly check the transaction every few seconds using getTransaction until it returns a valid transaction e.g. based on receipt_status.

1 Like

Have you tried the SendTransactionAndWaitForReceiptAsync method?
Currently there is not an equivalent call in the WebGL version.