Skip to content
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

Unify token standard/type #16251

Open
tomasklim opened this issue Jan 7, 2025 · 1 comment · May be fixed by #16286
Open

Unify token standard/type #16251

tomasklim opened this issue Jan 7, 2025 · 1 comment · May be fixed by #16286
Assignees
Labels
code Code improvements

Comments

@tomasklim
Copy link
Member

For some reason we introduced type to TokenTransfer object which override token standard, so standard is now located in standard attribute in case of TokenTransfer.
However, in case of TokenInfo in account, token standard is in type attribute.

Please unify.

Find out what is better, if using type from blockbook API or standard.

Do not forget about migration.

Then we will be able to get rid of this:

export const isNftTokenTransfer = (transfer: TokenTransfer) =>
    ['ERC1155', 'ERC721', 'BEP1155', 'BEP721'].includes(transfer.standard || '');

// TODO: TokenInfo should use TokenStandard type
export const isNftToken = (token: TokenInfo) =>
    ['ERC1155', 'ERC721', 'BEP1155', 'BEP721'].includes(token.type || '');
@github-project-automation github-project-automation bot moved this to 🎯 To do in Issues Suite Jan 7, 2025
@tomasklim tomasklim added the code Code improvements label Jan 7, 2025
@enjojoy
Copy link
Contributor

enjojoy commented Jan 9, 2025

I think that it's better to name it a standard, because it's named like that in Ethereum and Solana docs and this term is commonly used.

@tomasklim tomasklim moved this from 🎯 To do to 🏃‍♀️ In progress in Issues Suite Jan 9, 2025
@enjojoy enjojoy linked a pull request Jan 12, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code improvements
Projects
Status: 🏃‍♀️ In progress
Development

Successfully merging a pull request may close this issue.

2 participants