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

NFT and Collection need a static "fromConsolidated" method #38

Open
Swader opened this issue Mar 20, 2021 · 1 comment
Open

NFT and Collection need a static "fromConsolidated" method #38

Swader opened this issue Mar 20, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@Swader
Copy link
Contributor

Swader commented Mar 20, 2021

A conoslidated NFT looks like this:

image

It contains all the information of what happened to it. If we build a fromConsolidated static call into Collection and NFT, we can have an instance of such an entity which is up to date with the recent state of the world, without having to reconsolidate against the entire set.

Normal instantiation does not keep track of changes and has no idea what happened to an entity since genesis, so needs full reconsolidation. But with changelogs being included by default alongside every consolidated entity, we have an advantage in that we can rebuild that corner of the entity's world accurately and as up to date as the consolidated set we're fetching from is.

This then lets us easily call child functions like list, emote, changeissuer etc on the instantiated up-to-date entity.

@Swader Swader added the enhancement New feature or request label Mar 20, 2021
@Swader
Copy link
Contributor Author

Swader commented Mar 20, 2021

Another example of why this is useful:

const n = new NFT( ...);
n.list(...) // ok?

vs

const n = NFT.fromConsolidated(nft);
n.list(...) // Can't list if you're not the owner!! < --- CAN DO CHECKS live, without full set to read from

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

No branches or pull requests

1 participant