Skip to content

Lesson 8 - JS Syntax Question #2384

Answered by alymurtazamemon
alkali333 asked this question in Q&A
Discussion options

You must be logged in to vote

@alkali333 The second parameter (function) is the result of the first parameter.

provider.once(transactionResponse.hash, (transactionReceipt) => {
    console.log(
        `Completed with ${transactionReceipt.confirmations} confirmations`
    )
})

Here we are saying to provider to listen to this response hash transactionResponse.hash and once it gets called pass the result of it here (transactionReceipt). And the second parameter is callback where we explore our result further

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@alkali333
Comment options

Answer selected by alymurtazamemon
Comment options

You must be logged in to vote
2 replies
@krakxn
Comment options

@alkali333
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants