Documentation
¶
Overview ¶
Package Hpool is an implementation of the Hpool API in Golang.
Index ¶
- Constants
- Variables
- func NewClient(accessToken string) (c *client)
- func NewClientWithCustomHttpConfig(accessToken string, httpClient *http.Client) (c *client)
- func NewClientWithCustomTimeout(accessToken string, timeout time.Duration) (c *client)
- type Assets
- type Hpool
- func (i *Hpool) Miners(pool string) (miners []Miner, err error)
- func (i *Hpool) MiningIncome(pool string) (miningIncomes []MiningIncome, err error)
- func (i *Hpool) Plots(pool string) (plots []Plot, err error)
- func (i *Hpool) PoolDetail(pool string) (poolDetail Pool, err error)
- func (i *Hpool) PoolList(poolType PoolType) (pools []Pool, err error)
- func (i *Hpool) SetDebug(enable bool)
- func (i *Hpool) Totalassets() (assets []Assets, err error)
- type Miner
- type MiningIncome
- type Plot
- type Pool
- type PoolType
Constants ¶
View Source
const (
API_BASE = "https://www.hpool.in/api" // Hpool API endpoint
)
Variables ¶
Functions ¶
func NewClient ¶
func NewClient(accessToken string) (c *client)
NewClient return a new Hpool HTTP client
func NewClientWithCustomHttpConfig ¶
NewClientWithCustomHttpConfig returns a new Hpool HTTP client using the predefined http client
func NewClientWithCustomTimeout ¶
NewClient returns a new Hpool HTTP client with custom timeout
Types ¶
type Assets ¶
type Assets struct { Balance float64 `json:"balance,string"` CooperationAmount float64 `json:"cooperation_amount,string"` DepositAmount float64 `json:"deposit_amount,string"` FreezeBalance float64 `json:"freeze_balance,string"` Name string `json:"name"` Type string `json:"type"` TotalAssets float64 `json:"total_assets,string"` WithdrawAmount float64 `json:"withdraw_amount,string"` }
type Hpool ¶
type Hpool struct {
// contains filtered or unexported fields
}
hpool represent a hpool client
func NewWithCustomHttpClient ¶
NewWithCustomHttpClient returns an instantiated hpool struct with custom http client
func NewWithCustomTimeout ¶
NewWithCustomTimeout returns an instantiated hpool struct with custom timeout
func (*Hpool) MiningIncome ¶
func (i *Hpool) MiningIncome(pool string) (miningIncomes []MiningIncome, err error)
func (*Hpool) Totalassets ¶
type MiningIncome ¶
type Pool ¶
type Pool struct { ApiKey string `json:"api_key"` BlockReward float64 `json:"block_reward,string"` BlockTime int `json:"block_time"` Capacity int `json:"capacity"` Coin string `json:"coin"` DepositMortgageBalance float64 `json:"deposit_mortgage_balance,string"` DepositMortgageEffectiveBalance float64 `json:"deposit_mortgage_effective_balance,string"` DepositMortgageFreeBalance float64 `json:"deposit_mortgage_free_balance,string"` DepositRate float64 `json:"deposit_rate,string"` Fee float64 `json:"fee"` LoanMortgageBalance float64 `json:"loan_mortgage_balance,string"` Mortgage float64 `json:"mortgage,string"` Name string `json:"name"` Offline int `json:"offline"` Online int `json:"online"` PaymentTime string `json:"payment_time"` PointDepositBalance float64 `json:"point_deposit_balance,string"` PoolAddress string `json:"pool_address"` PoolIncome float64 `json:"pool_income,string"` PoolType string `json:"pool_type"` PreviousIncomePb float64 `json:"previous_income_pb,string"` TheoryMortgageBalance float64 `json:"theory_mortgage_balance,string"` Type string `json:"type"` UndistributedIncome float64 `json:"undistributed_income,string"` }
Click to show internal directories.
Click to hide internal directories.