Skip to content
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

Merged
merged 26 commits into from
Jul 3, 2024

Conversation

matiasbzurovski
Copy link
Contributor

@matiasbzurovski matiasbzurovski commented Jun 25, 2024

Jira ticket: ABW-3261
Jira ticket: ABW-2863

Description

  • Loads and display every metadata field available on a Resource.
  • Shows which arbitrary metadata is locked
  • Updates UI to follow new designs.

How to test

You can create a new test token under Dev preferences, which will create a STAR 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

Copy link
Contributor

@CyonAlexRDX CyonAlexRDX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

Comment on lines 254 to 259
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)
}
Copy link
Contributor

@GhenadieVP GhenadieVP Jun 28, 2024

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@GhenadieVP GhenadieVP Jun 28, 2024

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.

@matiasbzurovski matiasbzurovski merged commit 4ab06fb into main Jul 3, 2024
3 checks passed
@matiasbzurovski matiasbzurovski deleted the ABW-3261-resource-details branch July 3, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants