Last active
September 29, 2019 11:02
-
-
Save jamesmorgan/50da45da47537d7f7486427fd512e8fa to your computer and use it in GitHub Desktop.
transaction-handling.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract | |
.purchase(edition.edition, { | |
from: account, | |
value: priceInWei | |
}) | |
.on('transactionHash', hash => { | |
console.log('Purchase transaction submitted', hash); | |
}) | |
.on('receipt', receipt => { | |
console.log('Purchase successful - Ive been mined', receipt); | |
}) | |
.on('error', error => { | |
console.log('Purchase error', error); | |
}) | |
.on('confirmation', (confNumber, receipt) => { | |
console.log(`Confirmation [${confNumber}]`, receipt); | |
}) | |
.catch((error) => { | |
console.log('Purchase error', error); | |
}) | |
.finally(() => { | |
...do something when its all finished | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment