Moralis-JS-SDK icon indicating copy to clipboard operation
Moralis-JS-SDK copied to clipboard

Types: Missing .wait() method in ExecuteFunctionSendResult

Open xumepadismal opened this issue 2 years ago • 0 comments

New Bug Report

Checklist

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'.

xumepadismal avatar Mar 24 '22 16:03 xumepadismal