feat(@desktop/wallet): add collectibles filter option collectibleIDs
Closes #13215
This commit is contained in:
parent
61677b72ac
commit
c82a4ba602
|
@ -75,6 +75,7 @@ type
|
||||||
# see status-go/services/wallet/collectibles/filter.go Filter
|
# see status-go/services/wallet/collectibles/filter.go Filter
|
||||||
# All empty sequences mean include all
|
# All empty sequences mean include all
|
||||||
CollectibleFilter* = object
|
CollectibleFilter* = object
|
||||||
|
collectibleIds*: seq[CollectibleUniqueID]
|
||||||
communityIds*: seq[string]
|
communityIds*: seq[string]
|
||||||
communityPrivilegesLevels*: seq[int]
|
communityPrivilegesLevels*: seq[int]
|
||||||
filterCommunity*: FilterCommunityType
|
filterCommunity*: FilterCommunityType
|
||||||
|
@ -131,6 +132,9 @@ proc fromJson*(t: JsonNode, T: typedesc[OwnershipUpdateMessage]): OwnershipUpdat
|
||||||
)
|
)
|
||||||
|
|
||||||
# CollectibleFilter
|
# CollectibleFilter
|
||||||
|
proc newCollectibleFilterAllCollectibleIds*(): seq[CollectibleUniqueID] {.inline.} =
|
||||||
|
return @[]
|
||||||
|
|
||||||
proc newCollectibleFilterAllCommunityIds*(): seq[string] {.inline.} =
|
proc newCollectibleFilterAllCommunityIds*(): seq[string] {.inline.} =
|
||||||
return @[]
|
return @[]
|
||||||
|
|
||||||
|
@ -139,6 +143,7 @@ proc newCollectibleFilterAllCommunityPrivilegesLevels*(): seq[int] {.inline.} =
|
||||||
|
|
||||||
proc newCollectibleFilterAllEntries*(): CollectibleFilter {.inline.} =
|
proc newCollectibleFilterAllEntries*(): CollectibleFilter {.inline.} =
|
||||||
return CollectibleFilter(
|
return CollectibleFilter(
|
||||||
|
collectibleIds: newCollectibleFilterAllCollectibleIds(),
|
||||||
communityIds: newCollectibleFilterAllCommunityIds(),
|
communityIds: newCollectibleFilterAllCommunityIds(),
|
||||||
communityPrivilegesLevels: newCollectibleFilterAllCommunityPrivilegesLevels(),
|
communityPrivilegesLevels: newCollectibleFilterAllCommunityPrivilegesLevels(),
|
||||||
filterCommunity: FilterCommunityType.All
|
filterCommunity: FilterCommunityType.All
|
||||||
|
@ -146,6 +151,7 @@ proc newCollectibleFilterAllEntries*(): CollectibleFilter {.inline.} =
|
||||||
|
|
||||||
proc `$`*(self: CollectibleFilter): string =
|
proc `$`*(self: CollectibleFilter): string =
|
||||||
return fmt"""CollectibleFilter(
|
return fmt"""CollectibleFilter(
|
||||||
|
collectibleIds:{self.collectibleIds},
|
||||||
communityIds:{self.communityIds},
|
communityIds:{self.communityIds},
|
||||||
communityPrivilegesLevels:{self.communityPrivilegesLevels},
|
communityPrivilegesLevels:{self.communityPrivilegesLevels},
|
||||||
filterCommunity:{self.filterCommunity}
|
filterCommunity:{self.filterCommunity}
|
||||||
|
@ -153,6 +159,7 @@ proc `$`*(self: CollectibleFilter): string =
|
||||||
|
|
||||||
proc `%`*(t: CollectibleFilter): JsonNode {.inline.} =
|
proc `%`*(t: CollectibleFilter): JsonNode {.inline.} =
|
||||||
result = newJObject()
|
result = newJObject()
|
||||||
|
result["collectible_ids"] = %(t.collectibleIds)
|
||||||
result["community_ids"] = %(t.communityIds)
|
result["community_ids"] = %(t.communityIds)
|
||||||
result["community_privileges_levels"] = %(t.communityPrivilegesLevels)
|
result["community_privileges_levels"] = %(t.communityPrivilegesLevels)
|
||||||
result["filter_community"] = %(t.filterCommunity.int)
|
result["filter_community"] = %(t.filterCommunity.int)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit ee6621b06610f0a3223cf875cc969abfa25750c9
|
Subproject commit b38e2c9278b0f02368048d38a158da8f4a65bba7
|
Loading…
Reference in New Issue