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

Display SIP-013 (semi-fungible) token balances with correct decimals #2506

Open
314159265359879 opened this issue Jun 24, 2022 · 19 comments
Open
Labels
effort:small Expected to take up to 1 day of integration work enhancement

Comments

@314159265359879
Copy link
Contributor

These SIP-013 tokens are not shown with the correct decimal mark. I am not sure if that is because these are SIP-013 tokens and not SIP-010 tokens?

image

even though in the contract 8 decimals are defined (line 16): https://explorer.alexlab.co/txid/SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.key-alex-autoalex-v1?chain=mainnet

hirosystems/docs#110 also mentions some other examples of implemented SIP-013 tokens on mainnet.

@markmhendrickson
Copy link
Collaborator

Thanks for the report. Is the API returning data as expected for the decimals?

@314159265359879
Copy link
Contributor Author

Thanks for the report. Is the API returning data as expected for the decimals?

No it isn't. I checked with rafael and he says this would be the API call for a fungible token (FT), not semi-fungible token (SFT): https://stacks-node-api.mainnet.stacks.co/extended/v1/tokens/SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.key-alex-autoalex-v1/ft/metadata
he goes on saying "we do not support semi-fungible token metadata in the API yet". So I guess we'll have to take care of that first ;-)

@fiftyeightandeight
Copy link

Merging hirosystems/docs#110 into this PR.

What should be done to ask for Stacks API to add support for semi-fungible token (SFT) metadata?

stacksgov/sips#42 is now in the Accepted status, and there are contracts already using the standard on mainnet.

Examples:

semi-fungible trait: https://explorer.stacks.co/txid/0x74db763fbaa66da3368e642ddac48dc5ac81f3c6e5a9b1aaf358c5745608fdde?chain=mainnet
yield-alex-v1: https://explorer.stacks.co/txid/0x960dda517da8f9a71d8bf7736fc09bddfa5a7035f148387cd737eab73dcc62a6?chain=mainnet
key-alex-autoalex-v1: https://explorer.stacks.co/txid/0x81dfeb1dc081781e8fe6859ebfc6c4ce68b61b2d329b294f44649115dab3ac59?chain=mainnet
ytp-alex-v1: https://explorer.stacks.co/txid/0xc0283d14f4541b9c2844839fda971547c7318ec924115ce44be9109bb85bb9a7?chain=mainnet

Based on the above, it will be great to see Hiro wallet supporting SIP-013 standard.

@markmhendrickson markmhendrickson changed the title add SIP-013 (semi-fungible) token support to wallet Add SIP-013 (semi-fungible) token support Jun 27, 2022
@markmhendrickson
Copy link
Collaborator

@314159265359879 that makes sense, thanks for the additional investigation!

@rafaelcr is this API work planned for anytime soon, and is it tracked somewhere by chance? 🙏

@rafaelcr
Copy link

@markmhx @314159265359879 we have major plans for the token metadata service this Q3, and I'll make sure to include support for SIP-013 tokens in the roadmap. I'm putting together some internal docs and will update here with an issue once I file one for tracking.

@diwakergupta
Copy link

This issue suggests room for improvement in how various stakeholders engage with the SIP process cc/ @markmhx @sabbyanandan

It seems @314159265359879 (and perhaps others in the community) had the expectation that as SIP-013 would already be supported in the Hiro API, Wallets etc. Which seems reasonable from their perspective.

On the other hand, while SIP-013 has been under review since > 6 months ago, we (Hiro) haven't been much involved in it. In particular, I don't think any requirements from SIP-013 ever formally made their way into specific feature requests for any Hiro products, until last week.

@sabbyanandan one idea might be that we do a bi-weekly or monthly review of SIPs in flight, and anticipate support for any SIPs that reach accepted status. Open to other suggestions!

@Hero-Gamer
Copy link

Interesting, sounds like there is an opportunity to improve. If I am luckily enough to be a SIP Resident, this can be part of the scope to explore and facilitate.

@markmhendrickson
Copy link
Collaborator

Here's a link to the draft SIP in question for good measure: stacksgov/sips#42

@314159265359879
Copy link
Contributor Author

@diwakergupta I may have had the expectation but also had no clue as to the work involved I was mostly looking for the reason semi-fungibles are not yet supported and how to fix it.

The idea to follow SIP's in flight to anticipate support for them, is a brilliant idea though.

@314159265359879
Copy link
Contributor Author

SIP013 is activated and ratified what else is needed for the Hiro wallet to support these?

@markmhendrickson
Copy link
Collaborator

@rafaelcr I'm curious if SIP-013 has been factored into the more recent metadata service work by chance?

@rafaelcr
Copy link

rafaelcr commented Jan 5, 2023

@markmhx yes that's right, SIP-013 tokens are going to be supported by the Token Metadata Service upon release 👍

@markmhendrickson
Copy link
Collaborator

Great! I imagine once we integrate the new service in support of #1028, we can also leverage it for SIP-013 support per this issue.

@markmhendrickson markmhendrickson changed the title Add SIP-013 (semi-fungible) token support Display SIP-013 (semi-fungible) token balances with correct decimals Mar 19, 2024
@markmhendrickson
Copy link
Collaborator

Note: Discussion is taking place with ALEX about how to best distinguish whether a specific SIP-013 should be treated primarily as fungible or non-fungible given its intended behavior.

@fbwoolf
Copy link
Contributor

fbwoolf commented Mar 26, 2024

Are these returned in the query for fungible-tokens or non-fungible tokens? I'm not seeing how we know to query the metadata endpoint for /ft/, /nft/, or /sft/?

@314159265359879
Copy link
Contributor Author

@fbwoolf Chan (ALEX) is talking with Hiro about that.

@fbwoolf
Copy link
Contributor

fbwoolf commented Apr 8, 2024

Any movement here, or should I move it back into our backlog?

@rafaelcr
Copy link

rafaelcr commented Apr 9, 2024

Hi all, SIP-013 tokens have to be queried using this URL structure (similar to how an NFT is queried): /metadata/sft/:contract_id/:token_id, for example: https://api.hiro.so/metadata/sft/SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.key-alex-autoalex-v1/77050

However, I double checked the DB and no SIP-013 contract appears to have valid SIP-016 metadata defined (or, there's a bug in the API that does not read SFT metadata correctly). If you'd like to adjust some of the metadata and have it refreshed you can emit a SIP-019 notification or let me know and I'll refresh it manually.

Also, if you think there's a bug on the API side I can definitely check it out.

@fiftyeightandeight
Copy link

Hi all, SIP-013 tokens have to be queried using this URL structure (similar to how an NFT is queried): /metadata/sft/:contract_id/:token_id, for example: https://api.hiro.so/metadata/sft/SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.key-alex-autoalex-v1/77050

However, I double checked the DB and no SIP-013 contract appears to have valid SIP-016 metadata defined (or, there's a bug in the API that does not read SFT metadata correctly). If you'd like to adjust some of the metadata and have it refreshed you can emit a SIP-019 notification or let me know and I'll refresh it manually.

Also, if you think there's a bug on the API side I can definitely check it out.

Hi @rafaelcr let us review on our side and revert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:small Expected to take up to 1 day of integration work enhancement
Projects
None yet
Development

No branches or pull requests

8 participants