command

package
v0.0.0-...-f5274a0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeVINs

func EncodeVINs(txins []*wire.TxIn) interface{}

Types

type BlockHeader

type BlockHeader struct {
	Header *wire.BlockHeader
	Height int32
	NumTxs int64
}

type Coinbase

type Coinbase struct {
	Coinbase    string   `json:"coinbase"`
	TxInWitness []string `json:"txinwitness"`
	Sequence    uint32   `json:"sequence"`
}

type Command

type Command interface {
	Name() string
	Query(str Storage, params []interface{}) (interface{}, error)
}

func GetBestBlockHash

func GetBestBlockHash() Command

func GetBlock

func GetBlock() Command

func GetBlockCount

func GetBlockCount() Command

func GetBlockHash

func GetBlockHash() Command

func GetBlockHeader

func GetBlockHeader() Command

func GetRawTransaction

func GetRawTransaction() Command

func ListUnspent

func ListUnspent() Command

type ListUnspentQueryOptions

type ListUnspentQueryOptions struct {
	MinimumAmount    int64
	MaximumAmount    int64
	MaximumCount     uint32
	MinimumSumAmount int64
}

type ListUnspentQueryOptionsReq

type ListUnspentQueryOptionsReq struct {
	MinimumAmount    interface{} `json:"minimumAmount"`
	MaximumAmount    interface{} `json:"maximumAmount"`
	MaximumCount     interface{} `json:"maximumCount"`
	MinimumSumAmount interface{} `json:"minimumSumAmount"`
}

listunspent

type ScriptPubKey

type ScriptPubKey struct {
	ASM     string `json:"asm"`
	HEX     string `json:"hex"`
	Type    string `json:"type"`
	Address string `json:"address,omitempty"`
}

type ScriptSignature

type ScriptSignature struct {
	ASM string `json:"asm"`
	HEX string `json:"hex"`
}

type Storage

type Storage interface {
	GetBlockHash(height int32) (string, error)
	GetLatestBlockHash() (string, error)
	GetLatestBlockHeight() (int32, error)
	GetTransaction(hash string) (Transaction, error)
	GetBlockFromHash(hash string) (*btcutil.Block, error)
	GetHeaderFromHeight(height int32) (BlockHeader, error)
	GetHeaderFromHash(hash string) (BlockHeader, error)
	ListUnspent(startBlock, endBlock int, addresses []string, includeUnsafe bool, queryOptions ListUnspentQueryOptions) ([]model.OutPoint, error)
}

type Transaction

type Transaction struct {
	Tx        *wire.MsgTx
	BlockHash string
	BlockTime int64
	Height    int32
}

type Unspent

type Unspent struct {
	TxID          string  `json:"txid"`
	Vout          uint32  `json:"vout"`
	Address       string  `json:"address"`
	Label         string  `json:"label"`
	Amount        float64 `json:"amount"`
	ScriptPubKey  string  `json:"scriptPubKey"`
	WitnessScript string  `json:"witnessScript"`
	Spendable     bool    `json:"spendable"`
	Solvable      bool    `json:"solvable"`
	Reused        bool    `json:"reused"`
	Description   string  `json:"desc"`
	Confirmations uint32  `json:"confirmations"`
	Safe          bool    `json:"safe"`
}

func EncodeUnspent

func EncodeUnspent(op model.OutPoint, confirmations uint32) Unspent

type VerboseBlock

type VerboseBlock struct {
	Hash                 string      `json:"hash"`
	Confirmations        uint32      `json:"confirmations"`
	Height               int32       `json:"height"`
	Version              int32       `json:"version"`
	VersionHex           string      `json:"versionHex"`
	MerkleRoot           string      `json:"merkleroot"`
	Time                 int64       `json:"time"`
	MedianTime           int64       `json:"mediantime"`
	Nonce                uint32      `json:"nonce"`
	Bits                 string      `json:"bits"`
	Difficulty           float64     `json:"difficulty"`
	NumberOfTransactions int         `json:"nTx"`
	PreviousBlockHash    string      `json:"previousblockhash"`
	NextBlockHash        string      `json:"nextblokchash,omitempty"`
	StrippedSize         int         `json:"strippedsize"`
	Size                 int         `json:"size"`
	Weight               int         `json:"weight"`
	Transactions         interface{} `json:"tx"`
}

getblock

func EncodeBlock

func EncodeBlock(block *btcutil.Block, confirmations uint32, medianTime int64, nextBlockHash string, verbose int) (VerboseBlock, error)

type VerboseBlockHeader

type VerboseBlockHeader struct {
	Hash                 string  `json:"hash"`
	Confirmations        uint32  `json:"confirmations"`
	Height               int32   `json:"height"`
	Version              int32   `json:"version"`
	VersionHex           string  `json:"versionHex"`
	MerkleRoot           string  `json:"merkleroot"`
	Time                 int64   `json:"time"`
	MedianTime           int64   `json:"mediantime"`
	Nonce                uint32  `json:"nonce"`
	Bits                 string  `json:"bits"`
	Difficulty           float64 `json:"difficulty"`
	NumberOfTransactions int64   `json:"nTx"`
	PreviousBlockHash    string  `json:"previousblockhash"`
	NextBlockHash        string  `json:"nextblokchash,omitempty"`
}

getblockheader

func EncodeBlockHeader

func EncodeBlockHeader(block *wire.BlockHeader, numTxs int64, height int32, confirmations uint32, medianTime int64, nextBlockHash string) (VerboseBlockHeader, error)

type VerboseIn

type VerboseIn struct {
	TxID        string          `json:"txid"`
	Vout        uint32          `json:"vout"`
	ScriptSig   ScriptSignature `json:"scriptSig"`
	Sequence    uint32          `json:"sequence"`
	TxInWitness []string        `json:"txinwitness"`
}

type VerboseOut

type VerboseOut struct {
	Value        float64      `json:"value"`
	Index        uint32       `json:"n"`
	ScriptPubKey ScriptPubKey `json:"scriptPubKey"`
}

func EncodeVOUTs

func EncodeVOUTs(txouts []*wire.TxOut) []VerboseOut

type VerboseTransaction

type VerboseTransaction struct {
	Hex           string       `json:"hex"`
	TxID          string       `json:"txid"`
	Hash          string       `json:"hash"`
	Size          int          `json:"size"`
	VSize         int          `json:"vsize"`
	Weight        int          `json:"weight"`
	Version       int32        `json:"version"`
	LockTime      uint32       `json:"locktime"`
	VINs          interface{}  `json:"vin"`
	VOUTs         []VerboseOut `json:"vout"`
	BlockHash     string       `json:"blockhash"`
	Confirmations uint32       `json:"confirmations"`
	BlockTime     int64        `json:"blocktime"`
	Time          int64        `json:"time"`
}

getrawtransaction

func EncodeTransaction

func EncodeTransaction(tx *wire.MsgTx, blockHash string, confirmations uint32, time int64) VerboseTransaction

Jump to

Keyboard shortcuts

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