Skip to content

In complete typings for viem  #59

Description

@chann44

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions