|
|
@ -4,11 +4,25 @@ var yo = require('yo-yo') |
|
|
|
var EventsDecoder = remixLib.execution.EventsDecoder |
|
|
|
var EventsDecoder = remixLib.execution.EventsDecoder |
|
|
|
var TransactionReceiptResolver = require('../../lib/transactionReceiptResolver') |
|
|
|
var TransactionReceiptResolver = require('../../lib/transactionReceiptResolver') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const transactionDetailsLinks = { |
|
|
|
|
|
|
|
'Main': 'https://www.etherscan.io/tx/', |
|
|
|
|
|
|
|
'Rinkeby': 'https://rinkeby.etherscan.io/tx/', |
|
|
|
|
|
|
|
'Ropsten': 'https://ropsten.etherscan.io/tx/', |
|
|
|
|
|
|
|
'Kovan': 'https://kovan.etherscan.io/tx/', |
|
|
|
|
|
|
|
'Goerli': 'https://goerli.etherscan.io/tx/' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function txDetailsLink (network, hash) { |
|
|
|
|
|
|
|
if (transactionDetailsLinks[network]) { |
|
|
|
|
|
|
|
return transactionDetailsLinks[network] + hash |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export function makeUdapp (blockchain, udapp, executionContext, compilersArtefacts, logHtmlCallback) { |
|
|
|
export function makeUdapp (blockchain, udapp, executionContext, compilersArtefacts, logHtmlCallback) { |
|
|
|
// ----------------- UniversalDApp -----------------
|
|
|
|
// ----------------- UniversalDApp -----------------
|
|
|
|
// TODO: to remove when possible
|
|
|
|
// TODO: to remove when possible
|
|
|
|
udapp.event.register('transactionBroadcasted', (txhash, networkName) => { |
|
|
|
udapp.event.register('transactionBroadcasted', (txhash, networkName) => { |
|
|
|
var txLink = executionContext.txDetailsLink(networkName, txhash) |
|
|
|
var txLink = txDetailsLink(networkName, txhash) |
|
|
|
if (txLink && logHtmlCallback) logHtmlCallback(yo`<a href="${txLink}" target="_blank">${txLink}</a>`) |
|
|
|
if (txLink && logHtmlCallback) logHtmlCallback(yo`<a href="${txLink}" target="_blank">${txLink}</a>`) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|