In complete typings for viem

Đang mở
#59 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Start by reading the ResponseListener typings shown in the issue and locating their definition in the functions-toolkit package. Check how the listener uses its provider and whether the viem client can be supported alongside ethers. Done means viem users can pass a client without a type mismatch; the issue names no test or implementation file to guide verification.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
36
Fork
15
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của smartcontractkit/functions-toolkit

Tất cả issue của smartcontractkit/functions-toolkit

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.