• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created over 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate Go clients from anchor IDLs for Solana blockchain programs

anchor-go

logo

usage

anchor-go --src=/path/to/idl.json

Generated Code will be generated and saved to ./generated/.

TODO

  • instructions
  • accounts
  • types
  • events
  • errors
  • handle tuple types
  • constants

Future Development

anchor-go is exclusively supported by my own time (which is money).

If my work has been useful in building your for-profit services/infra/bots/etc., consider donating at DkP56dVfmTTN58oy6hDpRLtw4RMEFMmEWs8umN3Kg8vp

Thanks!

what is anchor-go?

anchor-go generates Go clients for Solana programs (smart contracts) written using the anchor framework.

what is anchor?

Link: https://github.com/project-serum/anchor

Anchor is a framework for Solana's Sealevel runtime providing several convenient developer tools for writing smart contracts.

I have an anchor program; how do I generate a Go client for it? (step by step)

example 1: metaplex nft candy machine

git clone https://github.com/metaplex-foundation/metaplex-program-library.git
cd metaplex-program-library
anchor idl parse -f candy-machine/program/src/lib.rs -o nft_candy_machine_v2.json
anchor-go --src=nft_candy_machine_v2.json

Note

  • anchor-go is in active development, so all APIs are subject to change.
  • This code is unaudited. Use at your own risk.

More Repositories

1

solana-go

Go SDK library and RPC client for the Solana Blockchain
Go
794
star
2

metaplex-go

Go clients for the Metaplex Solana programs
Go
37
star
3

codebox

Generate CodeQL taint-tracking models for Go (along with tests) in a graphical UI
JavaScript
20
star
4

binary

Encoding/decoding in Borsh and other formats.
Go
18
star
5

codemill

CodeQL model generation for Go.
Go
17
star
6

lgtm-cli

*Unofficial* lgtm.com CLI — Use at your own risk. Also don't add more than 3K projects to "My projects" list.
Go
13
star
7

marginfi-go

Golang client for the Marginfi protocol on Solana
9
star
8

serum-go

⚠️🚨⚠️🚨⚠️🚨⚠️🚨 EXPERIMENTAL Golang client for Serum Dex program (Solana)⚠️🚨⚠️🚨⚠️🚨
Go
8
star
9

cqlgen

cqlgen is a code generator for GitHub's CodeQL. WARNING: this is a WIP.
Go
6
star
10

go-dns-trees

A Tool for DNS Delegation Trust Graphing
Go
6
star
11

jupag-go

Golang client for the Jupiter Aggregator protocol on Solana
4
star
12

RethinkDB-Golang-dashboard

An example app which uses Golang and RethinkDB as backend for a real-time dashboard; written in JS, HTML and Golang
Go
4
star
13

solana-meta-snap-15oct2021

1M off-chain JSON metadata of Solana NFTs
2
star
14

dialect-go

Golang client for the Dialect protocol on Solana
Go
2
star
15

email-hunter-go

A tiny Go wrapper around Email Hunter API
Go
1
star
16

ramdiskbuffer

Go
1
star
17

ip-to-asn

Go
1
star
18

utilz

Go
1
star
19

gcv-go

Golang wrapper for Google Cloud Vision API
Go
1
star
20

solana-tx-meta-parser-generators

Generate parsers for the earlier Solana transaction metadata formats (pre-protobufs)
Go
1
star
21

depnet

Github Dependency Network CLI
Go
1
star
22

fees.solar-ui

Home of https://fees.solar
HTML
1
star
23

golang-bears

Recreating (part of) python pandas functionality in Golang, while taking https://www.udacity.com/course/machine-learning-for-trading--ud501
Go
1
star