How can I get the result of the transaction submitted to relay with ethers?
Environment
"defender-relay-client": "^1.39.0",
"ethers": "^6.0.5",
"next": "13.1.6",
"react": "18.2.0",
typescript
Details
I'm submitting ok the transaction to relay using defender-relay-client
but
tx.wait()
afterward returns an error about a time out.
Code to reproduce
As described in https://docs.openzeppelin.com/defender/relay#using-ethers.js :
const erc20 = new ethers.Contract(ERC20_ADDRESS, ERC20_ABI, signer);
const tx = await erc20.transfer(beneficiary, 1e18.toString());
const mined = await tx.wait();
Transaction submitted ok but tx.wait
returns error:
error - unhandledRejection: TypeError: receipt.confirmations is not a function
at DefenderRelayProvider.txListener (/.....ethers/lib.commonjs/providers/provider.js:743:36)
at Timeout._onTimeout (/..........@ethersproject/providers/lib/base-provider.js:2510:32)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7)