Skip to content
/ npapi Public

Lightweight Go wrapper for the Nanopool Ethereum API.

License

Notifications You must be signed in to change notification settings

lnsp/npapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npapi GoDoc

A lightweight Go wrapper for the Nanopool Ethereum API.

Example

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)
}