-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponses.go
128 lines (116 loc) · 4.12 KB
/
responses.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package ethermine
import "encoding/json"
type baseResponse struct {
Status string `json:"status"`
Data json.RawMessage `json:"data"`
}
// MinerHistoryResponse is the json response returned by
// the /miner/:miner/history endpoint.
type MinerHistoryResponse []struct {
Time int `json:"time"`
ReportedHashrate int `json:"reportedHashrate"`
CurrentHashrate float64 `json:"currentHashrate"`
ValidShares int `json:"validShares"`
InvalidShares int `json:"invalidShares"`
StaleShares int `json:"staleShares"`
AverageHashrate float64 `json:"averageHashrate"`
ActiveWorkers int `json:"activeWorkers"`
}
// MinerPayoutsResponse is the json response returned by
// the /miner/:miner/payouts endpoint.
type MinerPayoutsResponse []struct {
Start int `json:"start"`
End int `json:"end"`
Amount int64 `json:"amount"`
TxHash string `json:"txHash"`
PaidOn int `json:"paidOn"`
}
// MinerRoundsResponse is the json response returned by
// the /miner/:miner/rounds endpoint.
type MinerRoundsResponse []struct {
Block int `json:"block"`
Amount int64 `json:"amount"`
}
// MinerSettingsResponse is the json response returned by
// the /miner/:miner/settings endpoint.
type MinerSettingsResponse struct {
Monitor int `json:"monitor"`
MinPayout int64 `json:"minPayout"`
Email string `json:"email"`
IP string `json:"ip"`
}
// MinerStatisticsResponse is the json response returned by
// the /miner/:miner/currentStats.
type MinerStatisticsResponse struct {
Time int `json:"time"`
LastSeen int `json:"lastSeen"`
ReportedHashrate int `json:"reportedHashrate"`
CurrentHashrate float64 `json:"currentHashrate"`
ValidShares int `json:"validShares"`
InvalidShares int `json:"invalidShares"`
StaleShares int `json:"staleShares"`
AverageHashrate float64 `json:"averageHashrate"`
ActiveWorkers int `json:"activeWorkers"`
Unpaid int64 `json:"unpaid"`
Unconfirmed float64 `json:"unconfirmed"`
CoinsPerMin float64 `json:"coinsPerMin"`
UsdPerMin float64 `json:"usdPerMin"`
BtcPerMin float64 `json:"btcPerMin"`
}
// PoolMinedBlocksResponse is the json response returned by
// the /blocks/history endpoint.
type PoolMinedBlocksResponse []struct {
Time int `json:"time"`
NbrBlocks int `json:"nbrBlocks"`
Difficulty int64 `json:"difficulty"`
}
// PoolNetworkStatsResponse is the json response returned by
// the /networkStats endpoint.
type PoolNetworkStatsResponse struct {
Time int `json:"time"`
BlockTime float64 `json:"blockTime"`
Difficulty int64 `json:"difficulty"`
Hashrate int64 `json:"hashrate"`
USD float64 `json:"usd"`
BTC float64 `json:"btc"`
}
// PoolServerHashrateResponse is the json response returned by
// the /servers/history endpoint.
type PoolServerHashrateResponse []struct {
Time int `json:"time"`
Server string `json:"server"`
Hashrate float64 `json:"hashrate"`
}
// PoolStatsResponse is the json response returned by
// the /poolStats endpoint.
type PoolStatsResponse struct {
TopMiners []interface{} `json:"topMiners"`
MinedBlocks []struct {
Number int `json:"number"`
Miner string `json:"miner"`
Time int `json:"time"`
} `json:"minedBlocks"`
PoolStats struct {
HashRate float64 `json:"hashRate"`
Miners int `json:"miners"`
Workers int `json:"workers"`
BlocksPerHour float64 `json:"blocksPerHour"`
} `json:"poolStats"`
Price struct {
USD float64 `json:"usd"`
BTC float64 `json:"btc"`
} `json:"price"`
}
// WorkersStatsResponse is the json response returned by
// the various worker endpoints. TODO split?
type WorkerStatsResponse struct {
Worker string `json:"worker"`
Time int `json:"time"`
LastSeen int `json:"lastSeen"`
ReportedHashrate int `json:"reportedHashrate"`
CurrentHashrate float64 `json:"currentHashrate"`
ValidShares int `json:"validShares"`
InvalidShares int `json:"invalidShares"`
StaleShares int `json:"staleShares"`
AverageHashrate float64 `json:"averageHashrate"`
}