aydinnyunus / blockchain

:moneybag: Go (golang) Client for the Blockchain.info API

Home Page:https://godoc.org/github.com/alfg/blockchain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

blockchain

Build Status

Go Client for the Blockchain Data API https://blockchain.info/api/blockchain_api

Documentation: https://godoc.org/github.com/alfg/blockchain

Installation

go get github.com/alfg/blockchain

Example

package main

import (
  "github.com/alfg/blockchain"
  "fmt"
)

func main() {

	c, e := blockchain.New()
	resp, e := c.GetAddress("162FjqU7RYdojnejCDe6zrPDUpaLcv9Hhq")
	if e != nil {
		fmt.Print(e)
	}

	fmt.Println(resp.Hash160)
	fmt.Println(resp.Address)
	fmt.Println(resp.NTx)
	fmt.Println(resp.TotalReceived)
	fmt.Println(resp.TotalSent)
	fmt.Println(resp.FinalBalance)

	for i := range resp.Txs {
		fmt.Println(resp.Txs[i].Result)

		for j := range resp.Txs[i].Inputs {
			fmt.Println(resp.Txs[i].Inputs[j].Sequence)
			fmt.Println(resp.Txs[i].Inputs[j].PrevOut.Spent)
		}
	}

}

License

MIT

About

:moneybag: Go (golang) Client for the Blockchain.info API

https://godoc.org/github.com/alfg/blockchain

License:MIT License


Languages

Language:Go 100.0%