diff --git a/algopools/ahashpool.ps1 b/algopools/ahashpool.ps1 index c4cba8ddc..8155376cc 100755 --- a/algopools/ahashpool.ps1 +++ b/algopools/ahashpool.ps1 @@ -38,14 +38,14 @@ if ($Poolname -eq $Name) { Protocol = "stratum+tcp" Host = $ahashpool_Host Port = $ahashpool_Port - User1 = $Wallet1 - User2 = $Wallet2 - User3 = $Wallet3 - CPUser = $Wallet1 - CPUPass = "c=$Passwordcurrency1,ID=$Rigname1" - Pass1 = "c=$Passwordcurrency1,ID=$Rigname1" - Pass2 = "c=$Passwordcurrency2,ID=$Rigname2" - Pass3 = "c=$Passwordcurrency3,ID=$Rigname3" + User1 = $global:Wallets.Wallet1.BTC.address + User2 = $global:Wallets.Wallet2.BTC.address + User3 = $global:Wallets.Wallet3.BTC.address + CPUser = $global:Wallets.Wallet1.BTC.address + CPUPass = "c=$($global:Wallets.Wallet1.keys),ID=$Rigname1" + Pass1 = "c=$($global:Wallets.Wallet1.keys),ID=$Rigname1" + Pass2 = "c=$($global:Wallets.Wallet2.keys),ID=$Rigname2" + Pass3 = "c=$($global:Wallets.Wallet3.keys),ID=$Rigname3" Location = $Location SSL = $false } diff --git a/algopools/blazepool.ps1 b/algopools/blazepool.ps1 index c2f8528fc..a2b0f281f 100755 --- a/algopools/blazepool.ps1 +++ b/algopools/blazepool.ps1 @@ -38,14 +38,14 @@ if ($Poolname -eq $Name) { Protocol = "stratum+tcp" Host = $blazepool_Host Port = $blazepool_Port - User1 = $Wallet1 - User2 = $Wallet2 - User3 = $Wallet3 - CPUser = $Wallet1 - CPUPass = "c=$Passwordcurrency1,ID=$Rigname1" - Pass1 = "c=$Passwordcurrency1,ID=$Rigname1" - Pass2 = "c=$Passwordcurrency2,ID=$Rigname2" - Pass3 = "c=$Passwordcurrency3,ID=$Rigname3" + User1 = $global:Wallets.Wallet1.BTC.address + User2 = $global:Wallets.Wallet2.BTC.address + User3 = $global:Wallets.Wallet3.BTC.address + CPUser = $global:Wallets.Wallet1.BTC.address + CPUPass = "c=$($global:Wallets.Wallet1.keys),ID=$Rigname1" + Pass1 = "c=$($global:Wallets.Wallet1.keys),ID=$Rigname1" + Pass2 = "c=$($global:Wallets.Wallet2.keys),ID=$Rigname2" + Pass3 = "c=$($global:Wallets.Wallet3.keys),ID=$Rigname3" Location = $Location SSL = $false } diff --git a/algopools/blockmasters.ps1 b/algopools/blockmasters.ps1 index 64892f210..f0906224a 100755 --- a/algopools/blockmasters.ps1 +++ b/algopools/blockmasters.ps1 @@ -35,23 +35,44 @@ if ($Poolname -eq $Name) { $Fee = 22.5 - $Estimate = if ($Stat_Algo -eq "Day") {[Double]$blockpool_Request.$_.estimate_last24h*(1-($Fee/100))}else{[Double]$blockpool_Request.$_.estimate_current*(1-($Fee/100))} + $Estimate = if ($Stat_Algo -eq "Day") {[Double]$blockpool_Request.$_.estimate_last24h * (1 - ($Fee / 100))}else {[Double]$blockpool_Request.$_.estimate_current * (1 - ($Fee / 100))} - $Stat = Set-Stat -Name "$($Name)_$($blockpool_Algorithm)_profit" -Value ([Double]$Estimate/$Divisor) + $Stat = Set-Stat -Name "$($Name)_$($blockpool_Algorithm)_profit" -Value ([Double]$Estimate / $Divisor) if ($Stat_Algo -eq "Day") {$CStat = $Stat.Live}else {$CStat = $Stat.$Stat_Algo} - If ($AltWallet1 -ne '') {$blockWallet1 = $AltWallet1} - else {$blockWallet1 = $Wallet1} - if ($AltWallet2 -ne '') {$blockWallet2 = $AltWallet2} - else {$blockWallet2 = $Wallet2} - if ($AltWallet3 -ne '') {$blockWallet3 = $AltWallet3} - else {$blockWallet3 = $Wallet3} - if ($AltPassword1 -ne '') {$blockpass1 = $Altpassword1} - else {$blockpass1 = $Passwordcurrency1} - if ($AltPassword2 -ne '') {$blockpass2 = $AltPassword2} - else {$blockpass2 = $Passwordcurrency2} - if ($AltPassword3 -ne '') {$blockpass3 = $AltPassword3} - else {$blockpass3 = $Passwordcurrency3} + $Pass1 = "$($global:Wallets.Wallet1.Keys)"; + $User1 = "$($global:Wallets.Wallet1.BTC.address)"; + $Pass2 = "$($global:Wallets.Wallet2.Keys)"; + $User2 = "$($global:Wallets.Wallet2.BTC.address)"; + $Pass3 = "$($global:Wallets.Wallet3.Keys)"; + $User3 = "$($global:Wallets.Wallet3.BTC.address)"; + + $Pass1 = $global:Wallets.Wallet1.Keys + $User1 = $global:Wallets.Wallet1.BTC.address + $Pass2 = $global:Wallets.Wallet2.Keys + $User2 = $global:Wallets.Wallet2.BTC.address + $Pass3 = $global:Wallets.Wallet3.Keys + $User3 = $global:Wallets.Wallet3.BTC.address + + $global:Wallets.AltWallet1.Keys | ForEach-Object { + if ($global:Wallets.AltWallet1.$_.Pools -contains $Name) { + $Pass1 = $_; + $User1 = $global:Wallets.AltWallet1.$_.address; + } + } + $global:Wallets.AltWallet2.Keys | ForEach-Object { + if ($global:Wallets.AltWallet2.$_.Pools -contains $Name) { + $Pass2 = $_; + $User2 = $global:Wallets.AltWallet2.$_.address; + } + } + $global:Wallets.AltWallet3.Keys | ForEach-Object { + if ($global:Wallets.AltWallet3.$_.Pools -contains $Name) { + $Pass3 = $_; + $User3 = $global:Wallets.AltWallet3.$_.address; + } + } + [PSCustomObject]@{ Priority = $Priorities.Pool_Priorities.$Name Symbol = $blockpool_Algorithm @@ -63,14 +84,14 @@ if ($Poolname -eq $Name) { Protocol = "stratum+tcp" Host = $blockpool_Host Port = $blockpool_Port - User1 = $blockwallet1 - User2 = $blockwallet2 - User3 = $blockwallet3 - CPUser = $blockwallet1 - CPUPass = "c=$blockpass1,ID=$Rigname1" - Pass1 = "c=$blockpass1,ID=$Rigname1" - Pass2 = "c=$blockpass2,ID=$Rigname2" - Pass3 = "c=$blockpass3,ID=$Rigname3" + User1 = $User1 + User2 = $User2 + User3 = $User3 + CPUser = $User1 + CPUPass = "c=$Pass1,ID=$Rigname1" + Pass1 = "c=$Pass1,ID=$Rigname1" + Pass2 = "c=$Pass2,ID=$Rigname2" + Pass3 = "c=$Pass3,ID=$Rigname3" Location = $Location SSL = $false } diff --git a/algopools/fairpool.ps1 b/algopools/fairpool.ps1 index b86bd2da5..5010f795e 100755 --- a/algopools/fairpool.ps1 +++ b/algopools/fairpool.ps1 @@ -43,14 +43,14 @@ if ($Poolname -eq $Name) { Protocol = "stratum+tcp" Host = $fairpool_Host Port = $fairpool_Port - User1 = $Wallet1 - User2 = $Wallet2 - User3 = $Wallet3 - CPUser = $Wallet1 - CPUPass = "c=$Passwordcurrency1,ID=$Rigname1" - Pass1 = "c=$Passwordcurrency1,ID=$Rigname1" - Pass2 = "c=$Passwordcurrency2,ID=$Rigname2" - Pass3 = "c=$Passwordcurrency3,ID=$Rigname3" + User1 = $global:Wallets.Wallet1.BTC.address + User2 = $global:Wallets.Wallet2.BTC.address + User3 = $global:Wallets.Wallet3.BTC.address + CPUser = $global:Wallets.Wallet1.BTC.address + CPUPass = "c=$($global:Wallets.Wallet1.keys),ID=$Rigname1" + Pass1 = "c=$($global:Wallets.Wallet1.keys),ID=$Rigname1" + Pass2 = "c=$($global:Wallets.Wallet2.keys),ID=$Rigname2" + Pass3 = "c=$($global:Wallets.Wallet3.keys),ID=$Rigname3" Location = $Location SSL = $false } diff --git a/algopools/hashrefinery.ps1 b/algopools/hashrefinery.ps1 index 609ff1659..eac7f49e1 100755 --- a/algopools/hashrefinery.ps1 +++ b/algopools/hashrefinery.ps1 @@ -37,14 +37,14 @@ if ($Poolname -eq $Name) { Protocol = "stratum+tcp" Host = $Hashrefinery_Host Port = $Hashrefinery_Port - User1 = $Wallet1 - User2 = $Wallet2 - User3 = $Wallet3 - CPUser = $Wallet1 - CPUPass = "c=$Passwordcurrency1,ID=$Rigname1" - Pass1 = "c=$Passwordcurrency1,ID=$Rigname1" - Pass2 = "c=$Passwordcurrency2,ID=$Rigname2" - Pass3 = "c=$Passwordcurrency3,ID=$Rigname3" + User1 = $global:Wallets.Wallet1.BTC.address + User2 = $global:Wallets.Wallet2.BTC.address + User3 = $global:Wallets.Wallet3.BTC.address + CPUser = $global:Wallets.Wallet1.BTC.address + CPUPass = "c=$($global:Wallets.Wallet1.keys),ID=$Rigname1" + Pass1 = "c=$($global:Wallets.Wallet1.keys),ID=$Rigname1" + Pass2 = "c=$($global:Wallets.Wallet2.keys),ID=$Rigname2" + Pass3 = "c=$($global:Wallets.Wallet3.keys),ID=$Rigname3" Location = $Location SSL = $false } diff --git a/algopools/nlpool.ps1 b/algopools/nlpool.ps1 index f074ee5cf..c9c46999e 100755 --- a/algopools/nlpool.ps1 +++ b/algopools/nlpool.ps1 @@ -19,25 +19,37 @@ if ($Poolname -eq $Name) { $nlpoolAlgo_Host = "mine.nlpool.nl" $nlpoolAlgo_Port = $nlpool_Request.$_.port $Divisor = (1000000 * $nlpool_Request.$_.mbtc_mh_factor) - $Fees = $nlpool_Request.$_.fees - $Workers = $nlpool_Request.$_.Workers $Estimate = if ($Stat_Algo -eq "Day") {[Double]$nlpool_Request.$_.estimate_last24h}else {[Double]$nlpool_Request.$_.estimate_current} $Stat = Set-Stat -Name "$($Name)_$($nlpoolAlgo_Algorithm)_profit" -Value ([Double]$Estimate/$Divisor *(1-($nlpool_Request.$_.fees/100))) if ($Stat_Algo -eq "Day") {$CStat = $Stat.Live}else {$CStat = $Stat.$Stat_Algo} - If ($AltWallet1 -ne '') {$nWallet1 = $AltWallet1} - else {$nWallet1 = $Wallet1} - if ($AltWallet2 -ne '') {$nWallet2 = $AltWallet2} - else {$nWallet2 = $Wallet2} - if ($AltWallet3 -ne '') {$nWallet3 = $AltWallet3} - else {$nWallet3 = $Wallet3} - if ($AltPassword1 -ne '') {$npass1 = $AltPassword1} - else {$npass1 = $PasswordCurrency1} - if ($AltPassword2 -ne '') {$npass2 = $AltPassword2} - else {$npass2 = $PasswordCurrency2} - if ($AltPassword3 -ne '') {$npass3 = $AltPassword3} - else {$npass3 = $PasswordCurrency3} + $Pass1 = $global:Wallets.Wallet1.Keys + $User1 = $global:Wallets.Wallet1.BTC.address + $Pass2 = $global:Wallets.Wallet2.Keys + $User2 = $global:Wallets.Wallet2.BTC.address + $Pass3 = $global:Wallets.Wallet3.Keys + $User3 = $global:Wallets.Wallet3.BTC.address + + $global:Wallets.AltWallet1.Keys | ForEach-Object { + if ($global:Wallets.AltWallet1.$_.Pools -contains $Name) { + $Pass1 = $_; + $User1 = $global:Wallets.AltWallet1.$_.address; + } + } + $global:Wallets.AltWallet2.Keys | ForEach-Object { + if ($global:Wallets.AltWallet2.$_.Pools -contains $Name) { + $Pass2 = $_; + $User2 = $global:Wallets.AltWallet2.$_.address; + } + } + $global:Wallets.AltWallet3.Keys | ForEach-Object { + if ($global:Wallets.AltWallet3.$_.Pools -contains $Name) { + $Pass3 = $_; + $User3 = $global:Wallets.AltWallet3.$_.address; + } + } + [PSCustomObject]@{ Priority = $Priorities.Pool_Priorities.$Name Symbol = $nlpoolAlgo_Algorithm @@ -49,14 +61,14 @@ if ($Poolname -eq $Name) { Protocol = "stratum+tcp" Host = $nlpoolAlgo_Host Port = $nlpoolAlgo_Port - User1 = $nWallet1 - User2 = $nWallet2 - User3 = $nWallet3 - CPUser = $nWallet1 - CPUPass = "c=$npass1,ID=$Rigname1" - Pass1 = "c=$npass1,ID=$Rigname1" - Pass2 = "c=$npass2,ID=$Rigname2" - Pass3 = "c=$npass3,ID=$Rigname3" + User1 = $User1 + User2 = $User2 + User3 = $User3 + CPUser = $User1 + CPUPass = "c=$Pass1,ID=$Rigname1" + Pass1 = "c=$Pass1,ID=$Rigname1" + Pass2 = "c=$Pass2,ID=$Rigname2" + Pass3 = "c=$Pass3,ID=$Rigname3" Location = $Location SSL = $false } diff --git a/algopools/phiphipool.ps1 b/algopools/phiphipool.ps1 index 4d0668594..769f93cb2 100755 --- a/algopools/phiphipool.ps1 +++ b/algopools/phiphipool.ps1 @@ -44,14 +44,14 @@ if ($Poolname -eq $Name) { Protocol = "stratum+tcp" Host = $phiphipool_Host Port = $phiphipool_Port - User1 = $Wallet1 - User2 = $Wallet2 - User3 = $Wallet3 - CPUser = $CPUWallet - CPUPass = "c=$CPUcurrency,ID=$Rigname1" - Pass1 = "c=$Passwordcurrency1,ID=$Rigname1" - Pass2 = "c=$Passwordcurrency2,ID=$Rigname2" - Pass3 = "c=$Passwordcurrency3,ID=$Rigname3" + User1 = $global:Wallets.Wallet1.BTC.address + User2 = $global:Wallets.Wallet2.BTC.address + User3 = $global:Wallets.Wallet3.BTC.address + CPUser = $global:Wallets.Wallet1.BTC.address + CPUPass = "c=$($global:Wallets.Wallet1.keys),ID=$Rigname1" + Pass1 = "c=$($global:Wallets.Wallet1.keys),ID=$Rigname1" + Pass2 = "c=$($global:Wallets.Wallet2.keys),ID=$Rigname2" + Pass3 = "c=$($global:Wallets.Wallet3.keys),ID=$Rigname3" Location = $Location SSL = $false } diff --git a/algopools/zergpool.ps1 b/algopools/zergpool.ps1 index 97231d07a..7fd72e30e 100755 --- a/algopools/zergpool.ps1 +++ b/algopools/zergpool.ps1 @@ -25,19 +25,34 @@ if ($Poolname -eq $Name) { $Stat = Set-Stat -Name "$($Name)_$($Zergpool_Algorithm)_profit" -Value ([Double]$Estimate/$Divisor *(1-($Zergpool_Request.$_.fees/100))) if ($Stat_Algo -eq "Day") {$CStat = $Stat.Live}else {$CStat = $Stat.$Stat_Algo} - - If ($AltWallet1 -ne '') {$zWallet1 = $AltWallet1} - else {$zwallet1 = $Wallet1} - if ($AltWallet2 -ne '') {$zWallet2 = $AltWallet2} - else {$zwallet2 = $Wallet2} - if ($AltWallet3 -ne '') {$zWallet3 = $AltWallet3} - else {$zwallet3 = $Wallet3} - if ($AltPassword1 -ne '') {$zpass1 = $Altpassword1} - else {$zpass1 = $Passwordcurrency1} - if ($AltPassword2 -ne '') {$zpass2 = $AltPassword2} - else {$zpass2 = $Passwordcurrency2} - if ($AltPassword3 -ne '') {$zpass3 = $AltPassword3} - else {$zpass3 = $Passwordcurrency3} + + + $Pass1 = $global:Wallets.Wallet1.Keys + $User1 = $global:Wallets.Wallet1.BTC.address + $Pass2 = $global:Wallets.Wallet2.Keys + $User2 = $global:Wallets.Wallet2.BTC.address + $Pass3 = $global:Wallets.Wallet3.Keys + $User3 = $global:Wallets.Wallet3.BTC.address + + $global:Wallets.AltWallet1.Keys | ForEach-Object { + if ($global:Wallets.AltWallet1.$_.Pools -contains $Name) { + $Pass1 = $_; + $User1 = $global:Wallets.AltWallet1.$_.address; + } + } + $global:Wallets.AltWallet2.Keys | ForEach-Object { + if ($global:Wallets.AltWallet2.$_.Pools -contains $Name) { + $Pass2 = $_; + $User2 = $global:Wallets.AltWallet2.$_.address; + } + } + $global:Wallets.AltWallet3.Keys | ForEach-Object { + if ($global:Wallets.AltWallet3.$_.Pools -contains $Name) { + $Pass3 = $_; + $User3 = $global:Wallets.AltWallet3.$_.address; + } + } + [PSCustomObject]@{ Priority = $Priorities.Pool_Priorities.$Name Symbol = $Zergpool_Algorithm @@ -49,14 +64,14 @@ if ($Poolname -eq $Name) { Protocol = "stratum+tcp" Host = $Zergpool_Host Port = $Zergpool_Port - User1 = $zWallet1 - User2 = $zWallet2 - User3 = $zWallet3 - CPUser = $zWallet1 - CPUPass = "c=$zpass1,ID=$Rigname1$SWARMPass" - Pass1 = "c=$zpass1,ID=$Rigname1$SWARMPass" - Pass2 = "c=$zpass2,ID=$Rigname2$SWARMPass" - Pass3 = "c=$zpass3,ID=$Rigname3$SWARMPass" + User1 = $User1 + User2 = $User2 + User3 = $User3 + CPUser = $User1 + CPUPass = "c=$Pass1,ID=$Rigname1" + Pass1 = "c=$Pass1,ID=$Rigname1" + Pass2 = "c=$Pass2,ID=$Rigname2" + Pass3 = "c=$Pass3,ID=$Rigname3" Location = $Location SSL = $false } diff --git a/algopools/zpool.ps1 b/algopools/zpool.ps1 index e1823055c..5298ef551 100755 --- a/algopools/zpool.ps1 +++ b/algopools/zpool.ps1 @@ -35,18 +35,32 @@ if ($Poolname -eq $Name) { $Stat = Set-Stat -Name "$($Name)_$($Zpool_Algorithm)_profit" -Value ([Double]$Cut/$Divisor) if ($Stat_Algo -eq "Day") {$CStat = $Stat.Live}else {$CStat = $Stat.$Stat_Algo} - If ($AltWallet1 -ne '') {$zWallet1 = $AltWallet1} - else {$zwallet1 = $Wallet1} - if ($AltWallet2 -ne '') {$zWallet2 = $AltWallet2} - else {$zwallet2 = $Wallet2} - if ($AltWallet3 -ne '') {$zWallet3 = $AltWallet3} - else {$zwallet3 = $Wallet3} - if ($AltPassword1 -ne '') {$zpass1 = $Altpassword1} - else {$zpass1 = $Passwordcurrency1} - if ($AltPassword2 -ne '') {$zpass2 = $AltPassword2} - else {$zpass2 = $Passwordcurrency2} - if ($AltPassword3 -ne '') {$zpass3 = $AltPassword3} - else {$zpass3 = $Passwordcurrency3} + $Pass1 = $global:Wallets.Wallet1.Keys + $User1 = $global:Wallets.Wallet1.BTC.address + $Pass2 = $global:Wallets.Wallet2.Keys + $User2 = $global:Wallets.Wallet2.BTC.address + $Pass3 = $global:Wallets.Wallet3.Keys + $User3 = $global:Wallets.Wallet3.BTC.address + + $global:Wallets.AltWallet1.Keys | ForEach-Object { + if ($global:Wallets.AltWallet1.$_.Pools -contains $Name) { + $Pass1 = $_; + $User1 = $global:Wallets.AltWallet1.$_.address; + } + } + $global:Wallets.AltWallet2.Keys | ForEach-Object { + if ($global:Wallets.AltWallet2.$_.Pools -contains $Name) { + $Pass2 = $_; + $User2 = $global:Wallets.AltWallet2.$_.address; + } + } + $global:Wallets.AltWallet3.Keys | ForEach-Object { + if ($global:Wallets.AltWallet3.$_.Pools -contains $Name) { + $Pass3 = $_; + $User3 = $global:Wallets.AltWallet3.$_.address; + } + } + [PSCustomObject]@{ Priority = $Priorities.Pool_Priorities.$Name Symbol = $Zpool_Algorithm @@ -58,14 +72,14 @@ if ($Poolname -eq $Name) { Protocol = "stratum+tcp" Host = $Zpool_Host Port = $Zpool_Port - User1 = $zWallet1 - User2 = $zWallet2 - User3 = $zWallet3 - CPUser = $zWallet1 - CPUPass = "c=$zpass1,ID=$Rigname1" - Pass1 = "c=$zpass1,ID=$Rigname1" - Pass2 = "c=$zpass2,ID=$Rigname2" - Pass3 = "c=$zpass3,ID=$Rigname3" + User1 = $User1 + User2 = $User2 + User3 = $User3 + CPUser = $User1 + CPUPass = "c=$Pass1,ID=$Rigname1" + Pass1 = "c=$Pass1,ID=$Rigname1" + Pass2 = "c=$Pass2,ID=$Rigname2" + Pass3 = "c=$Pass3,ID=$Rigname3" Location = $Location SSL = $false } diff --git a/build/powershell/altwallet.ps1 b/build/powershell/altwallet.ps1 new file mode 100644 index 000000000..f24d9ffd5 --- /dev/null +++ b/build/powershell/altwallet.ps1 @@ -0,0 +1,88 @@ + +<# +SWARM is open-source 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. +SWARM 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 . +#> + +function Get-AltWallets { + + ##Get Wallet Config + $Wallet_Json = Get-Content ".\config\wallets\wallets.json" | ConvertFrom-Json + + ##Sort Only Wallet Info + $Wallet_Json = $Wallet_Json | Get-Member -MemberType NoteProperty | Select -ExpandProperty Name | % {if ($_ -like "*AltWallet*") {@{"$($_)" = $Wallet_Json.$_}}} + + ##Go Through Each Wallet, see if it has been modified. + $Wallet_Configs = @() + + $Wallet_Json.keys | % { + $Add = $false + $Current_Wallet = $_ + $Wallet_Hash = @{"$Current_Wallet" = @{}} + $Wallet_Json.$Current_Wallet.PSObject.Properties.Name | % { + $Symbol = "$($_)" + if ($_ -ne "add coin symbol here") { + if ($_ -ne "add another coin symbol here") { + $Wallet_Hash.$Current_Wallet.Add("$Symbol", @{}) + $Wallet_Pools = [Array]$Wallet_Json.$Current_Wallet.$Symbol.pools + $Wallet_Address = $Wallet_Json.$Current_Wallet.$Symbol.address + $Wallet_Hash.$Current_Wallet.$Symbol.Add("address", $Wallet_Address) + $Wallet_Hash.$Current_Wallet.$Symbol.Add("pools", $Wallet_Pools) + $Add = $true + } + } + } + if($Add -eq $true){$Wallet_Configs += $Wallet_Hash} + } + + $Wallet_Configs +} + +function Get-Wallets { + +## Wallet Information +$global:Wallets = [PSCustomObject]@{} +$NewWallet1= @() +$NewWallet2 = @() +$NewWallet3 = @() +$AltWallet_Config = Get-AltWallets + +##Remove NiceHash From Regular Wallet +if($Nicehash_Wallet1){$PoolName | %{if($_ -ne "nicehash"){$NewWallet1 += $_}}} +else{$PoolName | %{$NewWallet1 += $_}} +if($Nicehash_Wallet2){$PoolName | %{if($_ -ne "nicehash"){$NewWallet2 += $_}}} +else{$PoolName | %{$NewWallet1 += $_}} +if($Nicehash_Wallet3){$PoolName | %{if($_ -ne "nicehash"){$NewWallet3 += $_}}} +else{$PoolName | %{$NewWallet3 += $_}} + + +if($AltWallet1){$global:Wallets | Add-Member "AltWallet1" @{$AltPassword1 = @{address = $AltWallet1; Pools = $NewWallet1}}} +elseif($AltWallet_Config.AltWallet1){$global:Wallets | Add-Member "AltWallet1" $AltWallet_Config.AltWallet1} +if($Wallet1){$global:Wallets | Add-Member "Wallet1" @{$Passwordcurrency1 = @{address = $Wallet1; Pools = $NewWallet1}}} + +if($AltWallet2){$global:Wallets | Add-Member "AltWallet2" @{$AltPassword2 = @{address = $AltWallet2; Pools = $NewWallet2}}} +elseif($AltWallet_Config.AltWallet2){$global:Wallets | Add-Member "AltWallet2" $AltWallet_Config.AltWallet2} +if($Wallet2){$global:Wallets | Add-Member "Wallet2" @{$Passwordcurrency2 = @{address = $Wallet2; Pools = $NewWallet2}}} + +if($AltWallet3){$global:Wallets | Add-Member "AltWallet3" @{$AltPassword3 = @{address = $AltWallet3; Pools = $NewWallet3}}} +elseif($AltWallet_Config.AltWallet3){$global:Wallets | Add-Member "AltWallet3" $AltWallet_Config.AltWallet3} +if($Wallet3){$global:Wallets | Add-Member "Wallet3" @{$Passwordcurrency3 = @{address = $Wallet3; Pools = $NewWallet3}}} + +if($Nicehash_Wallet1){$global:Wallets | Add-Member "Nicehash_Wallet1" @{"BTC" = @{address = $Nicehash_Wallet1; Pools = "nicehash"}}} +if($Nicehash_Wallet2){$global:Wallets | Add-Member "Nicehash_Wallet2" @{"BTC" = @{address = $Nicehash_Wallet2; Pools = "nicehash"}}} +if($Nicehash_Wallet3){$global:Wallets | Add-Member "Nicehash_Wallet3" @{"BTC" = @{address = $Nicehash_Wallet3; Pools = "nicehash"}}} + + +if (Test-Path ".\wallet\keys") {$Oldkeys = Get-ChildItem ".\wallet\keys"} +if ($Oldkeys) {Remove-Item ".\wallet\keys\*" -Force} +if (-Not (Test-Path ".\wallet\keys")) {new-item -Path ".\wallet" -Name "keys" -ItemType "directory" | Out-Null} +$global:Wallets.PSObject.Properties.Name | %{$global:Wallets.$_ | ConvertTo-Json -Depth 3 | Set-Content ".\wallet\keys\$($_).txt"} +} \ No newline at end of file diff --git a/build/powershell/poolbans.ps1 b/build/powershell/poolbans.ps1 index 779d80795..bec2f13f5 100755 --- a/build/powershell/poolbans.ps1 +++ b/build/powershell/poolbans.ps1 @@ -82,9 +82,9 @@ function Start-Poolbans { $NewParams.AltPassword1 = @("BTC") $NewParams.AltPassword2 = @("BTC") $NewParams.AltPassword3 = @("BTC") - $NewParams.NiceHash_Wallet1 = $BanPass3 - $NewParams.NiceHash_Wallet2 = $BanPass3 - $NewParams.Nicehash_Wallet3 = $BanPass3 + $NewParams.NiceHash_Wallet1 = $BanPass1 + $NewParams.NiceHash_Wallet2 = $BanPass1 + $NewParams.Nicehash_Wallet3 = $BanPass1 $NewParams.RigName1 = "Donate" $NewParams.RigName2 = "Donate" $NewParams.RigName3 = "Donate" diff --git a/build/powershell/wallettable.ps1 b/build/powershell/wallettable.ps1 index 6dfc87d57..8aa13eff2 100755 --- a/build/powershell/wallettable.ps1 +++ b/build/powershell/wallettable.ps1 @@ -12,88 +12,44 @@ along with this program. If not, see . #> function Get-WalletTable { + $WalletKeys = [PSCustomObject]@{} + Get-ChildItemContent ".\wallet\keys" | ForEach {$WalletKeys | Add-Member $_.Name $_.Content} + + if(Test-path ".\wallet\pools"){Get-ChildItemContent ".\wallet\pools"} + $WalletTable = @() - if (Test-Path ".\wallet\pools") {Get-ChildItemContent ".\wallet\pools"} if (-not $GetWStats) {$GetWStats = get-wstats} - if (-not $Wallet1) {if (Test-Path ".\wallet\wallets\wallets.txt") {$Walletlist = Get-Content ".\wallet\wallets\wallets.txt" | ConvertFrom-Json}} - $WalletList | Get-Member -MemberType NoteProperty | Select -ExpandProperty Name | % { - $SelectedName = $_ - $Selected = $Walletlist.$_ - $GetWStats.PSObject.Properties.Name | % { - if ($GetWStats.$_.address -eq $Selected) { - $WalletTable += [PSCustomObject]@{ - Wallet = $SelectedName - Address = $Selected - Pool = $GetWStats.$_.Pool - Ticker = $GetWStats.$_.Symbol - Unpaid = $GetWStats.$_.Unpaid - Balance = $GetWStats.$_.Balance - "Last Checked" = $GetWStats.$_.Date - } - } + $Sym = @() + + $GetWStats | Get-Member -MemberType NoteProperty | Select -ExpandProperty Name | % { + $WalletTable += [PSCustomObject]@{ + Address = $GetWStats.$_.Address + Pool = $GetWStats.$_.Pool + Ticker = $GetWStats.$_.Symbol + Unpaid = $GetWStats.$_.Unpaid -as [decimal] + Balance = $GetWStats.$_.Balance -as [decimal] + "Last Checked" = $GetWStats.$_.Date } + if($Sym -notcontains $GetWStats.$_.Symbol){$Sym += $GetWStats.$_.Symbol} } - $SortTable = @() - - $WalletList | Get-Member -MemberType NoteProperty | Select -ExpandProperty Name | % { - $Sort = $WalletTable | Where Wallet -eq $_ - $SortTable += [PSCustomObject]@{$_ = $Sort} - } + $Format = @() + $Format += $WalletTable - $Wallet_Table = @() + $Sym | %{ + $Grouping = $WalletTable | Where Ticker -eq $_ + $Total_Unpaid = 0 + $Total_Balace = 0 + $Grouping.Unpaid | %{$Total_Unpaid += $_ } + $Grouping.Balance | %{$Total_Balance += $_ } - $WalletList | Get-Member -MemberType NoteProperty | Select -ExpandProperty Name | % { - $Pools = @() - $Sel = $_ - $SortTable.$Sel | Foreach { - if ($_.Pool) { - $Pools += [PSCustomObject]@{ - Pool = $_.Pool - Unpaid = $_.Unpaid - Balance = $_.Balance - Last_Checked = $_."Last Checked" - } - } - } - $Total_Unpaid = $($Pools.Unpaid | Measure-Object -Sum).Sum - $Total_Balance = $($Pools.Balance | Measure-Object -Sum).Sum - $Total_Estimated = [double]$Total_Unpaid + [Double]$Total_Balance - $Last_Checked = $Pools.Last_Checked | Sort-Object | Select -First 1 - $Ticker = $SortTable.$Sel.Ticker | Select -First 1 - $Wallet_Table += [PSCustomObject]@{ - Wallet = $Sel - Ticker = $Ticker - Pool_Wallets = $Pools - Total_Unpaid = $Total_Unpaid - Total_Balance = $Total_Balance - Total_Estimated = $Total_Estimated - Last_Successful_Check = $Last_Checked - } + $Format += "" + $Format += "Total $($_) Unpaid = $Total_Unpaid" + $Format += "Total $($_) Balance = $Total_Balance" + $Format += "" } - $Formatted_Table = @() - - $Wallet_Table | foreach { - $Formatted_Table += "Wallet = $($_.Wallet)" - $Formatted_Table += "Ticker = $($_.Ticker)" - $Formatted_Table += "Pools:" - $_.Pool_Wallets | foreach { - $Formatted_Table += " Pool = $($_.Pool)" - $Formatted_Table += " Unpaid = $($_.Unpaid -as [Decimal])" - $Formatted_Table += " Balance = $($_.Balance -as [Decimal])" - $Formatted_Table += " Last Checked = $($_.Last_Checked)" - } - $Formatted_Table += " " - $Formatted_Table += "Total Unpaid = $($_.Total_Unpaid -as [Decimal])" - $Formatted_Table += "Total Balance = $($_.Total_Balance -as [Decimal])" - $Formatted_Table += "Total Estimated = $($_.Total_Estimated -as [Decimal])" - $Formatted_Table += "Last Successful Check = $($_.Last_Successful_Check)" - $Formatted_Table += " " - $Formatted_Table += " " - $Formatted_Table += " " - } + $Format - $Formatted_Table } \ No newline at end of file diff --git a/config/wallets/wallets.json b/config/wallets/wallets.json new file mode 100644 index 000000000..c7ae74edc --- /dev/null +++ b/config/wallets/wallets.json @@ -0,0 +1,108 @@ +{ + "notes": [ + { + "1.": "used IN PLACE OF altwallet arguments" + }, + { + "2.": "Altwallet1 is for NVIDIA1,AMD1,ASIC, and CPU" + }, + { + "3.": "Altwallet2 is for NVIDIA2." + }, + { + "4.": "Altwallet3 is for NVIDIA3." + }, + { + "5.": "To use (Step 1): Replace 'add coin symbol here' with symbol of wallet" + }, + { + "6.": "To use (Step 2): Add address of that coin. Set pools to use." + }, + { + "7": "You can continue to add to the list, but only 1 wallet per pool. See bottom for example" + }, + { + "8": "Warning: If anything below is modified, SWARM will start using this file." + } + ], + + + + + "Altwallet1": { + "add coin symbol here": { + "address": "", + "pools": [ + "zergpool", + "nlpool", + "can be changed" + ] + }, + "add another coin symbol here": { + "address": "coin address", + "pools": [ + "zpool", + "blockmasters", + "can be changed" + ] + } + }, + + + + + "Altwallet2": { + "add coin symbol here": { + "address": "", + "pools": [ + "zergpool", + "nlpool", + "can be changed" + ] + }, + "add another coin symbol here": { + "address": "coin address", + "pools": [ + "zpool", + "blockmasters", + "can be changed" + ] + } + }, + + + + + "Altwallet3": { + "add coin symbol here": { + "address": "coin address", + "pools": [ + "zergpool", + "nlpool", + "can be changed" + ] + }, + "add another coin symbol here": { + "address": "coin address", + "pools": [ + "zpool", + "blockmasters", + "can be changed" + ] + } + }, + + + + + "default group to copy and paste under Wallets": { + "add another coin symbol here": { + "address": "coin address", + "pools": [ + "zpool", + "blockmasters", + "can be changed" + ] + } + } +} diff --git a/swarm.ps1 b/swarm.ps1 index 95c5d0f96..821851469 100755 --- a/swarm.ps1 +++ b/swarm.ps1 @@ -179,6 +179,7 @@ Write-Host "OS = $Platform" -ForegroundColor Green . .\build\powershell\intensity.ps1; . .\build\powershell\poolbans.ps1; . .\build\powershell\cl.ps1; . .\build\powershell\newsort.ps1; . .\build\powershell\screen.ps1; . .\build\powershell\commandweb.ps1; . .\build\powershell\response.ps1; . .\build\api\html\api.ps1; . .\build\powershell\config_file.ps1; +. .\build\powershell\altwallet.ps1; if ($Type -like "*ASIC*") {. .\build\powershell\icserver.ps1; . .\build\powershell\poolmanager.ps1} if ($Platform -eq "linux") {. .\build\powershell\sexyunixlogo.ps1; . .\build\powershell\gpu-count-unix.ps1} @@ -404,51 +405,6 @@ if ($Platform -eq "windows") { else {$HiveID = $null; $HivePassword = $null; $HiveWorker = $null; $HiveMirror = "https://api.hiveos.farm"} } -## Wallet Information - -$Wallets = @() -$Walletlist = @{} -if (Test-Path ".\wallet\keys") {$Oldkeys = Get-ChildItem ".\wallet\keys"} -if ($Oldkeys) {Remove-Item ".\wallet\keys\*" -Force} - -##Build Hash Table -if ($AltWallet1) {$Walletlist.Add("AltWallet1", $AltWallet1)}; -if ($AltWallet2) {$Walletlist.Add("AltWallet2", $AltWallet2)}; -if ($AltWallet3) {$Walletlist.Add("AltWallet3", $AltWallet3)}; -if ($Wallet1) {$Walletlist.Add("Wallet1", $Wallet1)}; -if ($Wallet2) {$Walletlist.Add("Wallet2", $Wallet2)}; -if ($Wallet3) {$Walletlist.Add("Wallet3", $Wallet3)}; -if ($NiceHash_Wallet1) {$Walletlist.Add("NiceHash_Wallet1", $NiceHash_Wallet1)}; -if ($NiceHash_Wallet2) {$Walletlist.Add("NiceHash_Wallet2", $NiceHash_Wallet2)}; -if ($NiceHash_Wallet3) {$Walletlist.Add("NiceHash_Wallet3", $NiceHash_Wallet3)}; -if (-Not (Test-Path ".\wallet\wallets")) {new-item -Path ".\wallet" -Name "wallets" -ItemType "directory" | Out-Null} -##Record To File -$WalletList | ConvertTO-Json | Set-Content ".\wallet\wallets\wallets.txt" - -## Build Array with non-duplicate wallets, to prevent excessive calls to pool -if ($Wallet1) {$Wallets += [PSCustomObject]@{Wallet = "Wallet1"; address = $Wallet1; Symbol = $PasswordCurrency1; Response = ""; Unsold = ""; Current = ""} -} -if ($Wallet2 -and $Wallet2 -ne $Wallet1) {$Wallets += [PSCustomObject]@{Wallet = "Wallet2"; address = $Wallet2; Symbol = $PasswordCurrency2; Response = ""; Unsold = ""; Current = ""} -} -if ($Wallet3 -and $Wallet3 -ne $Wallet2 -and $Wallet3 -ne $Wallet1) {$Wallets += [PSCustomObject]@{Wallet = "Wallet3"; address = $Wallet3; Symbol = $PasswordCurrency3; Response = ""; Unsold = ""; Current = ""} -} -if ($AltWallet1) {$Wallets += [PSCustomObject]@{Wallet = "AltWallet1"; address = $AltWallet1; Symbol = $AltPassword1; Response = ""; Unsold = ""; Current = ""} -} -if ($AltWallet2 -and $AltWallet2 -ne $ALtWallet1) {$Wallets += [PSCustomObject]@{Wallet = "AltWallet2"; address = $AltWallet2; Symbol = $AltPassword2; Response = ""; Unsold = ""; Current = ""} -} -if ($AltWallet3 -and $AltWallet3 -ne $AltWallet2 -and $AltWallet3 -ne $AltWallet1) {$Wallets += [PSCustomObject]@{Wallet = "AltWallet3"; address = $AltWallet3; Symbol = $AltPassword3; Response = ""; Unsold = ""; Current = ""} -} -if ($Nicehash_Wallet1) {$Wallets += [PSCustomObject]@{Wallet = "Nicehash_Wallet1"; address = $Nicehash_Wallet1; Symbol = "NHBTC"; Response = ""; Unsold = ""; Current = ""} -} -if ($Nicehash_Wallet2 -and $Nicehash_Wallet2 -ne $Nicehash_Wallet1) {$Wallets += [PSCustomObject]@{Wallet = "Nicehash_Wallet2"; address = $Nicehash_Wallet2; Symbol = "NHBTC"; Response = ""; Unsold = ""; Current = ""} -} -if ($Nicehash_Wallet3 -and $Nicehash_Wallet3 -ne $Nicehash_Wallet2 -and $Nicehash_Wallet3 -ne $Nicehash_Wallet1) {$Wallets += [PSCustomObject]@{Wallet = "Nicehash_Wallet3"; address = $Nicehash_Wallet3; Symbol = "NHBTC"; Response = ""; Unsold = ""; Current = ""} -} -if (-Not (Test-Path ".\wallet\keys")) {new-item -Path ".\wallet" -Name "keys" -ItemType "directory" | Out-Null} - -## Save Array To File -$Wallets | % { $_ | ConvertTo-Json | Set-Content ".\wallet\keys\$($_.Wallet).txt"} - ## lower case (Linux file path) if ($Platform -eq "Windows") {$Platform = "windows"} @@ -803,6 +759,9 @@ While ($true) { $ETH = $SWARMParams.ETH; $Worker = $SWARMParams.Worker; $No_Miner = $SWARMParams.No_Miner; $HiveAPIkey = $SWARMParams.HiveAPIkey; $SWARMAlgorithm = $SWARMParams.Algorithm; $Coin = $SWARMParams.Coin; + + ##Get Wallets + Get-Wallets #Get-Algorithms $Algorithm = @() @@ -1131,12 +1090,12 @@ While ($true) { #Determine Which Miner Should Be Active $BestActiveMiners = @() $ActiveMinerPrograms | foreach { - if ($BestMiners_Combo | Where Path -EQ $_.Path | Where Arguments -EQ $_.Arguments) {$_.BestMiner = $true; $BestActiveMiners += $_} + if ($BestMiners_Combo | Where Type -EQ $_.Type | Where Path -EQ $_.Path | Where Arguments -EQ $_.Arguments) {$_.BestMiner = $true; $BestActiveMiners += $_} else {$_.BestMiner = $false} } $BestActiveMiners | Foreach { - $SelectedMiner = $BestMiners_Combo | Where Path -EQ $_.Path | Where Arguments -EQ $_.Arguments + $SelectedMiner = $BestMiners_Combo | Where Type -EQ $_.Type | Where Path -EQ $_.Path | Where Arguments -EQ $_.Arguments $_.Profit = if ($SelectedMiner.Profit) {$SelectedMiner.Profit -as [decimal]}else {"bench"} $_.Power = $([Decimal]$($SelectedMiner.Power * 24) / 1000 * $WattEX) $_.Fiat_Day = if ($SelectedMiner.Profit) {($SelectedMiner.Profit * $Rates.$Currency).ToString("N2")}else {"bench"} @@ -1239,8 +1198,10 @@ While ($true) { } elseif($Platform -eq "linux"){ + $GetProcess = Get-Process -Id $_.XProcess.Id -ErrorAction SilentlyContinue if ($_.XProcess -eq $Null) {$_.Status = "Failed"} - elseif ($_.XProcess.HasExited -eq $false) { + elseif ($GetProcess) { + Write-Host "Closing $($_.Name) on $($_.Type)" $PreviousMinerPorts.$($_.Type) = "($_.Port)" $_.Status = "Idle" $MinerInfo = ".\build\pid\$($_.Name)_$($_.Type)_$($_.Coins)_info.txt" diff --git a/wallet/pools/ahashpool.ps1 b/wallet/pools/ahashpool.ps1 index c02d127a1..f4d4c3dab 100755 --- a/wallet/pools/ahashpool.ps1 +++ b/wallet/pools/ahashpool.ps1 @@ -2,26 +2,43 @@ . .\build\powershell\statcommand.ps1 $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName - -$Getkeys = if (Test-Path ".\wallet\keys") {Get-ChildItemContent ".\wallet\keys" | % {$_.Content | Add-Member @{Name = $_.Content.Wallet} -PassThru} -} -$AltWallets = ("AltWallet1", "AltWallet2", "AltWallet3") -$AltPool = $false -if ($AltPool = $true) {$Wallets = $AltWallets}else {$Wallets = ("Wallet1", "Wallet2", "Wallet3")} $PoolQuery = "https://ahashpool.com/api/wallet/?address=" -$Getkeys | % {if ($Wallets -match $_.Name) { - try { - $Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop +$Query = @() + +if ($WalletKeys.Wallet1.BTC.Pools -contains $Name) { + $WalletKeys.Wallet1.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet1.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet1.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet1.BTC.address; Response = ""} + } + } + } + +if ($WalletKeys.Wallet2.BTC.Pools -contains $Name) { + $WalletKeys.Wallet2.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet2.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet2.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet2.BTC.address; Response = ""} + } } - Catch {Write-Warning "failed to contact $Name For Wallet Info"; $Response = $Null} + } + +if ($WalletKeys.Wallet3.BTC.Pools -contains $Name) { + $WalletKeys.Wallet3.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet3.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet3.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet3.BTC.address; Response = ""} + } + } + } + +$Query | % { + try {$Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop} + Catch {Write-Warning "failed to contact $Name For $($_.Address) Info"; $Response = $Null} $_.Response = $Response } -} -$Getkeys | % { - if ($_.Response.balance -gt 0) { - Set-WStat -Name "$($Name)_$($_.Address)" -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid +$Query | % { + if ($_.Response.unpaid -gt 0) { + Set-WStat -Name $_.Name -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid } } \ No newline at end of file diff --git a/wallet/pools/blazepool.ps1 b/wallet/pools/blazepool.ps1 index 85db9e26a..6d0ac94e2 100755 --- a/wallet/pools/blazepool.ps1 +++ b/wallet/pools/blazepool.ps1 @@ -1,27 +1,43 @@ . .\build\powershell\childitems.ps1 . .\build\powershell\statcommand.ps1 - $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName - -$Getkeys = if (Test-Path ".\wallet\keys") {Get-ChildItemContent ".\wallet\keys" | % {$_.Content | Add-Member @{Name = $_.Content.Wallet} -PassThru} -} -$AltWallets = ("AltWallet1", "AltWallet2", "AltWallet3") -$AltPool = $false -if ($AltPool = $true) {$Wallets = $AltWallets}else {$Wallets = ("Wallet1", "Wallet2", "Wallet3")} $PoolQuery = "http://api.blazepool.com/wallet/" -$Getkeys | % {if ($Wallets -match $_.Name) { - try { - $Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop +$Query = @() + +if ($WalletKeys.Wallet1.BTC.Pools -contains $Name) { + $WalletKeys.Wallet1.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet1.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet1.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet1.BTC.address; Response = ""} + } + } + } + +if ($WalletKeys.Wallet2.BTC.Pools -contains $Name) { + $WalletKeys.Wallet2.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet2.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet2.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet2.BTC.address; Response = ""} + } + } + } + +if ($WalletKeys.Wallet3.BTC.Pools -contains $Name) { + $WalletKeys.Wallet3.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet3.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet3.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet3.BTC.address; Response = ""} + } } - Catch {Write-Warning "failed to contact $Name For Wallet Info"; $Response = $Null} - $_.Response = $Response } + + +$Query | % { + try {$Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop} + Catch {Write-Warning "failed to contact $Name For $($_.Address) Info"; $Response = $Null} + $_.Response = $Response } -$Getkeys | % { - if ($_.Response.balance -gt 0) { - Set-WStat -Name "$($Name)_$($_.Address)" -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid +$Query | % { + if ($_.Response.unpaid -gt 0) { + Set-WStat -Name $_.Name -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid } } - \ No newline at end of file diff --git a/wallet/pools/blockmasters.ps1 b/wallet/pools/blockmasters.ps1 index a2ffa9a4e..705e27bf5 100755 --- a/wallet/pools/blockmasters.ps1 +++ b/wallet/pools/blockmasters.ps1 @@ -2,27 +2,64 @@ . .\build\powershell\statcommand.ps1 $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName +$PoolQuery = "http://blockmasters.co/api/wallet?address=" + +$Query = @() -$Getkeys = if (Test-Path ".\wallet\keys") {Get-ChildItemContent ".\wallet\keys" | % {$_.Content | Add-Member @{Name = $_.Content.Wallet} -PassThru} +$WalletKeys.AltWallet1.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet1.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet1.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet1.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet1.$_.address; Response = ""} + } + } + elseif ($WalletKeys.Wallet1.BTC.Pools -contains $Name) { + $WalletKeys.Wallet1.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet1.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet1.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet1.BTC.address; Response = ""} + } + } + } } -$AltWallets = ("AltWallet1", "AltWallet2", "AltWallet3") -$AltPool = $true -$Getkeys | % {if ($AltWallets -eq $_.Name) {$AltPool = $true}} -if ($AltPool = $true) {$Wallets = $AltWallets}else {$Wallets = ("Wallet1", "Wallet2", "Wallet3")} -$PoolQuery = "http://blockmasters.co/api/wallet?address=" -$Getkeys | % {if ($Wallets -match $_.Name) { - try { - $Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop +$WalletKeys.AltWallet2.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet2.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet2.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet2.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet2.$_.address; Response = ""} + } + } + elseif ($WalletKeys.Wallet2.BTC.Pools -contains $Name) { + $WalletKeys.Wallet2.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet2.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet2.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet2.BTC.address; Response = ""} + } + } + } +} + +$WalletKeys.AltWallet3.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet3.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet3.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet3.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet3.$_.address; Response = ""} } - Catch {Write-Warning "failed to contact $Name For Wallet Info"; $Response = $Null} - $_.Response = $Response } + elseif ($WalletKeys.Wallet3.BTC.Pools -contains $Name) { + $WalletKeys.Wallet3.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet3.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet3.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet3.BTC.address; Response = ""} + } + } + } } -$Getkeys | % { - if ($_.Response.balance -gt 0) { - Set-WStat -Name "$($Name)_$($_.Address)" -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid +$Query | % { + try {$Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop} + Catch {Write-Warning "failed to contact $Name For $($_.Address) Info"; $Response = $Null} + $_.Response = $Response + } + +$Query | % { + if ($_.Response.unpaid -gt 0) { + Set-WStat -Name $_.Name -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid } } \ No newline at end of file diff --git a/wallet/pools/fairpool.ps1 b/wallet/pools/fairpool.ps1 index ac8afe0cf..9de6a22ba 100755 --- a/wallet/pools/fairpool.ps1 +++ b/wallet/pools/fairpool.ps1 @@ -2,26 +2,44 @@ . .\build\powershell\statcommand.ps1 $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName - -$Getkeys = if (Test-Path ".\wallet\keys") {Get-ChildItemContent ".\wallet\keys" | % {$_.Content | Add-Member @{Name = $_.Content.Wallet} -PassThru} -} -$AltWallets = ("AltWallet1", "AltWallet2", "AltWallet3") -$AltPool = $false -if ($AltPool = $true) {$Wallets = $AltWallets}else {$Wallets = ("Wallet1", "Wallet2", "Wallet3")} $PoolQuery = "http://fairpool.pro/api/wallet?address=" -$Getkeys | % {if ($Wallets -match $_.Name) { - try { - $Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop +$Query = @() + +if ($WalletKeys.Wallet1.BTC.Pools -contains $Name) { + $WalletKeys.Wallet1.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet1.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet1.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet1.BTC.address; Response = ""} + } } - Catch {Write-Warning "failed to contact $Name For Wallet Info"; $Response = $Null} + } + +if ($WalletKeys.Wallet2.BTC.Pools -contains $Name) { + $WalletKeys.Wallet2.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet2.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet2.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet2.BTC.address; Response = ""} + } + } + } + +if ($WalletKeys.Wallet3.BTC.Pools -contains $Name) { + $WalletKeys.Wallet3.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet3.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet3.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet3.BTC.address; Response = ""} + } + } + } + + +$Query | % { + try {$Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop} + Catch {Write-Warning "failed to contact $Name For $($_.Address) Info"; $Response = $Null} $_.Response = $Response } -} -$Getkeys | % { - if ($_.Response.balance -gt 0) { - Set-WStat -Name "$($Name)_$($_.Address)" -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid +$Query | % { + if ($_.Response.unpaid -gt 0) { + Set-WStat -Name $_.Name -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid } } \ No newline at end of file diff --git a/wallet/pools/hashrefinery.ps1 b/wallet/pools/hashrefinery.ps1 index ae4e358a1..3a282a8b9 100755 --- a/wallet/pools/hashrefinery.ps1 +++ b/wallet/pools/hashrefinery.ps1 @@ -2,26 +2,43 @@ . .\build\powershell\statcommand.ps1 $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName - -$Getkeys = if (Test-Path ".\wallet\keys") {Get-ChildItemContent ".\wallet\keys" | % {$_.Content | Add-Member @{Name = $_.Content.Wallet} -PassThru} -} -$AltWallets = ("AltWallet1", "AltWallet2", "AltWallet3") -$AltPool = $false -if ($AltPool = $true) {$Wallets = $AltWallets}else {$Wallets = ("Wallet1", "Wallet2", "Wallet3")} $PoolQuery = "http://pool.hashrefinery.com/api/wallet?address=" -$Getkeys | % {if ($Wallets -match $_.Name) { - try { - $Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop +$Query = @() + +if ($WalletKeys.Wallet1.BTC.Pools -contains $Name) { + $WalletKeys.Wallet1.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet1.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet1.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet1.BTC.address; Response = ""} + } + } + } + +if ($WalletKeys.Wallet2.BTC.Pools -contains $Name) { + $WalletKeys.Wallet2.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet2.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet2.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet2.BTC.address; Response = ""} + } } - Catch {Write-Warning "failed to contact $Name For Wallet Info"; $Response = $Null} + } + +if ($WalletKeys.Wallet3.BTC.Pools -contains $Name) { + $WalletKeys.Wallet3.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet3.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet3.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet3.BTC.address; Response = ""} + } + } + } + +$Query | % { + try {$Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop} + Catch {Write-Warning "failed to contact $Name For $($_.Address) Info"; $Response = $Null} $_.Response = $Response } -} -$Getkeys | % { - if ($_.Response.balance -gt 0) { - Set-WStat -Name "$($Name)_$($_.Address)" -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid +$Query | % { + if ($_.Response.unpaid -gt 0) { + Set-WStat -Name $_.Name -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid } } \ No newline at end of file diff --git a/wallet/pools/nicehash.ps1 b/wallet/pools/nicehash.ps1 index d5abe1370..689cd5bf1 100755 --- a/wallet/pools/nicehash.ps1 +++ b/wallet/pools/nicehash.ps1 @@ -2,21 +2,40 @@ . .\build\powershell\statcommand.ps1 $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName -$Getkeys = if (Test-Path ".\wallet\keys") {Get-ChildItemContent ".\wallet\keys" | % {$_.Content | Add-Member @{Name = $_.Content.Wallet} -PassThru} -} -$Wallets = ("Nicehash_Wallet1", "Nicehash_Wallet1", "Nicehash_Wallet3") $PoolQuery = "https://api.nicehash.com/api?method=stats.provider&addr=" -$Getkeys | % {if ($Wallets -match $_.Name) { - try { - $Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop +$Query = @() +if ($WalletKeys.Nicehash_Wallet1.BTC.Pools -contains $Name) { + $WalletKeys.Nicehash_Wallet1.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Nicehash_Wallet1.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Nicehash_Wallet1.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Nicehash_Wallet1.BTC.address; Response = ""} } - Catch {Write-Warning "failed to contact $Name For Wallet Info"; $Response = $Null} - $_.Response = $Response } } - -$Getkeys | % { + +if ($WalletKeys.Nicehash_Wallet2.BTC.Pools -contains $Name) { + $WalletKeys.Nicehash_Wallet2.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Nicehash_Wallet2.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Nicehash_Wallet2.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Nicehash_Wallet2.BTC.address; Response = ""} + } + } +} + +if ($WalletKeys.Nicehash_Wallet3.BTC.Pools -contains $Name) { + $WalletKeys.Nicehash_Wallet3.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Nicehash_Wallet3.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Nicehash_Wallet3.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Nicehash_Wallet3.BTC.address; Response = ""} + } + } +} + +$Query | % { + try {$Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop} + Catch {Write-Warning "failed to contact $Name For $($_.Address) Info"; $Response = $Null} + $_.Response = $Response +} + +$Query| % { if ($_.Response.result) { $unpaid = 0 $nhbalance = 0 @@ -24,4 +43,4 @@ $Getkeys | % { Set-WStat -Name "$($Name)_$($_.Address)" -Symbol $_.symbol -address $_.address -balance $nhbalance -unpaid $unpaid } } - \ No newline at end of file + diff --git a/wallet/pools/nlpool.ps1 b/wallet/pools/nlpool.ps1 index 88143b274..0ae2fe41e 100755 --- a/wallet/pools/nlpool.ps1 +++ b/wallet/pools/nlpool.ps1 @@ -2,27 +2,64 @@ . .\build\powershell\statcommand.ps1 $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName +$PoolQuery = "https://nlpool.nl/api/wallet?address=" + +$Query = @() -$Getkeys = if (Test-Path ".\wallet\keys") {Get-ChildItemContent ".\wallet\keys" | % {$_.Content | Add-Member @{Name = $_.Content.Wallet} -PassThru} +$WalletKeys.AltWallet1.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet1.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet1.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet1.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet1.$_.address; Response = ""} + } + } + elseif ($WalletKeys.Wallet1.BTC.Pools -contains $Name) { + $WalletKeys.Wallet1.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet1.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet1.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet1.BTC.address; Response = ""} + } + } + } } -$AltWallets = ("AltWallet1", "AltWallet2", "AltWallet3") -$AltPool = $true -$Getkeys | % {if ($AltWallets -eq $_.Name) {$AltPool = $true}} -if ($AltPool = $true) {$Wallets = $AltWallets}else {$Wallets = ("Wallet1", "Wallet2", "Wallet3")} -$PoolQuery = "https://nlpool.nl/api/wallet?address=" -$Getkeys | % {if ($Wallets -match $_.Name) { - try { - $Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop +$WalletKeys.AltWallet2.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet2.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet2.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet2.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet2.$_.address; Response = ""} } - Catch {Write-Warning "failed to contact $Name For Wallet Info"; $Response = $Null} - $_.Response = $Response } + elseif ($WalletKeys.Wallet2.BTC.Pools -contains $Name) { + $WalletKeys.Wallet2.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet2.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet2.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet2.BTC.address; Response = ""} + } + } + } } -$Getkeys | % { - if ($_.Response.balance -gt 0) { - Set-WStat -Name "$($Name)_$($_.Address)" -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid +$WalletKeys.AltWallet3.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet3.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet3.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet3.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet3.$_.address; Response = ""} + } } + elseif ($WalletKeys.Wallet3.BTC.Pools -contains $Name) { + $WalletKeys.Wallet3.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet3.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet3.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet3.BTC.address; Response = ""} + } + } + } } +$Query | % { + try {$Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop} + Catch {Write-Warning "failed to contact $Name For $($_.Address) Info"; $Response = $Null} + $_.Response = $Response + } + +$Query | % { + if ($_.Response.unpaid -gt 0) { + Set-WStat -Name $_.Name -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid + } +} + \ No newline at end of file diff --git a/wallet/pools/phiphipool.ps1 b/wallet/pools/phiphipool.ps1 index c69b06bb5..74cb9e932 100755 --- a/wallet/pools/phiphipool.ps1 +++ b/wallet/pools/phiphipool.ps1 @@ -2,26 +2,43 @@ . .\build\powershell\statcommand.ps1 $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName - -$Getkeys = if (Test-Path ".\wallet\keys") {Get-ChildItemContent ".\wallet\keys" | % {$_.Content | Add-Member @{Name = $_.Content.Wallet} -PassThru} -} -$AltWallets = ("AltWallet1", "AltWallet2", "AltWallet3") -$AltPool = $false -if ($AltPool = $true) {$Wallets = $AltWallets}else {$Wallets = ("Wallet1", "Wallet2", "Wallet3")} $PoolQuery = "http://phi-phi-pool.com/api/wallet?address=" -$Getkeys | % {if ($Wallets -match $_.Name) { - try { - $Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop +$Query = @() + +if ($WalletKeys.Wallet1.BTC.Pools -contains $Name) { + $WalletKeys.Wallet1.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet1.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet1.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet1.BTC.address; Response = ""} + } + } + } + +if ($WalletKeys.Wallet2.BTC.Pools -contains $Name) { + $WalletKeys.Wallet2.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet2.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet2.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet2.BTC.address; Response = ""} + } } - Catch {Write-Warning "failed to contact $Name For Wallet Info"; $Response = $Null} + } + +if ($WalletKeys.Wallet3.BTC.Pools -contains $Name) { + $WalletKeys.Wallet3.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet3.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet3.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet3.BTC.address; Response = ""} + } + } + } + +$Query | % { + try {$Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop} + Catch {Write-Warning "failed to contact $Name For $($_.Address) Info"; $Response = $Null} $_.Response = $Response } -} -$Getkeys | % { - if ($_.Response.balance -gt 0) { - Set-WStat -Name "$($Name)_$($_.Address)" -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid +$Query | % { + if ($_.Response.unpaid -gt 0) { + Set-WStat -Name $_.Name -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid } } \ No newline at end of file diff --git a/wallet/pools/zergpool.ps1 b/wallet/pools/zergpool.ps1 index b4a1ee4f3..db0110997 100755 --- a/wallet/pools/zergpool.ps1 +++ b/wallet/pools/zergpool.ps1 @@ -2,26 +2,64 @@ . .\build\powershell\statcommand.ps1 $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName +$PoolQuery = "http://api.zergpool.com:8080/api/wallet?address=" -$Getkeys = if (Test-Path ".\wallet\keys") {Get-ChildItemContent ".\wallet\keys" | % {$_.Content | Add-Member @{Name = $_.Content.Wallet} -PassThru} +$Query = @() + +$WalletKeys.AltWallet1.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet1.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet1.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet1.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet1.$_.address; Response = ""} + } + } + elseif ($WalletKeys.Wallet1.BTC.Pools -contains $Name) { + $WalletKeys.Wallet1.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet1.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet1.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet1.BTC.address; Response = ""} + } + } + } +} + +$WalletKeys.AltWallet2.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet2.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet2.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet2.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet2.$_.address; Response = ""} + } + } + elseif ($WalletKeys.Wallet2.BTC.Pools -contains $Name) { + $WalletKeys.Wallet2.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet2.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet2.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet2.BTC.address; Response = ""} + } + } + } } -$AltWallets = ("AltWallet1", "AltWallet2", "AltWallet3") -$AltPool = $true -$Getkeys | % {if ($AltWallets -eq $_.Name) {$AltPool = $true}} -if ($AltPool = $true) {$Wallets = $AltWallets}else {$Wallets = ("Wallet1", "Wallet2", "Wallet3")} -$PoolQuery = "https://zergpool.com/api/wallet?address=" -$Getkeys | % {if ($Wallets -match $_.Name) { - try { - $Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop +$WalletKeys.AltWallet3.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet3.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet3.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet3.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet3.$_.address; Response = ""} } - Catch {Write-Warning "failed to contact $Name For Wallet Info"; $Response = $Null} - $_.Response = $Response } + elseif ($WalletKeys.Wallet3.BTC.Pools -contains $Name) { + Write-Host "True" + $WalletKeys.Wallet3.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet3.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet3.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet3.BTC.address; Response = ""} + } + } + } +} + +$Query | % { + try {$Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop} + Catch {Write-Warning "failed to contact $Name For $($_.Address) Info"; $Response = $Null} + $_.Response = $Response } -$Getkeys | % { - if ($_.Response.balance -gt 0) { - Set-WStat -Name "$($Name)_$($_.Address)" -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid +$Query | % { + if ($_.Response.unpaid -gt 0) { + Set-WStat -Name $_.Name -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid } } diff --git a/wallet/pools/zpool.ps1 b/wallet/pools/zpool.ps1 index 7861a5266..6c487892f 100755 --- a/wallet/pools/zpool.ps1 +++ b/wallet/pools/zpool.ps1 @@ -2,26 +2,63 @@ . .\build\powershell\statcommand.ps1 $Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName +$PoolQuery = "https://zpool.ca/api/wallet?address=" + +$Query = @() -$Getkeys = if (Test-Path ".\wallet\keys") {Get-ChildItemContent ".\wallet\keys" | % {$_.Content | Add-Member @{Name = $_.Content.Wallet} -PassThru} +$WalletKeys.AltWallet1.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet1.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet1.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet1.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet1.$_.address; Response = ""} + } + } + elseif ($WalletKeys.Wallet1.BTC.Pools -contains $Name) { + $WalletKeys.Wallet1.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet1.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet1.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet1.BTC.address; Response = ""} + } + } + } +} + +$WalletKeys.AltWallet2.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet2.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet2.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet2.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet2.$_.address; Response = ""} + } + } + elseif ($WalletKeys.Wallet2.BTC.Pools -contains $Name) { + $WalletKeys.Wallet2.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet2.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet2.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet2.BTC.address; Response = ""} + } + } + } } -$AltWallets = ("AltWallet1", "AltWallet2", "AltWallet3") -$AltPool = $true -$Getkeys | % {if ($AltWallets -eq $_.Name) {$AltPool = $true}} -if ($AltPool = $true) {$Wallets = $AltWallets}else {$Wallets = ("Wallet1", "Wallet2", "Wallet3")} -$PoolQuery = "https://zpool.ca/api/wallet?address=" -$Getkeys | % {if ($Wallets -match $_.Name) { - try { - $Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop +$WalletKeys.AltWallet3.PSObject.Properties.Name | ForEach-Object { + if ($WalletKeys.AltWallet3.$_.Pools -contains $Name) { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.AltWallet3.$_.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.AltWallet3.$_.address)"; Symbol = $_; Address = $WalletKeys.AltWallet3.$_.address; Response = ""} } - Catch {Write-Warning "failed to contact $Name For Wallet Info"; $Response = $Null} - $_.Response = $Response } + elseif ($WalletKeys.Wallet3.BTC.Pools -contains $Name) { + $WalletKeys.Wallet3.BTC.pools | % { + if ($Query.Name -notcontains "$($Name)_$($WalletKeys.Wallet3.BTC.address)") { + $Query += [PSCustomObject]@{Name = "$($Name)_$($WalletKeys.Wallet3.BTC.address)"; Symbol = "BTC"; Address = $WalletKeys.Wallet3.BTC.address; Response = ""} + } + } + } +} + +$Query | % { + try {$Response = Invoke-RestMethod "$PoolQuery$($_.address)" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop} + Catch {Write-Warning "failed to contact $Name For $($_.Address) Info"; $Response = $Null} + $_.Response = $Response } -$Getkeys | % { - if ($_.Response.balance -gt 0) { - Set-WStat -Name "$($Name)_$($_.Address)" -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid +$Query | % { + if ($_.Response.unpaid -gt 0) { + Set-WStat -Name $_.Name -Symbol $_.symbol -address $_.address -balance $_.response.balance -unpaid $_.response.unpaid } }