Nhảy tới nội dung
This page uses machine translation from English, which may contain errors or unclear language. For the most accurate information, please see the original English version. Some content may be in the original English due to frequent updates. Help us improve this page's translation by joining our effort on Crowdin. (Crowdin translation page, Contributing guide)

Viem Extension for Kaia

Viem Extension for Kaia offers:

  • Supports both Ethereum and kaia transaction types.
  • Work with both MetaMask (window.ethereum) and Kaikas (window.klaytn)

Install

NOTE: @kaiachain/viem-ext@^2.0.5 recommends node 20 or later if you have issues with ES Module resolution.

Node.js

  • Install

    npm install --save @kaiachain/viem-ext

  • ESM or TypeScript

    import { http, createPublicClient, kairos } from "@kaiachain/viem-ext";
    const publicClient = createPublicClient({
    chain: kairos,
    transport: http(),
    })

  • CommonJS

    const { http, createPublicClient, kairos } = require("@kaiachain/viem-ext");
    const publicClient = createPublicClient({
    chain: kairos,
    transport: http(),
    })

Usage

See example and test.

Cải thiện trang này