-
Notifications
You must be signed in to change notification settings - Fork 39
feat(frontend): Create new variant type DIP721 for Custom tokens #10986
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
feat(frontend): Create new variant type DIP721 for Custom tokens #10986
Conversation
…-for-Custom-tokens
…-for-Custom-tokens
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.
Pull request overview
This PR adds support for the DIP721 variant to custom tokens in the frontend, including type definitions, utility mapping functions, service layer integration, and corresponding tests.
- Added
Dip721SaveCustomTokentype andDip721network key variant - Implemented mapping function
toDip721CustomTokento convert DIP721 tokens to backend format - Extended
hideTokenByKeyto handle DIP721 tokens in the service layer
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/frontend/src/lib/types/custom-token.ts |
Adds Dip721SaveCustomToken type and includes Dip721 variant in SaveCustomTokenWithKey union type |
src/frontend/src/lib/utils/custom-token.utils.ts |
Imports DIP721 type alias from backend declarations and implements toDip721CustomToken mapping function with network key handler |
src/frontend/src/lib/services/save-custom-tokens.services.ts |
Adds DIP721 store import, extends hideTokenByKey to handle DIP721, and includes TODO for missing loadCustomDip721Tokens |
src/frontend/src/icp/stores/dip721-custom-tokens.store.ts |
Creates new certified custom tokens store for DIP721 tokens |
src/frontend/src/tests/lib/utils/custom-token.utils.spec.ts |
Adds test case verifying correct type mapping for DIP721 network key |
src/frontend/src/tests/lib/services/save-custom-tokens.services.spec.ts |
Adds DIP721 mock token to test suite and verifies store reset behavior for disabled DIP721 tokens |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Motivation
We have a new variant DIP721 among the custom tokens, so we need to add it properly to the correct types.
Consequently, we need to adapt the mapping.