Moralis-JS-SDK
Moralis-JS-SDK copied to clipboard
Types: Missing .wait() method in ExecuteFunctionSendResult
New Bug Report
Checklist
- [x] I am not disclosing a vulnerability.
- [x] I have searched through existing issues and the Moralis Forum.
- [x] I can reproduce the issue with the latest SDK release, and my server is updated to the latest version.
Issue Description
According to the docs there is a wait
method in response to Moralis.executeFunction
and it indeed present in runtime, all good.
However TypeScript complains this method does not exist even if response type is asserted to as Moralis.ExecuteFunctionSendResult
Digging a bit into Moralis typings I found that
type EthersTransaction = import('ethers').Transaction;
which looks wrong to me. I think it should be changed to
type EthersTransaction = import('ethers').providers.TransactionResponse;
which type is correct. btw, even Moralis docs insists that "You will get back a transaction response from Ethers.js, ..."
Steps + code to reproduce
declare const tx: Moralis.ExecuteFunctionSendResult;
tx.wait(); // Property 'wait' does not exist on type 'Transaction'.