blockcypher

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package blockcypher defines primitives to work with the BlockCypher API.

Index

Constants

View Source
const (
	// Component name for monitoring.
	Component = "btc"
)

Variables

This section is empty.

Functions

func RetryWithBackOff added in v0.3.1

func RetryWithBackOff(ctx context.Context, call func() error) (err error)

RetryWithBackOff will retry the given call with an exponential backoff.

Types

type Client

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

Client is a BlockCypher API client.

func New

func New(c *Config) *Client

New creates a client for a Bitcoin network, using an optional BlockCypher API key.

func (*Client) Broadcast

func (c *Client) Broadcast(ctx context.Context, raw []byte) error

Broadcast implements github.com/stratumn/go-core/blockchain/btc.Broadcaster.Broadcast.

func (*Client) FindUnspent

func (c *Client) FindUnspent(ctx context.Context, address *types.ReversedBytes20, amount int64) (res btc.UnspentResult, err error)

FindUnspent implements github.com/stratumn/go-core/blockchain/btc.UnspentFinder.FindUnspent.

type Config

type Config struct {
	// Network is the Bitcoin network.
	Network btc.Network

	// APIKey is an optional BlockCypher API key.
	// It prevents your requests from being throttled.
	APIKey string
}

Config contains configuration options for the client.

Jump to

Keyboard shortcuts

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