Skip to content

Commit

Permalink
wiresaw over ws
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Nov 9, 2024
1 parent a4f4f26 commit cd0f1a0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/wiresaw/src/transports/wiresaw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import {
RpcTransactionReceipt,
RpcUserOperationReceipt,
Transport,
fallback,
http,
webSocket,
} from "viem";
import { getRpcMethod, getRpcSchema, TransportRequestFn, TransportRequestFnMapped } from "./common";

Expand Down Expand Up @@ -59,8 +61,9 @@ export function wiresaw<const transport extends Transport>(getTransport: transpo
return ((args) => {
const getWiresawTransport =
args.chain?.rpcUrls && "wiresaw" in args.chain.rpcUrls
? // TODO: enable WS
http(args.chain.rpcUrls.wiresaw.http[0])
? args.chain.rpcUrls.wiresaw.webSocket
? fallback([webSocket(args.chain.rpcUrls.wiresaw.webSocket[0]), http(args.chain.rpcUrls.wiresaw.http[0])])
: http(args.chain.rpcUrls.wiresaw.http[0])
: undefined;
if (!getWiresawTransport) return getTransport(args);

Expand Down

0 comments on commit cd0f1a0

Please sign in to comment.