Comments (2)
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!
from anchor-client-gen.
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 programs/admin
and programs/pools
due to missing type definitions in the IDL (and possibly other missing things).
As a workaround I can suggest manually creating an IDL which contain all the necessary definitions for each of the programs and then running anchor-client-gen using that. Either that or just combine these programs into one if possible.
from anchor-client-gen.
Related Issues (19)
- Awesome project
- Empty "/types/index.ts" HOT 3
- fetchMultiple support
- Simplifying client facing API by removing `connection` parameter HOT 2
- Better errors in the generated clients
- Event parsing support
- using Box<MyType> for instruction arguments should be handled transparently HOT 4
- `kind` of typescript union members should be static HOT 2
- How to pass additional `remaining accounts`? HOT 2
- Support Uint8Array when applicable HOT 8
- noImplicitAny violations in generated code HOT 1
- Pass programID as argument rather than saving it in a file HOT 21
- Generated client and type-check
- Enums don't use the correct discriminator when not in order HOT 1
- Arrays for zero_copy accounts are read incorrectly, it's getting the endian wrong I think
- Yarn install fails on the specified anchor-cli version in package.json HOT 1
- Generate types for events
- Method to fetch all accounts of given type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anchor-client-gen.