fix(@desktop/communities): Displaying toast messages when minting

Fix #9849
This commit is contained in:
Michal Iskierko 2023-04-11 10:09:01 +02:00 committed by Michał Iskierko
parent 2a6d00b939
commit 7055a77a96
17 changed files with 105 additions and 50 deletions

View File

@ -71,7 +71,7 @@ proc newModule*(
communityTokensService, communityTokensService,
networksService, networksService,
) )
result.communityTokensModule = community_tokens_module.newCommunityTokensModule(result, events, communityTokensService, transactionService) result.communityTokensModule = community_tokens_module.newCommunityTokensModule(result, events, communityTokensService, transactionService, networksService)
result.moduleLoaded = false result.moduleLoaded = false
result.curatedCommunitiesLoaded = false result.curatedCommunitiesLoaded = false

View File

@ -2,6 +2,7 @@ import ./io_interface as community_tokens_module_interface
import ../../../../../app_service/service/community_tokens/service as community_tokens_service import ../../../../../app_service/service/community_tokens/service as community_tokens_service
import ../../../../../app_service/service/transaction/service as transaction_service import ../../../../../app_service/service/transaction/service as transaction_service
import ../../../../../app_service/service/network/service as networks_service
import ../../../../../app_service/service/community/dto/community import ../../../../../app_service/service/community/dto/community
import ../../../../core/signals/types import ../../../../core/signals/types
import ../../../../core/eventemitter import ../../../../core/eventemitter
@ -16,18 +17,21 @@ type
events: EventEmitter events: EventEmitter
communityTokensService: community_tokens_service.Service communityTokensService: community_tokens_service.Service
transactionService: transaction_service.Service transactionService: transaction_service.Service
networksService: networks_service.Service
proc newCommunityTokensController*( proc newCommunityTokensController*(
communityTokensModule: community_tokens_module_interface.AccessInterface, communityTokensModule: community_tokens_module_interface.AccessInterface,
events: EventEmitter, events: EventEmitter,
communityTokensService: community_tokens_service.Service, communityTokensService: community_tokens_service.Service,
transactionService: transaction_service.Service transactionService: transaction_service.Service,
networksService: networks_service.Service
): Controller = ): Controller =
result = Controller() result = Controller()
result.communityTokensModule = communityTokensModule result.communityTokensModule = communityTokensModule
result.events = events result.events = events
result.communityTokensService = communityTokensService result.communityTokensService = communityTokensService
result.transactionService = transactionService result.transactionService = transactionService
result.networksService = networksService
proc delete*(self: Controller) = proc delete*(self: Controller) =
discard discard
@ -41,6 +45,12 @@ proc init*(self: Controller) =
self.events.on(SIGNAL_COMPUTE_DEPLOY_FEE) do(e:Args): self.events.on(SIGNAL_COMPUTE_DEPLOY_FEE) do(e:Args):
let args = ComputeDeployFeeArgs(e) let args = ComputeDeployFeeArgs(e)
self.communityTokensModule.onDeployFeeComputed(args.ethCurrency, args.fiatCurrency, args.errorCode) self.communityTokensModule.onDeployFeeComputed(args.ethCurrency, args.fiatCurrency, args.errorCode)
self.events.on(SIGNAL_COMMUNITY_TOKEN_DEPLOYED) do(e: Args):
let args = CommunityTokenDeployedArgs(e)
self.communityTokensModule.onCommunityTokenDeployStateChanged(args.communityToken.chainId, args.transactionHash, args.communityToken.deployState)
self.events.on(SIGNAL_COMMUNITY_TOKEN_DEPLOY_STATUS) do(e: Args):
let args = CommunityTokenDeployedStatusArgs(e)
self.communityTokensModule.onCommunityTokenDeployStateChanged(args.chainId, args.transactionHash, args.deployState)
proc deployCollectibles*(self: Controller, communityId: string, addressFrom: string, password: string, deploymentParams: DeploymentParameters, tokenMetadata: CommunityTokensMetadataDto, chainId: int) = proc deployCollectibles*(self: Controller, communityId: string, addressFrom: string, password: string, deploymentParams: DeploymentParameters, tokenMetadata: CommunityTokensMetadataDto, chainId: int) =
self.communityTokensService.deployCollectibles(communityId, addressFrom, password, deploymentParams, tokenMetadata, chainId) self.communityTokensService.deployCollectibles(communityId, addressFrom, password, deploymentParams, tokenMetadata, chainId)
@ -60,3 +70,6 @@ proc computeDeployFee*(self: Controller, chainId: int, accountAddress: string) =
proc getCommunityTokenBySymbol*(self: Controller, communityId: string, symbol: string): CommunityTokenDto = proc getCommunityTokenBySymbol*(self: Controller, communityId: string, symbol: string): CommunityTokenDto =
return self.communityTokensService.getCommunityTokenBySymbol(communityId, symbol) return self.communityTokensService.getCommunityTokenBySymbol(communityId, symbol)
proc getNetwork*(self:Controller, chainId: int): NetworkDto =
self.networksService.getNetwork(chainId)

View File

@ -27,4 +27,7 @@ method computeDeployFee*(self: AccessInterface, chainId: int, accountAddress: st
raise newException(ValueError, "No implementation available") raise newException(ValueError, "No implementation available")
method onDeployFeeComputed*(self: AccessInterface, ethCurrency: CurrencyAmount, fiatCurrency: CurrencyAmount, errorCode: ComputeFeeErrorCode) {.base.} = method onDeployFeeComputed*(self: AccessInterface, ethCurrency: CurrencyAmount, fiatCurrency: CurrencyAmount, errorCode: ComputeFeeErrorCode) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityTokenDeployStateChanged*(self: AccessInterface, chainId: int, transactionHash: string, deployState: DeployState) {.base.} =
raise newException(ValueError, "No implementation available") raise newException(ValueError, "No implementation available")

View File

@ -2,6 +2,7 @@ import NimQml, json, stint, strutils, chronicles
import ../../../../../app_service/service/community_tokens/service as community_tokens_service import ../../../../../app_service/service/community_tokens/service as community_tokens_service
import ../../../../../app_service/service/transaction/service as transaction_service import ../../../../../app_service/service/transaction/service as transaction_service
import ../../../../../app_service/service/network/service as networks_service
import ../../../../../app_service/service/community/dto/community import ../../../../../app_service/service/community/dto/community
import ../../../../../app_service/service/accounts/utils as utl import ../../../../../app_service/service/accounts/utils as utl
import ../../../../core/eventemitter import ../../../../core/eventemitter
@ -38,12 +39,13 @@ proc newCommunityTokensModule*(
parent: parent_interface.AccessInterface, parent: parent_interface.AccessInterface,
events: EventEmitter, events: EventEmitter,
communityTokensService: community_tokens_service.Service, communityTokensService: community_tokens_service.Service,
transactionService: transaction_service.Service): Module = transactionService: transaction_service.Service,
networksService: networks_service.Service): Module =
result = Module() result = Module()
result.parent = parent result.parent = parent
result.view = newView(result) result.view = newView(result)
result.viewVariant = newQVariant(result.view) result.viewVariant = newQVariant(result.view)
result.controller = controller.newCommunityTokensController(result, events, communityTokensService, transactionService) result.controller = controller.newCommunityTokensController(result, events, communityTokensService, transactionService, networksService)
method delete*(self: Module) = method delete*(self: Module) =
self.view.delete self.view.delete
@ -123,3 +125,8 @@ method onDeployFeeComputed*(self: Module, ethCurrency: CurrencyAmount, fiatCurre
method computeDeployFee*(self: Module, chainId: int, accountAddress: string) = method computeDeployFee*(self: Module, chainId: int, accountAddress: string) =
self.controller.computeDeployFee(chainId, accountAddress) self.controller.computeDeployFee(chainId, accountAddress)
method onCommunityTokenDeployStateChanged*(self: Module, chainId: int, transactionHash: string, deployState: DeployState) =
let network = self.controller.getNetwork(chainId)
let url = if network != nil: network.blockExplorerURL & "/tx/" & transactionHash else: ""
self.view.emitDeploymentStateChanged(deployState.int, url)

View File

@ -33,4 +33,6 @@ QtObject:
proc updateDeployFee*(self: View, ethCurrency: CurrencyAmount, fiatCurrency: CurrencyAmount, errorCode: int) = proc updateDeployFee*(self: View, ethCurrency: CurrencyAmount, fiatCurrency: CurrencyAmount, errorCode: int) =
self.deployFeeUpdated(newQVariant(ethCurrency), newQVariant(fiatCurrency), errorCode) self.deployFeeUpdated(newQVariant(ethCurrency), newQVariant(fiatCurrency), errorCode)
proc deploymentStateChanged*(self: View, status: int, url: string) {.signal.}
proc emitDeploymentStateChanged*(self: View, status: int, url: string) =
self.deploymentStateChanged(status, url)

View File

@ -474,5 +474,5 @@ proc getVerificationRequestFrom*(self: Controller, publicKey: string): Verificat
proc getCommunityTokens*(self: Controller, communityId: string): seq[CommunityTokenDto] = proc getCommunityTokens*(self: Controller, communityId: string): seq[CommunityTokenDto] =
self.communityTokensService.getCommunityTokens(communityId) self.communityTokensService.getCommunityTokens(communityId)
proc getNetworks*(self:Controller): seq[NetworkDto] = proc getNetwork*(self:Controller, chainId: int): NetworkDto =
self.networksService.getNetworks() self.networksService.getNetwork(chainId)

View File

@ -237,25 +237,23 @@ method delete*[T](self: Module[T]) =
self.view.delete self.view.delete
self.viewVariant.delete self.viewVariant.delete
proc createTokenItem[T](self: Module[T], tokenDto: CommunityTokenDto, networks: seq[NetworkDto]) : TokenItem = proc createTokenItem[T](self: Module[T], tokenDto: CommunityTokenDto, network: NetworkDto) : TokenItem =
var chainName, chainIcon: string var chainName, chainIcon: string
for network in networks: if network != nil:
if network.chainId == tokenDto.chainId: chainName = network.chainName
chainName = network.chainName chainIcon = network.iconURL
chainIcon = network.iconURL
break
result = initTokenItem(tokenDto, chainName, chainIcon) result = initTokenItem(tokenDto, chainName, chainIcon)
proc createChannelGroupItem[T](self: Module[T], channelGroup: ChannelGroupDto): SectionItem = proc createChannelGroupItem[T](self: Module[T], channelGroup: ChannelGroupDto): SectionItem =
let isCommunity = channelGroup.channelGroupType == ChannelGroupType.Community let isCommunity = channelGroup.channelGroupType == ChannelGroupType.Community
var communityDetails: CommunityDto var communityDetails: CommunityDto
var communityTokensItems: seq[TokenItem] var communityTokensItems: seq[TokenItem]
let networks = self.controller.getNetworks()
if (isCommunity): if (isCommunity):
communityDetails = self.controller.getCommunityById(channelGroup.id) communityDetails = self.controller.getCommunityById(channelGroup.id)
let communityTokens = self.controller.getCommunityTokens(channelGroup.id) let communityTokens = self.controller.getCommunityTokens(channelGroup.id)
communityTokensItems = communityTokens.map(proc(tokenDto: CommunityTokenDto): TokenItem = communityTokensItems = communityTokens.map(proc(tokenDto: CommunityTokenDto): TokenItem =
result = self.createTokenItem(tokenDto, networks) let network = self.controller.getNetwork(tokenDto.chainId)
result = self.createTokenItem(tokenDto, network)
) )
let unviewedCount = channelGroup.unviewedMessagesCount let unviewedCount = channelGroup.unviewedMessagesCount
@ -987,8 +985,8 @@ method contactsStatusUpdated*[T](self: Module[T], statusUpdates: seq[StatusUpdat
method onCommunityTokenDeployed*[T](self: Module[T], communityToken: CommunityTokenDto) {.base.} = method onCommunityTokenDeployed*[T](self: Module[T], communityToken: CommunityTokenDto) {.base.} =
let item = self.view.model().getItemById(communityToken.communityId) let item = self.view.model().getItemById(communityToken.communityId)
if item.id != "": if item.id != "":
let networks = self.controller.getNetworks() let network = self.controller.getNetwork(communityToken.chainId)
item.appendCommunityToken(self.createTokenItem(communityToken, networks)) item.appendCommunityToken(self.createTokenItem(communityToken, network))
method onCommunityTokenDeployStateChanged*[T](self: Module[T], communityId: string, contractAddress: string, deployState: DeployState) = method onCommunityTokenDeployStateChanged*[T](self: Module[T], communityId: string, contractAddress: string, deployState: DeployState) =
let item = self.view.model().getItemById(communityId) let item = self.view.model().getItemById(communityId)

View File

@ -37,11 +37,14 @@ type
CommunityTokenDeployedStatusArgs* = ref object of Args CommunityTokenDeployedStatusArgs* = ref object of Args
communityId*: string communityId*: string
contractAddress*: string contractAddress*: string
chainId*: int
transactionHash*: string
deployState*: DeployState deployState*: DeployState
type type
CommunityTokenDeployedArgs* = ref object of Args CommunityTokenDeployedArgs* = ref object of Args
communityToken*: CommunityTokenDto communityToken*: CommunityTokenDto
transactionHash*: string
type type
ComputeFeeErrorCode* {.pure.} = enum ComputeFeeErrorCode* {.pure.} = enum
@ -56,6 +59,10 @@ type
fiatCurrency*: CurrencyAmount fiatCurrency*: CurrencyAmount
errorCode*: ComputeFeeErrorCode errorCode*: ComputeFeeErrorCode
type ContractTuple = tuple
address: string
chainId: int
# Signals which may be emitted by this service: # Signals which may be emitted by this service:
const SIGNAL_COMMUNITY_TOKEN_DEPLOY_STATUS* = "communityTokenDeployStatus" const SIGNAL_COMMUNITY_TOKEN_DEPLOY_STATUS* = "communityTokenDeployStatus"
const SIGNAL_COMMUNITY_TOKEN_DEPLOYED* = "communityTokenDeployed" const SIGNAL_COMMUNITY_TOKEN_DEPLOYED* = "communityTokenDeployed"
@ -72,6 +79,7 @@ QtObject:
walletAccountService: wallet_account_service.Service walletAccountService: wallet_account_service.Service
tempAccountAddress: string tempAccountAddress: string
tempChainId: int tempChainId: int
addressAndTxMap: Table[ContractTuple, string]
proc delete*(self: Service) = proc delete*(self: Service) =
self.QObject.delete self.QObject.delete
@ -92,6 +100,7 @@ QtObject:
result.tokenService = tokenService result.tokenService = tokenService
result.settingsService = settingsService result.settingsService = settingsService
result.walletAccountService = walletAccountService result.walletAccountService = walletAccountService
result.addressAndTxMap = initTable[ContractTuple, string]()
proc init*(self: Service) = proc init*(self: Service) =
self.events.on(PendingTransactionTypeDto.CollectibleDeployment.event) do(e: Args): self.events.on(PendingTransactionTypeDto.CollectibleDeployment.event) do(e: Args):
@ -104,7 +113,9 @@ QtObject:
discard updateCommunityTokenState(tokenDto.address, deployState) #update db state discard updateCommunityTokenState(tokenDto.address, deployState) #update db state
except RpcException: except RpcException:
error "Error updating collectibles contract state", message = getCurrentExceptionMsg() error "Error updating collectibles contract state", message = getCurrentExceptionMsg()
let data = CommunityTokenDeployedStatusArgs(communityId: tokenDto.communityId, contractAddress: tokenDto.address, deployState: deployState) let data = CommunityTokenDeployedStatusArgs(communityId: tokenDto.communityId, contractAddress: tokenDto.address,
deployState: deployState, chainId: tokenDto.chainId,
transactionHash: self.addressAndTxMap.getOrDefault((tokenDto.address,tokenDto.chainId)))
self.events.emit(SIGNAL_COMMUNITY_TOKEN_DEPLOY_STATUS, data) self.events.emit(SIGNAL_COMMUNITY_TOKEN_DEPLOY_STATUS, data)
self.events.on(PendingTransactionTypeDto.CollectibleAirdrop.event) do(e: Args): self.events.on(PendingTransactionTypeDto.CollectibleAirdrop.event) do(e: Args):
@ -147,6 +158,8 @@ QtObject:
debug "Deployed contract address ", contractAddress=contractAddress debug "Deployed contract address ", contractAddress=contractAddress
debug "Deployment transaction hash ", transactionHash=transactionHash debug "Deployment transaction hash ", transactionHash=transactionHash
self.addressAndTxMap[(contractAddress, chainId)] = transactionHash
var communityToken: CommunityTokenDto var communityToken: CommunityTokenDto
communityToken.tokenType = TokenType.ERC721 communityToken.tokenType = TokenType.ERC721
communityToken.communityId = communityId communityToken.communityId = communityId
@ -166,7 +179,7 @@ QtObject:
# save token to db # save token to db
let communityTokenJson = tokens_backend.addCommunityToken(communityToken) let communityTokenJson = tokens_backend.addCommunityToken(communityToken)
communityToken = communityTokenJson.result.toCommunityTokenDto() communityToken = communityTokenJson.result.toCommunityTokenDto()
let data = CommunityTokenDeployedArgs(communityToken: communityToken) let data = CommunityTokenDeployedArgs(communityToken: communityToken, transactionHash: transactionHash)
self.events.emit(SIGNAL_COMMUNITY_TOKEN_DEPLOYED, data) self.events.emit(SIGNAL_COMMUNITY_TOKEN_DEPLOYED, data)
# observe transaction state # observe transaction state

View File

@ -9,6 +9,7 @@ QtObject {
id: root id: root
property var contactsStore property var contactsStore
property var communityTokensStore
property var networkConnectionStore property var networkConnectionStore
@ -17,8 +18,6 @@ QtObject {
chatCommunitySectionModuleInst: chatCommunitySectionModule chatCommunitySectionModuleInst: chatCommunitySectionModule
} }
readonly property CommunityTokensStore communityTokensStore: CommunityTokensStore { rootStore: root }
property bool openCreateChat: false property bool openCreateChat: false
property string createChatInitMessage: "" property string createChatInitMessage: ""
property var createChatFileUrls: [] property var createChatFileUrls: []

View File

@ -1,5 +1,4 @@
CommunitiesStore 1.0 CommunitiesStore.qml CommunitiesStore 1.0 CommunitiesStore.qml
CommunityTokensStore 1.0 CommunityTokensStore.qml
PermissionsStore 1.0 PermissionsStore.qml PermissionsStore 1.0 PermissionsStore.qml
RootStore 1.0 RootStore.qml RootStore 1.0 RootStore.qml
StickerData 1.0 StickerData.qml StickerData 1.0 StickerData.qml

View File

@ -354,15 +354,32 @@ StatusSectionLayout {
mintPanel.isFeeLoading = true mintPanel.isFeeLoading = true
} }
// TODO: Self-destruct backend function onDeploymentStateChanged(status, url) {
function onSelfDestructFeeUpdated(value) { let title = ""
// TODO better error handling let loading = false
if (value === "-") { let type = Constants.ephemeralNotificationType.normal
mintPanel.isFeeLoading = true switch (status) {
} else { case Constants.DeployState.InProgress:
mintPanel.isFeeLoading = false title = qsTr("Token is being minted...")
mintPanel.feeText = value loading = true
break
case Constants.DeployState.Deployed:
title = qsTr("Token minting finished")
type = Constants.ephemeralNotificationType.success
break
case Constants.DeployState.Failed:
title = qsTr("Token minting failed")
break
default:
console.warn("Unknown deploy state: "+status)
return
} }
Global.displayToastMessage(title,
qsTr("View on etherscan"),
"",
loading,
type,
url)
} }
} }
} }

View File

@ -51,12 +51,6 @@ StatusScrollView {
readonly property int iconSize: 20 readonly property int iconSize: 20
} }
enum DeployState {
Failed,
InProgress,
Deployed
}
contentWidth: mainLayout.width contentWidth: mainLayout.width
contentHeight: mainLayout.height contentHeight: mainLayout.height
padding: 0 padding: 0
@ -68,7 +62,7 @@ StatusScrollView {
spacing: Style.current.padding spacing: Style.current.padding
RowLayout { RowLayout {
visible: !root.preview && (root.deployState === CommunityCollectibleView.DeployState.InProgress) visible: !root.preview && (root.deployState === Constants.DeployState.InProgress)
spacing: Style.current.halfPadding spacing: Style.current.halfPadding
StatusDotsLoadingIndicator {} StatusDotsLoadingIndicator {}

View File

@ -21,21 +21,15 @@ StatusScrollView {
string accountName, string accountName,
string accountAddress) string accountAddress)
enum DeployState {
Failed,
InProgress,
Deployed
}
QtObject { QtObject {
id: d id: d
function getStateText(deployState) { function getStateText(deployState) {
if(deployState === CommunityMintedTokensView.DeployState.Failed) { if(deployState === Constants.DeployState.Failed) {
return qsTr("Failed") return qsTr("Failed")
} }
if(deployState === CommunityMintedTokensView.DeployState.InProgress) { if(deployState === Constants.DeployState.InProgress) {
return qsTr("Minting...") return qsTr("Minting...")
} }
return "" return ""

View File

@ -49,12 +49,14 @@ Item {
property RootStore rootStore: RootStore {} property RootStore rootStore: RootStore {}
property var rootChatStore: ChatStores.RootStore { property var rootChatStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore contactsStore: appMain.rootStore.contactStore
communityTokensStore: appMain.communityTokensStore
emojiReactionsModel: appMain.rootStore.emojiReactionsModel emojiReactionsModel: appMain.rootStore.emojiReactionsModel
openCreateChat: createChatView.opened openCreateChat: createChatView.opened
networkConnectionStore: appMain.networkConnectionStore networkConnectionStore: appMain.networkConnectionStore
} }
property ActivityCenterStore activityCenterStore: ActivityCenterStore {} property ActivityCenterStore activityCenterStore: ActivityCenterStore {}
property NetworkConnectionStore networkConnectionStore: NetworkConnectionStore {} property NetworkConnectionStore networkConnectionStore: NetworkConnectionStore {}
property CommunityTokensStore communityTokensStore: CommunityTokensStore {}
// set from main.qml // set from main.qml
property var sysPalette property var sysPalette
@ -876,6 +878,7 @@ Item {
rootStore: ChatStores.RootStore { rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore contactsStore: appMain.rootStore.contactStore
communityTokensStore: appMain.communityTokensStore
emojiReactionsModel: appMain.rootStore.emojiReactionsModel emojiReactionsModel: appMain.rootStore.emojiReactionsModel
openCreateChat: createChatView.opened openCreateChat: createChatView.opened
chatCommunitySectionModule: appMain.rootStore.mainModuleInst.getChatSectionModule() chatCommunitySectionModule: appMain.rootStore.mainModuleInst.getChatSectionModule()
@ -1000,6 +1003,7 @@ Item {
rootStore: ChatStores.RootStore { rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore contactsStore: appMain.rootStore.contactStore
communityTokensStore: appMain.communityTokensStore
emojiReactionsModel: appMain.rootStore.emojiReactionsModel emojiReactionsModel: appMain.rootStore.emojiReactionsModel
openCreateChat: createChatView.opened openCreateChat: createChatView.opened
chatCommunitySectionModule: { chatCommunitySectionModule: {
@ -1041,10 +1045,10 @@ Item {
sourceComponent: CreateChatView { sourceComponent: CreateChatView {
rootStore: ChatStores.RootStore { rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore contactsStore: appMain.rootStore.contactStore
communityTokensStore: appMain.communityTokensStore
emojiReactionsModel: appMain.rootStore.emojiReactionsModel emojiReactionsModel: appMain.rootStore.emojiReactionsModel
openCreateChat: createChatView.opened openCreateChat: createChatView.opened
chatCommunitySectionModule: appMain.rootStore.mainModuleInst.getChatSectionModule() chatCommunitySectionModule: appMain.rootStore.mainModuleInst.getChatSectionModule()
} }
emojiPopup: statusEmojiPopup emojiPopup: statusEmojiPopup
stickersPopup: statusStickersPopupLoader.item stickersPopup: statusStickersPopupLoader.item
@ -1064,6 +1068,7 @@ Item {
height: appView.height - _buttonSize * 2 height: appView.height - _buttonSize * 2
store: ChatStores.RootStore { store: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore contactsStore: appMain.rootStore.contactStore
communityTokensStore: appMain.communityTokensStore
emojiReactionsModel: appMain.rootStore.emojiReactionsModel emojiReactionsModel: appMain.rootStore.emojiReactionsModel
openCreateChat: createChatView.opened openCreateChat: createChatView.opened
chatCommunitySectionModule: appMain.rootStore.mainModuleInst.getChatSectionModule() chatCommunitySectionModule: appMain.rootStore.mainModuleInst.getChatSectionModule()

View File

@ -1,9 +1,9 @@
import QtQuick 2.15 import QtQuick 2.15
import utils 1.0
QtObject { QtObject {
id: root id: root
property var rootStore
property var communityTokensModuleInst: communityTokensModule ?? null property var communityTokensModuleInst: communityTokensModule ?? null
// Network selection properties: // Network selection properties:
@ -56,9 +56,6 @@ QtObject {
]) ])
} }
signal deployFeeUpdated(var ethCurrency, var fiatCurrency, int error)
signal selfDestructFeeUpdated(string value) // TO BE REMOVED
// Minting tokens: // Minting tokens:
function deployCollectible(communityId, accountAddress, name, symbol, description, supply, function deployCollectible(communityId, accountAddress, name, symbol, description, supply,
infiniteSupply, transferable, selfDestruct, chainId, artworkSource, accountName) infiniteSupply, transferable, selfDestruct, chainId, artworkSource, accountName)
@ -68,11 +65,18 @@ QtObject {
infiniteSupply, transferable, selfDestruct, chainId, artworkSource) infiniteSupply, transferable, selfDestruct, chainId, artworkSource)
} }
signal deployFeeUpdated(var ethCurrency, var fiatCurrency, int error)
signal deploymentStateChanged(int status, string url)
signal selfDestructFeeUpdated(string value) // TO BE REMOVED
readonly property Connections connections: Connections { readonly property Connections connections: Connections {
target: communityTokensModuleInst target: communityTokensModuleInst
function onDeployFeeUpdated(ethCurrency, fiatCurrency, errorCode) { function onDeployFeeUpdated(ethCurrency, fiatCurrency, errorCode) {
root.deployFeeUpdated(ethCurrency, fiatCurrency, errorCode) root.deployFeeUpdated(ethCurrency, fiatCurrency, errorCode)
} }
function onDeploymentStateChanged(status, url) {
root.deploymentStateChanged(status, url)
}
} }
function computeDeployFee(chainId, accountAddress) { function computeDeployFee(chainId, accountAddress) {

View File

@ -1,6 +1,7 @@
singleton RootStore 1.0 RootStore.qml singleton RootStore 1.0 RootStore.qml
CurrenciesStore 1.0 CurrenciesStore.qml CurrenciesStore 1.0 CurrenciesStore.qml
TransactionStore 1.0 TransactionStore.qml TransactionStore 1.0 TransactionStore.qml
CommunityTokensStore 1.0 CommunityTokensStore.qml
BIP39_en 1.0 BIP39_en.qml BIP39_en 1.0 BIP39_en.qml
ChartStoreBase 1.0 ChartStoreBase.qml ChartStoreBase 1.0 ChartStoreBase.qml
TokenBalanceHistoryStore 1.0 TokenBalanceHistoryStore.qml TokenBalanceHistoryStore 1.0 TokenBalanceHistoryStore.qml

View File

@ -883,6 +883,12 @@ QtObject {
Everyone = 4 Everyone = 4
} }
enum DeployState {
Failed,
InProgress,
Deployed
}
readonly property QtObject walletSection: QtObject { readonly property QtObject walletSection: QtObject {
readonly property string cancelledMessage: "cancelled" readonly property string cancelledMessage: "cancelled"
} }