Adding information to IDL which is useful for code generators.
Added Instruction Info
instruction discriminant includes type as well as value so code generators know how to
de/serialize it
Added Metadata
metadata is now stronly typed to include exactly the info we need
program address is parsed out by looking for declare_id macro and it is configurable if it
should fail if none or more than one are found or not
origin shank is included in order for code generators to treat the IDL a bit differently,
i.e. anchor doesn't include an instruction discriminant info, but assumes it to be derived
from the instruction name
Code Render Improvements
all field names are now lower camel case i.e. fieldName
instruction arg names are now only derived from the arg type if it is a custom type,
otherwise it is named instructionArgs
Considered but not included
Thought about flattening instruction args if it is a custom struct, i.e. inlining its fields.
However I saw a few cases where types for instruction args are reused and such it would result
in code repetition + if wrappers around an arg type are created that would make it more
difficult.
Adding information to IDL which is useful for code generators.
Added Instruction Info
instruction discriminant includes type as well as value so code generators know how to de/serialize it
Added Metadata
metadata is now stronly typed to include exactly the info we need
program address is parsed out by looking for
declare_id
macro and it is configurable if it should fail if none or more than one are found or notorigin
shank
is included in order for code generators to treat the IDL a bit differently, i.e.anchor
doesn't include an instruction discriminant info, but assumes it to be derived from the instruction nameCode Render Improvements
fieldName
instructionArgs
Considered but not included
Thought about flattening instruction args if it is a custom struct, i.e. inlining its fields. However I saw a few cases where types for instruction args are reused and such it would result in code repetition + if wrappers around an arg type are created that would make it more difficult.