2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
2021-10-05 20:50:22 +00:00
|
|
|
import "../stores"
|
2020-06-17 16:02:33 +00:00
|
|
|
|
2021-10-14 11:33:34 +00:00
|
|
|
// TODO: replace with StatusModal
|
2020-06-17 16:02:33 +00:00
|
|
|
ModalPopup {
|
|
|
|
id: popup
|
2021-10-05 20:50:22 +00:00
|
|
|
|
|
|
|
property var transaction
|
2022-04-04 11:26:30 +00:00
|
|
|
title: qsTr("Transaction Details")
|
2020-06-17 16:02:33 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: confirmations
|
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.top: parent.top
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.right: parent.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.rightMargin: Style.current.smallPadding
|
|
|
|
height: children[0].height + children[1].height + Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: confirmationsCount
|
2021-07-19 12:44:09 +00:00
|
|
|
text: {
|
2021-10-05 20:50:22 +00:00
|
|
|
if(transaction !== undefined)
|
2021-10-21 08:22:05 +00:00
|
|
|
return RootStore.getLatestBlockNumber() - RootStore.hex2Dec(transaction.blockNumber) + qsTr(" confirmation(s)")
|
2021-10-05 20:50:22 +00:00
|
|
|
else
|
|
|
|
return ""
|
2021-07-19 12:44:09 +00:00
|
|
|
}
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
}
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: confirmationsInfo
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("When the transaction has 12 confirmations you can consider it settled.")
|
2020-08-27 18:02:28 +00:00
|
|
|
wrapMode: Text.WordWrap
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2021-10-21 08:22:05 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.top: confirmationsCount.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2021-10-05 20:50:22 +00:00
|
|
|
width: parent.width
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: separator
|
|
|
|
anchors.top: confirmations.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: -Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.right: parent.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.rightMargin: -Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: block
|
|
|
|
anchors.top: separator.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
height: children[0].height
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: labelBlock
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Block")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2021-10-21 08:22:05 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: valueBlock
|
2021-10-05 20:50:22 +00:00
|
|
|
text: transaction !== undefined ? RootStore.hex2Dec(transaction.blockNumber) : ""
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
anchors.left: labelBlock.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: hash
|
|
|
|
anchors.top: block.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-08-27 18:02:28 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
height: children[0].height
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: labelHash
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Hash")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2021-10-21 08:22:05 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
|
2020-08-27 18:02:28 +00:00
|
|
|
Address {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: valueHash
|
2021-10-05 20:50:22 +00:00
|
|
|
text: transaction !== undefined ? transaction.id : ""
|
2020-06-17 16:02:33 +00:00
|
|
|
width: 160
|
2020-08-27 18:02:28 +00:00
|
|
|
maxWidth: parent.width - labelHash.width - Style.current.padding
|
|
|
|
color: Style.current.textColor
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
anchors.left: labelHash.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: from
|
|
|
|
anchors.top: hash.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
height: children[0].height
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: labelFrom
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("From")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2021-10-21 08:22:05 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
|
2020-08-27 18:02:28 +00:00
|
|
|
Address {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: valueFrom
|
2021-10-21 08:22:05 +00:00
|
|
|
text: transaction !== undefined ? transaction.from: ""
|
2020-08-27 18:02:28 +00:00
|
|
|
color: Style.current.textColor
|
2020-06-17 16:02:33 +00:00
|
|
|
width: 160
|
|
|
|
font.pixelSize: 14
|
|
|
|
anchors.left: labelFrom.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: toItem
|
|
|
|
anchors.top: from.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
height: children[0].height
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: labelTo
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("To")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2021-10-21 08:22:05 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
|
2020-08-27 18:02:28 +00:00
|
|
|
Address {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: valueTo
|
2021-10-05 20:50:22 +00:00
|
|
|
text: transaction !== undefined ? transaction.to: ""
|
2020-08-27 18:02:28 +00:00
|
|
|
color: Style.current.textColor
|
2020-06-17 16:02:33 +00:00
|
|
|
width: 160
|
|
|
|
font.pixelSize: 14
|
|
|
|
anchors.left: labelTo.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: gasLimitItem
|
|
|
|
anchors.top: toItem.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
height: children[0].height
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: labelGasLimit
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Gas limit")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2021-10-21 08:22:05 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: valueGasLimit
|
2021-10-05 20:50:22 +00:00
|
|
|
text: transaction !== undefined ? RootStore.hex2Dec(transaction.gasLimit): ""
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
anchors.left: labelGasLimit.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: gasPriceItem
|
|
|
|
anchors.top: gasLimitItem.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
height: children[0].height
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: labelGasPrice
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Gas price")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2021-10-21 08:22:05 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: valueGasPrice
|
2021-10-05 20:50:22 +00:00
|
|
|
text: transaction !== undefined ? RootStore.hex2Eth(transaction.gasPrice): ""
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
anchors.left: labelGasPrice.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: gasUsedItem
|
|
|
|
anchors.top: gasPriceItem.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
height: children[0].height
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: labelGasUsed
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Gas used")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2021-10-21 08:22:05 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: valueGasUsed
|
2021-10-05 20:50:22 +00:00
|
|
|
text: transaction !== undefined ? RootStore.hex2Dec(transaction.gasUsed): ""
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
anchors.left: labelGasUsed.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: nonceItem
|
|
|
|
anchors.top: gasUsedItem.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-06-17 16:02:33 +00:00
|
|
|
height: children[0].height
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: labelNonce
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Nonce")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2021-10-21 08:22:05 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-17 16:02:33 +00:00
|
|
|
id: valueNonce
|
2021-10-05 20:50:22 +00:00
|
|
|
text: transaction !== undefined ? RootStore.hex2Dec(transaction.nonce) : ""
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
anchors.left: labelNonce.right
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
2020-06-17 16:02:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|