Skip to content

tyzbit/btcapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

btcapi

Go wrapper around the btc-rpc-explorer API

Compatible API Versions

This is compatible with API version v1.1.0. It may be backwards compatible but if you have issues, consider upgrading your BTC-RPC-Explorer API (or find a newer version to use as a backend)

Usage Example

package main

import (
    "fmt"
    "os"

    "github.com/tyzbit/btcapi"
)

func main() {
    address := "34rng4QwB5pHUbGDJw1JxjLwgEU8TQuEqv"
    btc := btcapi.Config{
        ExplorerURL: "https://btc-rpc-explorer.example.com",
    }
    summary, err := btc.AddressSummary(address)
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
    fmt.Println("the balance of ", address, " is ", summary.TXHistory.BalanceSat, " satoshis")
}

About

Go wrapper around the btc-rpc-explorer API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages