Skip to content

Conversation

@AntonioVentilii
Copy link
Collaborator

Motivation

We want to accomodate more standard in IC service loadNfts, so we refactor the logic to have a conditional check for the accepted standard.

@AntonioVentilii AntonioVentilii requested a review from a team as a code owner January 7, 2026 15:50
Copilot AI review requested due to automatic review settings January 7, 2026 15:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the loadNfts function in the IC service to support multiple NFT token standards by introducing conditional logic to check token types. The refactoring sets up the infrastructure for accommodating additional standards beyond the currently supported EXT standard.

Key Changes:

  • Introduced conditional token standard checking using isTokenExt type guard
  • Added assertNever for exhaustiveness checking to ensure all token types are handled
  • Renamed getTokensByOwner to getExtTokensByOwner for clarity

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/frontend/src/icp/services/nft.services.ts Refactored loadNfts to use conditional logic for token standard checking, renamed imports for clarity, and added error handling for unsupported standards
src/frontend/src/tests/icp/services/nft.services.spec.ts Updated test expectations to reflect renamed imports and added new test case to verify error handling for unsupported token standards

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AntonioVentilii AntonioVentilii added this pull request to the merge queue Jan 7, 2026
Merged via the queue into main with commit 96cbeae Jan 7, 2026
78 checks passed
@AntonioVentilii AntonioVentilii deleted the refactor-frontend/Expand-logic-of-IC-service-loadNfts branch January 7, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants