GithubHelp home page GithubHelp logo

go-btc-api-client's Introduction

GO BTC API CLIENT

Overview

This repository is a client library that encapsulates HTTP requests to a third-party API. It provides a convenient interface for interacting with the API, specifically designed for querying and retrieving information from the Bitcoin blockchain. With this library, developers can easily integrate Bitcoin functionality into their applications by making HTTP requests to the API and accessing a wide range of features, including querying blockchain data, retrieving transaction details, checking account balances, and even sending Bitcoin transactions securely.

Note: This library is currently in an unstable version. Interfaces and types are subject to change as we continue to develop and improve the library.

Requirements

  • Go (Version 1.14 or later recommended)

Installation

 go get github.com/EthanShang8989/go-btc-api-client

Below is a simple example demonstrating how to use btcclient to fetch all transactions in a block:

package main

import (
	"fmt"
	"log"
	"github.com/EthanShang8989/go-btc-api-client/btcclient/esplora"
)

func main() {
	client := esplora.NewClient(btcclient.BlockstreamTestnetURL)
	blockHash := "0000000010942ddf9a42bf4b987867badad7c86bce24d28b2bd5cc459ef64c81"
	transactions, err := client.GetBlockAllTransactions(blockHash)
	if err != nil {
		log.Fatalf("Failed to get transactions: %v", err)
	}
	for _, tx := range transactions {
		fmt.Printf("Transaction ID: %s\n", tx.Txid)
	}
}

Compatibility

Fully compatible with the Blockstream API and partially compatible with the Mempool API. Note that some Mempool API endpoints are not yet supported.

Future Work

We are actively working on expanding the compatibility and functionality of the go-btc-api-client. The planned features include:

  • Full support for all Mempool API endpoints.
  • Support for mainstream third-party api
  • Partial compatibility with btcd types,

Stay tuned for updates and feel free to contribute to these enhancements!

Contributing

Contributions to the go-btc-api-client are welcome. Please feel free to fork the repository, make changes, and submit pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

go-btc-api-client's People

Contributors

ethanshang8989 avatar

Stargazers

 avatar 22388o⚡️  avatar Rsync⚡️  avatar

Watchers

 avatar

Forkers

rsync25 22388o

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.