walletwatch

package module
v0.0.0-...-db008cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2017 License: MIT Imports: 8 Imported by: 0

README

WalletWatch

A simple HTTP interface to the bitcoind ZeroMQ socket, providing push notifications of when zero-confirmation transactions involve one or more Bitcoin addresses enter the mempool.

$ curl http://localhost:8080/btc/address/1Kr6QSydW9bFQG1mXiPNNu6WpJGmUa9i1g?limit=1
{"hash":"d0a3daa38e28f2112740568f9827e072d661ce20a5bb890d515087901d44d711","outputs":{"R1Kr6QSydW9bFQG1mXiPNNu6WpJGmUa9i1g":146034487529}}

More cryptocurrencies will be added soon!

Status: Pre-Alpha

Requirements

Run bitcoind somewhere with the -zmqpubrawtx=tcp://127.0.0.1:1337 option.

Linux

apt-get install libzmq-dev libsodium-dev

Mac

brew install zeromq --with-libsodium

TODO

  • Server-Sent Events (SSE) output
  • Bitcoin SegWit
  • xpub watching
  • Bitcoin P2P integration for >0 confirmation checking
  • Ethereum
  • Ethereum tokens

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitcoinTx

type BitcoinTx struct {
	// contains filtered or unexported fields
}

func DecodeBitcoinTx

func DecodeBitcoinTx(data []byte) (*BitcoinTx, error)

func (*BitcoinTx) Hash

func (t *BitcoinTx) Hash() string

func (*BitcoinTx) MarshalJSON

func (t *BitcoinTx) MarshalJSON() ([]byte, error)

func (*BitcoinTx) Network

func (t *BitcoinTx) Network() CoinNetwork

func (*BitcoinTx) Outputs

func (t *BitcoinTx) Outputs() map[string]int

type Broker

type Broker struct {
	IncomingTx     chan Transaction
	NewClients     chan BrokerClientConfig
	ClosingClients chan BrokerClientConfig
	// contains filtered or unexported fields
}

func NewBroker

func NewBroker() *Broker

func (*Broker) Id

func (t *Broker) Id() uint64

func (*Broker) Start

func (t *Broker) Start()

type BrokerClientConfig

type BrokerClientConfig struct {
	Id        uint64
	Ch        chan Transaction
	Addresses map[string]bool
}

type CoinNetwork

type CoinNetwork int
const (
	BitcoinMainNet CoinNetwork = iota
)

type Transaction

type Transaction interface {
	// The blockchain network this transaction took place on
	Network() CoinNetwork

	// The network-unique identifier for this transaction
	Hash() string

	// The outputs involved in the transaction
	Outputs() map[string]int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL