btcapi

package
v0.0.0-...-d62eb6d Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainParams

func ChainParams(network string) *chaincfg.Params

func Request

func Request(method, baseURL, subPath string, requestBody io.Reader) ([]byte, error)

Types

type Client

type Client interface {
	GetRawTransaction(txHash *chainhash.Hash) (*wire.MsgTx, error)
	BroadcastTx(tx *wire.MsgTx) (*chainhash.Hash, error)
	ListUnspent(address btcutil.Address) ([]*UnspentOutput, error)
	GetTransactionByID(ID string) (*Transaction, error)
	GetCurrentBlockHash() (int64, error)
	GetRecommendedFees() (*RecommendedFees, error)
}

type RecommendedFees

type RecommendedFees struct {
	FastestFee  int64 `json:"fastestFee"`
	HalfHourFee int64 `json:"halfHourFee"`
	HourFee     int64 `json:"hourFee"`
	EconomyFee  int64 `json:"economyFee"`
	MinimumFee  int64 `json:"minimumFee"`
}

type Transaction

type Transaction struct {
	TxID     string `json:"txid"`
	Version  int64  `json:"version"`
	Locktime int64  `json:"locktime"`
	Size     int64  `json:"size"`
	Weight   int64  `json:"weight"`
	Fee      int64  `json:"fee"`
	Status   struct {
		Confirmed   bool   `json:"confirmed"`
		BlockHeight int64  `json:"block_height"`
		BlockHash   string `json:"block_hash"`
		BlockTime   int64  `json:"block_time"`
	} `json:"status"`
}

type UnspentOutput

type UnspentOutput struct {
	Outpoint *wire.OutPoint
	Output   *wire.TxOut
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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