Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lnsp/npapi

Lightweight Go wrapper for the Nanopool Ethereum API.
https://github.com/lnsp/npapi

ethereum go nanopool nanopool-ethereum-api wrapper

Last synced: 17 days ago
JSON representation

Lightweight Go wrapper for the Nanopool Ethereum API.

Awesome Lists containing this project

README

        

# npapi [![GoDoc](https://godoc.org/github.com/lnsp/npapi?status.svg)](https://godoc.org/github.com/lnsp/npapi)

A lightweight Go wrapper for the Nanopool Ethereum API.

## Example
```go
package main

import (
"fmt"
"github.com/lnsp/npapi"
)

func main() {
if len(os.Args) != 2 {
fmt.Fprintln(os.Stderr, "USAGE: go run main.go [nanopool account address]")
return
}
balance, err := npapi.Balance(os.Args[1])
if err != nil {
fmt.Fprintf(os.Stderr, "failed to fetch balance: %v\n", err)
return
}
fmt.Printf("You have earned %.6f ETH.\n", balance)
}
```