chainlink ts sdk have in complete typings with viem for example
import type { providers } from 'ethers';
import { type FunctionsResponse } from './types';
export declare class ResponseListener {
private functionsRouter;
private provider;
constructor({ provider, functionsRouterAddress, }: {
provider: providers.Provider;
functionsRouterAddress: string;
});
listenForResponse(requestId: string, timeout?: number): Promise<FunctionsResponse>;
listenForResponseFromTransaction(txHash: string, timeout?: number, confirmations?: number, checkInterval?: number): Promise<FunctionsResponse>;
listenForResponses(subscriptionId: number | string, callback: (functionsResponse: FunctionsResponse) => any): void;
stopListeningForResponses(): void;
}
Response listener accepts provider that i asume is a json rpc provider but when i pass a from viem it's mis matched types
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
const client = createPublicClient({
chain: mainnet,
transport: http('https://eth-mainnet.g.alchemy.com/v2/<apiKey>')
})
here client is equalent to json rpc provider from ethers
chainlink ts sdk have in complete typings with viem for example
Response listener accepts provider that i asume is a json rpc provider but when i pass a from viem it's mis matched types
here client is equalent to json rpc provider from ethers