-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Suggestion for IDL format #3092
Comments
This was something I was going to add to the new IDL spec, but then decided it didn't add enough value due to the fact that an account's type can be inferred from its on-chain data and its discriminator.
When you have an instruction and access to an RPC endpoint, the IDL stores enough information to derive the account's type. We strive to avoid storing anything that can be derived by clients to keep the IDL as small as possible.
Changing the IDL spec in order to "potentially enable AI to automatically build UI for on-chain program" doesn't make sense to me. |
The
In the current format, there is no way I can refer that the Using RDBMS as analogy, the existing idl only store the column type, without storing the foreign key ~ in my case, the I believe this improvement in Thanks! |
Motivation
The idl is missing some of the information from the code.
For example in this image:
The relation among the Bag account and Community & MemberInfo account is not shown in the idl while in fact sometimes they are attached to each other.
and the
and in the instruction code:
Why stating this relation matters?
While data in blockchain is public, but without easily accessible mean to understand the data structure then the benefit of publicing data become less. Stating this relation make it much easier to visualise the relations among PDAs, how the program works and potentially enable AI to automatically build UI for on-chain program.
Solution
Enable developers to add
ref
in the idl. The reference can be a account name within the current idl or another program's account type.Reference within the idl
Example for the data type:
Reference outside of the idl
Example for the data type:
Discussion
account
ortype
is the one of interest?The text was updated successfully, but these errors were encountered: