Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.2 KB

File metadata and controls

48 lines (37 loc) · 1.2 KB

nmcjson

nmcjson extends the btcjson package with Namecoin-specific JSON-RPC commands.

Examples

        // Register nmcjson commands with btcjson
        nmcjson.Init()
        id := 1
        // Create the command
        nameListCmd, err := nmcjson.NewNameListCmd(id)
        if err != nil {
            panic("Something wrong")
        }
        // Send the command and get a reply
        nameListReply, err := btcjson.RpcSend(myName, myPass, myURL, nameListCmd)
        if err != nil {
            panic("Something wrong")
        }
        // Print the reply
        if nameListReply.Result != nil {
            if info, ok := nameListReply.Result.([]nmcjson.NameListResult); ok {
                for _, v := range info {
                    fmt.Printf("Name: %v\n", v.Name)
                }
            }
        }

Documentation

Full go doc style documentation can be viewed online using the GoDoc site here.

Installation

$ go get github.com/kefkius/nmcjson

TODO

  • Unit tests

License

nmcjson is licensed under the liberal ISC License, the same license btcjson is licensed under.