2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
2020-06-23 18:51:10 +00:00
|
|
|
import QtQuick.Controls 2.13
|
2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2024-07-17 16:07:57 +00:00
|
|
|
import StatusQ 0.1
|
2021-06-11 13:57:43 +00:00
|
|
|
import StatusQ.Layout 0.1
|
2023-12-26 10:19:41 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2021-06-11 13:57:43 +00:00
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.controls 1.0
|
2023-08-23 11:46:04 +00:00
|
|
|
import shared.popups.keypairimport 1.0
|
2024-05-22 08:13:39 +00:00
|
|
|
|
2024-10-02 20:47:14 +00:00
|
|
|
import shared.stores 1.0 as SharedStores
|
2024-07-03 03:55:05 +00:00
|
|
|
import shared.stores.send 1.0
|
2021-10-14 13:39:12 +00:00
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
import AppLayouts.stores 1.0 as AppLayoutsStores
|
|
|
|
import AppLayouts.Communities.stores 1.0
|
|
|
|
import AppLayouts.Profile.stores 1.0 as ProfileStores
|
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
import "popups"
|
|
|
|
import "panels"
|
|
|
|
import "views"
|
|
|
|
import "stores"
|
2023-05-11 10:29:19 +00:00
|
|
|
import "controls"
|
2024-05-13 17:23:01 +00:00
|
|
|
import "popups/swap"
|
2024-08-06 16:04:22 +00:00
|
|
|
import "popups/buy"
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2021-06-11 13:57:43 +00:00
|
|
|
Item {
|
2022-08-09 15:08:39 +00:00
|
|
|
id: root
|
2021-06-11 13:57:43 +00:00
|
|
|
|
2020-11-27 16:21:15 +00:00
|
|
|
property bool hideSignPhraseModal: false
|
2024-05-22 08:13:39 +00:00
|
|
|
|
2024-10-02 20:47:14 +00:00
|
|
|
property SharedStores.RootStore sharedRootStore
|
2024-05-22 08:13:39 +00:00
|
|
|
property AppLayoutsStores.RootStore store
|
|
|
|
property ProfileStores.ContactsStore contactsStore
|
|
|
|
property CommunitiesStore communitiesStore
|
2024-07-03 03:55:05 +00:00
|
|
|
required property TransactionStore transactionStore
|
2024-05-22 08:13:39 +00:00
|
|
|
|
2022-03-10 17:01:17 +00:00
|
|
|
property var emojiPopup: null
|
2022-10-17 10:17:25 +00:00
|
|
|
property var sendModalPopup
|
2024-10-02 20:47:14 +00:00
|
|
|
property SharedStores.NetworkConnectionStore networkConnectionStore
|
2024-01-02 10:24:22 +00:00
|
|
|
property bool appMainVisible
|
2020-11-27 16:21:15 +00:00
|
|
|
|
2024-08-12 10:41:27 +00:00
|
|
|
property bool swapEnabled
|
|
|
|
|
2023-12-26 10:19:41 +00:00
|
|
|
onAppMainVisibleChanged: {
|
|
|
|
resetView()
|
|
|
|
}
|
2024-01-02 10:24:22 +00:00
|
|
|
|
|
|
|
onVisibleChanged: {
|
|
|
|
resetView()
|
|
|
|
}
|
2023-07-06 12:59:26 +00:00
|
|
|
|
2023-07-27 11:08:06 +00:00
|
|
|
Connections {
|
|
|
|
target: walletSection
|
|
|
|
|
2024-03-28 11:54:39 +00:00
|
|
|
function onFilterChanged(address) {
|
2024-06-24 13:52:10 +00:00
|
|
|
RootStore.selectedAddress = address === "" ? "" : address
|
2023-07-27 11:08:06 +00:00
|
|
|
}
|
2023-08-23 11:46:04 +00:00
|
|
|
|
|
|
|
function onDisplayKeypairImportPopup() {
|
|
|
|
keypairImport.active = true
|
|
|
|
}
|
|
|
|
|
|
|
|
function onDestroyKeypairImportPopup() {
|
|
|
|
keypairImport.active = false
|
|
|
|
}
|
2023-07-27 11:08:06 +00:00
|
|
|
}
|
2023-12-26 10:19:41 +00:00
|
|
|
|
2024-01-16 07:50:25 +00:00
|
|
|
enum LeftPanelSelection {
|
|
|
|
AllAddresses,
|
|
|
|
Address,
|
|
|
|
SavedAddresses
|
|
|
|
}
|
|
|
|
|
|
|
|
enum RightPanelSelection {
|
|
|
|
Assets,
|
2024-01-24 12:02:03 +00:00
|
|
|
Collectibles,
|
2024-01-16 07:50:25 +00:00
|
|
|
Activity
|
2020-11-27 16:21:15 +00:00
|
|
|
}
|
2021-04-20 18:52:09 +00:00
|
|
|
|
2023-07-06 12:59:26 +00:00
|
|
|
function resetView() {
|
2023-12-26 10:19:41 +00:00
|
|
|
if (!visible || !appMainVisible) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
d.displayAllAddresses()
|
|
|
|
|
2024-04-10 09:44:15 +00:00
|
|
|
d.resetRightPanelStackView()
|
2023-12-26 10:19:41 +00:00
|
|
|
}
|
|
|
|
|
2024-01-16 07:50:25 +00:00
|
|
|
function openDesiredView(leftPanelSelection, rightPanelSelection, data) {
|
|
|
|
if (leftPanelSelection !== WalletLayout.LeftPanelSelection.AllAddresses &&
|
|
|
|
leftPanelSelection !== WalletLayout.LeftPanelSelection.SavedAddresses &&
|
|
|
|
leftPanelSelection !== WalletLayout.LeftPanelSelection.Address) {
|
|
|
|
console.warn("not supported left selection", leftPanelSelection)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if (leftPanelSelection === WalletLayout.LeftPanelSelection.SavedAddresses) {
|
|
|
|
d.displaySavedAddresses()
|
|
|
|
} else {
|
2024-02-22 14:41:13 +00:00
|
|
|
let address = data.address ?? ""
|
2024-01-16 07:50:25 +00:00
|
|
|
if (leftPanelSelection === WalletLayout.LeftPanelSelection.AllAddresses) {
|
|
|
|
d.displayAllAddresses()
|
|
|
|
} else if (leftPanelSelection === WalletLayout.LeftPanelSelection.Address) {
|
2024-02-22 14:41:13 +00:00
|
|
|
if (!!address) {
|
|
|
|
d.displayAddress(address)
|
|
|
|
} else {
|
|
|
|
d.displayAllAddresses()
|
|
|
|
}
|
2024-01-16 07:50:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (rightPanelSelection !== WalletLayout.RightPanelSelection.Collectibles &&
|
|
|
|
rightPanelSelection !== WalletLayout.RightPanelSelection.Assets &&
|
|
|
|
rightPanelSelection !== WalletLayout.RightPanelSelection.Activity) {
|
|
|
|
console.warn("not supported right selection", rightPanelSelection)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
rightPanelStackView.currentItem.resetView()
|
|
|
|
rightPanelStackView.currentItem.currentTabIndex = rightPanelSelection
|
|
|
|
|
|
|
|
let savedAddress = data.savedAddress?? ""
|
|
|
|
if (!!savedAddress) {
|
|
|
|
RootStore.currentActivityFiltersStore.resetAllFilters()
|
|
|
|
RootStore.currentActivityFiltersStore.toggleSavedAddress(savedAddress)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-26 10:19:41 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
|
|
|
|
readonly property bool showSavedAddresses: RootStore.showSavedAddresses
|
|
|
|
onShowSavedAddressesChanged: {
|
|
|
|
if(showSavedAddresses) {
|
|
|
|
rightPanelStackView.replace(cmpSavedAddresses)
|
|
|
|
} else {
|
|
|
|
rightPanelStackView.replace(walletContainer)
|
|
|
|
}
|
|
|
|
RootStore.backButtonName = ""
|
|
|
|
}
|
|
|
|
|
2024-05-15 21:22:13 +00:00
|
|
|
property SwapInputParamsForm swapFormData: SwapInputParamsForm {
|
2024-06-07 12:27:56 +00:00
|
|
|
selectedAccountAddress: RootStore.selectedAddress
|
2024-05-13 17:23:01 +00:00
|
|
|
}
|
|
|
|
|
2024-08-06 16:04:22 +00:00
|
|
|
property BuyCryptoParamsForm buyFormData: BuyCryptoParamsForm {
|
|
|
|
selectedWalletAddress: RootStore.selectedAddress
|
|
|
|
}
|
|
|
|
|
2023-12-26 10:19:41 +00:00
|
|
|
function displayAllAddresses() {
|
|
|
|
RootStore.showSavedAddresses = false
|
|
|
|
RootStore.selectedAddress = ""
|
2024-04-10 09:44:15 +00:00
|
|
|
RootStore.setFilterAllAddresses()
|
2023-12-26 10:19:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function displayAddress(address) {
|
|
|
|
RootStore.showSavedAddresses = false
|
|
|
|
RootStore.selectedAddress = address
|
2024-04-10 09:44:15 +00:00
|
|
|
d.resetRightPanelStackView() // Avoids crashing on asset items being destroyed while in signal handler
|
2023-12-26 10:19:41 +00:00
|
|
|
RootStore.setFilterAddress(address)
|
|
|
|
}
|
|
|
|
|
|
|
|
function displaySavedAddresses() {
|
|
|
|
RootStore.showSavedAddresses = true
|
|
|
|
RootStore.selectedAddress = ""
|
|
|
|
}
|
2024-04-10 09:44:15 +00:00
|
|
|
|
|
|
|
function resetRightPanelStackView() {
|
|
|
|
if (rightPanelStackView.currentItem && !!rightPanelStackView.currentItem.resetView) {
|
|
|
|
rightPanelStackView.currentItem.resetView()
|
|
|
|
}
|
|
|
|
}
|
2024-08-06 16:04:22 +00:00
|
|
|
|
|
|
|
function getSelectedOrFirstNonWatchedAddress() {
|
|
|
|
return !!RootStore.selectedAddress ?
|
|
|
|
RootStore.selectedAddress :
|
|
|
|
StatusQUtils.ModelUtils.get(RootStore.nonWatchAccounts, 0, "address")
|
|
|
|
}
|
2023-07-06 12:59:26 +00:00
|
|
|
}
|
|
|
|
|
2021-06-11 13:57:43 +00:00
|
|
|
SignPhraseModal {
|
|
|
|
id: signPhrasePopup
|
2021-10-05 20:50:22 +00:00
|
|
|
onRemindLaterClicked: hideSignPhraseModal = true
|
2022-01-21 14:18:43 +00:00
|
|
|
onAcceptClicked: { RootStore.setHideSignPhraseModal(true); }
|
2024-11-20 08:09:35 +00:00
|
|
|
visible: !root.hideSignPhraseModal && !RootStore.hideSignPhraseModal
|
2021-04-20 18:52:09 +00:00
|
|
|
}
|
2020-11-27 17:32:48 +00:00
|
|
|
|
2021-09-20 12:06:14 +00:00
|
|
|
SeedPhraseBackupWarning {
|
|
|
|
id: seedPhraseWarning
|
|
|
|
width: parent.width
|
|
|
|
anchors.top: parent.top
|
|
|
|
}
|
|
|
|
|
2022-03-01 10:14:13 +00:00
|
|
|
Component {
|
|
|
|
id: cmpSavedAddresses
|
|
|
|
SavedAddressesView {
|
2023-12-26 10:19:41 +00:00
|
|
|
store: root.store
|
2022-08-09 15:08:39 +00:00
|
|
|
contactsStore: root.contactsStore
|
2024-02-02 09:55:56 +00:00
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2022-10-17 10:17:25 +00:00
|
|
|
sendModal: root.sendModalPopup
|
2023-12-26 10:19:41 +00:00
|
|
|
|
|
|
|
networkFilter.visible: false
|
|
|
|
headerButton.text: qsTr("Add new address")
|
|
|
|
headerButton.onClicked: {
|
|
|
|
Global.openAddEditSavedAddressesPopup({})
|
|
|
|
}
|
2022-03-01 10:14:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: walletContainer
|
|
|
|
RightTabView {
|
2024-10-02 20:47:14 +00:00
|
|
|
sharedRootStore: root.sharedRootStore
|
2022-08-09 15:08:39 +00:00
|
|
|
store: root.store
|
2022-09-05 09:15:47 +00:00
|
|
|
contactsStore: root.contactsStore
|
2024-02-22 14:41:19 +00:00
|
|
|
communitiesStore: root.communitiesStore
|
2022-10-17 10:17:25 +00:00
|
|
|
sendModal: root.sendModalPopup
|
2023-04-04 11:31:04 +00:00
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2023-12-26 10:19:41 +00:00
|
|
|
|
2024-08-12 10:41:27 +00:00
|
|
|
swapEnabled: root.swapEnabled
|
|
|
|
|
2024-08-03 07:49:14 +00:00
|
|
|
headerButton.text: RootStore.overview.ens || StatusQUtils.Utils.elideAndFormatWalletAddress(RootStore.overview.mixedcaseAddress)
|
2023-12-26 10:19:41 +00:00
|
|
|
headerButton.visible: !RootStore.overview.isAllAccounts
|
2024-01-15 09:19:25 +00:00
|
|
|
onLaunchShareAddressModal: Global.openShowQRPopup({
|
|
|
|
switchingAccounsEnabled: true,
|
|
|
|
hasFloatingButtons: true
|
|
|
|
})
|
2024-05-13 17:23:01 +00:00
|
|
|
onLaunchSwapModal: {
|
2024-08-06 16:04:22 +00:00
|
|
|
d.swapFormData.selectedAccountAddress = d.getSelectedOrFirstNonWatchedAddress()
|
2024-05-29 15:42:26 +00:00
|
|
|
d.swapFormData.selectedNetworkChainId = StatusQUtils.ModelUtils.getByKey(RootStore.filteredFlatModel, "layer", 1, "chainId")
|
2024-05-13 17:23:01 +00:00
|
|
|
d.swapFormData.fromTokensKey = tokensKey
|
2024-06-18 17:24:07 +00:00
|
|
|
d.swapFormData.defaultToTokenKey = RootStore.areTestNetworksEnabled ? Constants.swap.testStatusTokenKey : Constants.swap.mainnetStatusTokenKey
|
2024-05-13 17:23:01 +00:00
|
|
|
Global.openSwapModalRequested(d.swapFormData)
|
|
|
|
}
|
2022-03-01 10:14:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
StatusSectionLayout {
|
2021-09-20 12:06:14 +00:00
|
|
|
anchors.top: seedPhraseWarning.bottom
|
2022-08-09 15:08:39 +00:00
|
|
|
height: root.height - seedPhraseWarning.height
|
|
|
|
width: root.width
|
2022-09-13 16:17:54 +00:00
|
|
|
backButtonName: RootStore.backButtonName
|
2022-10-26 16:00:20 +00:00
|
|
|
notificationCount: activityCenterStore.unreadNotificationsCount
|
2023-04-28 10:35:18 +00:00
|
|
|
hasUnseenNotifications: activityCenterStore.hasUnseenNotifications
|
2023-07-17 20:06:34 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
onNotificationButtonClicked: Global.openActivityCenterPopup()
|
2022-09-13 16:17:54 +00:00
|
|
|
onBackButtonClicked: {
|
|
|
|
rightPanelStackView.currentItem.resetStack();
|
|
|
|
}
|
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
leftPanel: LeftTabView {
|
2020-11-27 17:32:48 +00:00
|
|
|
id: leftTab
|
2021-06-11 13:57:43 +00:00
|
|
|
anchors.fill: parent
|
2023-12-26 10:19:41 +00:00
|
|
|
emojiPopup: root.emojiPopup
|
|
|
|
networkConnectionStore: root.networkConnectionStore
|
|
|
|
|
2023-04-27 13:22:27 +00:00
|
|
|
changeSelectedAccount: function(address) {
|
2023-12-26 10:19:41 +00:00
|
|
|
d.displayAddress(address)
|
2023-05-12 07:11:44 +00:00
|
|
|
}
|
|
|
|
selectAllAccounts: function() {
|
2023-12-26 10:19:41 +00:00
|
|
|
d.displayAllAddresses()
|
2022-03-01 10:14:13 +00:00
|
|
|
}
|
2023-12-26 10:19:41 +00:00
|
|
|
selectSavedAddresses: function() {
|
|
|
|
d.displaySavedAddresses()
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
2020-11-27 17:32:48 +00:00
|
|
|
}
|
2021-06-11 13:57:43 +00:00
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
centerPanel: StackView {
|
2022-03-01 10:14:13 +00:00
|
|
|
id: rightPanelStackView
|
2021-10-05 20:50:22 +00:00
|
|
|
anchors.fill: parent
|
2022-09-13 16:17:54 +00:00
|
|
|
anchors.leftMargin: 64
|
|
|
|
anchors.rightMargin: 64
|
2022-03-01 10:14:13 +00:00
|
|
|
initialItem: walletContainer
|
|
|
|
replaceEnter: Transition {
|
|
|
|
NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 400; easing.type: Easing.OutCubic }
|
|
|
|
}
|
|
|
|
replaceExit: Transition {
|
|
|
|
NumberAnimation { property: "opacity"; from: 1; to: 0; duration: 400; easing.type: Easing.OutCubic }
|
|
|
|
}
|
2020-05-27 20:50:39 +00:00
|
|
|
}
|
2023-05-11 10:29:19 +00:00
|
|
|
headerBackground: AccountHeaderGradient {
|
|
|
|
width: parent.width
|
|
|
|
overview: RootStore.overview
|
|
|
|
}
|
2023-04-26 17:31:34 +00:00
|
|
|
|
|
|
|
footer: WalletFooter {
|
2023-09-27 14:03:49 +00:00
|
|
|
id: footer
|
|
|
|
|
2024-09-04 04:29:31 +00:00
|
|
|
readonly property bool isHoldingSelected: {
|
|
|
|
if (!rightPanelStackView.currentItem || rightPanelStackView.currentItem.currentTabIndex !== WalletLayout.RightPanelSelection.Collectibles) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return !!walletStore.currentViewedCollectible && walletStore.currentViewedHoldingID !== ""
|
|
|
|
}
|
2023-09-27 14:03:49 +00:00
|
|
|
readonly property bool isCommunityCollectible: !!walletStore.currentViewedCollectible ? walletStore.currentViewedCollectible.communityId !== "" : false
|
|
|
|
readonly property bool isOwnerCommunityCollectible: isCommunityCollectible ? (walletStore.currentViewedCollectible.communityPrivilegesLevel === Constants.TokenPrivilegesLevel.Owner) : false
|
|
|
|
|
2024-07-19 11:20:26 +00:00
|
|
|
visible: anyActionAvailable
|
2023-04-26 17:31:34 +00:00
|
|
|
width: parent.width
|
2024-05-13 17:23:01 +00:00
|
|
|
height: visible ? 61: implicitHeight
|
2023-04-26 17:31:34 +00:00
|
|
|
walletStore: RootStore
|
2024-07-03 03:55:05 +00:00
|
|
|
transactionStore: root.transactionStore
|
2024-08-12 10:41:27 +00:00
|
|
|
swapEnabled: root.swapEnabled
|
2023-04-26 17:31:34 +00:00
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2023-09-27 14:03:49 +00:00
|
|
|
isCommunityOwnershipTransfer: footer.isHoldingSelected && footer.isOwnerCommunityCollectible
|
2024-04-09 14:16:03 +00:00
|
|
|
communityName: {
|
2024-07-17 16:07:57 +00:00
|
|
|
if (selectedCommunityForCollectible.available)
|
|
|
|
return selectedCommunityForCollectible.item.name
|
|
|
|
if (isCommunityCollectible)
|
|
|
|
return Utils.compactAddress(walletStore.currentViewedCollectible.communityId, 4)
|
|
|
|
return ""
|
2024-04-09 14:16:03 +00:00
|
|
|
}
|
2024-07-17 16:07:57 +00:00
|
|
|
|
2024-01-15 09:19:25 +00:00
|
|
|
onLaunchShareAddressModal: Global.openShowQRPopup({
|
|
|
|
switchingAccounsEnabled: true,
|
|
|
|
hasFloatingButtons: true
|
|
|
|
})
|
2024-07-19 11:20:26 +00:00
|
|
|
onLaunchSendModal: (fromAddress) => {
|
2023-09-20 13:01:37 +00:00
|
|
|
if(isCommunityOwnershipTransfer) {
|
2024-07-17 14:49:42 +00:00
|
|
|
const tokenItem = walletStore.currentViewedCollectible
|
|
|
|
const ownership = StatusQUtils.ModelUtils.get(tokenItem.ownership, 0)
|
|
|
|
|
|
|
|
Global.openTransferOwnershipPopup(tokenItem.communityId,
|
2024-07-17 14:55:52 +00:00
|
|
|
footer.communityName,
|
2023-09-20 13:01:37 +00:00
|
|
|
tokenItem.communityImage,
|
|
|
|
{
|
2024-07-19 11:20:26 +00:00
|
|
|
key: tokenItem.tokenId,
|
|
|
|
privilegesLevel: tokenItem.communityPrivilegesLevel,
|
|
|
|
chainId: tokenItem.chainId,
|
|
|
|
name: tokenItem.name,
|
|
|
|
artworkSource: tokenItem.artworkSource,
|
|
|
|
accountAddress: fromAddress,
|
|
|
|
tokenAddress: tokenItem.contractAddress
|
2023-09-20 13:01:37 +00:00
|
|
|
},
|
|
|
|
root.sendModalPopup)
|
2024-07-17 14:55:52 +00:00
|
|
|
return
|
|
|
|
}
|
2024-08-01 10:17:36 +00:00
|
|
|
|
2024-07-17 14:55:52 +00:00
|
|
|
// Common send modal popup:
|
2024-07-19 11:20:26 +00:00
|
|
|
root.sendModalPopup.preSelectedAccountAddress = fromAddress
|
2024-07-17 14:55:52 +00:00
|
|
|
root.sendModalPopup.preSelectedSendType = Constants.SendType.Transfer
|
2024-08-01 10:17:36 +00:00
|
|
|
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingTokensKey
|
2024-07-17 14:55:52 +00:00
|
|
|
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType
|
|
|
|
root.sendModalPopup.onlyAssets = false
|
|
|
|
root.sendModalPopup.open()
|
2023-08-31 10:27:15 +00:00
|
|
|
}
|
|
|
|
onLaunchBridgeModal: {
|
2023-09-20 16:07:09 +00:00
|
|
|
root.sendModalPopup.preSelectedSendType = Constants.SendType.Bridge
|
2023-08-31 10:27:15 +00:00
|
|
|
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingID
|
|
|
|
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType
|
2023-09-18 09:45:37 +00:00
|
|
|
root.sendModalPopup.onlyAssets = true
|
2023-08-31 10:27:15 +00:00
|
|
|
root.sendModalPopup.open()
|
|
|
|
}
|
2024-05-13 17:23:01 +00:00
|
|
|
onLaunchSwapModal: {
|
|
|
|
d.swapFormData.fromTokensKey = ""
|
2024-08-06 16:04:22 +00:00
|
|
|
d.swapFormData.selectedAccountAddress = d.getSelectedOrFirstNonWatchedAddress()
|
2024-05-29 15:42:26 +00:00
|
|
|
d.swapFormData.selectedNetworkChainId = StatusQUtils.ModelUtils.getByKey(RootStore.filteredFlatModel, "layer", 1, "chainId")
|
2024-05-13 17:23:01 +00:00
|
|
|
if(!!walletStore.currentViewedHoldingTokensKey && walletStore.currentViewedHoldingType === Constants.TokenType.ERC20) {
|
|
|
|
d.swapFormData.fromTokensKey = walletStore.currentViewedHoldingTokensKey
|
|
|
|
}
|
2024-06-18 17:24:07 +00:00
|
|
|
d.swapFormData.defaultToTokenKey = RootStore.areTestNetworksEnabled ? Constants.swap.testStatusTokenKey : Constants.swap.mainnetStatusTokenKey
|
2024-05-13 17:23:01 +00:00
|
|
|
Global.openSwapModalRequested(d.swapFormData)
|
|
|
|
}
|
2024-08-06 16:04:22 +00:00
|
|
|
onLaunchBuyCryptoModal: {
|
|
|
|
d.buyFormData.selectedWalletAddress = d.getSelectedOrFirstNonWatchedAddress()
|
|
|
|
d.buyFormData.selectedNetworkChainId = StatusQUtils.ModelUtils.getByKey(RootStore.filteredFlatModel, "layer", 1, "chainId")
|
|
|
|
if(!!walletStore.currentViewedHoldingTokensKey && walletStore.currentViewedHoldingType === Constants.TokenType.ERC20) {
|
|
|
|
d.buyFormData.selectedTokenKey = walletStore.currentViewedHoldingTokensKey
|
|
|
|
}
|
|
|
|
Global.openBuyCryptoModalRequested(d.buyFormData)
|
|
|
|
}
|
2024-07-17 16:07:57 +00:00
|
|
|
|
|
|
|
ModelEntry {
|
|
|
|
id: selectedCommunityForCollectible
|
2024-07-19 11:20:26 +00:00
|
|
|
sourceModel: !!footer.walletStore.currentViewedCollectible && footer.isCommunityCollectible ? root.communitiesStore.communitiesList : null
|
2024-07-17 16:07:57 +00:00
|
|
|
key: "id"
|
|
|
|
value: footer.walletStore.currentViewedCollectible.communityId
|
|
|
|
}
|
2023-04-26 15:53:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-23 11:46:04 +00:00
|
|
|
Loader {
|
|
|
|
id: keypairImport
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
|
|
|
|
sourceComponent: KeypairImportPopup {
|
2024-06-24 10:30:24 +00:00
|
|
|
store.keypairImportModule: RootStore.keypairImportModule
|
2023-08-23 11:46:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
onLoaded: {
|
|
|
|
keypairImport.item.open()
|
|
|
|
}
|
|
|
|
}
|
2020-05-14 16:16:01 +00:00
|
|
|
}
|