diff --git a/packages/wiresaw/src/transports/wiresaw.ts b/packages/wiresaw/src/transports/wiresaw.ts index a78ade5846..26422428cc 100644 --- a/packages/wiresaw/src/transports/wiresaw.ts +++ b/packages/wiresaw/src/transports/wiresaw.ts @@ -6,7 +6,9 @@ import { RpcTransactionReceipt, RpcUserOperationReceipt, Transport, + fallback, http, + webSocket, } from "viem"; import { getRpcMethod, getRpcSchema, TransportRequestFn, TransportRequestFnMapped } from "./common"; @@ -59,8 +61,9 @@ export function wiresaw(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);