A lightweight Go wrapper for the Nanopool Ethereum API.
package main
import (
"fmt""github.com/lnsp/npapi"
)
funcmain() {
iflen(os.Args) !=2 {
fmt.Fprintln(os.Stderr, "USAGE: go run main.go [nanopool account address]")
return
}
balance, err:=npapi.Balance(os.Args[1])
iferr!=nil {
fmt.Fprintf(os.Stderr, "failed to fetch balance: %v\n", err)
return
}
fmt.Printf("You have earned %.6f ETH.\n", balance)
}