A Go client generator for Solana programs written using the Anchor framework. This project is a rewrite and enhancement of several existing implementations, including gagliardetto/anchor-go, fragmetric-labs/solana-anchor-go and daog1/solana-anchor-go.
- Extensive support for Anchor IDL specification (most common use cases)
- Improved code generation with better maintainability
- Enhanced type safety and error handling
- Support for uint8 discriminant in instructions
- Support for all Anchor program components:
- Instructions
- Accounts
- Types
- Events
- Errors
- Tuple types
- Constants
# Build the project
$ go build
# Generate Go client from an Anchor IDL
$ ./anchor-go -src=./example/dummy_idl.json -pkg=dummy -dst=./generated/dummyGenerated code will be saved to the specified destination directory (./generated/ in the example above).
All core features have been implemented and are actively maintained:
- Instructions
- Accounts
- Types
- Events
- Errors
- Tuple types
- Constants
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.