github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/plugins/cgminer/bitmine/types.go (about)

     1  // This file is part of the Smart Home
     2  // Program complex distribution https://github.com/e154/smart-home
     3  // Copyright (C) 2016-2023, Filippov Alex
     4  //
     5  // This library is free software: you can redistribute it and/or
     6  // modify it under the terms of the GNU Lesser General Public
     7  // License as published by the Free Software Foundation; either
     8  // version 3 of the License, or (at your option) any later version.
     9  //
    10  // This library is distributed in the hope that it will be useful,
    11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13  // Library General Public License for more details.
    14  //
    15  // You should have received a copy of the GNU Lesser General Public
    16  // License along with this library.  If not, see
    17  // <https://www.gnu.org/licenses/>.
    18  
    19  package bitmine
    20  
    21  import "github.com/pkg/errors"
    22  
    23  // DeviceType ...
    24  type DeviceType string
    25  
    26  // String ...
    27  func (d DeviceType) String() string {
    28  	return string(d)
    29  }
    30  
    31  var (
    32  	// ErrNoStatsInJsonResponse ...
    33  	ErrNoStatsInJsonResponse = errors.New("no stats in JSON response")
    34  	// ErrTooManyStatsInJsonResponse ...
    35  	ErrTooManyStatsInJsonResponse = errors.New("too many stats in JSON response")
    36  	// ErrReceivedMultipleSummaryObjects ...
    37  	ErrReceivedMultipleSummaryObjects = errors.New("received multiple Summary objects")
    38  	// ErrNoSummaryInfoReceived ...
    39  	ErrNoSummaryInfoReceived = errors.New("no summary info received")
    40  	// ErrNoVersionInJsonResponse ...
    41  	ErrNoVersionInJsonResponse = errors.New("no version in JSON response")
    42  	// ErrTooManyVersionsInJsonResponse ...
    43  	ErrTooManyVersionsInJsonResponse = errors.New("too many versions in JSON response")
    44  )
    45  
    46  const (
    47  	// ManufactureBitmine ...
    48  	ManufactureBitmine = "bitmine"
    49  )
    50  
    51  const (
    52  	// DeviceS9 ...
    53  	DeviceS9 = DeviceType("S9")
    54  	// DeviceS7 ...
    55  	DeviceS7 = DeviceType("S7")
    56  	// DeviceL3 ...
    57  	DeviceL3 = DeviceType("L3")
    58  	// DeviceL3Plus ...
    59  	DeviceL3Plus = DeviceType("L3+")
    60  	// DeviceD3 ...
    61  	DeviceD3 = DeviceType("D3")
    62  	// DeviceT9 ...
    63  	DeviceT9 = DeviceType("T9")
    64  )
    65  
    66  type commandRequest struct {
    67  	Command   string `json:"command"`
    68  	Parameter string `json:"parameter,omitempty"`
    69  }
    70  
    71  // ITransport ...
    72  type ITransport interface {
    73  	RunCommand(command, argument string) (res []byte, err error)
    74  }
    75  
    76  // Status - status of request
    77  type Status struct {
    78  	Status      string `json:"STATUS"`
    79  	When        int
    80  	Code        int
    81  	Msg         string
    82  	Description string
    83  }
    84  
    85  // GenericResponse ...
    86  type GenericResponse struct {
    87  	ID     int      `json:"id"`
    88  	Status []Status `json:"STATUS"`
    89  }
    90  
    91  // TODO remove in go2
    92  type StatsResponse struct {
    93  	GenericResponse
    94  	Stats []StatsL3 `json:"STATS"`
    95  }
    96  
    97  // DevsResponse ...
    98  type DevsResponse struct {
    99  	GenericResponse
   100  	Devs []Dev `json:"DEVS"`
   101  }
   102  
   103  // SummaryResponse ...
   104  type SummaryResponse struct {
   105  	GenericResponse
   106  	Summary []Summary `json:"SUMMARY"`
   107  }
   108  
   109  // PoolsResponse ...
   110  type PoolsResponse struct {
   111  	GenericResponse
   112  	Pools []Pool `json:"POOLS"`
   113  }
   114  
   115  // VersionResponse ...
   116  type VersionResponse struct {
   117  	GenericResponse
   118  	Version []Version `json:"VERSION"`
   119  }
   120  
   121  // S9
   122  type StatsS9 struct {
   123  	BMMiner               string
   124  	API                   string
   125  	Miner                 string
   126  	CompileTime           string
   127  	Type                  string
   128  	MinerID               string `json:"miner_id"`
   129  	MinerVersion          string `json:"miner_version"`
   130  	MinerCount            int16  `json:"miner_count"`
   131  	Elapsed               int64  `json:"Elapsed"`
   132  	Wait                  float64
   133  	DeviceHardwarePercent float64 `json:"Device Hardware%"`
   134  	Stats                 int     `json:"STATS"`
   135  	Max                   float64
   136  	NotMatchingWork       int `json:"no_matching_work"`
   137  	ID                    string
   138  	Calls                 int
   139  	Min                   float64
   140  	TotalAcn              int16   `json:"total_acn"`
   141  	TotalRate             float32 `json:"total_rate"`
   142  	TotalRateIdeal        float32 `json:"total_rateideal"`
   143  	TotalFrequencyAvg     float32 `json:"total_freqavg"`
   144  	Frequency             float32 `json:"frequency,string"`
   145  	FrequencyAvg6         float32 `json:"freq_avg6"`
   146  	FrequencyAvg7         float32 `json:"freq_avg7"`
   147  	FrequencyAvg8         float32 `json:"freq_avg8"`
   148  	FanNum                int16   `json:"fan_num"`
   149  	Fan3                  int16   `json:"fan3"`
   150  	Fan6                  int16   `json:"fan6"`
   151  	TempMax               int16   `json:"temp_max"`
   152  	TempNum               int16   `json:"temp_num"`
   153  	Temp6                 int16   `json:"temp6"`
   154  	Temp7                 int16   `json:"temp7"`
   155  	Temp8                 int16   `json:"temp8"`
   156  	Temp2_6               int16   `json:"temp2_6"`
   157  	Temp2_7               int16   `json:"temp2_7"`
   158  	Temp2_8               int16   `json:"temp2_8"`
   159  	Ghs5s                 float64 `json:"GHS 5s,string"`
   160  	GhsAverage            float64 `json:"GHS av"`
   161  	ChainHW6              int     `json:"chain_hw6"`
   162  	ChainHW7              int     `json:"chain_hw7"`
   163  	ChainHW8              int     `json:"chain_hw8"`
   164  	ChainAcs6             string  `json:"chain_acs6"`
   165  	ChainAcs7             string  `json:"chain_acs7"`
   166  	ChainAcs8             string  `json:"chain_acs8"`
   167  	ChainAcn6             int     `json:"chain_acn6"`
   168  	ChainAcn7             int     `json:"chain_acn7"`
   169  	ChainAcn8             int     `json:"chain_acn8"`
   170  	ChainRate6            float32 `json:"chain_rate6"`
   171  	ChainRate7            float32 `json:"chain_rate7"`
   172  	ChainRate8            float32 `json:"chain_rate8"`
   173  	ChainRateIdeal6       float32 `json:"chain_rateideal6"`
   174  	ChainRateIdeal7       float32 `json:"chain_rateideal7"`
   175  	ChainRateIdeal8       float32 `json:"chain_rateideal8"`
   176  	ChainOpenCore6        int     `json:"chain_opencore_6,string"`
   177  	ChainOpenCore7        int     `json:"chain_opencore_7,string"`
   178  	ChainOpenCore8        int     `json:"chain_opencore_8,string"`
   179  	ChainOffside6         int     `json:"chain_offside_6,string"`
   180  	ChainOffside7         int     `json:"chain_offside_7,string"`
   181  	ChainOffside8         int     `json:"chain_offside_8,string"`
   182  	// ChainXtime6 need to be parsed?
   183  	ChainXtime6 string `json:"chain_xtime6"`
   184  	ChainXtime7 string `json:"chain_xtime7"`
   185  	ChainXtime8 string `json:"chain_xtime8"`
   186  }
   187  
   188  // S7
   189  type StatsS7 struct {
   190  	CGMiner               string `json:"CGMiner,omitempty"`
   191  	Miner                 string
   192  	CompileTime           string
   193  	Type                  string
   194  	Stats                 int `json:"STATS"`
   195  	ID                    string
   196  	Elapsed               int64 `json:"Elapsed"`
   197  	Calls                 int
   198  	Wait                  float64
   199  	Max                   float64
   200  	Min                   float64
   201  	Ghs5s                 float64 `json:"GHS 5s"`
   202  	GhsAverage            float64 `json:"GHS av"`
   203  	Baud                  int     `json:"baud"`
   204  	MinerCount            int16   `json:"miner_count"`
   205  	AsicCount             int     `json:"asic_count"`
   206  	Timeout               int     `json:"timeout"`
   207  	Frequency             float32 `json:"frequency,string"`
   208  	Voltage               float32 `json:"voltage,string"`
   209  	FanNum                int16   `json:"fan_num"`
   210  	Fan1                  int16   `json:"fan1"`
   211  	Fan3                  int16   `json:"fan3"`
   212  	TempNum               int16   `json:"temp_num"`
   213  	Temp1                 int16   `json:"temp1"`
   214  	Temp2                 int16   `json:"temp2"`
   215  	Temp3                 int16   `json:"temp3"`
   216  	TempAvg               int16   `json:"temp_avg"`
   217  	TempMax               int16   `json:"temp_max"`
   218  	DeviceHardwarePercent float64 `json:"Device Hardware%"`
   219  	NotMatchingWork       int     `json:"no_matching_work"`
   220  	USBPipe               int     `json:"USB Pipe,string"`
   221  	HWv1                  int     `json:"hwv1"`
   222  	HWv2                  int     `json:"hwv2"`
   223  	HWv3                  int     `json:"hwv3"`
   224  	HWv4                  int     `json:"hwv4"`
   225  	ChainAcn1             int     `json:"chain_acn1"`
   226  	ChainAcn2             int     `json:"chain_acn2"`
   227  	ChainAcn3             int     `json:"chain_acn3"`
   228  	ChainAcs1             string  `json:"chain_acs1"`
   229  	ChainAcs2             string  `json:"chain_acs2"`
   230  	ChainAcs3             string  `json:"chain_acs3"`
   231  }
   232  
   233  // L3
   234  type StatsL3 struct {
   235  	CGMiner               string
   236  	Miner                 string
   237  	CompileTime           string
   238  	Type                  string
   239  	MinerCount            int16 `json:"miner_count"`
   240  	Elapsed               int64 `json:"Elapsed"`
   241  	Wait                  float64
   242  	DeviceHardwarePercent float64 `json:"Device Hardware%"`
   243  	NotMatchingWork       int     `json:"no_matching_work"`
   244  	Stats                 int     `json:"STATS"`
   245  	Min                   float64
   246  	Max                   float64
   247  	ID                    string
   248  	Calls                 int
   249  	Frequency             float32 `json:"frequency,string"`
   250  	FanNum                int16   `json:"fan_num"`
   251  	Fan1                  int16   `json:"fan1"`
   252  	Fan2                  int16   `json:"fan2"`
   253  	TempMax               int16   `json:"temp_max"`
   254  	TempNum               int16   `json:"temp_num"`
   255  	Temp1                 int16   `json:"temp1"`
   256  	Temp2                 int16   `json:"temp2"`
   257  	Temp3                 int16   `json:"temp3"`
   258  	Temp4                 int16   `json:"temp4"`
   259  	Temp2_1               int16   `json:"temp2_1"`
   260  	Temp2_2               int16   `json:"temp2_2"`
   261  	Temp2_3               int16   `json:"temp2_3"`
   262  	Temp2_4               int16   `json:"temp2_4"`
   263  	Temp3_1               int16   `json:"temp31"`
   264  	Temp3_2               int16   `json:"temp32"`
   265  	Temp3_3               int16   `json:"temp33"`
   266  	Temp3_4               int16   `json:"temp34"`
   267  	Temp4_1               int16   `json:"temp4_1"`
   268  	Temp4_2               int16   `json:"temp4_2"`
   269  	Temp4_3               int16   `json:"temp4_3"`
   270  	Temp4_4               int16   `json:"temp4_4"`
   271  	Ghs5s                 float64 `json:"GHS 5s,string"`
   272  	GhsAverage            float64 `json:"GHS av"`
   273  	ChainHW1              int     `json:"chain_hw1"`
   274  	ChainHW2              int     `json:"chain_hw2"`
   275  	ChainHW3              int     `json:"chain_hw3"`
   276  	ChainHW4              int     `json:"chain_hw4"`
   277  	ChainAcs1             string  `json:"chain_acs1"`
   278  	ChainAcs2             string  `json:"chain_acs2"`
   279  	ChainAcs3             string  `json:"chain_acs3"`
   280  	ChainAcs4             string  `json:"chain_acs4"`
   281  	ChainAcn1             int     `json:"chain_acn1"`
   282  	ChainAcn2             int     `json:"chain_acn2"`
   283  	ChainAcn3             int     `json:"chain_acn3"`
   284  	ChainAcn4             int     `json:"chain_acn4"`
   285  	ChainRate1            string  `json:"chain_rate1"`
   286  	ChainRate2            string  `json:"chain_rate2"`
   287  	ChainRate3            string  `json:"chain_rate3"`
   288  	ChainRate4            string  `json:"chain_rate4"`
   289  }
   290  
   291  // D3
   292  type StatsD3 struct {
   293  	Stats                 int    `json:"STATS"`
   294  	CGMiner               string `json:"CGMiner,omitempty"`
   295  	Miner                 string
   296  	CompileTime           string
   297  	Type                  string
   298  	ID                    string
   299  	Elapsed               int64 `json:"Elapsed"`
   300  	Calls                 int
   301  	Wait                  float64
   302  	Min                   float64
   303  	Max                   float64
   304  	Ghs5s                 float64 `json:"GHS 5s,string"`
   305  	GhsAverage            float64 `json:"GHS av"`
   306  	MinerCount            int16   `json:"miner_count"`
   307  	Frequency             float32 `json:"frequency,string"`
   308  	FanNum                int16   `json:"fan_num"`
   309  	Fan1                  int16   `json:"fan1"`
   310  	Fan2                  int16   `json:"fan2"`
   311  	DeviceHardwarePercent float64 `json:"Device Hardware%"`
   312  	NotMatchingWork       int     `json:"no_matching_work"`
   313  	TempNum               int16   `json:"temp_num"`
   314  	Temp1                 int16   `json:"temp1"`
   315  	Temp2                 int16   `json:"temp2"`
   316  	Temp3                 int16   `json:"temp3"`
   317  	Temp4                 int16   `json:"temp4"`
   318  	Temp2_1               int16   `json:"temp2_1"`
   319  	Temp2_2               int16   `json:"temp2_2"`
   320  	Temp2_3               int16   `json:"temp2_3"`
   321  	TempMax               int16   `json:"temp_max"`
   322  	ChainAcn1             int     `json:"chain_acn1"`
   323  	ChainAcn2             int     `json:"chain_acn2"`
   324  	ChainAcn3             int     `json:"chain_acn3"`
   325  	ChainAcs1             string  `json:"chain_acs1"`
   326  	ChainAcs2             string  `json:"chain_acs2"`
   327  	ChainAcs3             string  `json:"chain_acs3"`
   328  	ChainHW1              int     `json:"chain_hw1"`
   329  	ChainHW2              int     `json:"chain_hw2"`
   330  	ChainHW3              int     `json:"chain_hw3"`
   331  	ChainRate1            string  `json:"chain_rate1"`
   332  	ChainRate2            string  `json:"chain_rate2"`
   333  	ChainRate3            string  `json:"chain_rate3"`
   334  }
   335  
   336  // T9
   337  type StatsT9 struct {
   338  	BMMiner               string
   339  	Miner                 string
   340  	CompileTime           string
   341  	Type                  string
   342  	ID                    string
   343  	Stats                 int   `json:"STATS"`
   344  	Elapsed               int64 `json:"Elapsed"`
   345  	Calls                 int
   346  	Wait                  float64
   347  	Max                   float64
   348  	Min                   float64
   349  	Ghs5s                 float64 `json:"GHS 5s,string"`
   350  	GhsAverage            float64 `json:"GHS av"`
   351  	MinerCount            int16   `json:"miner_count"`
   352  	Frequency             float32 `json:"frequency,string"`
   353  	FanNum                int16   `json:"fan_num"`
   354  	Fan3                  int16   `json:"fan3"`
   355  	Fan6                  int16   `json:"fan6"`
   356  	TempNum               int16   `json:"temp_num"`
   357  	Temp2                 int16   `json:"temp2"`
   358  	Temp3                 int16   `json:"temp3"`
   359  	Temp4                 int16   `json:"temp4"`
   360  	Temp9                 int16   `json:"temp9"`
   361  	Temp10                int16   `json:"temp10"`
   362  	Temp11                int16   `json:"temp11"`
   363  	Temp12                int16   `json:"temp12"`
   364  	Temp13                int16   `json:"temp13"`
   365  	Temp14                int16   `json:"temp14"`
   366  	Temp2_2               int16   `json:"temp2_2"`
   367  	Temp2_3               int16   `json:"temp2_3"`
   368  	Temp2_4               int16   `json:"temp2_4"`
   369  	Temp2_9               int16   `json:"temp2_9"`
   370  	Temp2_10              int16   `json:"temp2_10"`
   371  	Temp2_11              int16   `json:"temp2_11"`
   372  	Temp2_12              int16   `json:"temp2_12"`
   373  	Temp2_13              int16   `json:"temp2_13"`
   374  	Temp2_14              int16   `json:"temp2_14"`
   375  	TempMax               int16   `json:"temp_max"`
   376  	FrequencyAvg2         float32 `json:"freq_avg2"`
   377  	FrequencyAvg3         float32 `json:"freq_avg3"`
   378  	FrequencyAvg4         float32 `json:"freq_avg4"`
   379  	FrequencyAvg5         float32 `json:"freq_avg5"`
   380  	FrequencyAvg6         float32 `json:"freq_avg6"`
   381  	FrequencyAvg7         float32 `json:"freq_avg7"`
   382  	FrequencyAvg8         float32 `json:"freq_avg8"`
   383  	FrequencyAvg9         float32 `json:"freq_avg9"`
   384  	FrequencyAvg10        float32 `json:"freq_avg10"`
   385  	FrequencyAvg11        float32 `json:"freq_avg11"`
   386  	FrequencyAvg12        float32 `json:"freq_avg12"`
   387  	FrequencyAvg13        float32 `json:"freq_avg13"`
   388  	FrequencyAvg14        float32 `json:"freq_avg14"`
   389  	TotalRateIdeal        float32 `json:"total_rateideal"`
   390  	TotalFrequencyAvg     float32 `json:"total_freqavg"`
   391  	TotalAcn              int16   `json:"total_acn"`
   392  	TotalRate             float32 `json:"total_rate"`
   393  	ChainRateIdeal2       float32 `json:"chain_rateideal2"`
   394  	ChainRateIdeal3       float32 `json:"chain_rateideal3"`
   395  	ChainRateIdeal4       float32 `json:"chain_rateideal4"`
   396  	ChainRateIdeal9       float32 `json:"chain_rateideal9"`
   397  	ChainRateIdeal10      float32 `json:"chain_rateideal10"`
   398  	ChainRateIdeal11      float32 `json:"chain_rateideal11"`
   399  	ChainRateIdeal12      float32 `json:"chain_rateideal12"`
   400  	ChainRateIdeal13      float32 `json:"chain_rateideal13"`
   401  	ChainRateIdeal14      float32 `json:"chain_rateideal14"`
   402  	DeviceHardwarePercent float64 `json:"Device Hardware%"`
   403  	NotMatchingWork       int     `json:"no_matching_work"`
   404  	ChainAcn2             int     `json:"chain_acn2"`
   405  	ChainAcn3             int     `json:"chain_acn3"`
   406  	ChainAcn4             int     `json:"chain_acn4"`
   407  	ChainAcn9             int     `json:"chain_acn9"`
   408  	ChainAcn10            int     `json:"chain_acn10"`
   409  	ChainAcn11            int     `json:"chain_acn11"`
   410  	ChainAcn12            int     `json:"chain_acn12"`
   411  	ChainAcn13            int     `json:"chain_acn13"`
   412  	ChainAcn14            int     `json:"chain_acn14"`
   413  	ChainAcs2             string  `json:"chain_acs2"`
   414  	ChainAcs3             string  `json:"chain_acs3"`
   415  	ChainAcs4             string  `json:"chain_acs4"`
   416  	ChainAcs9             string  `json:"chain_acs9"`
   417  	ChainAcs10            string  `json:"chain_acs10"`
   418  	ChainAcs11            string  `json:"chain_acs11"`
   419  	ChainAcs12            string  `json:"chain_acs12"`
   420  	ChainAcs13            string  `json:"chain_acs13"`
   421  	ChainAcs14            string  `json:"chain_acs14"`
   422  	ChainHW2              int     `json:"chain_hw2"`
   423  	ChainHW3              int     `json:"chain_hw3"`
   424  	ChainHW4              int     `json:"chain_hw4"`
   425  	ChainHW9              int     `json:"chain_hw9"`
   426  	ChainHW10             int     `json:"chain_hw10"`
   427  	ChainHW11             int     `json:"chain_hw11"`
   428  	ChainHW12             int     `json:"chain_hw12"`
   429  	ChainHW13             int     `json:"chain_hw13"`
   430  	ChainHW14             int     `json:"chain_hw14"`
   431  	ChainRate2            float32 `json:"chain_rate2"`
   432  	ChainRate3            float32 `json:"chain_rate3"`
   433  	ChainRate4            float32 `json:"chain_rate4"`
   434  	ChainRate9            float32 `json:"chain_rate9"`
   435  	ChainRate10           float32 `json:"chain_rate10"`
   436  	ChainRate11           float32 `json:"chain_rate11"`
   437  	ChainRate12           float32 `json:"chain_rate12"`
   438  	ChainRate13           float32 `json:"chain_rate13"`
   439  	ChainRate14           float32 `json:"chain_rate14"`
   440  	ChainXtime2           string  `json:"chain_xtime2"`
   441  	ChainXtime3           string  `json:"chain_xtime3"`
   442  	ChainXtime4           string  `json:"chain_xtime4"`
   443  	ChainXtime9           string  `json:"chain_xtime9"`
   444  	ChainXtime10          string  `json:"chain_xtime10"`
   445  	ChainXtime11          string  `json:"chain_xtime11"`
   446  	ChainXtime12          string  `json:"chain_xtime12"`
   447  	ChainXtime13          string  `json:"chain_xtime13"`
   448  	ChainXtime14          string  `json:"chain_xtime14"`
   449  	ChainOffside2         int     `json:"chain_offside_2,string"`
   450  	ChainOffside3         int     `json:"chain_offside_3,string"`
   451  	ChainOffside4         int     `json:"chain_offside_4,string"`
   452  	ChainOffside9         int     `json:"chain_offside_9,string"`
   453  	ChainOffside10        int     `json:"chain_offside_10,string"`
   454  	ChainOffside11        int     `json:"chain_offside_11,string"`
   455  	ChainOffside12        int     `json:"chain_offside_12,string"`
   456  	ChainOffside13        int     `json:"chain_offside_13,string"`
   457  	ChainOffside14        int     `json:"chain_offside_14,string"`
   458  	ChainOpenCore2        int     `json:"chain_opencore_2,string"`
   459  	ChainOpenCore3        int     `json:"chain_opencore_3,string"`
   460  	ChainOpenCore4        int     `json:"chain_opencore_4,string"`
   461  	ChainOpenCore9        int     `json:"chain_opencore_9,string"`
   462  	ChainOpenCore10       int     `json:"chain_opencore_10,string"`
   463  	ChainOpenCore11       int     `json:"chain_opencore_11,string"`
   464  	ChainOpenCore12       int     `json:"chain_opencore_12,string"`
   465  	ChainOpenCore13       int     `json:"chain_opencore_13,string"`
   466  	ChainOpenCore14       int     `json:"chain_opencore_14,string"`
   467  	MinerID               string  `json:"miner_id"`
   468  	MinerVersion          string  `json:"miner_version"`
   469  }
   470  
   471  // Dev ...
   472  type Dev struct {
   473  	GPU                 int64
   474  	Enabled             string
   475  	Status              string
   476  	Temperature         float64
   477  	FanSpeed            int     `json:"Fan Speed"`
   478  	FanPercent          int64   `json:"Fan Percent"`
   479  	GPUClock            int64   `json:"GPU Clock"`
   480  	MemoryClock         int64   `json:"Memory Clock"`
   481  	GPUVoltage          float64 `json:"GPU Voltage"`
   482  	Powertune           int64
   483  	MHSav               float64 `json:"MHS av"`
   484  	MHS5s               float64 `json:"MHS 5s"`
   485  	Accepted            int64
   486  	Rejected            int64
   487  	HardwareErrors      int64 `json:"Hardware Errors"`
   488  	Utility             float64
   489  	Intensity           string
   490  	LastSharePool       int64   `json:"Last Share Pool"`
   491  	LashShareTime       int64   `json:"Lash Share Time"`
   492  	TotalMH             float64 `json:"TotalMH"`
   493  	Diff1Work           int64   `json:"Diff1 Work"`
   494  	DifficultyAccepted  float64 `json:"Difficulty Accepted"`
   495  	DifficultyRejected  float64 `json:"Difficulty Rejected"`
   496  	LastShareDifficulty float64 `json:"Last Share Difficulty"`
   497  	LastValidWork       int64   `json:"Last Valid Work"`
   498  	DeviceHardware      float64 `json:"Device Hardware%"`
   499  	DeviceRejected      float64 `json:"Device Rejected%"`
   500  	DeviceElapsed       int64   `json:"Device Elapsed"`
   501  }
   502  
   503  // Summary ...
   504  type Summary struct {
   505  	Accepted              int64
   506  	BestShare             int64   `json:"Best Share"`
   507  	DeviceHardwarePercent float64 `json:"Device Hardware%"`
   508  	DeviceRejectedPercent float64 `json:"Device Rejected%"`
   509  	DifficultyAccepted    float64 `json:"Difficulty Accepted"`
   510  	DifficultyRejected    float64 `json:"Difficulty Rejected"`
   511  	DifficultyStale       float64 `json:"Difficulty Stale"`
   512  	Discarded             int64
   513  	Elapsed               int64
   514  	FoundBlocks           int64 `json:"Found Blocks"`
   515  	GetFailures           int64 `json:"Get Failures"`
   516  	Getworks              int64
   517  	HardwareErrors        int64 `json:"Hardware Errors"`
   518  	LocalWork             int64 `json:"Local Work"`
   519  	// non s7/s9/d3 etc.
   520  	MHS5s float64 `json:"MHS 5s"`
   521  	MHSav float64 `json:"MHS av"`
   522  	// s7 and later
   523  	GHS5s               float64 `json:"GHS 5s,string"`
   524  	GHSav               float64 `json:"GHS av"`
   525  	NetworkBlocks       int64   `json:"Network Blocks"`
   526  	PoolRejectedPercent float64 `json:"Pool Rejected%"`
   527  	PoolStalePercent    float64 `json:"Pool Stale%"`
   528  	Rejected            int64
   529  	RemoteFailures      int64 `json:"Remote Failures"`
   530  	Stale               int64
   531  	TotalMH             float64 `json:"Total MH"`
   532  	Utility             float64
   533  	WorkUtility         float64 `json:"Work Utility"`
   534  	LastGetWork         int     `json:"Last getwork"`
   535  }
   536  
   537  // Pool ...
   538  type Pool struct {
   539  	Accepted            int64
   540  	BestShare           int64   `json:"Best Share"`
   541  	Diff1Shares         int64   `json:"Diff1 Shares"`
   542  	DifficultyAccepted  float64 `json:"Difficulty Accepted"`
   543  	DifficultyRejected  float64 `json:"Difficulty Rejected"`
   544  	DifficultyStale     float64 `json:"Difficulty Stale"`
   545  	Discarded           int64
   546  	GetFailures         int64 `json:"Get Failures"`
   547  	Getworks            int64
   548  	HasGBT              bool    `json:"Has GBT"`
   549  	HasStratum          bool    `json:"Has Stratum"`
   550  	LastShareDifficulty float64 `json:"Last Share Difficulty"`
   551  	LastShareTime       string  `json:"Last Share Time"`
   552  	LongPoll            string  `json:"Long Poll"`
   553  	Pool                int64   `json:"POOL"`
   554  	PoolRejectedPercent float64 `json:"Pool Rejected%"`
   555  	PoolStalePercent    float64 `json:"Pool Stale%"`
   556  	Priority            int64
   557  	ProxyType           string `json:"Proxy Type"`
   558  	Proxy               string
   559  	Quota               int64
   560  	Rejected            int64
   561  	RemoteFailures      int64 `json:"Remote Failures"`
   562  	Stale               int64
   563  	Status              string
   564  	StratumActive       bool   `json:"Stratum Active"`
   565  	StratumURL          string `json:"Stratum URL"`
   566  	URL                 string `json:"URL"`
   567  	User                string `json:"User"`
   568  	Works               int64
   569  }
   570  
   571  // Version ...
   572  type Version struct {
   573  	BMMiner     string
   574  	API         string
   575  	Miner       string
   576  	CompileTime string
   577  	Type        string
   578  }