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

Unified Tokens & MetaESDTs #897

Merged
merged 52 commits into from Dec 1, 2022

Conversation

tanghel
Copy link
Contributor

@tanghel tanghel commented Nov 22, 2022

Reasoning

  • Although structurally similar, an NFT of type MetaESDT has much more similarity to a payable token, rather than an NFT
  • what is actually different between a fungible token and a MetaESDT is that every instance of it can carry certain metadata in the form of attributes
  • this is how e.g. LKMEX unlock schedule is encoded or how farming reward positions are stored

Proposed Changes

  • in all token-related endpoints, offer the possibility to load both tokens of type FungibleESDT and MetaESDT
  • in all nft-related endpoints, offer the possibility to not load tokens of type MetaESDT

How to test (mainnet)

  • /tokens?includeMetaESDT=true should return both tokens of type FungibleESDT and MetaESDT
  • /tokens?includeMetaESDT=true&type=MetaESDT should return only tokens of type MetaESDT
  • /tokens/:token should return token details even if type = MetaESDT
  • /tokens/:token/accounts should also return data for token collections of type MetaESDT and will return token identifier & attributes extra compared to a fungible token
  • /tokens/:token/supply should return supply information also for tokens of type MetaESDT. For now, all values are 0 but in the future, when the node saves collection supply, that information will be provided
  • /accounts/:account/tokens?includeMetaESDT=true should return both tokens of type FungibleESDT and MetaESDT from the specified account
    • it should also contain the attributes field in case of MetaESDT
  • /accounts/:account/tokens?includeMetaESDT=true&type=MetaESDT should return only tokens of type MetaESDT from the specified account
  • /accounts/:account/tokens/:token should return account token details also if its type is MetaESDT
  • /collections?excludeMetaESDT=true should return only collections of type NonFungibleESDT and SemiFungibleESDT (without the ones of type MetaESDT)
  • /accounts/:account/roles/collections?excludeMetaESDT=true should return only collections of type NonFungibleESDT and SemiFungibleESDT (without the ones of type MetaESDT) from the specified account
  • /accounts/:account/collections?excludeMetaESDT=true should return only collections of type NonFungibleESDT and SemiFungibleESDT (without the ones of type MetaESDT) from the specified account
  • /accounts/:account/roles/tokens?includeMetaESDT=true should return both tokens of type FungibleESDT and MetaESDT from the specified account
  • /accounts/:account/nfts?excludeMetaESDT=true should return only NFTs of type NonFungibleESDT and SemiFungibleESDT (without the ones of type MetaESDT) from the specified account

@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2022

Codecov Report

Base: 27.84% // Head: 26.93% // Decreases project coverage by -0.90% ⚠️

Coverage data is based on head (b58299f) compared to base (818b63e).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@               Coverage Diff               @@
##           development     #897      +/-   ##
===============================================
- Coverage        27.84%   26.93%   -0.91%     
===============================================
  Files                7        7              
  Lines              237      245       +8     
  Branches             8        8              
===============================================
  Hits                66       66              
- Misses             163      171       +8     
  Partials             8        8              
Flag Coverage Δ
unittests 26.93% <0.00%> (-0.91%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/utils/api.checker.ts 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tanghel tanghel added the feature New feature or request label Nov 23, 2022
@gabrielmatei
Copy link
Contributor

/tokens?withMetaESDT=true&type=MetaESDT should return only tokens of type FungibleESDT - shouldn't it only return MetaESDT tokens?

cfaur09
cfaur09 previously approved these changes Nov 23, 2022
@cfaur09 cfaur09 added the test Create or update unit / integration tests label Nov 23, 2022
cfaur09
cfaur09 previously approved these changes Nov 24, 2022
@tanghel tanghel merged commit a1af978 into development Dec 1, 2022
@tanghel tanghel deleted the SERVICES-918-unified-tokens-and-meta-esd-ts branch December 1, 2022 13:41
@tanghel tanghel restored the SERVICES-918-unified-tokens-and-meta-esd-ts branch December 1, 2022 14:04
@tanghel tanghel deleted the SERVICES-918-unified-tokens-and-meta-esd-ts branch December 1, 2022 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request test Create or update unit / integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants