insight

package
v0.0.0-...-772481a Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNotEnoughBalance = "16: bad-txns-vout-negative. Code:-26"

type errorBroadcast string

View Source
const ErrNotEnoughFee = "66: insufficient priority. Code:-26"
View Source
const ErrTransactionTooSmall = "64: dust. Code:-26"
View Source
const ErrTxDecodeFailed = "Something seems wrong: TX decode failed. Code:-2"

Variables

This section is empty.

Functions

func BroadcastTransaction

func BroadcastTransaction(asset bcoins.Coin, tx bcoins.Transaction) (insightjson.Txid, bcoins.Transaction, error)

broadcast a signed transaction to the blockexplorer. the transaction will either be denied or rejected by the network

func GetInsightExplorer

func GetInsightExplorer(symbol string) (bcoins.Insight, error)

Types

type UTXO

type UTXO struct {
	Hash      *chainhash.Hash
	TxIndex   uint32
	Amount    int64
	Spendable bool
	PKScript  []byte
}

func GetMinimalRequiredUTXO

func GetMinimalRequiredUTXO(requiredAmount int64, sourceUTXOs []*UTXO) []*UTXO

take in requiredAmount in satoshi. This is how much we want to spend however we don't want to use all utxo's we have on our address only the minimal utxo's combined is what we want so the transaction becomes smaller in bytes the smaller the transaction, the less fees is required

func GetUnspentOutputs

func GetUnspentOutputs(publicKey string, coin *bcoins.Coin) []*UTXO

Jump to

Keyboard shortcuts

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