How to reliably check Casper (CSPR) balance in Electron js application?

I’m building an Electron app (Node 18) to check cryptocurrency balances, including Casper (CSPR). However, I’m getting “No working endpoints found” errors when trying to check CSPR balances.

**Error Message:**
javascript
Testing available endpoints...
Testing endpoint: https://rpc.mainnet.casperlabs.io
Testing endpoint: https://casper-node.services.dev.z7x.org
// ... more endpoints ...
Endpoint https://casper-node.services.dev.z7x.org failed: getaddrinfo ENOTFOUND
Found 0 working endpoints
CSPR balance check failed: Error: No working endpoints found

Here the code to check the CSPR enpoint

async function testEndpoint(url) {
    try {
        console.log(`Testing endpoint: ${url}`);
        const response = await axios.post(`${url}/rpc`, {
            jsonrpc: "2.0",
            id: "0",
            method: "info_get_status",
            params: []
        }, {
            timeout: 10000,
            headers: { 'Content-Type': 'application/json' },
            validateStatus: status => status < 500,
            httpsAgent: new require('https').Agent({
                rejectUnauthorized: false,
                timeout: 10000
            })
        });
        
        if (response.data && !response.data.error) {
            console.log(`Endpoint ${url} is working`);
            return true;
        }
        console.log(`Endpoint ${url} returned invalid data:`, response.data);
        return false;
    } catch (error) {
        console.log(`Endpoint ${url} failed:`, error.message);
        return false;
    }
}

and balance checking function

async function getCSPRBalance(key) {
    try {
        const formattedKey = normalizePublicKey(key);
        
        const endpoints = Array.isArray(config.casper.apiUrl) 
            ? config.casper.apiUrl 
            : [config.casper.apiUrl];
        
        // Test endpoints in parallel
        const endpointTests = endpoints.map(endpoint => testEndpoint(endpoint));
        const results = await Promise.allSettled(endpointTests);
        
        const workingEndpoints = endpoints.filter((endpoint, index) => 
            results[index].status === 'fulfilled' && results[index].value === true
        );
        
        if (workingEndpoints.length === 0) {
            throw new Error('No working endpoints found');
        }

        // Try each working endpoint
        for (const baseUrl of workingEndpoints) {
            try {
                const url = `${baseUrl}/rpc`;
                const rpcKey = `01${formattedKey}`;

                const accountResponse = await axios.post(url, {
                    jsonrpc: "2.0",
                    id: "1",
                    method: "state_get_account_info",
                    params: {
                        public_key: rpcKey
                    }
                });

                // ... rest of balance checking logic ...
            } catch (endpointError) {
                // Continue to next endpoint
            }
        }
    } catch (error) {
        return {
            success: false,
            error: error.message || 'Failed to check CSPR balance',
            address: key
        };
    }
}

the endpoints

const endpoints = [
    'https://rpc.mainnet.casperlabs.io',
    'https://casper-node.services.dev.z7x.org',
    'https://casper-proxy.liquidstaking.com',
    'https://casper-node-proxy.dev.z7x.org',
    'https://node.casper.network.dev.z7x.org'
];

I’ve tried:

Using different Casper RPC endpoints
Adding SSL/TLS error handling
Implementing timeout and retry mechanisms
Disabling SSL verification for testing

The sample public key I’m testing with: 0203d9f49b0d76a3f14482ab11926f0d5f792e933f3df824dc1e0b07104474c4c3b3
Questions:

Are there more reliable Casper RPC endpoints I should be using?
Is there something wrong with my endpoint testing approach?
Are there specific considerations for making RPC calls to Casper nodes from an Electron app?

Environment:

Electron
Node.js 18
axios for HTTP requests
casper-js-sdk for key handling

Any help would be greatly appreciated!