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

Metadata update fail #139

Closed
kjchiang3 opened this issue Mar 17, 2023 · 42 comments
Closed

Metadata update fail #139

kjchiang3 opened this issue Mar 17, 2023 · 42 comments
Assignees
Labels

Comments

@kjchiang3
Copy link

kjchiang3 commented Mar 17, 2023

We had our token metadata in the SIP-010 format as follows:

{
  "title": "Asset Metadata",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Identifies the asset to which this token represents"
    },
    "description": {
      "type": "string",
      "description": "Describes the asset to which this token represents"
    },
    "image": {
      "type": "string",
      "description": "A URI pointing to a resource with mime type image/* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."
    }
  }
}

We then updated it to check if we just had the wrong JSON schema, and followed the wrapped USD token information and schema:

stsw json: https://app.stackswap.org/token/stsw.json

{
  “name”: “StackSwap”,
  “symbol”: “STSW”,
  “description”: “StackSwap Project”,
  “image”: “https://app.stackswap.org/icon/stsw.svg”
}

xusd json link : https://wrapped.com/xusd.json

{
  “name”: “Wrapped USD”,
  “symbol”: “xUSD”,
  “description”: “Wrapped USD on Stacks (xUSD) is a 1:1 equivalent of stable-backed USD on the Stacks network.“,
  “image”: “https://wrapped.com/images/xusd.png”
}

xusd hiro link : https://api.hiro.so/metadata/v1/ft/SP2TZK01NKDC89J6TA56SA47SDF7RTHYEQ79AAB9A.Wrapped-USD

{“name”:“Wrapped USD”,“symbol”:“xUSD”,“decimals”:8,“total_supply”:“31881338771272”,“token_uri”:“https://wrapped.com/xusd.json”,“description”:“Wrapped USD on Stacks (xUSD) is a 1:1 equivalent of stable-backed USD on the Stacks network.“,”image_uri”:“https://wrapped.com/images/xusd.png”,“image_canonical_uri”:“https://wrapped.com/images/xusd.png”,“tx_id”:“0xfe7848716ba423dfaf664a975771f75763720b0be8a0759a56b2d80a45692ca7”,“sender_address”:“SP2TZK01NKDC89J6TA56SA47SDF7RTHYEQ79AAB9A”,“metadata”:{“sip”:16,“name”:“Wrapped USD”,“description”:“Wrapped USD on Stacks (xUSD) is a 1:1 equivalent of stable-backed USD on the Stacks network.“,”image”:“https://wrapped.com/images/xusd.png”,“cached_image”:“https://wrapped.com/images/xusd.png”}}

We ran the contract call to update the metadata as follows:

tx: https://explorer.stacks.co/txid/0x9a3b332e85a34aeb32a5f5144a53e9ccbfde3dca6d1b1b303f20372429a7fc89?chain=mainnet

However, we are still left with the same information on the Hiro side:

stsw hiro: https://api.hiro.so/metadata/v1/ft/SP1Z92MPDQEWZXW36VX71Q25HKF5K2EPCJ304F275.stsw-token-v4a

{“name”:“STACKSWAP”,“symbol”:“STSW”,“decimals”:6,“total_supply”:“1000000000000000”,“token_uri”:“https://app.stackswap.org/token/stsw.json”,“tx_id”:“0x3edffbd025ca2c29cfde8c583c0e0babacd4aa21075d10307d37c64ae78d579e”,“sender_address”:“SP1Z92MPDQEWZXW36VX71Q25HKF5K2EPCJ304F275”}

Is there anything we are missing on how to carry this out correctly? We have also previously included both json scheme in the SIP-010 versions and the SIP-019 example in the documentation to cover all bases, but so far this hasn't worked. This is also important for us on the end of helping users quickly and easily create their tokens on the Stackswap Token Launchpad, so we have a few users, entrepreneurs, and project leaders keeping up with this issue so they may see their tokens show up correctly on the Hiro Wallet extension.

Thank you for your work on SIP-019 @rafaelcr ! Hope we can find a solution here.

@egtalbot
Copy link

+1 for looking at fixing this issue. Using this api call for FatStx to deal with tokens I don't have in my predefined array is one of the features in my plans for FatStx tool so obviously it needs to be up to date for that feature to make sense :)

@buxor
Copy link

buxor commented Mar 17, 2023

+1 just created a new token via the launchpad and it’s not displaying correctly across wallets. Appreciate everyone’s time on this 🙌

@rafaelcr
Copy link
Collaborator

Thanks for the detailed report @kjchiang3 , I'll take a look at this

@rafaelcr rafaelcr self-assigned this Mar 17, 2023
@rafaelcr
Copy link
Collaborator

This has been manually fixed for now: https://api.hiro.so/metadata/ft/SP1Z92MPDQEWZXW36VX71Q25HKF5K2EPCJ304F275.stsw-token-v4a

I'll look into the underlying cause for the SIP-019 notification error

@martinfolb
Copy link

Hello - I have the same issue with my fan token MartyParty created by the fan community - it won’t show in their wallets and can’t be sent or received. Used the Launchpad - if you swap on Stackswap it shows in the drop-down but not in Hiro wallet - thanks

@rafaelcr
Copy link
Collaborator

hi @martinfolb can you provide more info about your token? Contract name or deploy transaction ID would be sufficient

@martinfolb
Copy link

martinfolb commented Mar 21, 2023 via email

@martinfolb
Copy link

martinfolb commented Mar 23, 2023 via email

@rafaelcr
Copy link
Collaborator

Hi @martinfolb I can't see the pictures you shared in #139 (comment)

After debugging on the API it looks like the transaction you shared deployed this contract which should contain your STSW-MARTYPARTY token: https://explorer.stacks.co/txid/0x293ca94ccf17001cefda85bb376a5335a0a25dda5bd84888879cffd717a3aa24?chain=mainnet

However, when the API tries to fetch metadata for it, the token metadata URI returned by the contract is an empty string "". Can you check if there's a way to update this token metadata URI? As it stands today, it does not conform to SIP-010 and as a consequence it's not supported by the API.

@kjchiang3
Copy link
Author

Hi @rafaelcr, we can look into this URI issue. For clarity, could you provide what URI conforms to SIP-010?

Also, is there any other part of the metadata that isn't in line with SIP-010? If this is the reason for the SIP-019 contract call, we should be able to attend to it.

Thank you!

@rafaelcr
Copy link
Collaborator

Sure @kjchiang3 , basically, the contract should implement this trait function correctly: https://github.com/stacksgov/sips/blob/main/sips/sip-010/sip-010-fungible-token-standard.md#token-uri

The returned JSON should also follow the standard specified here: https://github.com/stacksgov/sips/blob/main/sips/sip-016/sip-016-token-metadata.md#json-scheme-of-metadata

Once you update URIs for contracts, you could emit a SIP-019 notification to have it be refreshed in the API automatically: stacksgov/sips#72

I'm going to close this issue but please feel free to continue asking questions here or to reopen if you find anything else.

@kjchiang3
Copy link
Author

Thanks @rafaelcr, will report back.

@martinfolb
Copy link

martinfolb commented Mar 27, 2023 via email

@martinfolb
Copy link

martinfolb commented Mar 27, 2023 via email

@kjchiang3
Copy link
Author

hi @rafaelcr,

The token that Martin linked to was the LP token for the STSW-MARTY pool.

I think we want to take a look at this instead:
https://explorer.stacks.co/txid/SP1Z92MPDQEWZXW36VX71Q25HKF5K2EPCJ304F275.tokensoft-token-v4ksopvchts?chain=mainnet is the token that should show the MARTYPARTY token.

We tried notifying again:
https://explorer.stacks.co/txid/0x08da2c32295f0d13b9619c7536113166e6cf5d4d09530b3f012eb5c1f64207f8?chain=mainnet

And are still here:
https://api.hiro.so/metadata/v1/ft/SP1Z92MPDQEWZXW36VX71Q25HKF5K2EPCJ304F275.tokensoft-token-v4ksopvchts

MARTY token on our end:
https://stackswap-launchpad.s3.amazonaws.com/1d30ebb4-bca8-4e1e-8bf2-80d254e0cc83.json

On the subject of token URI, we already had that json schema previously (as seen above on the MARTY json on our end) before attempting to following the xUSD json schema.

And, on viewing the SIP-016 examples, there are many variations of json scheme.

Would you be able to let us know a definite way that you have been able to notify the database on your end? Perhaps we can follow that path.

@martinfolb
Copy link

martinfolb commented Mar 28, 2023 via email

@rafaelcr
Copy link
Collaborator

Done! @martinfolb @kjchiang3 https://api.hiro.so/metadata/v1/ft/SP1Z92MPDQEWZXW36VX71Q25HKF5K2EPCJ304F275.tokensoft-token-v4ksopvchts

Let me know if more token contracts need refreshing while we fix the underlying re-org issue in #131

@kjchiang3
Copy link
Author

Can I provide you with a list of the tokens that require updating for the time being? @rafaelcr
Really appreciate the help.

@rafaelcr
Copy link
Collaborator

Sure, go ahead @kjchiang3

@martinfolb
Copy link

martinfolb commented Mar 28, 2023 via email

@martinfolb
Copy link

martinfolb commented Mar 28, 2023 via email

@rafaelcr
Copy link
Collaborator

rafaelcr commented Mar 28, 2023

Any way we can insert the profile logo?

You'll need to adjust the JSON file so that image is a first-level value (as specified in SIP-016), see this example: https://cdn.citycoins.co/metadata/miamicoin.json
@martinfolb

@martinfolb
Copy link

martinfolb commented Mar 29, 2023 via email

@martinfolb
Copy link

martinfolb commented Mar 30, 2023 via email

@kjchiang3
Copy link
Author

@rafaelcr, i have a list of tokens that need updating on Hiro API database. would you please let me know what format you would prefer so as to save as much work as possible on your end? thank you.

@martinfolb
Copy link

martinfolb commented Mar 31, 2023 via email

@martinfolb
Copy link

martinfolb commented Mar 31, 2023 via email

@martinfolb
Copy link

martinfolb commented Mar 31, 2023 via email

@egtalbot
Copy link

egtalbot commented Mar 31, 2023

Are there any plans to make charts for the Stacks tokens? If not maybe I can start a project to do it - how would we get the price - from the contracts?

Obviously this is getting away from the topic of this issue but. . .
For current price I think the swap contracts have calls to obtain the swap ratios.

I already have code which obtains historical (meaning for any completed swap transactions) prices for tokens from Arkadiko and Alex swaps by looking at transaction Hiro API. Would be easy enough to extend it to Stackswap as well. main problem is that it is in C# since that's my primary programming language and is designed just to populate a local database on my machine. But I'm happy to share it somehow if a project to create charts ops up. If I were to create one (no plans to do so) I would consider using stacksonchain as an alternative to the Hiro API, depending on how I designed it.

@kjchiang3
Copy link
Author

nfpstudio.io from Despread is up and running as well.

@kjchiang3
Copy link
Author

hi @rafaelcr,

here's a list of current tokens launched from the Launchpad:

Token List.xlsx

thank you so much!

@martinfolb
Copy link

martinfolb commented Apr 3, 2023 via email

@rafaelcr
Copy link
Collaborator

rafaelcr commented Apr 3, 2023

@kjchiang3

here's a list of current tokens launched from the Launchpad:

Token List.xlsx

I've started refreshing some of these but FYI images are not being consumed given that they don't appear as a first level image property on the metadata JSONs e.g.:

https://api.hiro.so/metadata/ft/SP1Z92MPDQEWZXW36VX71Q25HKF5K2EPCJ304F275.tokensoft-token-v4kmazs39bv
https://stackswap-launchpad.s3.amazonaws.com/385484af-840d-4e90-b3f8-b7930c209eb1.json

Can these JSONs be updated so they have the correct image entry?

@kjchiang3
Copy link
Author

@rafaelcr,

we've updated the JSONs accordingly:
https://stackswap-launchpad.s3.amazonaws.com/64d0f0d8-3d20-4b1a-bca5-f459e44e142a.json
image is now at a first level property.

thanks!

@martinfolb
Copy link

martinfolb commented Apr 4, 2023 via email

@martinfolb
Copy link

martinfolb commented Apr 4, 2023 via email

@rafaelcr
Copy link
Collaborator

rafaelcr commented Apr 4, 2023

Done @kjchiang3 , all tokens are now refreshed and I can confirm that they show up correctly. If you need any more help, feel free to open a new issue.

Please refrain from discussing token prices and market activity in this thread, thank you.

@buxor
Copy link

buxor commented Apr 4, 2023

Hi Rafael, the token still does not show up correctly in Xverse.

Kindly see attached. The correct token would be ORD Ordinance.

621B92DD-5774-4893-B31A-B48323BF6BC4
08542528-BA84-477F-ADFB-0AD9FE9AF0E3

@rafaelcr
Copy link
Collaborator

rafaelcr commented Apr 4, 2023

@buxor could it be cache on Xverse's side? This is the response from the API

https://api.hiro.so/metadata/ft/SP1Z92MPDQEWZXW36VX71Q25HKF5K2EPCJ304F275.tokensoft-token-v4k1pq1uv0w

{
  "name": "Ordinance",
  "symbol": "ORD",
  "decimals": 6,
  "total_supply": "1000000000000000",
  "token_uri": "https://stackswap-launchpad.s3.amazonaws.com/7ef29bcf-eae4-4e4d-bafd-54a83deb0c46.json",
  "description": "Social credits for the Ordinals community, administered by the Bureaucrats.",
  "image_uri": "http://s3-us-east-2.amazonaws.com/stackswap-launchpad/d37555bc-b4e7-47e9-b1e1-b3797467d924.png",
  "image_canonical_uri": "http://s3-us-east-2.amazonaws.com/stackswap-launchpad/d37555bc-b4e7-47e9-b1e1-b3797467d924.png",
  "tx_id": "0xf6b48220f4d23ca265e62a9f5458adbb0534081dab1cb9465fb7820023901edc",
  "sender_address": "SP1Z92MPDQEWZXW36VX71Q25HKF5K2EPCJ304F275",
  "metadata": {
    "sip": 16,
    "name": "Ordinance",
    "description": "Social credits for the Ordinals community, administered by the Bureaucrats.",
    "image": "http://s3-us-east-2.amazonaws.com/stackswap-launchpad/d37555bc-b4e7-47e9-b1e1-b3797467d924.png",
    "cached_image": "http://s3-us-east-2.amazonaws.com/stackswap-launchpad/d37555bc-b4e7-47e9-b1e1-b3797467d924.png"
  }
}

@kjchiang3
Copy link
Author

kjchiang3 commented Apr 4, 2023

Just did a sample transaction on Stackswap, and the Hiro popup shows the following:
image

However, if I right-click the broken image to open image in new tab, it shows up correctly.

edit: for reference I am on Chrome Windows 10.

@buxor
Copy link

buxor commented Apr 4, 2023

Okay I’ll try moving some to hiro and check there, many thanks 🙌

@martinfolb
Copy link

martinfolb commented Apr 6, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants