Documentation
¶
Index ¶
- Variables
- func TransactionFromBytes(b []byte) (*transaction, int)
- func TransactionFromHex(h string) (*transaction, int)
- func WithOptionalLogger(l Logger) func(*rpcClient)
- func WithTimeoutDuration(d time.Duration) func(*rpcClient)
- type Address
- type BatchResults
- type BatchedTransaction
- type BbBlock
- type BbBlockTransaction
- type BbBlockTransactionInOut
- type BitIndex
- type Bitcoind
- func (b *Bitcoind) BbGetBlock(hash_or_number string, page uint64) (block *BbBlock, err error)
- func (b *Bitcoind) DecodeRawTransaction(txHex string) (string, error)
- func (b *Bitcoind) DumpPrivKey(address string) (string, error)
- func (b *Bitcoind) Generate(amount float64) ([]string, error)
- func (b *Bitcoind) GenerateToAddress(amount float64, address string) ([]string, error)
- func (b *Bitcoind) GetBestBlockHash() (hash string, err error)
- func (b *Bitcoind) GetBlock(blockHash string) (block *Block, err error)
- func (b *Bitcoind) GetBlockByHeight(blockHeight int) (block *Block, err error)
- func (b *Bitcoind) GetBlockHash(blockHeight int) (blockHash string, err error)
- func (b *Bitcoind) GetBlockHeader(blockHash string) (blockHeader *BlockHeader, err error)
- func (b *Bitcoind) GetBlockHeaderAndCoinbase(blockHash string) (blockHeaderAndCoinbase *BlockHeaderAndCoinbase, err error)
- func (b *Bitcoind) GetBlockHeaderHex(blockHash string) (blockHeader *string, err error)
- func (b *Bitcoind) GetBlockHex(blockHash string) (raw *string, err error)
- func (b *Bitcoind) GetBlockOverview(blockHash string) (block *BlockOverview, err error)
- func (b *Bitcoind) GetBlockStats(blockHash string) (block *BlockStats, err error)
- func (b *Bitcoind) GetBlockStatsByHeight(blockHeight int) (block *BlockStats, err error)
- func (b *Bitcoind) GetBlockTemplate(includeSegwit bool) (template *BlockTemplate, err error)
- func (b *Bitcoind) GetBlockchainInfo() (info BlockchainInfo, err error)
- func (b *Bitcoind) GetChainTips() (tips ChainTips, err error)
- func (b *Bitcoind) GetChainTxStats(blockcount int) (stats ChainTXStats, err error)
- func (b *Bitcoind) GetConnectionCount() (count uint64, err error)
- func (b *Bitcoind) GetDifficulty() (difficulty float64, err error)
- func (b *Bitcoind) GetHelp() (j []byte, err error)
- func (b *Bitcoind) GetInfo() (info GetInfo, err error)
- func (b *Bitcoind) GetMempoolAncestors(txid string, details bool) (raw []byte, err error)
- func (b *Bitcoind) GetMempoolDescendants(txid string, details bool) (raw []byte, err error)
- func (b *Bitcoind) GetMempoolEntry(txid string) (entry MempoolEntry, err error)
- func (b *Bitcoind) GetMempoolInfo() (info MempoolInfo, err error)
- func (b *Bitcoind) GetMiningCandidate() (template *MiningCandidate, err error)
- func (b *Bitcoind) GetMiningInfo() (info MiningInfo, err error)
- func (b *Bitcoind) GetNetTotals() (totals NetTotals, err error)
- func (b *Bitcoind) GetNetworkInfo() (info NetworkInfo, err error)
- func (b *Bitcoind) GetNewAddress() (string, error)
- func (b *Bitcoind) GetPeerInfo() (info PeerInfo, err error)
- func (b *Bitcoind) GetRawBlock(blockHash string) ([]byte, error)
- func (b *Bitcoind) GetRawBlockReader(blockHash string) (io.ReadCloser, error)
- func (b *Bitcoind) GetRawBlockRest(blockHash string) (io.ReadCloser, error)
- func (b *Bitcoind) GetRawMempool(details bool) (raw []byte, err error)
- func (b *Bitcoind) GetRawNonFinalMempool() ([]string, error)
- func (b *Bitcoind) GetRawTransaction(txID string) (rawTx *RawTransaction, err error)
- func (b *Bitcoind) GetRawTransactionHex(txID string) (rawTx *string, err error)
- func (b *Bitcoind) GetRawTransactionRest(txid string) (io.ReadCloser, error)
- func (b *Bitcoind) GetSettings() (settings Settings, err error)
- func (b *Bitcoind) GetTxOut(txHex string, vout int, includeMempool bool) (res *TXOut, err error)
- func (b *Bitcoind) ListUnspent(addresses []string) (res []*UnspentTransaction, err error)
- func (b *Bitcoind) SendRawTransaction(hex string) (txid string, err error)
- func (b *Bitcoind) SendRawTransactionWithoutFeeCheck(hex string) (txid string, err error)
- func (b *Bitcoind) SendRawTransactionWithoutFeeCheckOrScriptCheck(raw string) (string, error)
- func (b *Bitcoind) SendRawTransactions(batchedTransactions []*BatchedTransaction, config map[string]interface{}) (*BatchResults, error)
- func (b *Bitcoind) SendToAddress(address string, amount float64) (string, error)
- func (b *Bitcoind) SetAccount(address, account string) error
- func (b *Bitcoind) SignRawTransaction(hex string) (sr *SignRawTransactionResponse, err error)
- func (b *Bitcoind) SubmitBlock(hexData string) (result string, err error)
- func (b *Bitcoind) SubmitMiningSolution(miningCandidateID string, nonce uint32, coinbase string, time uint32, ...) (result string, err error)
- func (b *Bitcoind) Uptime() (uptime uint64, err error)
- func (b *Bitcoind) ValidateAddress(address string) (addr Address, err error)
- type Block
- type Block2
- type BlockHeader
- type BlockHeaderAndCoinbase
- type BlockOverview
- type BlockPage
- type BlockStats
- type BlockTemplate
- type BlockTxid
- type BlockchainInfo
- type BytesData
- type ChainTXStats
- type ChainTips
- type DefaultLogger
- func (l *DefaultLogger) Debugf(format string, args ...interface{})
- func (l *DefaultLogger) Errorf(format string, args ...interface{})
- func (l *DefaultLogger) Fatalf(format string, args ...interface{})
- func (l *DefaultLogger) Infof(format string, args ...interface{})
- func (l *DefaultLogger) Warnf(format string, args ...interface{})
- type Error
- type GetInfo
- type LocalAddress
- type Logger
- type MempoolEntry
- type MempoolInfo
- type MiningCandidate
- type MiningInfo
- type NetTotals
- type Network
- type NetworkInfo
- type OpReturn
- type Option
- type Peer
- type PeerInfo
- type RawMemPool
- type RawTransaction
- type ScriptPubKey
- type ScriptSig
- type Settings
- type SignRawTransactionResponse
- type TXOut
- type Tag
- type Tip
- type Transaction
- type TxResponse
- type UnspentTransaction
- type Utxo
- type UtxoResponse
- type Vin
- type Vout
- type ZMQ
Constants ¶
This section is empty.
Variables ¶
var (
ErrTimeout = errors.New("Timeout reading data from server")
)
Functions ¶
func TransactionFromBytes ¶
TransactionFromBytes takes a slice of bytes and constructs a Transaction object
func TransactionFromHex ¶
TransactionFromHex takes a hex string and constructs a Transaction object
func WithOptionalLogger ¶
func WithOptionalLogger(l Logger) func(*rpcClient)
func WithTimeoutDuration ¶
Types ¶
type Address ¶
type Address struct {
IsValid bool `json:"isvalid"`
Address string `json:"address"`
ScriptPubKey string `json:"scriptPubKey"`
IsMine bool `json:"ismine"`
IsWatchOnly bool `json:"iswatchonly"`
IsScript bool `json:"isscript"`
}
Address comment
type BatchResults ¶
type BatchResults struct {
Known []string `json:"known"`
Evicted []string `json:"evicted"`
Invalid []*TxResponse `json:"invalid"`
Unconfirmed []*TxResponse `json:"unconfirmed"`
}
type BatchedTransaction ¶
type BbBlock ¶
type BbBlock struct {
Bits string `json:"bits"`
Confirmations int64 `json:"confirmations"`
Difficulty string `json:"difficulty"`
Hash string `json:"hash"`
Height uint64 `json:"height"`
ItemsOnPage uint64 `json:"itemsOnPage"`
MerkleRoot string `json:"merkleroot"`
NextBlockHash string `json:"nextblockhash"`
Nonce string `json:"nonce"`
Page uint64 `json:"page"`
PreviousBlockHash string `json:"previousblockhash"`
Size uint64 `json:"size"`
Time uint64 `json:"time"`
TotalPages uint64 `json:"totalPages"`
TxCount uint64 `json:"txcount"`
Txs []BbBlockTransaction `json:"txs"`
Version uint64 `json:"version"`
}
BbBlock struct
type BbBlockTransaction ¶
type BbBlockTransaction struct {
BlockHash string `json:"blockHash"`
BlockHeight uint64 `json:"blockHeight"`
BlockTime uint64 `json:"blockTime"`
Confirmations uint64 `json:"confirmations"`
Fees string `json:"fees"`
Height uint64 `json:"blockHeight"`
Txid string `json:"txid"`
Value string `json:"value"`
ValueIn string `json:"valueIn"`
Vin []BbBlockTransactionInOut `json:"vin"`
Vout []BbBlockTransactionInOut `json:"vout"`
}
type BbBlockTransactionInOut ¶
type BitIndex ¶
type BitIndex struct {
BaseURL string
}
BitIndex comment
func NewBitIndexClient ¶
NewBitIndexClient returns a new bitIndex client for the given url
type Bitcoind ¶
type Bitcoind struct {
Storage *cache.Cache
IPAddress string
// contains filtered or unexported fields
}
A Bitcoind represents a Bitcoind client
func New ¶
func New(host string, port int, path, user, passwd string, useSSL bool, opts ...Option) (*Bitcoind, error)
New return a new bitcoind
func (*Bitcoind) BbGetBlock ¶
GetInfo returns the number of connections to other nodes.
func (*Bitcoind) DecodeRawTransaction ¶
DecodeRawTransaction comment
func (*Bitcoind) GenerateToAddress ¶
GenerateToAddress for regtest
func (*Bitcoind) GetBestBlockHash ¶
GetBestBlockHash comment
func (*Bitcoind) GetBlockByHeight ¶
func (*Bitcoind) GetBlockHash ¶
GetBlockHash comment
func (*Bitcoind) GetBlockHeader ¶
func (b *Bitcoind) GetBlockHeader(blockHash string) (blockHeader *BlockHeader, err error)
GetBlockHeader returns the block header for the given hash.
func (*Bitcoind) GetBlockHeaderAndCoinbase ¶
func (b *Bitcoind) GetBlockHeaderAndCoinbase(blockHash string) (blockHeaderAndCoinbase *BlockHeaderAndCoinbase, err error)
GetBlockHeaderAndCoinbase returns information about the block with the given hash.
func (*Bitcoind) GetBlockHeaderHex ¶
GetBlockHeaderHex returns the block header hex for the given hash.
func (*Bitcoind) GetBlockHex ¶
GetBlockHex returns information about the block with the given hash.
func (*Bitcoind) GetBlockOverview ¶
func (b *Bitcoind) GetBlockOverview(blockHash string) (block *BlockOverview, err error)
GetBlockOverview returns basic information about the block with the given hash.
func (*Bitcoind) GetBlockStats ¶
func (b *Bitcoind) GetBlockStats(blockHash string) (block *BlockStats, err error)
GetBlockStats returns block stats from the given block hash.
func (*Bitcoind) GetBlockStatsByHeight ¶
func (b *Bitcoind) GetBlockStatsByHeight(blockHeight int) (block *BlockStats, err error)
GetBlockStatsByHeight returns block stats from the given block height.
func (*Bitcoind) GetBlockTemplate ¶
func (b *Bitcoind) GetBlockTemplate(includeSegwit bool) (template *BlockTemplate, err error)
GetBlockTemplate comment
func (*Bitcoind) GetBlockchainInfo ¶
func (b *Bitcoind) GetBlockchainInfo() (info BlockchainInfo, err error)
GetBlockchainInfo returns the number of connections to other nodes.
func (*Bitcoind) GetChainTips ¶
GetChainTips return information about all known tips in the block tree, including the main chain as well as orphaned branches. Possible values for status: 1. "invalid" This branch contains at least one invalid block 2. "headers-only" Not all blocks for this branch are available, but the headers are valid 3. "valid-headers" All blocks are available for this branch, but they were never fully validated 4. "valid-fork" This branch is not part of the active chain, but is fully validated 5. "active" This is the tip of the active main chain, which is certainly valid
func (*Bitcoind) GetChainTxStats ¶
func (b *Bitcoind) GetChainTxStats(blockcount int) (stats ChainTXStats, err error)
GetChainTxStats returns the number of connections to other nodes.
func (*Bitcoind) GetConnectionCount ¶
GetConnectionCount returns the number of connections to other nodes.
func (*Bitcoind) GetDifficulty ¶
GetDifficulty comment
func (*Bitcoind) GetMempoolAncestors ¶
GetMempoolAncestors if txid is in the mempool, returns all in-mempool ancestors..
func (*Bitcoind) GetMempoolDescendants ¶
GetMempoolDescendants if txid is in the mempool, returns all in-mempool descendants..
func (*Bitcoind) GetMempoolEntry ¶
func (b *Bitcoind) GetMempoolEntry(txid string) (entry MempoolEntry, err error)
GetMempoolEntry returns the entry in the current mempool for a specific tx id
func (*Bitcoind) GetMempoolInfo ¶
func (b *Bitcoind) GetMempoolInfo() (info MempoolInfo, err error)
GetMempoolInfo comment
func (*Bitcoind) GetMiningCandidate ¶
func (b *Bitcoind) GetMiningCandidate() (template *MiningCandidate, err error)
GetMiningCandidate comment
func (*Bitcoind) GetMiningInfo ¶
func (b *Bitcoind) GetMiningInfo() (info MiningInfo, err error)
GetMiningInfo comment
func (*Bitcoind) GetNetTotals ¶
GetNetTotals returns the number of connections to other nodes.
func (*Bitcoind) GetNetworkInfo ¶
func (b *Bitcoind) GetNetworkInfo() (info NetworkInfo, err error)
GetNetworkInfo returns the number of connections to other nodes.
func (*Bitcoind) GetNewAddress ¶
func (*Bitcoind) GetPeerInfo ¶
GetPeerInfo returns the number of connections to other nodes.
func (*Bitcoind) GetRawBlock ¶
GetRawBlock returns the raw bytes of the block with the given hash.
func (*Bitcoind) GetRawBlockReader ¶
func (b *Bitcoind) GetRawBlockReader(blockHash string) (io.ReadCloser, error)
GetRawBlockReader returns a reader of the block with the given hash.
func (*Bitcoind) GetRawBlockRest ¶
func (b *Bitcoind) GetRawBlockRest(blockHash string) (io.ReadCloser, error)
func (*Bitcoind) GetRawMempool ¶
GetRawMempool returns the number of connections to other nodes.
func (*Bitcoind) GetRawNonFinalMempool ¶
GetRawNonFinalMempool returns all transaction ids in the non-final memory pool as a json array of string transaction ids.
func (*Bitcoind) GetRawTransaction ¶
func (b *Bitcoind) GetRawTransaction(txID string) (rawTx *RawTransaction, err error)
GetRawTransaction returns raw transaction representation for given transaction id.
func (*Bitcoind) GetRawTransactionHex ¶
GetRawTransactionHex returns raw transaction representation for given transaction id.
func (*Bitcoind) GetRawTransactionRest ¶
func (b *Bitcoind) GetRawTransactionRest(txid string) (io.ReadCloser, error)
func (*Bitcoind) GetSettings ¶
GetInfo returns the number of connections to other nodes.
func (*Bitcoind) ListUnspent ¶
func (b *Bitcoind) ListUnspent(addresses []string) (res []*UnspentTransaction, err error)
ListUnspent comment
func (*Bitcoind) SendRawTransaction ¶
func (*Bitcoind) SendRawTransactionWithoutFeeCheck ¶
func (*Bitcoind) SendRawTransactionWithoutFeeCheckOrScriptCheck ¶
func (*Bitcoind) SendRawTransactions ¶
func (b *Bitcoind) SendRawTransactions(batchedTransactions []*BatchedTransaction, config map[string]interface{}) (*BatchResults, error)
func (*Bitcoind) SendToAddress ¶
SendToAddress comment
func (*Bitcoind) SetAccount ¶
func (*Bitcoind) SignRawTransaction ¶
func (b *Bitcoind) SignRawTransaction(hex string) (sr *SignRawTransactionResponse, err error)
SignRawTransaction comment
func (*Bitcoind) SubmitBlock ¶
SubmitBlock comment
func (*Bitcoind) SubmitMiningSolution ¶
func (b *Bitcoind) SubmitMiningSolution(miningCandidateID string, nonce uint32, coinbase string, time uint32, version uint32) (result string, err error)
SubmitMiningSolution comment
type Block ¶
type Block struct {
Hash string `json:"hash"`
Confirmations int64 `json:"confirmations"`
Size uint64 `json:"size"`
Height uint64 `json:"height"`
Version int64 `json:"version"`
VersionHex string `json:"versionHex"`
MerkleRoot string `json:"merkleroot"`
TxCount uint64 `json:"txcount"`
NTx uint64 `json:"nTx"`
NumTx uint64 `json:"num_tx"`
Tx []string `json:"tx"`
Time uint64 `json:"time"`
MedianTime uint64 `json:"mediantime"`
Nonce uint64 `json:"nonce"`
Bits string `json:"bits"`
Difficulty float64 `json:"difficulty"`
Chainwork string `json:"chainwork"`
PreviousBlockHash string `json:"previousblockhash"`
NextBlockHash string `json:"nextblockhash"`
// extra properties
CoinbaseTx *RawTransaction `json:"coinbaseTx"`
TotalFees float64 `json:"totalFees"`
Miner string `json:"miner"`
Pagination *BlockPage `json:"pages"`
}
Block struct
type Block2 ¶
type Block2 struct {
Hash string `json:"hash"`
Size int `json:"size"`
Height int `json:"height"`
Version uint32 `json:"version"`
VersionHex string `json:"versionHex"`
MerkleRoot string `json:"merkleroot"`
TxCount uint64 `json:"txcount"`
NTx uint64 `json:"nTx"`
NumTx uint64 `json:"num_tx"`
Tx []string `json:"tx"`
Time uint32 `json:"time"`
MedianTime uint32 `json:"mediantime"`
Nonce uint32 `json:"nonce"`
Bits string `json:"bits"`
Difficulty float64 `json:"difficulty"`
Chainwork string `json:"chainwork"`
PreviousBlockHash string `json:"previousblockhash"`
NextBlockHash string `json:"nextblockhash"`
BlockSubsidy uint64 `json:"blockSubsidy"`
BlockReward uint64 `json:"blockReward"`
USDPrice float64 `json:"usdPrice"`
Miner string `json:"miner"`
}
Block2 struct
type BlockHeader ¶
type BlockHeader struct {
Hash string `json:"hash"`
Confirmations int64 `json:"confirmations"`
Size uint64 `json:"size"`
Height uint64 `json:"height"`
Version uint64 `json:"version"`
VersionHex string `json:"versionHex"`
MerkleRoot string `json:"merkleroot"`
Time uint64 `json:"time"`
MedianTime uint64 `json:"mediantime"`
Nonce uint64 `json:"nonce"`
Bits string `json:"bits"`
Difficulty float64 `json:"difficulty"`
Chainwork string `json:"chainwork"`
PreviousBlockHash string `json:"previousblockhash"`
NextBlockHash string `json:"nextblockhash"`
NTx uint64 `json:"nTx"`
TxCount uint64 `json:"num_tx"`
}
BlockHeader comment
type BlockHeaderAndCoinbase ¶
type BlockHeaderAndCoinbase struct {
Hash string `json:"hash"`
Confirmations int64 `json:"confirmations"`
Size uint64 `json:"size"`
Height uint64 `json:"height"`
Version uint64 `json:"version"`
VersionHex string `json:"versionHex"`
MerkleRoot string `json:"merkleroot"`
NumTx uint64 `json:"num_tx"`
Time uint64 `json:"time"`
MedianTime uint64 `json:"mediantime"`
Nonce uint64 `json:"nonce"`
Bits string `json:"bits"`
Difficulty float64 `json:"difficulty"`
Chainwork string `json:"chainwork"`
PreviousBlockHash string `json:"previousblockhash"`
NextBlockHash string `json:"nextblockhash"`
Tx []RawTransaction `json:"tx"`
}
BlockHeaderAndCoinbase comment
type BlockOverview ¶
type BlockOverview struct {
Hash string `json:"hash"`
Confirmations int64 `json:"confirmations"`
Size uint64 `json:"size"`
Height uint64 `json:"height"`
Version int64 `json:"version"`
VersionHex string `json:"versionHex"`
MerkleRoot string `json:"merkleroot"`
// TxCount uint64 `json:"txcount"`
Time uint64 `json:"time"`
MedianTime uint64 `json:"mediantime"`
Nonce uint64 `json:"nonce"`
Bits string `json:"bits"`
Difficulty float64 `json:"difficulty"`
Chainwork string `json:"chainwork"`
PreviousBlockHash string `json:"previousblockhash"`
NextBlockHash string `json:"nextblockhash"`
}
BlockOverview struct
type BlockStats ¶
type BlockStats struct {
AvgFee float64 `json:"avgfee"`
AvgFeeRate float64 `json:"avgfeerate"`
AvgTxSize int `json:"avgtxsize"`
BlockHash string `json:"blockhash"`
Height int `json:"height"`
Ins int `json:"ins"`
MaxFee float64 `json:"maxfee"`
MaxFeeRate float64 `json:"maxfeerate"`
MaxTxSize int `json:"maxtxsize"`
MedianFee float64 `json:"medianfee"`
MedianFeeRate float64 `json:"medianfeerate"`
MedianTime int `json:"mediantime"`
MedianTxSize int `json:"mediantxsize"`
MinFee float64 `json:"minfee"`
MinFeeRate float64 `json:"minfeerate"`
MinTxSize int `json:"mintxsize"`
Outs int `json:"outs"`
Subsidy float64 `json:"subsidy"`
Time int `json:"time"`
TotalOut float64 `json:"total_out"`
TotalSize int `json:"total_size"`
TotalFee float64 `json:"totalfee"`
Txs int `json:"txs"`
UtxoIncrease int `json:"utxo_increase"`
UtxoSizeInc int `json:"utxo_size_inc"`
}
type BlockTemplate ¶
type BlockTemplate struct {
Version uint32 `json:"version"`
PreviousBlockHash string `json:"previousblockhash"`
Target string `json:"target"`
Transactions []Transaction `json:"transactions"`
Bits string `json:"bits"`
CurTime uint64 `json:"curtime"`
CoinbaseValue uint64 `json:"coinbasevalue"`
Height uint32 `json:"height"`
MinTime uint64 `json:"mintime"`
NonceRange string `json:"noncerange"`
DefaultWitnessCommitment string `json:"default_witness_commitment"`
SizeLimit uint64 `json:"sizelimit"`
WeightLimit uint64 `json:"weightlimit"`
SigOpLimit int64 `json:"sigoplimit"`
VBRequired int64 `json:"vbrequired"`
// extra mining candidate fields
IsMiningCandidate bool `json:"-"`
MiningCandidateID string `json:"-"`
MiningCandidate *MiningCandidate `json:"-"`
MerkleBranches []string `json:"-"`
}
BlockTemplate comment
type BlockTxid ¶
type BlockTxid struct {
BlockHash string `json:"blockhash"`
Tx []string `json:"tx"`
StartIndex uint64 `json:"startIndex"`
EndIndex uint64 `json:"endIndex"`
Count uint64 `json:"count"`
}
BlockTxid comment
type BlockchainInfo ¶
type BlockchainInfo struct {
Chain string `json:"chain"`
Blocks int32 `json:"blocks"`
Headers int32 `json:"headers"`
BestBlockHash string `json:"bestblockhash"`
Difficulty float64 `json:"difficulty"`
MedianTime int64 `json:"mediantime"`
VerificationProgress float64 `json:"verificationprogress,omitempty"`
Pruned bool `json:"pruned"`
PruneHeight int32 `json:"pruneheight,omitempty"`
ChainWork string `json:"chainwork,omitempty"`
}
BlockchainInfo comment
type BytesData ¶
type BytesData struct {
Addr int `json:"addr"`
BlockTXN int `json:"blocktxn"`
CmpctBlock int `json:"cmpctblock"`
FeeFilter int `json:"feefilter"`
GetAddr int `json:"getaddr"`
GetData int `json:"getdata"`
GetHeaders int `json:"getheaders"`
Headers int `json:"headers"`
Inv int `json:"inv"`
NotFound int `json:"notfound"`
Ping int `json:"ping"`
Pong int `json:"pong"`
Reject int `json:"reject"`
SendCmpct int `json:"sendcmpct"`
SendHeaders int `json:"sendheaders"`
TX int `json:"tx"`
VerAck int `json:"verack"`
Version int `json:"version"`
}
BytesData struct
type ChainTXStats ¶
type ChainTXStats struct {
Time int `json:"time"`
TXCount int `json:"txcount"`
WindowBlockCount int `json:"window_block_count"`
WindowTXCount int `json:"window_tx_count"`
WindowInterval int `json:"window_interval"`
TXRate float64 `json:"txrate"`
}
ChainTXStats struct
type DefaultLogger ¶
type DefaultLogger struct{}
func (*DefaultLogger) Debugf ¶
func (l *DefaultLogger) Debugf(format string, args ...interface{})
func (*DefaultLogger) Errorf ¶
func (l *DefaultLogger) Errorf(format string, args ...interface{})
func (*DefaultLogger) Fatalf ¶
func (l *DefaultLogger) Fatalf(format string, args ...interface{})
func (*DefaultLogger) Infof ¶
func (l *DefaultLogger) Infof(format string, args ...interface{})
func (*DefaultLogger) Warnf ¶
func (l *DefaultLogger) Warnf(format string, args ...interface{})
type GetInfo ¶
type GetInfo struct {
Version int32 `json:"version"`
ProtocolVersion int32 `json:"protocolversion"`
WalletVersion int32 `json:"walletversion"`
Balance float64 `json:"balance"`
InitComplete bool `json:"initcomplete"`
Blocks int32 `json:"blocks"`
TimeOffset int64 `json:"timeoffset"`
Connections int32 `json:"connections"`
Proxy string `json:"proxy"`
Difficulty float64 `json:"difficulty"`
TestNet bool `json:"testnet"`
STN bool `json:"stn"`
KeyPoolOldest int64 `json:"keypoololdest"`
KeyPoolSize int32 `json:"keypoolsize"`
PayTXFee float64 `json:"paytxfee"`
RelayFee float64 `json:"relayfee"`
Errors string `json:"errors"`
MaxBlockSize int64 `json:"maxblocksize"`
MaxMinedBlockSize int64 `json:"maxminedblocksize"`
MaxStackMemoryUsagePolicy uint64 `json:"maxstackmemoryusagepolicy"`
MaxStackMemoryUsageConsensus uint64 `json:"maxstackmemoryusageconsensus"`
}
GetInfo comment
type LocalAddress ¶
type LocalAddress struct {
Address string `json:"address"`
Port int `json:"port"`
Score int `json:"score"`
}
LocalAddress comment
type Logger ¶
type Logger interface {
// Debugf logs a message at debug level.
Debugf(format string, args ...interface{})
// Infof logs a message at info level.
Infof(format string, args ...interface{})
// Warnf logs a message at warn level.
Warnf(format string, args ...interface{})
// Errorf logs a message at error level.
Errorf(format string, args ...interface{})
// Fatalf logs a message at fatal level.
Fatalf(format string, args ...interface{})
}
type MempoolEntry ¶
type MempoolInfo ¶
type MempoolInfo struct {
Size int `json:"size"` // Current tx count
JournalSize int `json:"journalsize"` // Current tx count within the journal
NonFinalSize int `json:"nonfinalsize"` // Current non-final tx count
Bytes int `json:"bytes"` // Transaction size
Usage int `json:"usage"` // Total memory usage for the mempool
UsageDisk int `json:"usagedisk"` // Total disk usage for storing mempool transactions
UsageCpfp int `json:"usagecpfp"` // Total memory usage for the low paying transactions
NonFinalUsage int `json:"nonfinalusage"` // Total memory usage for the non-final mempool
MaxMemPool int `json:"maxmempool"` // Maximum memory usage for the mempool
MaxMempoolSizeDisk int `json:"maxmempoolsizedisk"` // Maximum disk usage for storing mempool transactions
MaxMempoolSizeCpfp int `json:"maxmempoolsizecpfp"` // Maximum memory usage for the low paying transactions
MemPoolMinFree float64 `json:"mempoolminfee"` // Minimum fee (in BSV/kB) for tx to be accepted
}
MempoolInfo comment
type MiningCandidate ¶
type MiningCandidate struct {
ID string `json:"id"`
PreviousHash string `json:"prevhash"`
CoinbaseValue uint64 `json:"coinbaseValue"`
Version uint32 `json:"version"`
Bits string `json:"nBits"`
CurTime uint64 `json:"time"`
Height uint32 `json:"height"`
NumTx uint32 `json:"num_tx"`
SizeWithoutCoinbase uint64 `json:"sizeWithoutCoinbase"`
MerkleProof []string `json:"merkleProof"`
}
MiningCandidate comment
type MiningInfo ¶
type MiningInfo struct {
Blocks int `json:"blocks"`
CurrentBlockSize int `json:"currentblocksize"`
CurrentBlockTX int `json:"currentblocktx"`
Difficulty float64 `json:"difficulty"`
BlocksPriorityPercent int `json:"blockprioritypercentage"`
Errors string `json:"errors"`
NetworkHashPS float64 `json:"networkhashps"`
PooledTX int `json:"pooledtx"`
Chain string `json:"chain"`
}
MiningInfo comment
type NetTotals ¶
type NetTotals struct {
TotalBytesRecv int `json:"totalbytesrecv"`
TotalBytesSent int `json:"totalbytessent"`
TimeMillis int `json:"timemillis"`
UploadTarget struct {
TimeFrame int `json:"timeframe"`
Target int `json:"target"`
TargetReached bool `json:"target_reached"`
ServeHistoricalBlocks bool `json:"serve_historical_blocks"`
BytesLeftInCycle int `json:"bytes_left_in_cycle"`
TimeLeftInCycle int `json:"time_left_in_cycle"`
} `json:"uploadtarget"`
}
NetTotals comment
type Network ¶
type Network struct {
Name string `json:"name"`
Limited bool `json:"limited"`
Reachable bool `json:"reachable"`
Proxy string `json:"proxy"`
ProxyRandmomizeCredentials bool `json:"proxy_randomize_credentials"`
}
Network comment
type NetworkInfo ¶
type NetworkInfo struct {
Version int `json:"version"`
SubVersion string `json:"subversion"`
ProtocolVersion int `json:"protocolversion"`
LocalServices string `json:"localservices"`
LocalRelay bool `json:"localrelay"`
TimeOffset int `json:"timeoffset"`
TXPropagationFreq int `json:"txnpropagationfreq"`
TXPropagationLen int `json:"txnpropagationqlen"`
NetworkActive bool `json:"networkactive"`
Connections int `json:"connections"`
AddressCount int `json:"addresscount"`
Networks []Network `json:"networks"`
RelayFee float64 `json:"relayfee"`
MinConsolidationFactor int `json:"minconsolidationfactor"`
MinConsolidationInputMaturity int `json:"minconsolidationinputmaturity"`
MaxConsolidationInputScriptSize int `json:"maxconsolidationinputscriptsize"`
AcceptNonStdConsolidationInput bool `json:"acceptnonstdconsolidationinput"`
ExcessUTXOCharge float64 `json:"excessutxocharge"`
LocalAddresses []LocalAddress `json:"localaddresses"`
Warnings string `json:"warnings"`
}
NetworkInfo comment
type OpReturn ¶
type OpReturn struct {
Type string `json:"type"`
Action string `json:"action"`
Text string `json:"text"`
Parts []string `json:"parts"`
}
OpReturn comment
type Peer ¶
type Peer struct {
ID int `json:"id"`
Addr string `json:"addr"`
AddrLocal string `json:"addrlocal"`
Services string `json:"services"`
RelayTXes bool `json:"relaytxes"`
LastSend int `json:"lastsend"`
LastRecv int `json:"lastrecv"`
BytesSent int `json:"bytessent"`
BytesRecv int `json:"bytesrecv"`
ConnTime int `json:"conntime"`
TimeOffset int `json:"timeoffset"`
PingTime float64 `json:"pingtime"`
MinPing float64 `json:"minping"`
Version int `json:"version"`
Subver string `json:"subver"`
Inbound bool `json:"inbound"`
AddNode bool `json:"addnode"`
StartingHeight int `json:"startingheight"`
TXNInvSize int `json:"txninvsize"`
Banscore int `json:"banscore"`
SyncedHeaders int `json:"synced_headers"`
SyncedBlocks int `json:"synced_blocks"`
// "inflight": [],
WhiteListed bool `json:"whitelisted"`
BytesSendPerMsg BytesData `json:"bytessent_per_msg"`
BytesRecvPerMsg BytesData `json:"bytesrecv_per_msg"`
}
Peer struct
type RawTransaction ¶
type RawTransaction struct {
Hex string `json:"hex,omitempty"`
TxID string `json:"txid"`
Hash string `json:"hash"`
Version int32 `json:"version"`
Size uint32 `json:"size"`
LockTime uint32 `json:"locktime"`
Vin []*Vin `json:"vin"`
Vout []*Vout `json:"vout"`
BlockHash string `json:"blockhash,omitempty"`
Confirmations uint32 `json:"confirmations,omitempty"`
Time int64 `json:"time,omitempty"`
Blocktime int64 `json:"blocktime,omitempty"`
BlockHeight uint64 `json:"blockheight,omitempty"`
}
RawTransaction comment
type ScriptPubKey ¶
type ScriptPubKey struct {
ASM string `json:"asm"`
Hex string `json:"hex"`
ReqSigs int64 `json:"reqSigs,omitempty"`
Type string `json:"type"`
Addresses []string `json:"addresses,omitempty"`
OpReturn *OpReturn `json:"opReturn,omitempty"`
Tag *Tag `json:"tag,omitempty"`
IsTruncated bool `json:"isTruncated"`
}
ScriptPubKey Comment
type Settings ¶
type Settings struct {
ExcessiveBlockSize int `json:"excessiveblocksize"`
BlockMaxSize int `json:"blockmaxsize"`
MaxTxSizePolicy int `json:"maxtxsizepolicy"`
MaxOrphanTxSize int `json:"maxorphantxsize"`
DataCarrierSize int64 `json:"datacarriersize"`
MaxScriptSizePolicy int `json:"maxscriptsizepolicy"`
MaxOpsPerScriptPolicy int64 `json:"maxopsperscriptpolicy"`
MaxScriptNumLengthPolicy int `json:"maxscriptnumlengthpolicy"`
MaxPubKeysPerMultisigPolicy int64 `json:"maxpubkeyspermultisigpolicy"`
MaxTxSigopsCountsPolicy int64 `json:"maxtxsigopscountspolicy"`
MaxStackMemoryUsagePolicy int `json:"maxstackmemoryusagepolicy"`
MaxStackMemoryUsageConsensus int `json:"maxstackmemoryusageconsensus"`
LimitAncestorCount int `json:"limitancestorcount"`
LimitCPFPGroupMembersCount int `json:"limitcpfpgroupmemberscount"`
MaxMempool int `json:"maxmempool"`
MaxMempoolSizedisk int `json:"maxmempoolsizedisk"`
MempoolMaxPercentCPFP int `json:"mempoolmaxpercentcpfp"`
AcceptNonStdOutputs bool `json:"acceptnonstdoutputs"`
DataCarrier bool `json:"datacarrier"`
MinMiningTxFee float64 `json:"minminingtxfee"`
MaxStdTxValidationDuration int `json:"maxstdtxvalidationduration"`
MaxNonStdTxValidationDuration int `json:"maxnonstdtxvalidationduration"`
MaxTxChainValidationBudget int `json:"maxtxchainvalidationbudget"`
ValidationClockCpu bool `json:"validationclockcpu"`
MinConsolidationFactor int `json:"minconsolidationfactor"`
MaxConsolidationInputScriptSize int `json:"maxconsolidationinputscriptsize"`
MinConfConsolidationInput int `json:"minconfconsolidationinput"`
MinConsolidationInputMaturity int `json:"minconsolidationinputmaturity"`
AcceptNonStdConsolidationInput bool `json:"acceptnonstdconsolidationinput"`
}
type SignRawTransactionResponse ¶
SignRawTransactionResponse struct
type TXOut ¶
type TXOut struct {
BestBlock string `json:"bestblock"`
Confirmations int `json:"confirmations"`
Value float64 `json:"value"`
ScriptPubKey ScriptPubKey `json:"scriptPubKey"`
Coinbase bool `json:"coinbase"`
}
type Transaction ¶
type Transaction struct {
TXID string `json:"txid"`
Hash string `json:"hash"`
Data string `json:"data"`
}
Transaction comment
type TxResponse ¶
type UnspentTransaction ¶
type UnspentTransaction struct {
TXID string `json:"txid"`
Vout uint32 `json:"vout"`
Address string `json:"address"`
ScriptPubKey string `json:"scriptPubKey"`
Amount float64 `json:"amount"`
Satoshis uint64 `json:"satoshis"`
Confirmations uint32 `json:"confirmations"`
}
UnspentTransaction type
type Utxo ¶
type Utxo struct {
TxID string `json:"txid"`
Vout uint32 `json:"vout"`
Height uint32 `json:"height"`
Value uint64 `json:"value"`
}
Utxo bitindex comment
type UtxoResponse ¶
type UtxoResponse struct {
Address string `json:"address"`
Utxos []Utxo `json:"utxos"`
Balance uint64 `json:"balance"`
}
UtxoResponse comment
type Vin ¶
type Vin struct {
Coinbase string `json:"coinbase"`
Txid string `json:"txid"`
Vout uint64 `json:"vout"`
ScriptSig ScriptSig `json:"scriptSig"`
Sequence uint32 `json:"sequence"`
}
Vin represent an IN value
type Vout ¶
type Vout struct {
Value float64 `json:"value"`
N int `json:"n"`
ScriptPubKey ScriptPubKey `json:"scriptPubKey"`
}
Vout represent an OUT value
type ZMQ ¶
type ZMQ struct {
// contains filtered or unexported fields
}
ZMQ struct