Skip to content

Commit

Permalink
v6.3.22
Browse files Browse the repository at this point in the history
Improvements:
- Core: Optimize miner window title display
- Remove obsolete code & minor code optimizations (summary & footer)

Miner updates:
- JayddeeCpu-v24.7
- OneZeroMiner-v1.4.3
- Wildrig-v0.41.7
  • Loading branch information
UselessGuru committed Dec 21, 2024
1 parent 5877845 commit f424ba8
Show file tree
Hide file tree
Showing 113 changed files with 873 additions and 739 deletions.
4 changes: 2 additions & 2 deletions Balances/HashCryptos.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\HashCryptos.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Balances/HiveON.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\Hiveon.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Balances/MiningDutch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\MiningDutch.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
141 changes: 141 additions & 0 deletions Balances/MiningPoolHub.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<#
Copyright (c) 2018-2024 UselessGuru
UG-Miner is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
UG-Miner is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
#>

<#
Product: UG-Miner
File: \Balances\MiningPoolHub.ps1
Version: 6.3.22
Version date: 2024/12/21
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName

$RetryInterval = $Config.PoolsConfig.$Name.PoolAPIretryInterval
$PoolAPItimeout = $Config.PoolsConfig.$Name.PoolAPItimeout
$RetryCount = $Config.PoolsConfig.$Name.PoolAPIretryInterval

$Headers = @{ "Cache-Control" = "no-cache" }
$Useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"

While (-not $UserAllBalances -and $RetryCount -gt 0 -and $Config.MiningPoolHubAPIKey) {
Try {
$Url = "https://miningpoolhub.com/"
$WebResponse = Invoke-WebRequest -Uri $Url -TimeoutSec $PoolAPItimeout -ErrorAction Ignore

# PWSH 6+ no longer supports basic parsing -> parse text
$CoinList = [System.Collections.Generic.List[PSCustomObject]]@()
$InCoinList = $false

If ($WebResponse.statuscode -eq 200) {
($WebResponse.Content -split "\n" -replace ' \s+' -replace ' $').ForEach(
{
If ($_ -like '<table id="coinList"*>') {
$InCoinList = $true
}
If ($InCoinList) {
If ($_ -like '</table>') { Return }
If ($_ -like '<td align="left"><a href="*') {
$CoinList.Add($_ -replace '<td align="left"><a href="' -replace '" target="_blank">.+' -replace '^//' -replace '.miningpoolhub.com')
}
}
}
)
}

$UserAllBalances = (((Invoke-RestMethod "http://miningpoolhub.com/index.php?page=api&action=getuserallbalances&api_key=$($Config.MiningPoolHubAPIKey)" -Headers $Headers -TimeoutSec $PoolAPItimeout -ErrorAction Ignore).getuserallbalances).data).Where({ $_.confirmed -gt 0 -or $_.unconfirmed -gt 0 })

If ($Config.LogBalanceAPIResponse) {
"$([DateTime]::Now.ToUniversalTime())" | Out-File -LiteralPath ".\Logs\BalanceAPIResponse_$Name.json" -Append -Force -ErrorAction Ignore
$Request | Out-File -LiteralPath ".\Logs\BalanceAPIResponse_$Name.json" -Append -Force -ErrorAction Ignore
$UserAllBalances | ConvertTo-Json -Depth 10 >> ".\Logs\BalanceAPIResponse_$Name.json"
}

If ($CoinList -and $UserAllBalances) {
($CoinList | Sort-Object).ForEach(
{
$CoinBalance = $null
$RetryCount2 = $Config.PoolsConfig.$Name.PoolAPIretryInterval

While (-not ($CoinBalance) -and $RetryCount2 -gt 0) {
$RetryCount2--
Try {
$CoinBalance = ((Invoke-RestMethod "http://$($_).miningpoolhub.com/index.php?page=api&action=getuserbalance&api_key=$($Config.MiningPoolHubAPIKey)" -Headers $Headers -UserAgent $UserAgent -TimeoutSec $PoolAPItimeout -ErrorAction Ignore).getuserbalance).data
If ($Config.LogBalanceAPIResponse) {
$APIResponse | ConvertTo-Json -Depth 10 | Out-File -LiteralPath ".\Logs\CoinBalanceAPIResponse_$Name.json" -Append -Force -ErrorAction Ignore
}
}
Catch {
Start-Sleep -Seconds $RetryInterval # Pool might not like immediate requests
}
}

If ($Balance = $UserAllBalances.Where({ $_.confirmed -eq $CoinBalance.confirmed -and $_.unconfirmed -eq $CoinBalance.unconfirmed })) {
$Currency = ""
$RetryCount2 = $Config.PoolsConfig.$Name.PoolAPIretryInterval
$PoolInfo = $null

While (-not ($PoolInfo) -and $RetryCount2 -gt 0) {
$RetryCount2--
Try {
$PoolInfo = ((Invoke-RestMethod "http://$($_).miningpoolhub.com/index.php?page=api&action=getpoolinfo&api_key=$($Config.MiningPoolHubAPIKey)" -Headers $Headers -UserAgent $UserAgent -TimeoutSec $PoolAPItimeout -ErrorAction Ignore).getpoolinfo).data
If ($Config.LogBalanceAPIResponse) {
$APIResponse | ConvertTo-Json -Depth 10 | Out-File -LiteralPath ".\Logs\BalanceAPIResponse_$Name.json" -Append -Force -ErrorAction Ignore
}
$Currency = $PoolInfo.currency
}
Catch {
Start-Sleep -Seconds $RetryInterval # Pool might not like immediate requests
}
}

If ($Currency) {
# Prefer custom payout threshold
$PayoutThreshold = $Config.PoolsConfig.$Name.PayoutThreshold.$Currency

If ((-not $PayoutThreshold) -and $Currency -eq "BTC" -and $Config.PoolsConfig.$Name.PayoutThreshold.mBTC) { $PayoutThreshold = $Config.PoolsConfig.$Name.PayoutThreshold.mBTC / 1000 }
If (-not $PayoutThreshold) { $PayoutThreshold = $PoolInfo.min_ap_threshold }

[PSCustomObject]@{
DateTime = [DateTime]::Now.ToUniversalTime()
Pool = $Name
Currency = $Currency
Wallet = $Config.MiningPoolHubUserName
Pending = [Double]$CoinBalance.unconfirmed
Balance = [Double]$CoinBalance.confirmed
Unpaid = [Double]($CoinBalance.confirmed + $CoinBalance.unconfirmed)
# Total = [Double]($CoinBalance.confirmed + $CoinBalance.unconfirmed + $CoinBalance.ae_confirmed + $CoinBalance.ae_unconfirmed + $CoinBalance.exchange)
PayoutThreshold = [Double]$PayoutThreshold
Url = "https://$($_).miningpoolhub.com/index.php?page=account&action=pooledit"
}
}
Else {
Write-Message -Level Warn "$($Name): Cannot determine balance for currency '$(If ($_) { $_ } Else { "unknown" })' - cannot convert some balances to BTC or other currencies."
}
}
}
)
}
}
Catch {
Start-Sleep -Seconds $RetryInterval # Pool might not like immediate requests
}

$RetryCount--
}

$Error.Clear()
[System.GC]::Collect()
4 changes: 2 additions & 2 deletions Balances/NiceHash.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\NiceHash.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

If ($Config.NiceHashWallet) {
Expand Down
4 changes: 2 additions & 2 deletions Balances/ProHashing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\ProHashing.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Balances/ZergPool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\ZergPool.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Balances/Zpool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\Zpool.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Brains/HashCryptos.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\MiningDutch.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

using module ..\Includes\Include.psm1
Expand Down
4 changes: 2 additions & 2 deletions Brains/MiningDutch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\MiningDutch.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

using module ..\Includes\Include.psm1
Expand Down
4 changes: 2 additions & 2 deletions Brains/ProHashing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\ProHashing.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

using module ..\Includes\Include.psm1
Expand Down
4 changes: 2 additions & 2 deletions Brains/ZPool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\ZPool.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

using module ..\Includes\Include.psm1
Expand Down
4 changes: 2 additions & 2 deletions Brains/ZergPool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\ZergPool.ps1
Version: 6.3.21
Version date: 2024/12/16
Version: 6.3.22
Version date: 2024/12/21
#>

using module ..\Includes\Include.psm1
Expand Down
2 changes: 2 additions & 0 deletions Data/Algorithms.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@
"xdag": "RandomXDAG",
"xelishash": "XelisHash",
"xelisv2": "XelisHash",
"xelishashv2": "XelisHashV2",
"xelisv2pepew": "XelisV2PepePow",
"xelishashv2pepew": "XelisV2PepePow",
"xla": "Panthera",
"yescryptr16": "YescryptR16",
"yescryptr32": "YescryptR32",
Expand Down
1 change: 1 addition & 0 deletions Data/CoinNames.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"CLORE": "Clore",
"CMS": "Cmusicai",
"CPU": "Cpuchain",
"CRC": "Craft",
"CRNC": "Crionic",
"CTXC": "Cortex",
"CURVE": "Curve",
Expand Down
1 change: 1 addition & 0 deletions Data/CurrencyAlgorithm.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"COCO": "Scrypt",
"CPMK": "Yespower",
"CPU": "CpuPower",
"CRC": "Scrypt",
"CRM": "Skein",
"CRNC": "YespowerLtncg",
"CTXC": "Cuckaroo30ctx",
Expand Down
Loading

0 comments on commit f424ba8

Please sign in to comment.