Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean addition of CoinMinerz.com VTC pool #609

Merged
merged 4 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
62 changes: 62 additions & 0 deletions pools/coinminerz.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package pools

import (
"fmt"
"time"

"github.com/vertcoin-project/one-click-miner-vnext/util"
)

var _ Pool = &CoinMinerz{}

type CoinMinerz struct {
Address string
LastFetchedPayout time.Time
LastPayout uint64
}

func NewCoinMinerz(addr string) *CoinMinerz {
return &CoinMinerz{Address: addr}
}

func (p *CoinMinerz) GetPendingPayout() uint64 {
jsonPayload := map[string]interface{}{}
err := util.GetJson(fmt.Sprintf("https://coinminerz.com/api/v1/Vertcoin/statistics?address=%s", p.Address), &jsonPayload)
if err != nil {
return 0
}
vtc, ok := jsonPayload["payments.next"].(float64)
if !ok {
return 0
}
vtc *= 100000000
return uint64(vtc)
}

func (p *CoinMinerz) GetStratumUrl() string {
return "stratum+tcp://stratum.coinminerz.com:3317"
}

func (p *CoinMinerz) GetUsername() string {
return p.Address
}

func (p *CoinMinerz) GetPassword() string {
return "x"
}

func (p *CoinMinerz) GetID() int {
return 10
}

func (p *CoinMinerz) GetName() string {
return "CoinMinerz.com"
}

func (p *CoinMinerz) GetFee() float64 {
return 1
}

func (p *CoinMinerz) OpenBrowserPayoutInfo(addr string) {
util.OpenBrowser(fmt.Sprintf("https://coinminerz.com/miner/Vertcoin/%s", addr))
}
1 change: 1 addition & 0 deletions pools/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func GetPools(addr string, testnet bool) []Pool {
NewP2Pool(addr),
Newzpool(addr),
NewMiningpoolSweden(addr),
NewCoinMinerz(addr),
}
}

Expand Down