chain

package
v0.0.0-...-89d61c9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package chain contains implementation of the chain interface communicating with [Block Cypher API](https://www.blockcypher.com/dev/bitcoin/).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BTC

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

func Connect

func Connect(config *Config) (*BTC, error)

Connect performs initialization for communication with Block Cypher based on provided config.

func (*BTC) PublishTransaction

func (b *BTC) PublishTransaction(rawTransaction []byte) (string, error)

PublishTransaction sends a raw transaction to Block Cypher's API. It returns a transaction hash as a hexadecimal string.

type Config

type Config struct {
	// Token is Block Cypher's user token required for access to POST and DELETE
	// calls on the API.
	Token string
	Coin  string // Options: "btc", "bcy", "ltc", "doge"
	Chain string // Options: "main", "test3", "test"
}

Config contains configuration for Block Cypher API.

Jump to

Keyboard shortcuts

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