The One Question bounty closes Thursday 10 December.

Join in
We Them Media logo We Them Media Support us

Web3bridge Students (Cohort XI) Share What They’ve Learned: NFT Gated Event Contract

The picture loads from YouTube. The player loads only when you press Play. Turn on captions in the player if you need them.

Cohort 11 students explain transaction responses in the ethers and web3 libraries. A response confirms a transaction was broadcast, and its wait function returns a receipt once a set number of blocks are mined. They also describe methods that prepare a transaction and estimate the gas needed.

Not by We Them Media Channel: Web3Bridge. Published Saturday 14 December 2024.

Titles are the owner’s. It plays from their channel.

Transcript

This transcript may contain errors. This video belongs to Web3Bridge. Letters mark each change of speaker.

These are the speakers’ own words. We have not checked their claims.

0:00 A: This video is proudly brought to you by VirtueBridge with Links, our official sponsors for Cohort 11.

0:08 B: Basically, what's transaction response? They're normally used in the ethers.js library and the web.js library. So what are- what- how do we use them? Transaction responses are basically That initial response you get when you broadcast a transaction to the blockchain network. So it's like a confirmation that your transaction has been broadcasted to the network. So when you send a transaction, it returns a response which has the block header, the block number, the block hash, to the value, the RVS. But among us, what's returned is there is a value that is returned called wait, and that takes in a function whereby- Wait. It returns a promise, um, which- this promise resolves after the- when the number of blocks that are specified as a parameter have been mined. What do I mean? So when you said from that response that you've returned, let me say the transactionResponse.wait and passing the number of, let me say, blocks like 2, it will return now a transaction receipt. So in summary, if I'm to summarize this, like a transaction response, it's just a confirmation that your transaction has been broadcasted to the blockchain network, and then that transaction receipt is that response that you get for, for your transaction to be actually mined. So that response you get is what we call the transaction receipt. So when the transaction receipt is received after the blocks, the number of blocks you specified in the .wait function on the transaction response have been resolved.

1:48 C: So these libraries provide methods that allow us to kind of communicate with our blockchain and also communicate with our smart contract on-chain. So amongst these libraries, some methods like the populateTransactions, which enable us, you know, kind of populate a transaction, creates transactions which includes the function signatures and also some other values that are included in our transactions. Prepare this- prepare the transaction before it's been sent to the blockchain to interact with our smart contract. And also the estimateGas method. The estimateGas method allows us to be able to estimate the amount of gas necessary to perform a particular transaction on-chain. And this method is actually very useful so that we can actually estimate the total amount of gas that is needed to perform a transaction by a particular user and Also enables the- whoever is interacting with the smart contract to be able to set the appropriate gas limit for every transaction it is interacting with the blockchain. Yeah.

More from this hub

Something wrong, or a video you want off this page? Write to wethem.xyz@gmail.com and it is fixed or taken down within 48 hours.