2022-09-05 09:15:47 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Window 2.12
|
2023-05-31 09:25:16 +00:00
|
|
|
import QtGraphicalEffects 1.15
|
2022-09-05 09:15:47 +00:00
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
|
|
|
import shared.controls 1.0
|
2023-05-31 09:25:16 +00:00
|
|
|
import shared.panels 1.0
|
2022-09-05 09:15:47 +00:00
|
|
|
import utils 1.0
|
2023-01-19 21:14:23 +00:00
|
|
|
import shared.stores 1.0
|
2022-09-05 09:15:47 +00:00
|
|
|
|
|
|
|
import "../controls"
|
2023-05-23 08:44:35 +00:00
|
|
|
import "../popups"
|
2023-02-20 10:57:45 +00:00
|
|
|
import "../stores" as WalletStores
|
|
|
|
import ".."
|
2023-05-16 08:25:40 +00:00
|
|
|
import "../panels"
|
2022-09-05 09:15:47 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
|
2023-04-25 16:54:50 +00:00
|
|
|
property var overview: WalletStores.RootStore.overview
|
2022-09-05 09:15:47 +00:00
|
|
|
property var contactsStore
|
|
|
|
property var transaction
|
|
|
|
property var sendModal
|
2023-01-17 20:05:21 +00:00
|
|
|
readonly property bool isTransactionValid: transaction !== undefined && !!transaction
|
2022-09-05 09:15:47 +00:00
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: d
|
2023-05-10 11:54:06 +00:00
|
|
|
readonly property bool isIncoming: root.isTransactionValid ? root.transaction.to.toLowerCase() === root.overview.mixedcaseAddress.toLowerCase() : false
|
2023-02-28 17:15:22 +00:00
|
|
|
readonly property bool isNFT: root.isTransactionValid ? root.transaction.isNFT : false
|
2023-01-17 20:05:21 +00:00
|
|
|
readonly property string savedAddressNameTo: root.isTransactionValid ? d.getNameForSavedWalletAddress(transaction.to) : ""
|
|
|
|
readonly property string savedAddressNameFrom: root.isTransactionValid ? d.getNameForSavedWalletAddress(transaction.from): ""
|
|
|
|
readonly property string from: root.isTransactionValid ? !!savedAddressNameFrom ? savedAddressNameFrom : Utils.compactAddress(transaction.from, 4): ""
|
|
|
|
readonly property string to: root.isTransactionValid ? !!savedAddressNameTo ? savedAddressNameTo : Utils.compactAddress(transaction.to, 4): ""
|
2023-04-04 12:09:36 +00:00
|
|
|
readonly property string savedAddressEns: root.isTransactionValid ? RootStore.getEnsForSavedWalletAddress(isIncoming ? transaction.from : transaction.to) : ""
|
|
|
|
readonly property string savedAddressChains: root.isTransactionValid ? RootStore.getChainShortNamesForSavedWalletAddress(isIncoming ? transaction.from : transaction.to) : ""
|
2023-05-31 09:25:16 +00:00
|
|
|
readonly property string networkShortName: root.isTransactionValid ? RootStore.getNetworkShortName(transaction.chainId) : ""
|
|
|
|
readonly property string networkFullName: root.isTransactionValid ? RootStore.getNetworkFullName(transaction.chainId): ""
|
|
|
|
readonly property string networkIcon: root.isTransactionValid ? RootStore.getNetworkIcon(transaction.chainId): ""
|
|
|
|
readonly property int blockNumber: root.isTransactionValid ? RootStore.hex2Dec(root.transaction.blockNumber) : 0
|
|
|
|
readonly property string bridgeNetworkIcon: "" // TODO fill when bridge data is implemented
|
|
|
|
readonly property string bridgeNetworkFullname: "" // TODO fill when bridge data is implemented
|
|
|
|
readonly property string bridgeNetworkShortName: "" // TODO fill when bridge data is implemented
|
|
|
|
readonly property int bridgeBlockNumber: 0 // TODO fill when bridge data is implemented
|
|
|
|
readonly property string swapSymbol: "" // TODO fill when swap data is implemented
|
|
|
|
readonly property string symbol: root.isTransactionValid ? transaction.symbol : ""
|
|
|
|
readonly property var multichainNetworks: [] // TODO fill icon for networks for multichain
|
2022-09-05 09:15:47 +00:00
|
|
|
|
|
|
|
function getNameForSavedWalletAddress(address) {
|
|
|
|
return RootStore.getNameForSavedWalletAddress(address)
|
|
|
|
}
|
|
|
|
|
2023-05-31 09:25:16 +00:00
|
|
|
function retryTransaction() {
|
|
|
|
// TODO handle failed transaction retry
|
|
|
|
}
|
|
|
|
}
|
2022-09-05 09:15:47 +00:00
|
|
|
|
|
|
|
StatusScrollView {
|
2023-05-31 09:25:16 +00:00
|
|
|
id: scrollView
|
2023-05-31 20:58:23 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
contentWidth: availableWidth
|
2022-09-05 09:15:47 +00:00
|
|
|
|
|
|
|
Column {
|
|
|
|
id: column
|
2023-05-31 20:58:23 +00:00
|
|
|
width: scrollView.availableWidth
|
2023-05-31 09:25:16 +00:00
|
|
|
spacing: Style.current.xlPadding + Style.current.halfPadding
|
2022-09-05 09:15:47 +00:00
|
|
|
|
2023-05-31 09:25:16 +00:00
|
|
|
Column {
|
2022-09-05 09:15:47 +00:00
|
|
|
width: parent.width
|
2023-05-31 09:25:16 +00:00
|
|
|
spacing: Style.current.bigPadding
|
|
|
|
|
|
|
|
TransactionDelegate {
|
|
|
|
id: transactionHeader
|
|
|
|
objectName: "transactionDetailHeader"
|
|
|
|
width: parent.width
|
|
|
|
leftPadding: 0
|
|
|
|
|
|
|
|
modelData: transaction
|
|
|
|
transactionType: d.isIncoming ? TransactionDelegate.Receive : TransactionDelegate.Send
|
|
|
|
currentCurrency: RootStore.currentCurrency
|
|
|
|
cryptoValue: root.isTransactionValid ? transaction.value.amount: 0.0
|
|
|
|
fiatValue: root.isTransactionValid ? RootStore.getFiatValue(cryptoValue, symbol, currentCurrency): 0.0
|
|
|
|
networkIcon: d.networkIcon
|
|
|
|
networkColor: root.isTransactionValid ? RootStore.getNetworkColor(transaction.chainId): ""
|
|
|
|
networkName: d.networkFullName
|
|
|
|
swapSymbol: d.swapSymbol
|
|
|
|
bridgeNetworkName: d.bridgeNetworkFullname
|
|
|
|
symbol: d.symbol
|
|
|
|
transferStatus: root.isTransactionValid ? RootStore.hex2Dec(transaction.txStatus): ""
|
|
|
|
timeStampText: root.isTransactionValid ? qsTr("Signed at %1").arg(LocaleUtils.formatDateTime(transaction.timestamp * 1000, Locale.LongFormat)): ""
|
|
|
|
addressNameTo: root.isTransactionValid ? WalletStores.RootStore.getNameForAddress(transaction.to): ""
|
|
|
|
addressNameFrom: root.isTransactionValid ? WalletStores.RootStore.getNameForAddress(transaction.from): ""
|
|
|
|
sensor.enabled: false
|
|
|
|
formatCurrencyAmount: RootStore.formatCurrencyAmount
|
|
|
|
color: Theme.palette.transparent
|
|
|
|
state: "header"
|
|
|
|
onRetryClicked: d.retryTransaction()
|
2023-05-10 11:54:06 +00:00
|
|
|
}
|
2023-05-31 09:25:16 +00:00
|
|
|
|
|
|
|
Separator { }
|
2022-09-05 09:15:47 +00:00
|
|
|
}
|
|
|
|
|
2023-05-16 08:25:40 +00:00
|
|
|
WalletTxProgressBlock {
|
2023-05-31 09:25:16 +00:00
|
|
|
id: progressBlock
|
2023-05-16 08:25:40 +00:00
|
|
|
width: Math.min(513, root.width)
|
|
|
|
error: transactionHeader.transactionStatus === TransactionDelegate.TransactionStatus.Failed
|
2023-05-24 06:22:29 +00:00
|
|
|
isLayer1: RootStore.getNetworkLayer(root.transaction.chainId) == 1
|
2023-05-31 09:25:16 +00:00
|
|
|
confirmations: root.isTransactionValid ? Math.abs(WalletStores.RootStore.getLatestBlockNumber(root.transaction.chainId) - d.blockNumber): 0
|
|
|
|
chainName: d.networkFullName
|
2023-05-24 06:22:29 +00:00
|
|
|
timeStamp: root.isTransactionValid ? transaction.timestamp: ""
|
2023-05-16 08:25:40 +00:00
|
|
|
}
|
|
|
|
|
2023-05-31 09:25:16 +00:00
|
|
|
Separator {
|
|
|
|
width: progressBlock.width
|
|
|
|
}
|
2022-09-05 09:15:47 +00:00
|
|
|
|
2023-06-02 08:29:40 +00:00
|
|
|
WalletNftPreview {
|
|
|
|
visible: root.isTransactionValid && d.isNFT && !!transaction.nftImageUrl
|
|
|
|
width: Math.min(304, progressBlock.width)
|
|
|
|
nftName: root.isTransactionValid ? transaction.nftName : ""
|
|
|
|
nftUrl: root.isTransactionValid && !!transaction.nftImageUrl ? transaction.nftImageUrl : ""
|
|
|
|
strikethrough: transactionHeader.transactionType === TransactionDelegate.Destroy
|
|
|
|
tokenId: root.isTransactionValid ? transaction.tokenID : ""
|
|
|
|
contractAddress: root.isTransactionValid ? transaction.contract : ""
|
|
|
|
}
|
|
|
|
|
2023-05-31 09:25:16 +00:00
|
|
|
Column {
|
|
|
|
width: progressBlock.width
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
width: parent.width
|
|
|
|
font.pixelSize: 15
|
|
|
|
color: Theme.palette.directColor5
|
|
|
|
text: qsTr("Transaction summary")
|
|
|
|
elide: Text.ElideRight
|
2022-09-05 09:15:47 +00:00
|
|
|
}
|
2023-05-31 09:25:16 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
width: parent.width
|
|
|
|
height: Style.current.smallPadding
|
2022-09-05 09:15:47 +00:00
|
|
|
}
|
|
|
|
|
2023-05-31 09:25:16 +00:00
|
|
|
DetailsPanel {
|
|
|
|
RowLayout {
|
|
|
|
spacing: 0
|
|
|
|
width: parent.width
|
|
|
|
height: opacity > 0 ? Math.max(implicitHeight, 85) : 0
|
|
|
|
opacity: fromNetworkTile.visible || toNetworkTile.visible ? 1 : 0
|
|
|
|
TransactionDataTile {
|
|
|
|
id: fromNetworkTile
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
title: qsTr("From")
|
|
|
|
subTitle: {
|
|
|
|
switch(transactionHeader.transactionType) {
|
|
|
|
case TransactionDelegate.Swap:
|
|
|
|
return d.symbol
|
|
|
|
case TransactionDelegate.Bridge:
|
|
|
|
return d.networkFullName
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
asset.name: {
|
|
|
|
switch(transactionHeader.transactionType) {
|
|
|
|
case TransactionDelegate.Swap:
|
|
|
|
return !!d.symbol ? Style.png("tokens/%1".arg(d.symbol)) : ""
|
|
|
|
case TransactionDelegate.Bridge:
|
|
|
|
return !!d.networkIcon ? Style.svg(d.networkIcon) : ""
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
visible: !!subTitle
|
|
|
|
}
|
|
|
|
TransactionDataTile {
|
|
|
|
id: toNetworkTile
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
title: qsTr("To")
|
|
|
|
subTitle: {
|
|
|
|
switch(transactionHeader.transactionType) {
|
|
|
|
case TransactionDelegate.Swap:
|
|
|
|
return d.swapSymbol
|
|
|
|
case TransactionDelegate.Bridge:
|
|
|
|
return d.bridgeNetworkFullname
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
asset.name: {
|
|
|
|
switch(transactionHeader.transactionType) {
|
|
|
|
case TransactionDelegate.Swap:
|
|
|
|
return !!d.swapSymbol ? Style.png("tokens/%1".arg(d.swapSymbol)) : ""
|
|
|
|
case TransactionDelegate.Bridge:
|
|
|
|
return !!d.bridgeNetworkIcon ? Style.svg(d.bridgeNetworkIcon) : ""
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
visible: !!subTitle
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TransactionAddressTile {
|
|
|
|
width: parent.width
|
|
|
|
title: transactionHeader.transactionType === TransactionDelegate.Swap || transactionHeader.transactionType === TransactionDelegate.Bridge ?
|
|
|
|
qsTr("In") : qsTr("From")
|
|
|
|
addresses: root.isTransactionValid ? [root.transaction.from] : []
|
|
|
|
contactsStore: root.contactsStore
|
|
|
|
rootStore: WalletStores.RootStore
|
|
|
|
onButtonClicked: {
|
|
|
|
if (transactionHeader.transactionType === TransactionDelegate.Swap || transactionHeader.transactionType === TransactionDelegate.Bridge) {
|
|
|
|
addressMenu.openEthAddressMenu(this, addresses[0])
|
|
|
|
} else {
|
|
|
|
addressMenu.openSenderMenu(this, addresses[0])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TransactionAddressTile {
|
|
|
|
width: parent.width
|
|
|
|
title: qsTr("To")
|
|
|
|
addresses: root.isTransactionValid ? [root.transaction.to] : []
|
|
|
|
contactsStore: root.contactsStore
|
|
|
|
rootStore: WalletStores.RootStore
|
|
|
|
onButtonClicked: addressMenu.openReceiverMenu(this, addresses[0])
|
|
|
|
visible: transactionHeader.transactionType !== TransactionDelegate.Swap && transactionHeader.transactionType !== TransactionDelegate.Bridge && transactionHeader.transactionType !== TransactionDelegate.Destroy
|
|
|
|
}
|
|
|
|
TransactionDataTile {
|
|
|
|
width: parent.width
|
|
|
|
title: qsTr("Using")
|
|
|
|
buttonIconName: "external"
|
|
|
|
subTitle: "" // TODO fill protocol name for Swap and Bridge
|
|
|
|
asset.name: "" // TODO fill protocol icon for Bridge and Swap e.g. Style.svg("network/Network=Arbitrum")
|
|
|
|
onButtonClicked: {
|
|
|
|
// TODO handle
|
|
|
|
}
|
|
|
|
visible: !!subTitle
|
|
|
|
}
|
|
|
|
TransactionDataTile {
|
|
|
|
width: parent.width
|
|
|
|
title: qsTr("%1 Tx hash").arg(d.networkFullName)
|
|
|
|
subTitle: root.isTransactionValid ? root.transaction.txHash : ""
|
|
|
|
visible: !!subTitle
|
|
|
|
buttonIconName: "more"
|
|
|
|
onButtonClicked: addressMenu.openTxMenu(this, subTitle, d.networkShortName)
|
|
|
|
}
|
|
|
|
TransactionDataTile {
|
|
|
|
width: parent.width
|
|
|
|
title: qsTr("%1 Tx hash").arg(d.bridgeNetworkFullname)
|
|
|
|
subTitle: "" // TODO fill tx hash for Bridge
|
|
|
|
visible: !!subTitle
|
|
|
|
buttonIconName: "more"
|
|
|
|
onButtonClicked: addressMenu.openTxMenu(this, subTitle, d.bridgeNetworkShortName)
|
|
|
|
}
|
|
|
|
TransactionContractTile {
|
|
|
|
// Used for Bridge and Swap to display 'From' network Protocol contract address
|
|
|
|
address: "" // TODO fill protocol contract address for 'from' network for Bridge and Swap
|
|
|
|
symbol: "" // TODO fill protocol name for Bridge and Swap
|
|
|
|
networkName: d.networkFullName
|
|
|
|
shortNetworkName: d.networkShortName
|
|
|
|
visible: !!subTitle && (transactionHeader.transactionType === TransactionDelegate.Bridge || transactionHeader.transactionType === TransactionDelegate.Swap)
|
|
|
|
}
|
|
|
|
TransactionContractTile {
|
|
|
|
// Used to display contract address for any network
|
|
|
|
address: root.isTransactionValid ? transaction.contract : ""
|
|
|
|
symbol: root.isTransactionValid ? transaction.value.symbol.toUpperCase() : ""
|
|
|
|
networkName: d.networkFullName
|
|
|
|
shortNetworkName: d.networkShortName
|
|
|
|
}
|
|
|
|
TransactionContractTile {
|
|
|
|
// Used for Bridge to display 'To' network Protocol contract address
|
|
|
|
address: "" // TODO fill protocol contract address for 'to' network for Bridge
|
|
|
|
symbol: "" // TODO fill protocol name for Bridge
|
|
|
|
networkName: d.bridgeNetworkFullname
|
|
|
|
shortNetworkName: d.bridgeNetworkShortName
|
|
|
|
visible: !!subTitle && transactionHeader.transactionType === TransactionDelegate.Bridge
|
|
|
|
}
|
|
|
|
TransactionContractTile {
|
|
|
|
// Used for Bridge and Swap to display 'To' network token contract address
|
|
|
|
address: {
|
|
|
|
if (!root.isTransactionValid)
|
|
|
|
return ""
|
|
|
|
switch(transactionHeader.transactionType) {
|
|
|
|
case TransactionDelegate.Swap:
|
|
|
|
return transaction.contract
|
|
|
|
case TransactionDelegate.Bridge:
|
|
|
|
return "" // TODO fill swap token's contract address for 'to' network for Bridge
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
symbol: {
|
|
|
|
if (!root.isTransactionValid)
|
|
|
|
return ""
|
|
|
|
switch(transactionHeader.transactionType) {
|
|
|
|
case TransactionDelegate.Swap:
|
|
|
|
return d.swapSymbol
|
|
|
|
case TransactionDelegate.Bridge:
|
|
|
|
return transaction.value.symbol.toUpperCase()
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
networkName: d.bridgeNetworkFullname
|
|
|
|
shortNetworkName: d.bridgeNetworkShortName
|
|
|
|
}
|
|
|
|
}
|
2022-09-05 09:15:47 +00:00
|
|
|
|
2023-05-31 09:25:16 +00:00
|
|
|
Item {
|
|
|
|
width: parent.width
|
|
|
|
height: Style.current.bigPadding
|
|
|
|
}
|
|
|
|
|
|
|
|
DetailsPanel {
|
|
|
|
width: progressBlock.width
|
|
|
|
RowLayout {
|
|
|
|
width: parent.width
|
|
|
|
height: Math.max(implicitHeight, 85)
|
|
|
|
spacing: 0
|
|
|
|
TransactionDataTile {
|
|
|
|
id: multichainNetworksTile
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Networks")
|
|
|
|
visible: d.multichainNetworks.length > 0
|
|
|
|
Row {
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
topMargin: multichainNetworksTile.statusListItemTitleArea.height + multichainNetworksTile.topPadding
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: multichainNetworksTile.leftPadding
|
|
|
|
}
|
|
|
|
spacing: -4
|
|
|
|
Repeater {
|
|
|
|
model: d.multichainNetworks
|
|
|
|
delegate: StatusRoundedImage {
|
|
|
|
width: 20
|
|
|
|
height: 20
|
|
|
|
visible: image.source !== ""
|
|
|
|
border.width: index === 0 ? 0 : 1
|
|
|
|
border.color: Theme.palette.white
|
|
|
|
image.source: Style.svg("tiny/" + modelData)
|
|
|
|
z: index + 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TransactionDataTile {
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Network")
|
|
|
|
subTitle: d.networkFullName
|
|
|
|
asset.name: !!d.networkIcon ? Style.svg("%1".arg(d.networkIcon)) : ""
|
|
|
|
smallIcon: true
|
|
|
|
visible: transactionHeader.transactionType !== TransactionDelegate.Bridge
|
|
|
|
}
|
|
|
|
TransactionDataTile {
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Token format")
|
|
|
|
subTitle: root.isTransactionValid ? transaction.type.toUpperCase() : ""
|
|
|
|
visible: !!subTitle
|
|
|
|
}
|
|
|
|
TransactionDataTile {
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Nonce")
|
|
|
|
subTitle: root.isTransactionValid ? RootStore.hex2Dec(root.transaction.nonce) : ""
|
|
|
|
visible: !!subTitle
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TransactionDataTile {
|
|
|
|
width: parent.width
|
|
|
|
title: qsTr("Input data")
|
|
|
|
subTitle: root.isTransactionValid ? root.transaction.input : ""
|
|
|
|
visible: !!subTitle
|
|
|
|
buttonIconName: "more"
|
|
|
|
onButtonClicked: addressMenu.openInputDataMenu(this, subTitle)
|
|
|
|
}
|
|
|
|
TransactionDataTile {
|
|
|
|
width: parent.width
|
|
|
|
title: !!d.networkFullName ? qsTr("Included in Block on %1").arg(d.networkFullName) : qsTr("Included on Block")
|
|
|
|
subTitle: d.blockNumber
|
|
|
|
tertiaryTitle: root.isTransactionValid ? LocaleUtils.formatDateTime(transaction.timestamp * 1000, Locale.LongFormat) : ""
|
|
|
|
visible: d.blockNumber > 0
|
|
|
|
}
|
|
|
|
TransactionDataTile {
|
|
|
|
width: parent.width
|
|
|
|
title: !!d.bridgeNetworkFullname ? qsTr("Included in Block on %1").arg(d.bridgeNetworkFullname) : qsTr("Included on Block")
|
|
|
|
subTitle: d.bridgeBlockNumber
|
|
|
|
tertiaryTitle: root.isTransactionValid ? LocaleUtils.formatDateTime(transaction.timestamp * 1000, Locale.LongFormat) : ""
|
|
|
|
visible: d.bridgeBlockNumber > 0
|
|
|
|
}
|
|
|
|
}
|
2022-09-05 09:15:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusExpandableItem {
|
|
|
|
width: parent.width
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
|
|
|
type: StatusExpandableItem.Type.Tertiary
|
|
|
|
expandable: true
|
|
|
|
primaryText: qsTr("Fees")
|
|
|
|
expandableComponent: fees
|
|
|
|
expanded: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: fees
|
|
|
|
Column {
|
|
|
|
width: parent.width
|
|
|
|
spacing: 8
|
|
|
|
Row {
|
|
|
|
spacing: 8
|
|
|
|
InformationTile {
|
|
|
|
id: baseFee
|
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: qsTr("Base fee")
|
2023-01-17 20:05:21 +00:00
|
|
|
secondaryText: root.isTransactionValid ? qsTr("%1").arg(LocaleUtils.currencyAmountToLocaleString(root.transaction.baseGasFees)) : ""
|
2022-09-05 09:15:47 +00:00
|
|
|
}
|
|
|
|
InformationTile {
|
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: qsTr("Tip")
|
2023-01-17 20:05:21 +00:00
|
|
|
secondaryText: root.isTransactionValid ? "%1 <font color=\"%2\">• ".
|
|
|
|
arg(LocaleUtils.currencyAmountToLocaleString(root.transaction.maxPriorityFeePerGas)).
|
|
|
|
arg(Theme.palette.baseColor1) +
|
|
|
|
qsTr("Max: %1").
|
|
|
|
arg(LocaleUtils.currencyAmountToLocaleString(root.transaction.maxFeePerGas)) +
|
|
|
|
"</font>" : ""
|
2022-09-05 09:15:47 +00:00
|
|
|
secondaryLabel.textFormat: Text.RichText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
InformationTile {
|
|
|
|
maxWidth: parent.width
|
|
|
|
primaryText: qsTr("Total fee")
|
2023-01-17 20:05:21 +00:00
|
|
|
secondaryText: root.isTransactionValid ? "%1 <font color=\"%2\">• ".
|
|
|
|
arg(LocaleUtils.currencyAmountToLocaleString(root.transaction.totalFees)).
|
|
|
|
arg(Theme.palette.baseColor1) +
|
|
|
|
qsTr("Max: %1").
|
|
|
|
arg(LocaleUtils.currencyAmountToLocaleString(root.transaction.maxTotalFees)) +
|
|
|
|
"</font>" : ""
|
2022-09-05 09:15:47 +00:00
|
|
|
secondaryLabel.textFormat: Text.RichText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-05-23 08:44:35 +00:00
|
|
|
|
|
|
|
TransactionAddressMenu {
|
|
|
|
id: addressMenu
|
|
|
|
|
|
|
|
contactsStore: root.contactsStore
|
|
|
|
onOpenSendModal: (address) => root.sendModal.open(address)
|
|
|
|
}
|
2023-05-31 09:25:16 +00:00
|
|
|
|
|
|
|
component DetailsPanel: Item {
|
|
|
|
width: parent.width
|
|
|
|
height: detailsColumn.childrenRect.height
|
|
|
|
default property alias content: detailsColumn.children
|
|
|
|
Rectangle {
|
|
|
|
id: tileBackground
|
|
|
|
anchors.fill: parent
|
|
|
|
radius: 8
|
|
|
|
border.width: 1
|
|
|
|
border.color: Style.current.separator
|
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: detailsColumn
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 1
|
|
|
|
spacing: 0
|
|
|
|
layer.enabled: true
|
|
|
|
layer.effect: OpacityMask {
|
|
|
|
maskSource: tileBackground
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
component TransactionContractTile: TransactionDataTile {
|
|
|
|
property string networkName: ""
|
|
|
|
property string symbol: ""
|
|
|
|
property string address: ""
|
|
|
|
property string shortNetworkName: ""
|
|
|
|
width: parent.width
|
|
|
|
title: qsTr("%1 %2 contract address").arg(networkName).arg(symbol)
|
|
|
|
subTitle: !!address && !/0x0+$/.test(address) ? address : ""
|
|
|
|
buttonIconName: "more"
|
|
|
|
visible: !!subTitle
|
|
|
|
onButtonClicked: addressMenu.openContractMenu(this, address, shortNetworkName, symbol)
|
|
|
|
}
|
2022-09-05 09:15:47 +00:00
|
|
|
}
|