Skip to content

Conversation

@AntonioVentilii
Copy link
Collaborator

Motivation

We are going to transform the standard field of a Token type from an enum to an object (so that we can extend it with other fields like version or subStandards).

But first, we need to rename the existing type for TokenStandard: the idea is that value is the symbol of the standard:

export const TokenStandardSchema = z.object({
	code: TokenStandardCodeSchema,
})

Copilot AI review requested due to automatic review settings December 12, 2025 12:39
@AntonioVentilii AntonioVentilii requested a review from a team as a code owner December 12, 2025 12:39
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 performs a systematic rename of the TokenStandard type to TokenStandardCode across the frontend codebase. The motivation is to prepare for transforming the standard field from an enum to an object structure that can include additional properties like version or subStandards. The name "TokenStandardCode" better reflects that this represents the code/symbol of a standard, rather than the standard itself.

  • Renamed the Zod schema from TokenStandardSchema to TokenStandardCodeSchema
  • Updated the TypeScript type from TokenStandard to TokenStandardCode
  • Updated all imports, type annotations, and usages across 18+ files including tests, components, services, and utilities

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/frontend/src/lib/schema/token.schema.ts Renamed TokenStandardSchema to TokenStandardCodeSchema
src/frontend/src/lib/types/token.ts Renamed TokenStandard type to TokenStandardCode and updated related types
src/frontend/src/lib/utils/token.utils.ts Updated function parameter types from TokenStandard to TokenStandardCode
src/frontend/src/lib/stores/send.store.ts Updated store type definitions to use TokenStandardCode
src/frontend/src/lib/services/token.services.ts Updated service parameter types to use TokenStandardCode
src/frontend/src/lib/types/ai-assistant.ts Updated AI assistant types to use TokenStandardCode
src/frontend/src/lib/components/address/DestinationWizardStep.svelte Updated component prop types to use TokenStandardCode
src/frontend/src/icp/utils/ic-send.utils.ts Updated utility function parameter types to use TokenStandardCode
src/frontend/src/icp/stores/receive-token.store.ts Updated store context types to use TokenStandardCode
src/frontend/src/icp/components/send/IcSendDestination.svelte Updated component prop types to use TokenStandardCode
src/frontend/src/icp-eth/derived/cketh.derived.ts Updated derived store types to use TokenStandardCode
src/frontend/src/eth/types/erc721.ts Updated ERC721 type definitions to use TokenStandardCode
src/frontend/src/eth/types/erc20.ts Updated ERC20 type definitions to use TokenStandardCode
src/frontend/src/eth/types/erc1155.ts Updated ERC1155 type definitions to use TokenStandardCode
src/frontend/src/eth/services/eth-transactions.services.ts Updated service parameter types to use TokenStandardCode
src/frontend/src/eth/providers/alchemy.providers.ts Updated provider type annotations to use TokenStandardCode
src/frontend/src/tests/lib/schema/token.schema.spec.ts Updated test suite name and references to use TokenStandardCodeSchema
src/frontend/src/tests/lib/utils/token.utils.spec.ts Updated test variable types to use TokenStandardCode
src/frontend/src/tests/icp/utils/icrc.utils.spec.ts Updated test type assertions to use TokenStandardCode
src/frontend/src/tests/icp/utils/ext.utils.spec.ts Updated test type assertions to use TokenStandardCode
src/frontend/src/tests/eth/services/erc-custom-tokens.services.spec.ts Updated test type assertions to use TokenStandardCode
src/frontend/src/sol/services/worker.sol-wallet.services.ts Contains unrelated changes for worker message handling and iOS-specific worker singleton logic

💡 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 12, 2025
Merged via the queue into main with commit 9fe2cb0 Dec 12, 2025
78 checks passed
@AntonioVentilii AntonioVentilii deleted the refactor-frontend/Rename-Token-Standard-type branch December 12, 2025 13: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