yiimp

package module
v0.0.0-...-d00d908 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2019 License: MIT Imports: 12 Imported by: 6

README

go-yiimp-api

Yiimppool Api library for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToFloat64

func ToFloat64(value interface{}) (float64, error)

Types

type Algo

type Algo struct {
	Name            string  `json:"name"`
	Port            uint16  `json:"port"`
	Coins           uint16  `json:"coins"`
	Fees            float32 `json:"fees"`
	Hashrate        float64 `json:"hashrate"`
	Workers         uint16  `json:"workers"`
	EstimateCurrent float64 `json:"estimate_current"`
	EstimateLast24h float64 `json:"estimate_last24h"`
	ActualLast24h   float64 `json:"actual_last24h"`
	Hashrate24h     float64 `json:"hashrate_last24h"`
	UnitFactor      float64 `json:"mbtc_mh_factor,omitempty"`
	RentalCurrent   float64 `json:"rental_current,omitempty"`
}

func (*Algo) UnmarshalJSON

func (a *Algo) UnmarshalJSON(data []byte) error

type Currencies

type Currencies map[string]Currency

type Currency

type Currency struct {
	Name          string `json:"name"`
	Symbol        string `json:"symbol,omitempty"`
	Port          uint16 `json:"port"`
	Algo          string `json:"algo"`
	Height        uint32 `json:"height"`
	Workers       uint16 `json:"workers"`
	Shares        uint64 `json:"shares"`
	Hashrate      uint64 `json:"hashrate"`
	LastBlock     uint32 `json:"lastblock"`
	TimeSinceLast uint32 `json:"timesincelast"`
}

type Miner

type Miner struct {
	Version    string  `json:"version"`
	Password   string  `json:"password"`
	Id         string  `json:"ID"`
	Algo       string  `json:"algo"`
	Difficulty float32 `json:"difficulty"`
	Subscribe  uint8   `json:"subscribe"`
	Accepted   float64 `json:"accepted"`
	Rejected   float64 `json:"rejected"`
}

func (*Miner) UnmarshalJSON

func (a *Miner) UnmarshalJSON(data []byte) error

type PoolStatus

type PoolStatus map[string]Algo

type Rental

type Rental struct {
	Balance     float64   `json:"balance"`
	Unconfirmed float64   `json:"unconfirmed"`
	Jobs        RentalJob `json:"jobs"`
}

type RentalJob

type RentalJob struct {
	JobId      uint32  `json:"jobid,string"`
	Algo       string  `json:"algo"`
	Price      float64 `json:"price,string"`
	Hashrate   uint64  `json:"hashrate,string"`
	Server     string  `json:"server"`
	Port       uint16  `json:"port,string"`
	Username   string  `json:"username"`
	Password   string  `json:"password"`
	Started    uint8   `json:"started"`
	Active     uint8   `json:"active"`
	Accepted   float64 `json:"accepted,string"`
	Rejected   float64 `json:"rejected,string"`
	Difficulty float32 `json:"diff,string"`
}

type Wallet

type Wallet struct {
	Currency string  `json:"currency"`
	Unsold   float64 `json:"unsold"`
	Balance  float64 `json:"balance"`
	Unpaid   float64 `json:"unpaid"`
	Paid     float64 `json:"paid"`
	Total    float64 `json:"total"`
}

type WalletEx

type WalletEx struct {
	Currency string  `json:"currency"`
	Unsold   float64 `json:"unsold"`
	Balance  float64 `json:"balance"`
	Unpaid   float64 `json:"unpaid"`
	Paid     float64 `json:"paid"`
	Total    float64 `json:"total"`
	Miners   []Miner `json:"miners"`
}

type YiimpClient

type YiimpClient struct {
	// contains filtered or unexported fields
}

func NewYiimpClient

func NewYiimpClient(client *http.Client, BaseURL string, ApiKey string, UserAgent string) *YiimpClient

func (*YiimpClient) GetCurrencies

func (client *YiimpClient) GetCurrencies() (Currencies, error)

func (*YiimpClient) GetRental

func (client *YiimpClient) GetRental(key string) (Rental, error)

func (*YiimpClient) GetStatus

func (client *YiimpClient) GetStatus() (PoolStatus, error)

func (*YiimpClient) GetWallet

func (client *YiimpClient) GetWallet(address string) (Wallet, error)

func (*YiimpClient) GetWalletEx

func (client *YiimpClient) GetWalletEx(address string) (WalletEx, error)

func (YiimpClient) SetDebug

func (client YiimpClient) SetDebug(debug bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL