Skip to content

Alivers/anchor-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anchor-go

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.

Features

  • 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

Idl Spec

Anchor Idl Spec

Usage

# Build the project
$ go build

# Generate Go client from an Anchor IDL
$ ./anchor-go -src=./example/dummy_idl.json -pkg=dummy -dst=./generated/dummy

Generated code will be saved to the specified destination directory (./generated/ in the example above).

Development Status

All core features have been implemented and are actively maintained:

  • Instructions
  • Accounts
  • Types
  • Events
  • Errors
  • Tuple types
  • Constants

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages