-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ABW-3261] Display all resource metadata fields #1186
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
# Conflicts: # RadixWallet.xcodeproj/project.pbxproj # RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
var allMetadataItems = Set(item.metadata.items) | ||
if let nextCursor = item.metadata.nextCursor { | ||
// Only fetch metadata if there is more after the first page returned. | ||
let remaining = try await gatewayAPIClient.fetchEntityMetadata(item.address, ledgerState: response.ledgerState, nextCursor: nextCursor) | ||
allMetadataItems.append(contentsOf: remaining) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% sure about this, this will increase the overall loading times of the Wallet. Ideally the metadata should be fetched only when going in the Resource Details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it wasn't increasing the overall loading times, since we only fetch the actual resource when we try to open its details. Before that, we are actually requesting state/entity/details
for the accounts (not the resources), and in such case we don't have any item.metadata.nextCursor
(as it only fetches the explicit metadata of the resources inside the accounts).
However, I pushed a new commit that explicitly requests the metadata only when requested. It adds some noise, so let me know if you prefer which version you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost true. We are fetching the resource details outside of Resource Details screen for the resources that are either part of staking or pool units, see fetchPoolAndStakeUnitsDetails or when categorising resources to pool units, stake units, nft claims.
Jira ticket: ABW-3261
Jira ticket: ABW-2863
Description
How to test
You can create a new test token under
Dev preferences
, which will create aSTAR
token with 37 metadata fields.If you want to test pagination with a resource that has more than 1 page of metadata, let me know and I can send you an NFT with that.
Screenshots