import { ethers } from 'ethers' ; export function getProviderWithFallback ( ... rpcNodeUrls ) { return new ethers . providers . FallbackProvider ( rpcNodeUrls . filter ( ( url ) => url ) . map ( ( url ) => new ethers . providers . JsonRpcProvider ( url ) ) ) ; }