LimeChain/etherlime

Wait for Transaction using only the hash

javaadpatel opened this issue · 3 comments

I am generating a transaction using uPort and would like to use etherlime to wait for the transaction to complete, usually I would use something like the below code to wait for the transaction, but with the uPort transaction all I have is the transaction hash.

Is there a way to use verboseWaitForTransaction and only pass the hash on which to wait?

/*Create Investment through metaMask*/
    const createInvesmentTxn= await investmentFactoryInstance
        .createInvestment(
            managerAddress,
            ethers.utils.parseEther(formValues.totalInvestmentCost),
            formValues.title,
            formValues.rationale,
            createdAt,
            investmentDeadlineUnixTimestamp,
            formValues.commissionFee
        );
    
    await investmentFactoryInstance.verboseWaitForTransaction(createInvesmentTxn);

Thank you for your issue. We are going to research and I will keep you updated. Do you have a repo where we can test during the development process ?

Hi @ochikov , thanks for looking into this. I currently don't have a repo as I've been working locally but i'll be pushing my code up soon and then will post a link to the repo.

Ideally, this is what I'm looking to do:

 /*Create Investment using UPort*/
    (await createUPortInvestmentFactory())
        .createInvestment(
                managerAddress,
                ethers.utils.parseEther(formValues.totalInvestmentCost),
                formValues.title,
                formValues.rationale,
                createdAt,
                investmentDeadlineUnixTimestamp,
                formValues.commissionFee,
            'createInvestmentReq');

     uPortConnect.onResponse('createInvestmentReq').then(async payload => {
       const hash = payload.payload;
        await investmentFactoryInstance.verboseWaitForTransaction(hash);
     })