-
Notifications
You must be signed in to change notification settings - Fork 22
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
Possible to support multiple programs with inter-dependencies? #52
Comments
It's not a dumb question. Anchor has some limitations when it comes to generating IDL definitions for types imported from external modules and I don't think this kind of use-case is fully supported within Anchor IDL generation itself - i.e. IIRC Anchor will generate "incomplete" IDLs e.g. for the admin program where the IDL will reference types which are not included within it. So this is something that is currently not supported from Anchor and has been descussed here coral-xyz/anchor#1972. I've also proposed a way support for this could be added for Anchor coral-xyz/anchor#2011. I haven't tested anchor-client-gen for your specific setup, but what I would assume would happen is that the client generation would fail for |
Ahh thanks for the links those are what I was looking for. And yea the IDL generation fails because not all the types are there...expected. I was able to temporarily work around by just removing the Type-Defined parameters, and go back to the raw primitives. Not ideal but I'm unblocked for now. I've got all the program business logic centralized right now but it's becoming monolithic so I'm trying to break it out into smaller programs with extra CPI calls. Thanks for the info and appreciate your work on this project, it's been extremely helpful! |
Apologies if this is a dumb question, let's say I have a project with a few programs:
where the
accounts
,structs
,enums
, etc are defined in themain
program, and referenced as a dependency in the other two. Anchor creates three IDL's. Is it possible to generate a client (or three different clients?) from this structure? Right now I don't think it's possible to expose the structs cross-program.The text was updated successfully, but these errors were encountered: