Skip to content

Conversation

@AntonioVentilii
Copy link
Collaborator

Motivation

Similar to what we have for ERC NFTs, we create a service to load EXT NFTs.

@AntonioVentilii AntonioVentilii requested a review from a team as a code owner November 27, 2025 09:19
Copilot AI review requested due to automatic review settings November 27, 2025 09:19
@AntonioVentilii AntonioVentilii requested a review from a team as a code owner November 27, 2025 09:19
@AntonioVentilii AntonioVentilii marked this pull request as draft November 27, 2025 09:19
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 implements a service to load EXT NFTs for ICP (Internet Computer Protocol), mirroring the existing functionality for ERC NFTs on Ethereum. The implementation adds utility functions to map EXT token data to NFT objects, a service layer to fetch NFTs from multiple collections, and comprehensive test coverage for both utilities and services.

Key changes:

  • Added loadNfts service to fetch EXT NFTs from multiple token collections for a given identity
  • Created mapExtNft utility to transform EXT token indices into standardized NFT objects with proper identifiers and image URLs
  • Introduced IcNonFungibleToken type to represent ICP-based NFTs in the type system

Reviewed changes

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

Show a summary per file
File Description
src/frontend/src/icp/services/nft.services.ts New service implementing NFT loading logic with error handling for multiple EXT token collections
src/frontend/src/icp/utils/nft.utils.ts Utility functions to map EXT token data to standardized NFT format with collection metadata
src/frontend/src/icp/types/nft.ts Type definition for ICP non-fungible tokens (currently only ExtToken)
src/frontend/src/lib/types/nft.ts Updated NonFungibleToken union type to include IcNonFungibleToken instead of ExtToken directly
src/frontend/src/tests/icp/services/nft.services.spec.ts Comprehensive tests for loadNfts service covering edge cases and error handling
src/frontend/src/tests/icp/utils/nft.utils.spec.ts Tests for mapExtNft utility including validation of negative indices
src/frontend/src/tests/mocks/ext-tokens.mock.ts Added second mock EXT token for testing multiple collection scenarios

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

@AntonioVentilii AntonioVentilii marked this pull request as ready for review November 27, 2025 10:12
@AntonioVentilii AntonioVentilii added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit b57abf2 Nov 27, 2025
79 checks passed
@AntonioVentilii AntonioVentilii deleted the feat-frontend/Service-to-load-EXT-NFTs branch November 27, 2025 10:24
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