Hey bros, another issue on etherjs, I read the docs and still can't figure out what I should write down here... what does resulting a promise mean exactly in terms of code please?

Mar 11, 2022, 10:58 AM
It'll return the transaction hash if it resolves correctly
Mar 11, 2022, 11:31 AM
That's true, but what should I write to get the hash? Is : await provider.sendTransaction(rawTx) accurate here?
The etherjs docs are not very explicit
Mar 11, 2022, 11:35 AM
const txhash = await provider.sendTransaction(rawTx);
Should work
Mar 11, 2022, 11:38 AM
Mar 11, 2022, 11:42 AM
Hmm try console logging it
Yeah which ide is this anyway
Mar 11, 2022, 11:44 AM
An online course : chainshot.com
Like cryptozombies for solidity but for etherjs ;)
Mar 11, 2022, 11:45 AM
on txhash
you have to get the hash only
not the whole result
Mar 11, 2022, 11:47 AM
Mar 11, 2022, 11:50 AM
where you used hash?
try to append
.hash to txHash
and please learn how to take screenshots
Mar 11, 2022, 11:51 AM
now I get the hash, thanks, and it tells me I have to resolve the promise
Mar 11, 2022, 11:55 AM
I think it is just expecting you to return the value, instead of console logging it
Is the cannot read property error , old one or after you changed ?
Mar 11, 2022, 12:02 PM
I tried to add this line
The final step that is missing is that I return the promise
Mar 11, 2022, 12:04 PM
return txhash
Try this, after your console log
Mar 11, 2022, 12:05 PM
OMG it worked!!!!!
Thanks bro!!!!!
I don't understand, they asked a promise of the function call, and in the etherjs docs it supposes a function : provider.waitForTransaction
Mar 11, 2022, 12:07 PM
txhash variable is the promise
You just need to return the promise object
The trxhash variable is a transaction promise object, with a "hash" property
Mar 11, 2022, 12:09 PM
So txHash here is not just the hash, despite the name, it is a list of elements, if I got it right
Mar 11, 2022, 12:09 PM
Correct
It is a promise object, which might have many properties, one of which is 'hash'
Mar 11, 2022, 12:09 PM
I got it, you are amazing bro, thanks a lot
I'm new to etherjs, I followed hours and hours of solidity but I look forward to master hardhat and etherjs very soon
Mar 11, 2022, 12:11 PM
👍
Mar 11, 2022, 12:11 PM
Keep working hard !
Mar 11, 2022, 12:11 PM
I can give you one tip,
Master your javascript, all the concepts , especially ES6 ,

After that you wouldn't need to do a course on ether.js
I did not do any course on ethers.js,

Whenever i want to do anything, i just refer to their doc,
But i am able to do this, only because my JS concepts are pretty strong
Mar 11, 2022, 12:12 PM
https://forum.polygon.technology/t/alert-upcoming-downtime-due-to-issue-with-pos-chain/2324

downtime on a blockchain wtf
Mar 11, 2022, 12:28 PM
Thanks for the advice ! Which concepts are these in your opinion, do you recommand a JS course?
What is the difference between hardhat and etherjs please?
Mar 11, 2022, 12:51 PM
Etherjs tool that helps you on the frontend to connect your contracts. Hardhat tool used to create smart contracts, deploy and different architecture related things
Mar 11, 2022, 1:01 PM
Thanks, as a smart contract engineer on the backend will I need etherjs? I had in mind I would only need hardhat to test my contract
Mar 11, 2022, 1:05 PM
https://ethereum.stackexchange.com/a/46377
Don't limit yourself, learn everything you can learn. That's how you can go one step ahead in job applications, interviews.
Mar 11, 2022, 1:09 PM
Mmm i don’t think so, is very ease to learn tho.
Mar 11, 2022, 1:11 PM
That's true bro, I just want to proceed step by step
Mar 11, 2022, 1:26 PM
All promises, async, etc basically ES6.

Tyler McGinnis from ui.dev i have heard is good.
Or get any top rated ones from udemy
Mar 11, 2022, 1:40 PM
multisig?
Mar 11, 2022, 2:11 PM

© 2024 Draquery.com All rights reserved.