ws-go-server/models/mempool.go
2025-05-18 23:54:04 +02:00

74 lines
3 KiB
Go

package models
// MempoolBlock represents a block in the mempool-blocks message
type MempoolBlock struct {
BlockSize int `json:"blockSize"`
BlockVSize float64 `json:"blockVSize"`
NTx int `json:"nTx"`
TotalFees int `json:"totalFees"`
MedianFee float64 `json:"medianFee"`
FeeRange []float64 `json:"feeRange"`
}
// Block represents a block in the blocks message
type Block struct {
ID string `json:"id"`
Height int `json:"height"`
Version int `json:"version"`
Timestamp int64 `json:"timestamp"`
Bits int `json:"bits"`
Nonce uint32 `json:"nonce"`
Difficulty float64 `json:"difficulty"`
MerkleRoot string `json:"merkle_root"`
TxCount int `json:"tx_count"`
Size int `json:"size"`
Weight int `json:"weight"`
PreviousBlockHash string `json:"previousblockhash"`
MedianTime int64 `json:"mediantime"`
Stale bool `json:"stale"`
Extras BlockExtras `json:"extras"`
}
type BlockExtras struct {
Reward int `json:"reward"`
CoinbaseRaw string `json:"coinbaseRaw"`
Orphans []string `json:"orphans"`
MedianFee float64 `json:"medianFee"`
FeeRange []float64 `json:"feeRange"`
TotalFees int `json:"totalFees"`
AvgFee int `json:"avgFee"`
AvgFeeRate int `json:"avgFeeRate"`
UtxoSetChange int `json:"utxoSetChange"`
AvgTxSize float64 `json:"avgTxSize"`
TotalInputs int `json:"totalInputs"`
TotalOutputs int `json:"totalOutputs"`
TotalOutputAmt int64 `json:"totalOutputAmt"`
SegwitTotalTxs int `json:"segwitTotalTxs"`
SegwitTotalSize int `json:"segwitTotalSize"`
SegwitTotalWeight int `json:"segwitTotalWeight"`
VirtualSize float64 `json:"virtualSize"`
CoinbaseAddress string `json:"coinbaseAddress"`
CoinbaseAddresses []string `json:"coinbaseAddresses"`
CoinbaseSignature string `json:"coinbaseSignature"`
CoinbaseSignatureAscii string `json:"coinbaseSignatureAscii"`
Header string `json:"header"`
UtxoSetSize *int `json:"utxoSetSize"`
TotalInputAmt *int64 `json:"totalInputAmt"`
Pool PoolInfo `json:"pool"`
MatchRate *float64 `json:"matchRate"`
ExpectedFees *int `json:"expectedFees"`
ExpectedWeight *int `json:"expectedWeight"`
Similarity float64 `json:"similarity"`
}
type PoolInfo struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
MinerNames []string `json:"minerNames"`
}
type MempoolFee struct {
FeeRate float64 `json:"fee_rate"`
Fee float64 `json:"fee"`
}