orca-so / orca-sdks

Open-sourced typescript SDKs for Orca
MIT License
43 stars 10 forks source link

Add TokenRepository for managing a local instance of mints #51

Closed terranmoccasin closed 11 months ago

terranmoccasin commented 11 months ago

https://app.asana.com/0/1204730191677489/1204910648740839/f

Adds a TokenRepository class to manage a local collection of mints. The class also provides methods to tag mints with strings, and also retrieve token metadata and tags.

Mintlists are a simple collection of mints, and business logic is not encapsulated in the mintlist struct. Applications can use TokenRepository to combine multiple mintlists and also apply business logic via tags.

For example, after retrieving the "Orca Extended List", which represents tokens that do not need a token warning in the UI, these mints can be added to the repository and tagged with "whitelisted". The UI component can then retrieve all tokens using getAll(), and it can use the "whitelisted" tag to properly render the mints.