2023-11-28 19:16:18 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
|
|
|
import StatusQ 0.1
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: root
|
|
|
|
|
2024-05-28 17:39:41 +00:00
|
|
|
property TokensStore walletTokensStore: TokensStore {}
|
2023-11-28 19:16:18 +00:00
|
|
|
|
|
|
|
readonly property var groupedAccountsAssetsModel: GroupedAccountsAssetsModel {}
|
|
|
|
property var assetsWithFilteredBalances
|
|
|
|
readonly property var tokensBySymbolModel: TokensBySymbolModel {}
|
2024-02-07 14:56:45 +00:00
|
|
|
readonly property var communityModel: ListModel {
|
|
|
|
Component.onCompleted: append([{
|
|
|
|
communityId: "ddls",
|
|
|
|
communityName: "Doodles",
|
|
|
|
communityImage: ModelsData.collectibles.doodles
|
|
|
|
},
|
|
|
|
{
|
|
|
|
communityId: "sox",
|
|
|
|
communityName: "Socks",
|
|
|
|
communityImage: ModelsData.icons.socks
|
|
|
|
},
|
|
|
|
{
|
|
|
|
communityId: "ast",
|
|
|
|
communityName: "Astafarians",
|
|
|
|
communityImage: ModelsData.icons.dribble
|
|
|
|
}])
|
|
|
|
}
|
2023-11-28 19:16:18 +00:00
|
|
|
|
|
|
|
// renaming tokens by symbol key so that can be used to join models
|
|
|
|
readonly property var renamedTokensBySymbolModel: RolesRenamingModel {
|
|
|
|
sourceModel: tokensBySymbolModel
|
|
|
|
mapping: [
|
|
|
|
RoleRename {
|
|
|
|
from: "key"
|
|
|
|
to: "tokensKey"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
// join account assets and tokens by symbol model
|
|
|
|
property LeftJoinModel jointModel: LeftJoinModel {
|
|
|
|
leftModel: assetsWithFilteredBalances
|
|
|
|
rightModel: renamedTokensBySymbolModel
|
|
|
|
joinRole: "tokensKey"
|
|
|
|
}
|
|
|
|
|
|
|
|
// combining community model with assets to get community meta data
|
|
|
|
property LeftJoinModel groupedAccountAssetsModel: LeftJoinModel {
|
|
|
|
leftModel: jointModel
|
|
|
|
rightModel: communityModel
|
|
|
|
joinRole: "communityId"
|
|
|
|
}
|
2024-01-29 15:37:17 +00:00
|
|
|
|
2024-07-05 12:49:31 +00:00
|
|
|
readonly property var assetsController: QtObject {
|
2024-05-28 17:39:41 +00:00
|
|
|
property int revision
|
|
|
|
|
|
|
|
function filterAcceptsSymbol(symbol) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
2023-11-28 19:16:18 +00:00
|
|
|
}
|