Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alfg/blockchain
:moneybag: Go (golang) Client for the Blockchain.info API
https://github.com/alfg/blockchain
bitcoin blockchain go
Last synced: 8 days ago
JSON representation
:moneybag: Go (golang) Client for the Blockchain.info API
- Host: GitHub
- URL: https://github.com/alfg/blockchain
- Owner: alfg
- License: mit
- Created: 2014-12-23T06:39:51.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-04T07:14:11.000Z (over 7 years ago)
- Last Synced: 2024-06-18T23:16:52.066Z (5 months ago)
- Topics: bitcoin, blockchain, go
- Language: Go
- Homepage: https://godoc.org/github.com/alfg/blockchain
- Size: 6.84 KB
- Stars: 45
- Watchers: 6
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
blockchain
==========[![Build Status](https://travis-ci.org/alfg/blockchain.svg?branch=master)](https://travis-ci.org/alfg/blockchain)
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
```go
package mainimport (
"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