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

Add qxListAssets or similar to list all assets #109

Open
nnz-qubic opened this issue May 14, 2024 · 1 comment
Open

Add qxListAssets or similar to list all assets #109

nnz-qubic opened this issue May 14, 2024 · 1 comment

Comments

@nnz-qubic
Copy link

Hi,

playing around I noticed that to get Qx bid/asks for an asset one needs to specify the asset name and issuer. That's because apparently it's possible to have multiple assets with the same name (CfB).

While for SC it's easy as the issuer is always the all-A (AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFXIB), getting the issuer of an asset is more complicated (*). Furthermore, with more and more Tokens being created it will be hard to keep track of which assets exist, and most probably we don't want UI/tool developers to maintain an hard-coded list of assets and their issuers.

It would be great therefore to have a way of asking nodes for a list of all existing assets, SC and tokens. Opening this issue as of CfB advice.

I haven't found where this data can be found in memory yet, but judging from the other Qx calls the implementation could be something like:

struct Assets_input
{
    uint64 offset;
};

struct Assets_output
{
    struct Asset
    {
        id issuer;
        uint64 assetName;
     };

     array<Asset, 256> assets;
};

struct Assets_locals
{
    // ...
};

PUBLIC_FUNCTION_WITH_LOCALS(Assets)
   // ...
_

This assuming is a Qx function/responsibility. It could also be just a core network message. Especially dubious after readong #102 ... Again, I'm not sure where this info is in memory yet, I'll investigate more and if able I may try and provide a PR.

(*) I haven't found a way to do it yet

@Qsilver97
Copy link
Contributor

Qsilver97 commented Jun 8, 2024

You need to iterate through the universe file!
There are entries for asset creation mixed in with all the transfers

To be able to get a realtime list a new core data structure is needed, TokenList I will make an issue out of that to explain in more detail and the advantages it provides

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

No branches or pull requests

2 participants