Unified Tokens & MetaESDTs
Reasoning
- Although structurally similar, an NFT of type
MetaESDThas 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
FungibleESDTandMetaESDT - in all nft-related endpoints, offer the possibility to not load tokens of type
MetaESDT
How to test (mainnet)
-
/tokens?includeMetaESDT=trueshould return both tokens of typeFungibleESDTandMetaESDT -
/tokens?includeMetaESDT=true&type=MetaESDTshould return only tokens of typeMetaESDT -
/tokens/:tokenshould return token details even if type =MetaESDT -
/tokens/:token/accountsshould also return data for token collections of typeMetaESDTand will return token identifier & attributes extra compared to a fungible token -
/tokens/:token/supplyshould return supply information also for tokens of typeMetaESDT. 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=trueshould return both tokens of typeFungibleESDTandMetaESDTfrom the specified account- it should also contain the
attributesfield in case ofMetaESDT
- it should also contain the
-
/accounts/:account/tokens?includeMetaESDT=true&type=MetaESDTshould return only tokens of typeMetaESDTfrom the specified account -
/accounts/:account/tokens/:tokenshould return account token details also if its type isMetaESDT -
/collections?excludeMetaESDT=trueshould return only collections of typeNonFungibleESDTandSemiFungibleESDT(without the ones of typeMetaESDT) -
/accounts/:account/roles/collections?excludeMetaESDT=trueshould return only collections of typeNonFungibleESDTandSemiFungibleESDT(without the ones of typeMetaESDT) from the specified account -
/accounts/:account/collections?excludeMetaESDT=trueshould return only collections of typeNonFungibleESDTandSemiFungibleESDT(without the ones of typeMetaESDT) from the specified account -
/accounts/:account/roles/tokens?includeMetaESDT=trueshould return both tokens of typeFungibleESDTandMetaESDTfrom the specified account -
/accounts/:account/nfts?excludeMetaESDT=trueshould return only NFTs of typeNonFungibleESDTandSemiFungibleESDT(without the ones of typeMetaESDT) from the specified account
Codecov Report
Base: 27.84% // Head: 26.93% // Decreases project coverage by -0.90% :warning:
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%) |
:arrow_down: |
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.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
/tokens?withMetaESDT=true&type=MetaESDT should return only tokens of type FungibleESDT - shouldn't it only return MetaESDT tokens?
/tokens?withMetaESDT=true&type=MetaESDT should return only tokens of type FungibleESDT- shouldn't it only returnMetaESDTtokens?
Indeed, there was a problem in the PR description. Should be good now