Skip to content

Commit

Permalink
Update web3_provider_publicnode.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
avkos committed Oct 23, 2024
1 parent 2ea7543 commit 85a0f06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/web3-rpc-providers/src/web3_provider_publicnode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ export class PublicNodeProvider<
};
// eslint-disable-next-line class-methods-use-this
public getRPCURL(network: Network, transport: Transport, _: string, _host: string) {
const defaultHost = `${PublicNodeProvider.networkHostMap[network]}.publicnode.com`;
if (!defaultHost) {
if (!PublicNodeProvider.networkHostMap[network]) {
throw new Error('Network info not avalible.');
}
const defaultHost = `${PublicNodeProvider.networkHostMap[network]}.publicnode.com`;
const host = isValid(_host) ? _host : defaultHost;
if (websocketExclusions.includes(network) && transport === Transport.WebSocket) {
return `${transport}://${host}/websocket`;
Expand Down

0 comments on commit 85a0f06

Please sign in to comment.