Code Monkey home page Code Monkey logo

Comments (2)

0xBraunGuy avatar 0xBraunGuy commented on August 12, 2024 1

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.

kklas avatar kklas commented on August 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.