Commit cbc2b2e1 authored by Hayden Adams's avatar Hayden Adams

add web3 block confirmations to transactions

parent 7d49acec
...@@ -396,6 +396,7 @@ class App extends Component { ...@@ -396,6 +396,7 @@ class App extends Component {
{from: this.state.currentMaskAddress, value: weiSold}) {from: this.state.currentMaskAddress, value: weiSold})
.on('transactionHash', console.log('Transaction Hash created')) .on('transactionHash', console.log('Transaction Hash created'))
.on('receipt', (receipt) => {console.log(receipt)}) //Success .on('receipt', (receipt) => {console.log(receipt)}) //Success
.on('confirmation', (confirmationNumber, receipt) => {console.log(confirmationNumber)}) //Transaction Mined - Not working?
.on('error', console.error); .on('error', console.error);
}); });
} }
...@@ -422,7 +423,8 @@ class App extends Component { ...@@ -422,7 +423,8 @@ class App extends Component {
exchange.methods.tokenToEthSwap(tokensSoldInt, minEthInt, timeout).send( exchange.methods.tokenToEthSwap(tokensSoldInt, minEthInt, timeout).send(
{from: this.state.currentMaskAddress}) {from: this.state.currentMaskAddress})
.on('transactionHash', console.log('Transaction Hash created')) .on('transactionHash', console.log('Transaction Hash created'))
.on('receipt', (receipt) => {console.log(receipt)}) //Success .on('receipt', (receipt) => {console.log(receipt)}) //Transaction submitted to blockchain
.on('confirmation', (confirmationNumber, receipt) => {console.log(confirmationNumber)}) //Transaction Mined - Not working?
.on('error', console.error); .on('error', console.error);
}); });
} }
...@@ -453,6 +455,7 @@ class App extends Component { ...@@ -453,6 +455,7 @@ class App extends Component {
{from: this.state.currentMaskAddress}) {from: this.state.currentMaskAddress})
.on('transactionHash', console.log('Transaction Hash created')) .on('transactionHash', console.log('Transaction Hash created'))
.on('receipt', (receipt) => {console.log(receipt)}) //Success .on('receipt', (receipt) => {console.log(receipt)}) //Success
.on('confirmation', (confirmationNumber, receipt) => {console.log(confirmationNumber)}) //Transaction Mined - Not working?
.on('error', console.error); .on('error', console.error);
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment