2023-12-06 10:54:36 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2024-09-11 12:00:25 +00:00
|
|
|
import Qt.labs.settings 1.1
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2024-07-18 20:10:24 +00:00
|
|
|
import StatusQ.Components 0.1
|
2022-05-23 11:45:29 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2024-06-14 17:50:52 +00:00
|
|
|
import StatusQ.Core 0.1
|
2023-12-06 10:54:36 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2024-06-14 17:50:52 +00:00
|
|
|
import StatusQ.Core.Utils 0.1
|
2022-05-23 11:45:29 +00:00
|
|
|
|
2024-09-11 12:00:25 +00:00
|
|
|
import AppLayouts.Wallet.controls 1.0
|
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
import utils 1.0
|
2023-08-23 11:46:04 +00:00
|
|
|
import shared.controls 1.0
|
2022-03-25 08:46:47 +00:00
|
|
|
import shared.views 1.0
|
2024-02-26 02:32:59 +00:00
|
|
|
import shared.stores 1.0 as SharedStores
|
2023-09-11 10:20:36 +00:00
|
|
|
import shared.panels 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
|
2022-09-05 09:15:47 +00:00
|
|
|
import "./"
|
2021-10-05 20:50:22 +00:00
|
|
|
import "../stores"
|
|
|
|
import "../panels"
|
2022-07-28 20:56:44 +00:00
|
|
|
import "../views/collectibles"
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2023-12-26 10:19:41 +00:00
|
|
|
RightTabBaseView {
|
2022-07-19 13:17:35 +00:00
|
|
|
id: root
|
2021-10-05 20:50:22 +00:00
|
|
|
|
|
|
|
property alias currentTabIndex: walletTabBar.currentIndex
|
|
|
|
|
2023-04-26 15:53:49 +00:00
|
|
|
signal launchShareAddressModal()
|
2024-05-13 17:23:01 +00:00
|
|
|
signal launchSwapModal(string tokensKey)
|
2023-04-26 15:53:49 +00:00
|
|
|
|
2023-05-31 07:47:52 +00:00
|
|
|
function resetView() {
|
2024-04-10 09:44:15 +00:00
|
|
|
resetStack()
|
2023-05-31 07:47:52 +00:00
|
|
|
root.currentTabIndex = 0
|
|
|
|
}
|
|
|
|
|
2022-09-13 16:17:54 +00:00
|
|
|
function resetStack() {
|
|
|
|
stack.currentIndex = 0;
|
2024-06-06 13:10:20 +00:00
|
|
|
RootStore.backButtonName = d.getBackButtonText(stack.currentIndex);
|
2022-09-13 16:17:54 +00:00
|
|
|
}
|
|
|
|
|
2024-02-20 09:04:39 +00:00
|
|
|
headerButton.onClicked: {
|
|
|
|
root.launchShareAddressModal()
|
|
|
|
}
|
|
|
|
header.visible: stack.currentIndex === 0
|
|
|
|
|
2023-12-26 10:19:41 +00:00
|
|
|
StackLayout {
|
|
|
|
id: stack
|
2024-01-10 09:27:11 +00:00
|
|
|
anchors.fill: parent
|
2023-07-13 08:48:26 +00:00
|
|
|
|
2023-04-26 17:31:34 +00:00
|
|
|
onCurrentIndexChanged: {
|
|
|
|
RootStore.backButtonName = d.getBackButtonText(currentIndex)
|
|
|
|
}
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2023-12-26 10:19:41 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
function getBackButtonText(index) {
|
|
|
|
switch(index) {
|
|
|
|
case 1:
|
|
|
|
return qsTr("Collectibles")
|
|
|
|
case 2:
|
|
|
|
return qsTr("Assets")
|
|
|
|
case 3:
|
|
|
|
return qsTr("Activity")
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|
2024-02-26 02:32:59 +00:00
|
|
|
|
|
|
|
readonly property var detailedCollectibleActivityController: RootStore.tmpActivityController0
|
2023-12-26 10:19:41 +00:00
|
|
|
}
|
|
|
|
|
2024-07-26 14:47:18 +00:00
|
|
|
Component {
|
|
|
|
id: confirmHideCommunityAssetsPopup
|
|
|
|
|
|
|
|
ConfirmHideCommunityAssetsPopup {
|
|
|
|
destroyOnClose: true
|
|
|
|
|
|
|
|
required property string communityId
|
|
|
|
|
|
|
|
onConfirmButtonClicked: {
|
|
|
|
RootStore.walletAssetsStore.assetsController.showHideGroup(communityId, false /*hide*/)
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-20 17:32:36 +00:00
|
|
|
// StackLayout.currentIndex === 0
|
2023-04-26 17:31:34 +00:00
|
|
|
ColumnLayout {
|
2023-04-26 15:53:49 +00:00
|
|
|
spacing: 0
|
2023-08-23 11:46:04 +00:00
|
|
|
|
|
|
|
ImportKeypairInfo {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: Style.current.bigPadding
|
|
|
|
Layout.preferredHeight: childrenRect.height
|
|
|
|
visible: root.store.walletSectionInst.hasPairedDevices && root.store.walletSectionInst.keypairOperabilityForObservedAccount === Constants.keypair.operability.nonOperable
|
|
|
|
|
|
|
|
onRunImport: {
|
|
|
|
root.store.walletSectionInst.runKeypairImportPopup()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-06 10:54:36 +00:00
|
|
|
RowLayout {
|
2023-04-26 17:31:34 +00:00
|
|
|
Layout.fillWidth: true
|
2023-12-06 10:54:36 +00:00
|
|
|
StatusTabBar {
|
|
|
|
id: walletTabBar
|
|
|
|
objectName: "rightSideWalletTabBar"
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: Style.current.padding
|
|
|
|
|
|
|
|
StatusTabButton {
|
2024-03-22 07:55:07 +00:00
|
|
|
objectName: "assetsTabButton"
|
2023-12-06 10:54:36 +00:00
|
|
|
leftPadding: 0
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Assets")
|
|
|
|
}
|
|
|
|
StatusTabButton {
|
2024-03-22 07:55:07 +00:00
|
|
|
objectName: "collectiblesTabButton"
|
2023-12-06 10:54:36 +00:00
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Collectibles")
|
|
|
|
}
|
|
|
|
StatusTabButton {
|
2024-03-22 07:55:07 +00:00
|
|
|
objectName: "activityTabButton"
|
2023-12-06 10:54:36 +00:00
|
|
|
rightPadding: 0
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Activity")
|
2024-07-18 20:10:24 +00:00
|
|
|
|
|
|
|
StatusBetaTag {
|
|
|
|
// TODO remove me when Activity is no longer experimental
|
|
|
|
// Keep Activity as the last tab for now as the Experimental tag don't flow
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 6
|
|
|
|
anchors.left: parent.right
|
|
|
|
anchors.leftMargin: 5
|
2024-08-30 10:19:42 +00:00
|
|
|
cursorShape: Qt.PointingHandCursor
|
2024-07-18 20:10:24 +00:00
|
|
|
}
|
2023-12-06 10:54:36 +00:00
|
|
|
}
|
|
|
|
onCurrentIndexChanged: {
|
|
|
|
RootStore.setCurrentViewedHoldingType(walletTabBar.currentIndex === 1 ? Constants.TokenType.ERC721 : Constants.TokenType.ERC20)
|
|
|
|
}
|
2022-07-28 20:56:44 +00:00
|
|
|
}
|
2023-12-06 10:54:36 +00:00
|
|
|
StatusFlatButton {
|
|
|
|
id: filterButton
|
2024-03-22 07:55:07 +00:00
|
|
|
objectName: "filterButton"
|
2023-12-06 10:54:36 +00:00
|
|
|
icon.name: "filter"
|
|
|
|
checkable: true
|
|
|
|
icon.color: checked ? Theme.palette.primaryColor1 : Theme.palette.baseColor1
|
|
|
|
Behavior on icon.color { ColorAnimation { duration: 200; easing.type: Easing.InOutQuad } }
|
|
|
|
highlighted: checked
|
2023-09-12 14:26:38 +00:00
|
|
|
}
|
2023-04-26 17:31:34 +00:00
|
|
|
}
|
2024-01-25 11:18:58 +00:00
|
|
|
Loader {
|
2023-11-22 19:58:02 +00:00
|
|
|
id: mainViewLoader
|
2023-04-26 17:31:34 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2024-01-25 11:18:58 +00:00
|
|
|
sourceComponent: {
|
|
|
|
switch (walletTabBar.currentIndex) {
|
|
|
|
case 0: return assetsView
|
|
|
|
case 1: return collectiblesView
|
|
|
|
case 2: return historyView
|
2022-07-28 20:56:44 +00:00
|
|
|
}
|
2023-04-26 17:31:34 +00:00
|
|
|
}
|
2024-01-25 11:18:58 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: assetsView
|
2024-06-14 17:50:52 +00:00
|
|
|
|
2024-06-14 18:20:07 +00:00
|
|
|
AssetsView {
|
2024-06-14 17:50:52 +00:00
|
|
|
AssetsViewAdaptor {
|
|
|
|
id: assetsViewAdaptor
|
|
|
|
|
|
|
|
accounts: RootStore.addressFilters
|
2024-07-15 15:56:50 +00:00
|
|
|
chains: RootStore.networkFiltersArray
|
2024-06-14 17:50:52 +00:00
|
|
|
|
|
|
|
marketValueThreshold:
|
|
|
|
RootStore.tokensStore.displayAssetsBelowBalance
|
|
|
|
? RootStore.tokensStore.getDisplayAssetsBelowBalanceThresholdDisplayAmount()
|
|
|
|
: 0
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: RootStore.tokensStore
|
|
|
|
|
|
|
|
function displayAssetsBelowBalanceThresholdChanged() {
|
|
|
|
assetsViewAdaptor.marketValueThresholdChanged()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tokensModel: RootStore.walletAssetsStore.groupedAccountAssetsModel
|
|
|
|
|
|
|
|
formatBalance: (balance, symbol) => {
|
|
|
|
return LocaleUtils.currencyAmountToLocaleString(
|
|
|
|
RootStore.currencyStore.getCurrencyAmount(balance, symbol))
|
|
|
|
}
|
|
|
|
|
|
|
|
chainsError: (chains) => {
|
|
|
|
if (!root.networkConnectionStore)
|
|
|
|
return ""
|
|
|
|
return root.networkConnectionStore.getBlockchainNetworkDownText(chains)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-11 12:00:25 +00:00
|
|
|
function refreshSortSettings() {
|
|
|
|
settings.category = settingsCategoryName
|
|
|
|
walletSettings.sync()
|
|
|
|
settings.sync()
|
|
|
|
let value = SortOrderComboBox.TokenOrderAlpha
|
|
|
|
if (walletSettings.assetsViewCustomOrderApplyTimestamp > settings.sortOrderUpdateTimestamp && customOrderAvailable) {
|
|
|
|
value = SortOrderComboBox.TokenOrderCustom
|
|
|
|
} else {
|
|
|
|
value = settings.currentSortValue
|
|
|
|
}
|
|
|
|
sortByValue(value)
|
|
|
|
setSortOrder(settings.currentSortOrder)
|
|
|
|
}
|
|
|
|
|
|
|
|
function saveSortSettings() {
|
|
|
|
settings.currentSortValue = getSortValue()
|
|
|
|
settings.currentSortOrder = getSortOrder()
|
|
|
|
settings.sortOrderUpdateTimestamp = new Date().getTime()
|
|
|
|
settings.sync()
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property string settingsCategoryName: {
|
|
|
|
const addressFilters = RootStore.addressFilters
|
|
|
|
return "AssetsViewSortSettings-" + (addressFilters.indexOf(':') > -1 ? "all" : addressFilters)
|
|
|
|
}
|
|
|
|
onSettingsCategoryNameChanged: {
|
|
|
|
saveSortSettings()
|
|
|
|
refreshSortSettings()
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: refreshSortSettings()
|
|
|
|
Component.onDestruction: saveSortSettings()
|
|
|
|
|
|
|
|
readonly property Settings walletSettings: Settings {
|
|
|
|
id: walletSettings
|
|
|
|
category: "walletSettings-" + root.contactsStore.myPublicKey
|
|
|
|
property var assetsViewCustomOrderApplyTimestamp
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property Settings settings: Settings {
|
|
|
|
id: settings
|
|
|
|
property int currentSortValue: SortOrderComboBox.TokenOrderDateAdded
|
|
|
|
property var sortOrderUpdateTimestamp
|
|
|
|
property int currentSortOrder: Qt.DescendingOrder
|
|
|
|
}
|
|
|
|
|
2024-06-14 17:50:52 +00:00
|
|
|
loading: RootStore.overview.balanceLoading
|
|
|
|
sorterVisible: filterButton.checked
|
|
|
|
customOrderAvailable: RootStore.walletAssetsStore.assetsController.hasSettings
|
|
|
|
model: assetsViewAdaptor.model
|
|
|
|
|
|
|
|
marketDataError: !!root.networkConnectionStore
|
|
|
|
? root.networkConnectionStore.getMarketNetworkDownText()
|
|
|
|
: ""
|
|
|
|
balanceError: {
|
|
|
|
if (!root.networkConnectionStore)
|
|
|
|
return ""
|
|
|
|
|
|
|
|
return (root.networkConnectionStore.noBlockchainConnectionAndNoCache
|
|
|
|
&& !root.networkConnectionStore.noMarketConnectionAndNoCache)
|
|
|
|
? root.networkConnectionStore.noBlockchainConnectionAndNoCacheText
|
|
|
|
: ""
|
|
|
|
}
|
|
|
|
|
|
|
|
formatFiat: balance => RootStore.currencyStore.formatCurrencyAmount(
|
|
|
|
balance, RootStore.currencyStore.currentCurrency)
|
|
|
|
|
|
|
|
sendEnabled: root.networkConnectionStore.sendBuyBridgeEnabled &&
|
|
|
|
!RootStore.overview.isWatchOnlyAccount && RootStore.overview.canSend
|
2024-08-02 09:24:40 +00:00
|
|
|
communitySendEnabled: RootStore.tokensStore.showCommunityAssetsInSend
|
2024-06-14 17:50:52 +00:00
|
|
|
swapEnabled: !RootStore.overview.isWatchOnlyAccount
|
2024-08-12 10:41:27 +00:00
|
|
|
swapVisible: root.swapEnabled
|
2024-06-14 17:50:52 +00:00
|
|
|
|
|
|
|
onSendRequested: {
|
|
|
|
const modal = root.sendModal
|
|
|
|
|
|
|
|
modal.preSelectedSendType = Constants.SendType.Transfer
|
2024-08-01 10:17:36 +00:00
|
|
|
modal.preSelectedHoldingID = key
|
2024-06-14 17:50:52 +00:00
|
|
|
modal.preSelectedHoldingType = Constants.TokenType.ERC20
|
|
|
|
modal.onlyAssets = true
|
|
|
|
modal.open()
|
|
|
|
}
|
|
|
|
|
|
|
|
onSwapRequested: root.launchSwapModal(key)
|
|
|
|
onReceiveRequested: root.launchShareAddressModal()
|
|
|
|
onCommunityClicked: Global.switchToCommunity(communityKey)
|
2024-07-26 14:47:18 +00:00
|
|
|
|
|
|
|
onHideRequested: (key) => {
|
|
|
|
const token = ModelUtils.getByKey(model, "key", key)
|
|
|
|
Global.openConfirmHideAssetPopup(token.symbol, token.name, token.icon, !!token.communityId)
|
|
|
|
}
|
|
|
|
onHideCommunityAssetsRequested:
|
|
|
|
(communityKey) => {
|
|
|
|
const community = ModelUtils.getByKey(model, "communityId", communityKey)
|
|
|
|
confirmHideCommunityAssetsPopup.createObject(root, {
|
|
|
|
name: community.communityName,
|
|
|
|
icon: community.communityIcon,
|
|
|
|
communityId: communityKey }
|
|
|
|
).open()
|
|
|
|
}
|
2024-06-14 17:50:52 +00:00
|
|
|
onManageTokensRequested: Global.changeAppSectionBySectionType(
|
|
|
|
Constants.appSection.profile,
|
|
|
|
Constants.settingsSubsection.wallet,
|
|
|
|
Constants.walletSettingsSubsection.manageAssets)
|
2024-07-26 14:47:18 +00:00
|
|
|
onAssetClicked: (key) => {
|
2024-06-14 17:50:52 +00:00
|
|
|
const token = ModelUtils.getByKey(model, "key", key)
|
|
|
|
|
2024-10-01 15:23:17 +00:00
|
|
|
RootStore.tokensStore.getHistoricalDataForToken(
|
|
|
|
token.symbol, RootStore.currencyStore.currentCurrency)
|
2024-06-14 17:50:52 +00:00
|
|
|
|
2024-01-25 11:18:58 +00:00
|
|
|
assetDetailView.token = token
|
2024-08-02 09:24:40 +00:00
|
|
|
RootStore.setCurrentViewedHolding(
|
|
|
|
token.symbol, token.key, Constants.TokenType.ERC20, token.communityId ?? "")
|
2024-01-25 11:18:58 +00:00
|
|
|
stack.currentIndex = 2
|
|
|
|
}
|
2023-11-22 19:58:02 +00:00
|
|
|
}
|
|
|
|
}
|
2024-06-14 17:50:52 +00:00
|
|
|
|
2024-01-25 11:18:58 +00:00
|
|
|
Component {
|
|
|
|
id: collectiblesView
|
2024-09-11 12:00:25 +00:00
|
|
|
CollectiblesView {
|
|
|
|
id: collView
|
|
|
|
function refreshSortSettings() {
|
|
|
|
settings.category = settingsCategoryName
|
|
|
|
walletSettings.sync()
|
|
|
|
settings.sync()
|
|
|
|
let value = SortOrderComboBox.TokenOrderAlpha
|
|
|
|
if (walletSettings.collectiblesViewCustomOrderApplyTimestamp > settings.sortOrderUpdateTimestamp && customOrderAvailable) {
|
|
|
|
value = SortOrderComboBox.TokenOrderCustom
|
|
|
|
} else {
|
|
|
|
value = settings.currentSortValue
|
|
|
|
}
|
|
|
|
sortByValue(value)
|
|
|
|
setSortOrder(settings.currentSortOrder)
|
|
|
|
}
|
|
|
|
|
|
|
|
function saveSortSettings() {
|
|
|
|
settings.currentSortValue = getSortValue()
|
|
|
|
settings.currentSortOrder = getSortOrder()
|
|
|
|
settings.sortOrderUpdateTimestamp = new Date().getTime()
|
|
|
|
settings.sync()
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property string settingsCategoryName: "CollectiblesViewSortSettings-" + (addressFilters.indexOf(':') > -1 ? "all" : addressFilters)
|
|
|
|
onSettingsCategoryNameChanged: {
|
|
|
|
saveSortSettings()
|
|
|
|
refreshSortSettings()
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: refreshSortSettings()
|
|
|
|
Component.onDestruction: saveSortSettings()
|
|
|
|
|
|
|
|
readonly property Settings walletSettings: Settings {
|
|
|
|
id: walletSettings
|
|
|
|
category: "walletSettings-" + root.contactsStore.myPublicKey
|
|
|
|
property real collectiblesViewCustomOrderApplyTimestamp: 0
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property Settings settings: Settings {
|
|
|
|
id: settings
|
|
|
|
property int currentSortValue: SortOrderComboBox.TokenOrderDateAdded
|
|
|
|
property real sortOrderUpdateTimestamp: 0
|
|
|
|
property alias selectedFilterGroupIds: collView.selectedFilterGroupIds
|
|
|
|
property int currentSortOrder: Qt.DescendingOrder
|
|
|
|
}
|
|
|
|
|
2024-07-17 14:55:52 +00:00
|
|
|
ownedAccountsModel: RootStore.nonWatchAccounts
|
2024-01-31 18:09:44 +00:00
|
|
|
controller: RootStore.collectiblesStore.collectiblesController
|
2024-01-25 11:18:58 +00:00
|
|
|
networkFilters: RootStore.networkFilters
|
|
|
|
addressFilters: RootStore.addressFilters
|
|
|
|
sendEnabled: root.networkConnectionStore.sendBuyBridgeEnabled && !RootStore.overview.isWatchOnlyAccount && RootStore.overview.canSend
|
|
|
|
filterVisible: filterButton.checked
|
2024-09-11 12:00:25 +00:00
|
|
|
customOrderAvailable: controller.hasSettings
|
2024-01-25 11:18:58 +00:00
|
|
|
onCollectibleClicked: {
|
|
|
|
RootStore.collectiblesStore.getDetailedCollectible(chainId, contractAddress, tokenId)
|
2024-08-02 09:24:40 +00:00
|
|
|
RootStore.setCurrentViewedHolding(uid, uid, tokenType, communityId)
|
2024-02-26 02:32:59 +00:00
|
|
|
d.detailedCollectibleActivityController.resetFilter()
|
2024-04-10 09:44:15 +00:00
|
|
|
d.detailedCollectibleActivityController.setFilterAddressesJson(JSON.stringify(RootStore.addressFilters.split(":")))
|
2024-02-26 02:32:59 +00:00
|
|
|
d.detailedCollectibleActivityController.setFilterChainsJson(JSON.stringify([chainId]), false)
|
|
|
|
d.detailedCollectibleActivityController.setFilterCollectibles(JSON.stringify([uid]))
|
|
|
|
d.detailedCollectibleActivityController.updateFilter()
|
|
|
|
|
2024-01-25 11:18:58 +00:00
|
|
|
stack.currentIndex = 1
|
|
|
|
}
|
2024-07-19 11:20:26 +00:00
|
|
|
onSendRequested: (symbol, tokenType, fromAddress) => {
|
2024-07-17 14:55:52 +00:00
|
|
|
const collectible = ModelUtils.getByKey(controller.sourceModel, "symbol", symbol)
|
2024-07-19 11:20:26 +00:00
|
|
|
if (!!collectible && collectible.communityPrivilegesLevel === Constants.TokenPrivilegesLevel.Owner) {
|
2024-07-17 14:55:52 +00:00
|
|
|
Global.openTransferOwnershipPopup(collectible.communityId,
|
|
|
|
collectible.communityName,
|
|
|
|
collectible.communityImage,
|
|
|
|
{
|
2024-07-19 11:20:26 +00:00
|
|
|
key: collectible.tokenId,
|
|
|
|
privilegesLevel: collectible.communityPrivilegesLevel,
|
|
|
|
chainId: collectible.chainId,
|
|
|
|
name: collectible.name,
|
|
|
|
artworkSource: collectible.communityImage,
|
|
|
|
accountAddress: fromAddress,
|
|
|
|
tokenAddress: collectible.contractAddress
|
2024-07-17 14:55:52 +00:00
|
|
|
},
|
|
|
|
root.sendModal)
|
|
|
|
return
|
|
|
|
}
|
2024-07-19 11:20:26 +00:00
|
|
|
|
|
|
|
root.sendModal.preSelectedAccountAddress = fromAddress
|
2024-07-17 14:55:52 +00:00
|
|
|
root.sendModal.preSelectedHoldingID = symbol
|
|
|
|
root.sendModal.preSelectedHoldingType = tokenType
|
|
|
|
root.sendModal.preSelectedSendType = tokenType === Constants.TokenType.ERC721 ?
|
|
|
|
Constants.SendType.ERC721Transfer:
|
|
|
|
Constants.SendType.ERC1155Transfer
|
|
|
|
root.sendModal.onlyAssets = false
|
|
|
|
root.sendModal.open()
|
|
|
|
}
|
2024-01-25 11:18:58 +00:00
|
|
|
onReceiveRequested: (symbol) => root.launchShareAddressModal()
|
|
|
|
onSwitchToCommunityRequested: (communityId) => Global.switchToCommunity(communityId)
|
|
|
|
onManageTokensRequested: Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.wallet,
|
2024-01-31 18:09:44 +00:00
|
|
|
Constants.walletSettingsSubsection.manageCollectibles)
|
2024-02-07 22:58:56 +00:00
|
|
|
isFetching: RootStore.collectiblesStore.areCollectiblesFetching
|
|
|
|
isUpdating: RootStore.collectiblesStore.areCollectiblesUpdating
|
|
|
|
isError: RootStore.collectiblesStore.areCollectiblesError
|
2024-01-25 11:18:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Component {
|
2023-09-21 06:58:44 +00:00
|
|
|
id: historyView
|
2024-01-25 11:18:58 +00:00
|
|
|
HistoryView {
|
|
|
|
overview: RootStore.overview
|
2024-10-01 15:37:05 +00:00
|
|
|
walletRootStore: RootStore
|
2024-02-22 14:41:19 +00:00
|
|
|
communitiesStore: root.communitiesStore
|
2024-01-25 11:18:58 +00:00
|
|
|
showAllAccounts: RootStore.showAllAccounts
|
|
|
|
sendModal: root.sendModal
|
|
|
|
filterVisible: filterButton.checked
|
2024-02-29 14:53:08 +00:00
|
|
|
onLaunchTransactionDetail: function (txID) {
|
|
|
|
RootStore.activityController.fetchTxDetails(txID)
|
2024-01-25 11:18:58 +00:00
|
|
|
stack.currentIndex = 3
|
|
|
|
}
|
2022-07-28 20:56:44 +00:00
|
|
|
}
|
|
|
|
}
|
2022-07-19 13:17:35 +00:00
|
|
|
}
|
2023-04-26 17:31:34 +00:00
|
|
|
}
|
|
|
|
CollectibleDetailView {
|
2024-02-29 14:53:08 +00:00
|
|
|
id: collectibleDetailView
|
|
|
|
|
|
|
|
visible : (stack.currentIndex === 1)
|
|
|
|
|
2023-07-17 23:56:40 +00:00
|
|
|
collectible: RootStore.collectiblesStore.detailedCollectible
|
|
|
|
isCollectibleLoading: RootStore.collectiblesStore.isDetailedCollectibleLoading
|
2024-02-26 02:32:59 +00:00
|
|
|
activityModel: d.detailedCollectibleActivityController.model
|
2024-03-27 21:49:46 +00:00
|
|
|
addressFilters: RootStore.addressFilters
|
2024-02-26 02:32:59 +00:00
|
|
|
rootStore: SharedStores.RootStore
|
|
|
|
walletRootStore: RootStore
|
|
|
|
communitiesStore: root.communitiesStore
|
2023-09-11 10:20:36 +00:00
|
|
|
|
|
|
|
onVisibleChanged: {
|
2024-02-26 02:32:59 +00:00
|
|
|
if (!visible) {
|
2023-11-07 22:45:47 +00:00
|
|
|
RootStore.resetCurrentViewedHolding(Constants.TokenType.ERC721)
|
2024-09-04 04:29:31 +00:00
|
|
|
RootStore.collectiblesStore.resetDetailedCollectible()
|
2024-02-26 02:32:59 +00:00
|
|
|
}
|
2023-09-11 10:20:36 +00:00
|
|
|
}
|
2024-02-29 14:53:08 +00:00
|
|
|
|
|
|
|
onLaunchTransactionDetail: function (txID) {
|
|
|
|
d.detailedCollectibleActivityController.fetchTxDetails(txID)
|
|
|
|
stack.currentIndex = 3
|
|
|
|
|
|
|
|
// Take user to the activity view when they press the "Back" button
|
|
|
|
walletTabBar.currentIndex = 2
|
|
|
|
}
|
2023-04-26 17:31:34 +00:00
|
|
|
}
|
|
|
|
AssetsDetailView {
|
|
|
|
id: assetDetailView
|
2022-10-28 17:17:16 +00:00
|
|
|
|
2023-04-26 17:31:34 +00:00
|
|
|
visible: (stack.currentIndex === 2)
|
2022-10-28 17:17:16 +00:00
|
|
|
|
2024-10-01 15:23:17 +00:00
|
|
|
tokensStore: RootStore.tokensStore
|
2024-03-13 17:38:16 +00:00
|
|
|
allNetworksModel: RootStore.filteredFlatModel
|
2023-04-26 15:53:49 +00:00
|
|
|
address: RootStore.overview.mixedcaseAddress
|
2023-11-24 12:16:13 +00:00
|
|
|
currencyStore: RootStore.currencyStore
|
|
|
|
networkFilters: RootStore.networkFilters
|
2023-05-22 14:05:04 +00:00
|
|
|
|
2023-04-26 17:31:34 +00:00
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2023-09-11 10:20:36 +00:00
|
|
|
|
|
|
|
onVisibleChanged: {
|
|
|
|
if (!visible)
|
2023-11-07 22:45:47 +00:00
|
|
|
RootStore.resetCurrentViewedHolding(Constants.TokenType.ERC20)
|
2023-09-11 10:20:36 +00:00
|
|
|
}
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
2023-04-25 16:54:50 +00:00
|
|
|
|
2024-03-20 17:32:36 +00:00
|
|
|
Loader {
|
|
|
|
active: stack.currentIndex === 3
|
|
|
|
|
|
|
|
sourceComponent: TransactionDetailView {
|
|
|
|
controller: RootStore.activityDetailsController
|
|
|
|
onVisibleChanged: {
|
|
|
|
if (visible) {
|
|
|
|
if (!!transaction) {
|
|
|
|
RootStore.addressWasShown(transaction.sender)
|
|
|
|
if (transaction.sender !== transaction.recipient) {
|
|
|
|
RootStore.addressWasShown(transaction.recipient)
|
|
|
|
}
|
2023-12-20 10:46:33 +00:00
|
|
|
}
|
2024-03-20 17:32:36 +00:00
|
|
|
} else {
|
|
|
|
controller.resetActivityEntry()
|
2023-12-20 10:46:33 +00:00
|
|
|
}
|
|
|
|
}
|
2024-03-20 17:32:36 +00:00
|
|
|
showAllAccounts: RootStore.showAllAccounts
|
|
|
|
communitiesStore: root.communitiesStore
|
|
|
|
sendModal: root.sendModal
|
2024-09-24 10:16:40 +00:00
|
|
|
rootStore: SharedStores.RootStore
|
2024-09-24 11:51:22 +00:00
|
|
|
currenciesStore: SharedStores.RootStore.currencyStore
|
2024-03-20 17:32:36 +00:00
|
|
|
contactsStore: root.contactsStore
|
|
|
|
networkConnectionStore: root.networkConnectionStore
|
|
|
|
visible: (stack.currentIndex === 3)
|
2023-06-12 08:14:19 +00:00
|
|
|
}
|
2022-03-23 11:08:49 +00:00
|
|
|
}
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
|
|
|
}
|