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

Add API for Token information #374

Closed
1 task
poor-defined opened this issue Jul 10, 2023 · 19 comments
Closed
1 task

Add API for Token information #374

poor-defined opened this issue Jul 10, 2023 · 19 comments
Assignees
Labels
documentation Improvements or additions to documentation UserStory a brief, plain-language explanation of a feature or functionality

Comments

@poor-defined
Copy link
Contributor

poor-defined commented Jul 10, 2023

Currently, the browser provides a method for developers to upload Token Info via email to the developer community. However, this method is no longer sufficient to meet the needs of new frameworks like Kuai for SUDT development. Instead, an API for Token Info uploading should be introduced as a replacement.

Current way

Image

Related part in Kuai

Image

  • Also a workflow are supposed be added to ensure the TokenInfo can only be modified to the Token creator.
@poor-defined poor-defined converted this from a draft issue Jul 10, 2023
@poor-defined poor-defined self-assigned this Jul 10, 2023
@zmcNotafraid zmcNotafraid moved this from 🆕 New to 🏗 In Progress in CKB Explorer Jul 31, 2023
@zmcNotafraid
Copy link
Member

  1. Is anyone can use this api to upload udt info? or only used by KUAI?
  2. Upload info has limit or not? Such every day once ..
  3. Uplaod info is updated immediately or needs admin to approve?

@poor-defined
Copy link
Contributor Author

  1. Is anyone can use this api to upload udt info? or only used by KUAI?

It's better to open it only for KUAI first.

  1. Upload info has limit or not? Such every day once ..

No limit.

  1. Uplaod info is updated immediately or needs admin to approve?

No approve.

cc @Keith-CY

@Keith-CY
Copy link
Member

Keith-CY commented Aug 3, 2023

It's better to open it only for KUAI first.

I doubt if it's feasible to only support for Kuai, because it's impossible to differentiate requests from projects built by kuai.

No limit.

If the request is not limited by some rule, it will be used to attack the service. E.g., sending 100,000 requests in a minute

No approve.

If the submission is not audited, it will be used to harm the service, e.g. update the decimal to make transfer amount 10x than it's, so the attacker can cheat others by claiming that he/she has sent 10x sudt.

@poor-defined
Copy link
Contributor Author

I have added a workflow for verifying the creator's email.
Please check this link
@Keith-CY

@Keith-CY
Copy link
Member

I have added a workflow for verifying the creator's email. Please check this link @Keith-CY

A Report button can be placed next to the verification code if the creator is forestalled by the attacker.

image

@zmcNotafraid zmcNotafraid moved this from 🏗 In Progress to 🔎 Code Review in CKB Explorer Sep 18, 2023
@zmcNotafraid zmcNotafraid moved this from 🔎 Code Review to 👀 Testing in CKB Explorer Sep 18, 2023
@Danie0918 Danie0918 moved this from 👀 Testing to 🏗 In Progress in CKB Explorer Sep 18, 2023
@zhangyouxin
Copy link

zhangyouxin commented Oct 24, 2023

frontend pr: Magickbase/ckb-explorer-frontend#127

@Danie0918 Danie0918 moved this from 🏗 In Progress to 🔎 Code Review in CKB Explorer Oct 30, 2023
@poor-defined poor-defined added documentation Improvements or additions to documentation UserStory a brief, plain-language explanation of a feature or functionality labels Nov 24, 2023
@zmcNotafraid
Copy link
Member

@Keith-CY
Copy link
Member

I found the UI design is slightly different from the PRD

In PRD, there is a dialog with options submit token info and modify token info for the next step, but the dialog is missing in the design.

Another question is about Report mentioned at #374 (comment) it's neither mentioned in the PRD nor the design.

Please check @Sven-TBD

Besides, I would suggest adding a button on the token detail page for users to submit a modification.

@Keith-CY Keith-CY moved this from 🔎 Code Review to 🏗 In Progress in CKB Explorer Jan 21, 2024
@poor-defined
Copy link
Contributor Author

I found the UI design is slightly different from the PRD

In PRD, there is a dialog with options submit token info and modify token info for the next step, but the dialog is missing in the design.

Another question is about Report mentioned at #374 (comment) it's neither mentioned in the PRD nor the design.

Please check @Sven-TBD

Besides, I would suggest adding a button on the token detail page for users to submit a modification.

I guess this is because I made two version, the one with dialog is on the original version and is deleted after a meeting. And I put the report button on the original version which should be on the latest one. BTW, do we still need the dialog? Based on the last meeting we had about the Token API things, the dialog should be deleted because the user could modify the Token Info only on the Token Information page.

The PRD has been updated, and I put the report button here.
image

@Keith-CY
Copy link
Member

I found the UI design is slightly different from the PRD
In PRD, there is a dialog with options submit token info and modify token info for the next step, but the dialog is missing in the design.
Another question is about Report mentioned at #374 (comment) it's neither mentioned in the PRD nor the design.
Please check @Sven-TBD
Besides, I would suggest adding a button on the token detail page for users to submit a modification.

I guess this is because I made two version, the one with dialog is on the original version and is deleted after a meeting. And I put the report button on the original version which should be on the latest one. BTW, do we still need the dialog? Based on the last meeting we had about the Token API things, the dialog should be deleted because the user could modify the Token Info only on the Token Information page.

The PRD has been updated, and I put the report button here. image

Got it, I think the dialog for choosing the next step is unnecessary if they can modify token info on the token detail page

@Keith-CY
Copy link
Member

Keith-CY commented Jan 21, 2024

Before modifying the info of a token, its original info is expected to be filled in the form. So all fields of token info are expected to be returned in API as https://testnet-api.explorer.nervos.org/api/v1/udts/0x5a2051e1289743e5878e8045e277500c3c105a4b60faa50c91054a32490ce24b

Now website is missing in the response, need support for @zmcNotafraid


Besides, I found that creator email is not necessary in the modify token info dialog because it's private information, and getting veri-code doesn't require it to be on the page. @Sven-TBD

@Keith-CY
Copy link
Member

Keith-CY commented Jan 23, 2024

Before modifying the info of a token, its original info is expected to be filled in the form. So all fields of token info are expected to be returned in API as https://testnet-api.explorer.nervos.org/api/v1/udts/0x5a2051e1289743e5878e8045e277500c3c105a4b60faa50c91054a32490ce24b

Now website is missing in the response, need support for @zmcNotafraid

Besides, I found that creator email is not necessary in the modify token info dialog because it's private information, and getting veri-code doesn't require it to be on the page. @Sven-TBD

According to the discussion yesterday, I need 2 more fields returned in the SUDT info API

  1. website, which is submitted when token info is updated
  2. creator email, which is submitted when the token info is initialized, and the email address should be protected by concealing some chars, e.g. abc***ail.com
    @zmcNotafraid

@zmcNotafraid
Copy link
Member

returns operator_website and email in udt show api

Before modifying the info of a token, its original info is expected to be filled in the form. So all fields of token info are expected to be returned in API as https://testnet-api.explorer.nervos.org/api/v1/udts/0x5a2051e1289743e5878e8045e277500c3c105a4b60faa50c91054a32490ce24b
Now website is missing in the response, need support for @zmcNotafraid
Besides, I found that creator email is not necessary in the modify token info dialog because it's private information, and getting veri-code doesn't require it to be on the page. @Sven-TBD

According to the discussion yesterday, I need 2 more fields returned in the SUDT info API

  1. website, which is submitted when token info is updated
  2. creator email, which is submitted when the token info is initialized, and the email address should be protected by concealing some chars, e.g. abc***ail.com
    @zmcNotafraid

@Keith-CY
Copy link
Member

Keith-CY commented Feb 2, 2024

I found a typo in PRD that MagickBase should be MagiCKBase, it's a combination of Magi and CKBase, it will be fixed in code directly, but please update the PRD and design later
cc @Sven-TBD @FrederLu
7 (1)

@zmcNotafraid
Copy link
Member

Ignore total_amount update PR: nervosnetwork/ckb-explorer#1615

@FrederLu
Copy link

FrederLu commented Feb 5, 2024

https://pudge.explorer.nervos.org/sudt/0xe3be4fb98ec914886c6525abac97e1f8769c59492636a1d35955e9163ef46efa

Image
Image

usdt (deprecated) prompts an exception when entering the verification code to submit. It is expected that the data was submitted according to sUDT.

@Keith-CY
Copy link
Member

Keith-CY commented Feb 5, 2024

pudge.explorer.nervos.org/sudt/0xe3be4fb98ec914886c6525abac97e1f8769c59492636a1d35955e9163ef46efa

Image Image

usdt (deprecated) prompts an exception when entering the verification code to submit. It is expected that the data was submitted according to sUDT.

It should be fixed by Magickbase/ckb-explorer-frontend#249

The mismatched typehash comes from computation with default parameters, but it can be read from the url when it's the token detail page.

@poor-defined poor-defined moved this from 🏗 In Progress to 👀 Testing in CKB Explorer Feb 19, 2024
@FrederLu
Copy link

Verified.

@FrederLu FrederLu moved this from 👀 Testing to ✅ Done in CKB Explorer Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation UserStory a brief, plain-language explanation of a feature or functionality
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants