Transaction Progress

If you are building a user interface with RenJS, you may want to show the user more details about the shift's progress. Here's how to retrieve information about deposits & confirmations, transaction hashes and RenVM statuses:

Deposits and confirmations

const deposit = await mint.wait(confirmations)
.on("deposit", deposit => console.log(deposit));
/*{
"chain": "Btc",
"utxo": {
"txid": "d054b3290f93624e748a4209d55f76546bd734ad55b854c3fa15b190f31c3f9e",
"value": 100000,
"script_hex": "76a914b0c08e3b7da084d7dbe9431e9e49fb61fb3b64d788ac",
"output_no": 0,
"confirmations": 0
}
}*/

Each new confirmation will emit a new deposit event.

RenVM details

const signature = await deposit.submit()
// RenVM transaction status
.on("status", status => console.log(status))
// RenVM transaction hash
.on("txHash", txHash => console.log(txHash));

Ethereum details

submitToEthereum returns the same promievent type as used by Web3:

await signature.submitToEthereum(web3.currentProvider)
.on("transactionHash", txHash => console.log(txHash))
.on("confirmation", confirmation => console.log(confirmation))
.on("receipt", receipt => console.log(receipt));