Initial commit
This commit is contained in:
commit
c5111cb551
20 changed files with 1764 additions and 0 deletions
74
models/mempool.go
Normal file
74
models/mempool.go
Normal file
|
@ -0,0 +1,74 @@
|
|||
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"`
|
||||
}
|
8
models/ticker.go
Normal file
8
models/ticker.go
Normal file
|
@ -0,0 +1,8 @@
|
|||
package models
|
||||
|
||||
type Ticker struct {
|
||||
Symbol string `json:"symbol"`
|
||||
Last float64 `json:"last"`
|
||||
Bid float64 `json:"bid"`
|
||||
Ask float64 `json:"ask"`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue