Skip to content

Conversation

@AntonioVentilii
Copy link
Collaborator

Motivation

Some EXT token canisters do not support the newest method for transfer tokens_ext, so, we need to fallback on the legacy one if needed. In this PR, we access the canister method for legacy tokens.

Note that the methods are actually equivalent, just different names.

@AntonioVentilii AntonioVentilii requested a review from a team as a code owner December 19, 2025 09:03
Copilot AI review requested due to automatic review settings December 19, 2025 09:03
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 adds support for the legacy tokens endpoint in EXT v2 token canisters to handle canisters that don't support the newer tokens_ext method. The implementation provides a new getTokensByOwnerLegacy method that calls the legacy tokens canister method and returns a simple array of token indices.

  • Added getTokensByOwnerLegacy method to ExtV2TokenCanister class
  • Implemented comprehensive test suite for the new legacy method
  • Maintains consistent error handling patterns with existing methods

Reviewed changes

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

File Description
src/frontend/src/icp/canisters/ext-v2-token.canister.ts Added getTokensByOwnerLegacy method that calls the legacy tokens canister endpoint and handles responses (including the "No tokens" edge case)
src/frontend/src/tests/icp/canisters/ext-v2-token.canister.spec.ts Added comprehensive test suite covering success cases, error handling, and edge cases for getTokensByOwnerLegacy

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

@AntonioVentilii AntonioVentilii added this pull request to the merge queue Dec 19, 2025
Merged via the queue into main with commit 38e9f03 Dec 19, 2025
78 checks passed
@AntonioVentilii AntonioVentilii deleted the feat-frontend/Add-legacy-tokens-endpoint-to-EXT-tokens branch December 19, 2025 10:13
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