-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(pop-api): expose read functions to obtain asset details #379
Comments
From an API perspective, it would be great if I could specify the attributes (bitflags) I want in a single call. I guess the only strongly typed return type would be a vector of enum variants though. |
I propose expanding the pop-api::fungibles read functionality by adding methods to retrieve asset roles, minimum balance requirements, and sufficiency status. |
@al3mart Could you expand a bit on these two please ? I cant quite understand what needs to be done
|
Ale is off for a few days so thought I might try to answer your question. The fungibles pallet wraps the assets pallet from the SDK to provide a stable interface for contracts which is standards compliant and hopefully easier to use for smart contract devs. We have various read functions (example), so that a contract can query certain state of a fungible token as required. The current read functions available do not surface all of the useful state to contracts, as indicated by Ale. It would therefore be great to add a few additional read functions for those attributes on https://github.com/paritytech/polkadot-sdk/blob/b71bd53f5fde0624c828461432a6b0f223c585c2/substrate/frame/assets/src/types.rs#L52 which are useful. Ale named roles, min balance and sufficiency. The existing implementation can be replicated for the additional ones added. Note that exposing such reads from the fungibles pallets will also require corresponding benchmarks (example) Finally, at least from my perspective, it would be useful to improve the API so that a contract can specify multiple attributes to be queried in a single call, but this should probably be dealt with in a separate issue to keep the scope here limited. |
Awesome thx for the explanations and the links ! |
@Krayt78 Yes sure |
@soloking1412 / @Krayt78 are you working on this? |
@mittal-parth Can I start working on this ? |
Sure go ahead, if you are doing so |
Ok , can you say like after I make changes how to submit ? |
You can make a PR by following this guide from GitHub You can check this link for a general guide to contribute to any open source project. |
Right now we expose certain read functions so that contracts integrating
pop-api::fungibles
can read:It would be great expanding the read capabilities such that a contract can obtain the following asset details:
The text was updated successfully, but these errors were encountered: