Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

Anchor IDL Parser

This is a parser for Solana programs compiled with Anchor using IDL.

Install

go get github.com/heroims/anchor-idl-parser-go

Usage

import (
	aip "github.com/heroims/anchor-idl-parser-go"
)

func main() {
    // Create Parser
    ammIdlParser, err := aip.NewParserWithPath("path/to/amm_idl.json")
    ammIdlParser, err := aip.NewParserWithJson("{\"json\": \"data\"}")

    if err == nil {
        // Parse instruction (support cpi log)
        insInfo, insErr := ammIdlParser.InstructionParse(instructionData)

        // Parse account
        accountInfo, accErr := ammIdlParser.AccountsParse(accountData)

        // Parse log
        eventInfo, eventErr := ammIdlParser.EventDataParse(logString)
    }
}

References

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages