Skip to content

Commit

Permalink
Fix the bug of showing btc balance even if the wallet have no balance
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdeLhalimSB committed Sep 1, 2023
1 parent 7c0cb31 commit 07b68e1
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 1 deletion.
Binary file modified .vs/Crypto_Wallets_Scanner/v16/.suo
Binary file not shown.
35 changes: 34 additions & 1 deletion Crypto_Wallets_Scanner/Wallets_Scanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,29 @@ public Wallets_Scanner(string wallet_address)
{
this.wallet_address = wallet_address;
}

static bool ContainsOnlyZeroesAndSpecialChars(string input)
{
foreach (char c in input)
{
// Check if the character is not '0' and not a special character
if (c != '0' && !IsSpecialCharacter(c))
{
return false;
}
}
return true;
}

static bool IsSpecialCharacter(char c)
{
// Define the set of special characters you want to consider
string specialChars = "!@#$%^&*()_+[]{}|;':\",./<>?`~\\-";

// Check if the character is in the set of special characters
return specialChars.Contains(c);
}

public string GetWalletBallance(string wallet,string blockchaine,string blockch,string id)
{
string result = "";
Expand All @@ -38,7 +61,17 @@ public string GetWalletBallance(string wallet,string blockchaine,string blockch,
if (bnb != null)
{
string balance = bnb.InnerText.Trim();
result = blockch + " Network, Wallet: " + wallet + " | Balance: " + balance.Replace(" ","").Replace("\n","").Replace("{{Math.abs(change)}}%","") + " \n_____________________________________________\n";
balance = balance.Replace(" ", "").Replace("\n", "").Replace("{{Math.abs(change)}}%", "");

if (balance == "0BTC0USD")
{
result = string.Empty;
}
else
{
result = blockch + " Network, Wallet: " + wallet + " | Balance: " + balance + " \n_____________________________________________\n";
}

}
else
{
Expand Down
Binary file modified Crypto_Wallets_Scanner/bin/Debug/Crypto_Wallets_Scanner.exe
Binary file not shown.
Binary file modified Crypto_Wallets_Scanner/bin/Debug/Crypto_Wallets_Scanner.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Crypto_Wallets_Scanner/obj/Debug/Crypto_Wallets_Scanner.exe
Binary file not shown.
Binary file modified Crypto_Wallets_Scanner/obj/Debug/Crypto_Wallets_Scanner.pdb
Binary file not shown.
Binary file not shown.

0 comments on commit 07b68e1

Please sign in to comment.