You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A limitation right now is that IDL type definitions are only generated for structs that live in the top-level of a Solana program.
It is possible to circumvent this limitation by having the Anchor CLI 1) run 'cargo doc' on a Solana program, and 2) recursively walk through the generated HTML documentation to generate IDL type definitions off of structs that are referenced in the program's fields/declarations/instructions which derive BorshSerialize/BorshDeserialize.
The only workaround right now for this is to duplicate the definitions of structs from imported crates and transmute the memory of instantiated versions of the duplicate structs when they need to be passed to external functions.
There is an option for 'cargo doc' as well to output JSON, though it requires Rust nightly which would not be ideal.
The text was updated successfully, but these errors were encountered:
A limitation right now is that IDL type definitions are only generated for structs that live in the top-level of a Solana program.
It is possible to circumvent this limitation by having the Anchor CLI 1) run 'cargo doc' on a Solana program, and 2) recursively walk through the generated HTML documentation to generate IDL type definitions off of structs that are referenced in the program's fields/declarations/instructions which derive BorshSerialize/BorshDeserialize.
The only workaround right now for this is to duplicate the definitions of structs from imported crates and transmute the memory of instantiated versions of the duplicate structs when they need to be passed to external functions.
There is an option for 'cargo doc' as well to output JSON, though it requires Rust nightly which would not be ideal.
The text was updated successfully, but these errors were encountered: