mpos

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

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 9 Imported by: 4

README

go-mpos-api

MPOS Api library for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MposClient

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

func NewMposClient

func NewMposClient(client *http.Client, BaseURL string, ApiToken string, UserId uint64, UserAgent string) *MposClient

func (*MposClient) GetPoolHashrate

func (client *MposClient) GetPoolHashrate() (float64, error)

func (*MposClient) GetPoolInfo

func (client *MposClient) GetPoolInfo() (PoolInfo, error)

func (*MposClient) GetPoolStatus

func (client *MposClient) GetPoolStatus() (PoolStatus, error)

func (*MposClient) GetUserBalance

func (client *MposClient) GetUserBalance() (UserBalance, error)

func (*MposClient) GetUserStatus

func (client *MposClient) GetUserStatus() (UserStatus, error)

func (*MposClient) GetUserTransactions

func (client *MposClient) GetUserTransactions() (UserTransactions, error)

func (*MposClient) GetUserWorkers

func (client *MposClient) GetUserWorkers() ([]UserWorkers, error)

func (MposClient) SetDebug

func (client MposClient) SetDebug(debug bool)

type MposRequest

type MposRequest struct {
	Page   string `url:"page"`
	Action string `url:"action"`
	Apikey string `url:"api_key"`
	UserId uint64 `url:"id,omitempty"`
}

type PoolInfo

type PoolInfo struct {
	Currency             string  `json:"currency"`
	CoinName             string  `json:"coinname"`
	CoinTarget           string  `json:"cointarget"`
	CoinDiffChangeTarget int     `json:"coindiffchangetarget"`
	Algorithm            string  `json:"algorithm"`
	StratumPort          uint16  `json:"stratumport,string"`
	PayoutSystem         string  `json:"payout_system"`
	Confirmations        uint32  `json:"confirmations"`
	MinAPThreshold       float64 `json:"min_ap_threshold"`
	MaxAPThreshold       float64 `json:"max_ap_threshold"`
	RewardType           string  `json:"reward_type"`
	Reward               float64 `json:"reward"`
	TxFee                float64 `json:"txfee"`
	TxFeeManual          float64 `json:"txfee_manual"`
	TxFeeAuto            float64 `json:"txfee_auto"`
	Fees                 float64 `json:"fees"`
}

type PoolStatus

type PoolStatus struct {
	Poolname            string  `json:"pool_name"`
	Hashrate            float64 `json:"hashrate"`
	Efficiency          float64 `json:"efficiency"`
	Progress            float64 `json:"progress"`
	Workers             uint32  `json:"workers"`
	CurrentNetworkBlock uint32  `json:"currentnetworkblock"`
	NextNetworkBlock    uint32  `json:"nextnetworkblock"`
	LastBlock           uint32  `json:"lastblock"`
	NetworkDiff         float64 `json:"networkdiff"`
	EstTime             float64 `json:"esttime"`
	EstShares           float64 `json:"estshares"`
	TimeSinceLast       uint32  `json:"timesincelast"`
	NetHashRate         float64 `json:"nethashrate"`
}

func (*PoolStatus) UnmarshalJSON

func (s *PoolStatus) UnmarshalJSON(data []byte) error

type TransactionTimestamp

type TransactionTimestamp time.Time

func (*TransactionTimestamp) MarshalJSON

func (tt *TransactionTimestamp) MarshalJSON() ([]byte, error)

MarshalJSON override marshalJSON

func (*TransactionTimestamp) String

func (tt *TransactionTimestamp) String() string

String returns it's string representation

func (*TransactionTimestamp) UnmarshalJSON

func (tt *TransactionTimestamp) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON override unmarshalJSON

type UserBalance

type UserBalance struct {
	Confirmed   float64 `json:"confirmed"`
	Unconfirmed float64 `json:"unconfirmed"`
	Orphaned    float64 `json:"orphaned"`
}

func (*UserBalance) UnmarshalJSON

func (s *UserBalance) UnmarshalJSON(data []byte) error

type UserShares

type UserShares struct {
	Valid         float64    `json:"valid"`
	Invalid       float64    `json:"invalid"`
	DonatePercent strFloat64 `json:"donate_percent"`
	IsAnonymous   int        `json:"is_anonymous"`
}

type UserStatus

type UserStatus struct {
	Username  string     `json:"username"`
	Shares    UserShares `json:"shares"`
	Hashrate  float64    `json:"hashrate"`
	Sharerate float64    `json:"sharerate"`
}

func (*UserStatus) UnmarshalJSON

func (s *UserStatus) UnmarshalJSON(data []byte) error

type UserTransaction

type UserTransaction struct {
	Id            int                  `json:"id"`
	Username      string               `json:"username"`
	Type          string               `json:"type"`
	Amount        float64              `json:"amount"`
	CoinAddress   string               `json:"coin_address"`
	Timestamp     TransactionTimestamp `json:"timestamp"`
	TxId          string               `json:"txid"`
	Height        uint32               `json:"height"`
	BlockHash     string               `json:"blockhash"`
	Confirmations uint16               `json:"confirmations"`
}

type UserTransactionSummary

type UserTransactionSummary struct {
	Bonus   float64 `json:"Bonus"`
	Credit  float64 `json:"Credit"`
	DebitAP float64 `json:"Debit_AP"`
	Fee     float64 `json:"Fee"`
	TXFee   float64 `json:"TXFee"`
}

type UserTransactions

type UserTransactions struct {
	Transactions       []UserTransaction      `json:"transactions"`
	TransactionSummary UserTransactionSummary `json:"transactionsummary"`
}

type UserWorkers

type UserWorkers struct {
	Id              int    `json:"id"`
	Username        string `json:"username"`
	Password        string `json:"password"`
	Monitor         uint   `json:"monitor"`
	CountAll        uint   `json:"count_all"`
	CountAllArchive uint   `json:"count_all_archive"`
	Hashrate        int    `json:"hashrate"`
	Difficulty      int    `json:"difficulty"`
}

Jump to

Keyboard shortcuts

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