bs

package
v0.0.0-...-3f76438 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package bs will be CLI to access to blockstream TestNet3

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tx

type Tx struct {
	TxID     string   `json:"txid"`
	Version  int      `json:"version"`
	LockTime int      `json:"locktime"`
	Vin      []Vin    `json:"vin"`
	Vout     []Vout   `json:"vout"`
	Fee      uint64   `json:"fee"`
	Status   TxStatus `json:"status"`
}

Tx expresses transactions in blockstream responses.

func GetTx

func GetTx(txid string) (*Tx, error)

GetTx retrieves transaction data associated with the given transaction ID.

type TxStatus

type TxStatus struct {
	Confirmed   bool   `json:"confirmed"`
	BlockHeight int64  `json:"block_height"`
	BlockHash   string `json:"block_hash"`
	BlockTime   uint64 `json:"block_time"`
}

TxStatus expresses the status of the transaction.

type UTXO

type UTXO struct {
	TxID   string   `json:"txid"`
	Idx    uint32   `json:"vout"`
	Status TxStatus `json:"status"`
	Value  uint64   `json:"value"`
}

UTXO expresses an unspent transaction output.

func GetUTXO

func GetUTXO(a string) ([]UTXO, error)

GetUTXO retrieves a list of UTXO of the given address.

type Vin

type Vin struct {
	TxID       string `json:"txid"`
	Vout       uint32 `json:"vout"`
	PrevOut    Vout   `json:"prevout"`
	IsCoinbase bool   `json:"is_coinbase"`
	Sequence   uint64 `json:"sequence"`
}

Vin expresses vin item in blockstream responses.

type VinSummary

type VinSummary struct {
	TxID         string `json:"txid"`
	Vout         uint32 `json:"vout"`
	ScriptPubKey string `json:"scriptpubkey"`
	Value        uint64 `json:"value"`
}

VinSummary expresses a summary of Vin.

func GetUTXOWithScriptPubKey

func GetUTXOWithScriptPubKey(a string) ([]VinSummary, error)

GetUTXOWithScriptPubKey returns a list of summary of UTXO with ScriptPubKey.

type Vout

type Vout struct {
	ScriptPubKey        string `json:"scriptpubkey"`
	ScriptPubKeyAddress string `json:"scriptpubkey_address"`
	Value               uint64 `json:"value"`
}

Vout expresses vout item in blockstream responses.

Jump to

Keyboard shortcuts

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