Skip to content
Unofficial golang implementation for the WhatsOnChain API
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
.codacy.yml
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
CODE_STANDARDS.md
CONTRIBUTING.md
LICENSE
README.md
addresses.go
addresses_test.go
blocks.go
blocks_test.go
chain_info.go
chain_info_test.go
circulating_supply.go
circulating_supply_test.go
client.go
definitions.go
go.mod
go.sum
health.go
health_test.go
transactions.go
transactions_test.go
whatsonchain.go
whatsonchain_test.go

README.md

go-whatsonchain

go-whatsonchain is the unofficial golang implementation for the whatsonchain.com API

Go Build Status Report Codacy Badge Release standard-readme compliant GoDoc

Table of Contents

Installation

go-whatsonchain requires a supported release of Go.

$ go get -u github.com/mrz1836/go-whatsonchain

Documentation

You can view the generated documentation here.

Features

  • Client is completely configurable
  • Customize the network per request (main, test or stn)
  • Using heimdall http client with exponential backoff & more
  • Current coverage for the whatsonchain.com API
    • Health
    • Chain Info
    • Circulating Supply
    • Blocks
    • Transactions
    • Addresses
    • Receipt
    • Statement
    • Mempool
    • Search

Examples & Tests

All unit tests and examples run via Travis CI and uses Go version 1.13.x. View the deployment configuration file.

Run all tests (including integration tests)

$ cd ../go-whatsonchain
$ go test ./... -v

Run tests (excluding integration tests)

$ cd ../go-whatsonchain
$ go test ./... -v -test.short

Benchmarks

Run the Go benchmarks:

$ cd ../go-whatsonchain
$ go test -bench . -benchmem

Code Standards

Read more about this Go project's code standards.

Usage

Basic implementation:

package main

import (
	"fmt"
	"github.com/mrz1836/go-whatsonchain"
)

func main() {

    // Create a client
    client, _ := whatsonchain.NewClient(whatsonchain.NetworkMain, nil)

    // Get a balance for an address
    balance, _ := client.AddressBalance("16ZqP5Tb22KJuvSAbjNkoiZs13mmRmexZA")
    fmt.Println("confirmed balance", balance.Confirmed)
}

Maintainers

MrZ
MrZ

Contributing

View the contributing guidelines and follow the code of conduct.

Support the development of this project 🙏 and support WhatsOnChain

Donate Support

Credits

WhatsOnChain for their hard work on the Whatsonchain API

AustEcon's Python Version

License

License

You can’t perform that action at this time.