|
| 1 | +package main |
| 2 | + |
| 3 | +// The types in this file are returned by the dcrdata API. They are copied from |
| 4 | +// the decred/dcrdata repo to prevent having to import it and all of its |
| 5 | +// dependencies. |
| 6 | + |
| 7 | +// TreasuryBalance is the current balance, spent amount, and tx count for the |
| 8 | +// treasury. |
| 9 | +type TreasuryBalance struct { |
| 10 | + Balance int64 `json:"balance"` |
| 11 | + // TxCount should probably be called OutputCount. |
| 12 | + TxCount int64 `json:"tx_count"` |
| 13 | + AddCount int64 `json:"add_count"` |
| 14 | + Added int64 `json:"added"` |
| 15 | + SpendCount int64 `json:"spend_count"` |
| 16 | + Spent int64 `json:"spent"` |
| 17 | + TGenCount int64 `json:"tgen_count"` |
| 18 | + TGen int64 `json:"tbase"` |
| 19 | + ImmatureCount int64 `json:"immature_count"` |
| 20 | + Immature int64 `json:"immature"` |
| 21 | +} |
| 22 | + |
| 23 | +// CoinSupply models the coin supply at a certain best block. |
| 24 | +type CoinSupply struct { |
| 25 | + Height int64 `json:"block_height"` |
| 26 | + Hash string `json:"block_hash"` |
| 27 | + Mined int64 `json:"supply_mined"` |
| 28 | + Ultimate int64 `json:"supply_ultimate"` |
| 29 | +} |
| 30 | + |
| 31 | +// BlockDataBasic models primary information about a block. |
| 32 | +type BlockDataBasic struct { |
| 33 | + Height uint32 `json:"height"` |
| 34 | + Size uint32 `json:"size"` |
| 35 | + Hash string `json:"hash"` |
| 36 | + Difficulty float64 `json:"diff"` |
| 37 | + StakeDiff float64 `json:"sdiff"` |
| 38 | + Time int64 `json:"time"` |
| 39 | + NumTx uint32 `json:"txlength"` |
| 40 | + MiningFee *int64 `json:"fees,omitempty"` |
| 41 | + TotalSent *int64 `json:"total_sent,omitempty"` |
| 42 | + // TicketPoolInfo may be nil for side chain blocks. |
| 43 | + PoolInfo *TicketPoolInfo `json:"ticket_pool,omitempty"` |
| 44 | +} |
| 45 | + |
| 46 | +// BlockSubsidies contains the block reward proportions for a certain block |
| 47 | +// height. The stake_reward is per vote, while total is for a certain number of |
| 48 | +// votes. |
| 49 | +type BlockSubsidies struct { |
| 50 | + BlockNum int64 `json:"height"` |
| 51 | + BlockHash string `json:"hash,omitempty"` |
| 52 | + Work int64 `json:"work_reward"` |
| 53 | + Stake int64 `json:"stake_reward"` |
| 54 | + NumVotes int16 `json:"num_votes,omitempty"` |
| 55 | + TotalStake int64 `json:"stake_reward_total,omitempty"` |
| 56 | + Tax int64 `json:"project_subsidy"` |
| 57 | + Total int64 `json:"total,omitempty"` |
| 58 | +} |
| 59 | + |
| 60 | +// TicketPoolInfo models data about ticket pool |
| 61 | +type TicketPoolInfo struct { |
| 62 | + Height uint32 `json:"height"` |
| 63 | + Size uint32 `json:"size"` |
| 64 | + Value float64 `json:"value"` |
| 65 | + ValAvg float64 `json:"valavg"` |
| 66 | + Winners []string `json:"winners"` |
| 67 | +} |
0 commit comments