<?php
// RPC endpoints configuration.
// This file prefers environment variables RPC_1, RPC_56, RPC_137 if set, otherwise falls back to defaults.
$rpc = [];
// Defaults (public endpoints)
$rpc_defaults = [
    1 => 'https://rpc.ankr.com/eth',
    56 => 'https://bsc-dataseed.binance.org/',
    137 => 'https://rpc.ankr.com/polygon/3b0eeea65025e0d16145ffb399ef2b0d0a4ce6eb717a174632c50722fe1a6499',
];

// Note: For production, replace these with your provider URLs or set environment variables RPC_1, RPC_56, RPC_137

foreach ($rpc_defaults as $chain => $url) {
    $env_key = 'RPC_' . $chain;
    $env_val = getenv($env_key);
    if ($env_val !== false && strlen(trim($env_val))>0) {
        $rpc[$chain] = trim($env_val);
    } else {
        $rpc[$chain] = $url;
    }
}

return $rpc;
?>