2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-06-17 16:02:33 +00:00
|
|
|
import "../../../../shared"
|
2021-10-14 09:24:34 +00:00
|
|
|
import "../../../../shared/panels"
|
2021-10-14 11:33:34 +00:00
|
|
|
import "../../../../shared/popups"
|
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
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Transaction Details"
|
|
|
|
title: qsTrId("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)
|
|
|
|
return RootStore.getLatestBlockNumber() - RootStore.hex2Dec(transaction.blockNumber) + qsTrId(" confirmation(s)")
|
|
|
|
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
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "When the transaction has 12 confirmations you can consider it settled."
|
|
|
|
text: qsTrId("confirmations-helper-text")
|
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
|
2020-07-02 15:14:31 +00:00
|
|
|
color: Style.current.darkGrey
|
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
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Block"
|
|
|
|
text: qsTrId("block")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2020-07-02 15:14:31 +00:00
|
|
|
color: Style.current.darkGrey
|
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
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Hash"
|
|
|
|
text: qsTrId("hash")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2020-07-02 15:14:31 +00:00
|
|
|
color: Style.current.darkGrey
|
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
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "From"
|
|
|
|
text: qsTrId("from")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2020-07-02 15:14:31 +00:00
|
|
|
color: Style.current.darkGrey
|
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-05 20:50:22 +00:00
|
|
|
text: transaction !== undefined ? transaction.fromAddress: ""
|
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
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "To"
|
|
|
|
text: qsTrId("to")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2020-07-02 15:14:31 +00:00
|
|
|
color: Style.current.darkGrey
|
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
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Gas limit"
|
|
|
|
text: qsTrId("gas-limit")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2020-07-02 15:14:31 +00:00
|
|
|
color: Style.current.darkGrey
|
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
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Gas price"
|
|
|
|
text: qsTrId("gas-price")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2020-07-02 15:14:31 +00:00
|
|
|
color: Style.current.darkGrey
|
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
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Gas used"
|
|
|
|
text: qsTrId("gas-used")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2020-07-02 15:14:31 +00:00
|
|
|
color: Style.current.darkGrey
|
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
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Nonce"
|
|
|
|
text: qsTrId("nonce")
|
2020-06-17 16:02:33 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
font.weight: Font.Medium
|
2020-07-02 15:14:31 +00:00
|
|
|
color: Style.current.darkGrey
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|