@@ -40,15 +40,15 @@ const alchemyToViemChain: Record<number, string> = {
4040type AlchemyProtocol = "https" | "wss" ;
4141
4242// https://github.com/alchemyplatform/alchemy-sdk-js/blob/c4440cb/src/util/const.ts#L16-L18
43- function alchemyURL ( protocol : AlchemyProtocol , chainId : number ) : string {
43+ function alchemyURL ( protocol : AlchemyProtocol , chainId : number | string ) : string {
4444 const network = alchemyToViemChain [ chainId ] ;
4545 if ( ! network ) {
4646 throw new Error ( `Unsupported chain ID: ${ chainId } ` ) ;
4747 }
4848 return `${ protocol } ://${ network } .g.alchemy.com/v2/${ alchemyApiKey } ` ;
4949}
5050
51- export const getChainRpcUrl = ( protocol : AlchemyProtocol , chainId : number ) => {
51+ export const getChainRpcUrl = ( protocol : AlchemyProtocol , chainId : number | string ) => {
5252 return alchemyURL ( protocol , chainId ) ;
5353} ;
5454
@@ -57,9 +57,9 @@ export const getDefaultChainRpcUrl = (protocol: AlchemyProtocol) => {
5757} ;
5858
5959export const getTransports = ( ) => {
60- const alchemyTransport = ( chain : Chain ) =>
60+ const alchemyTransport = ( chain : AppKitNetwork ) =>
6161 fallback ( [ http ( alchemyURL ( "https" , chain . id ) ) , webSocket ( alchemyURL ( "wss" , chain . id ) ) ] ) ;
62- const defaultTransport = ( chain : Chain ) =>
62+ const defaultTransport = ( chain : AppKitNetwork ) =>
6363 fallback ( [ http ( chain . rpcUrls . default ?. http ?. [ 0 ] ) , webSocket ( chain . rpcUrls . default ?. webSocket ?. [ 0 ] ) ] ) ;
6464
6565 return {
0 commit comments