このページは英語からの機械翻訳を使用しており、誤りや不明瞭な表現が含まれている可能性があります。最も正確な情報については、オリジナルの英語版をご覧ください。頻繁な更新のため、一部のコンテンツはオリジナルの英語になっている可能性があります。Crowdinでの取り 組みに参加して、このページの翻訳改善にご協力ください。 (Crowdin translation page, Contributing guide)
Read
You can call functions in Smart Contract via "Call" RPC API. What you can call here is limited to view functions that is not changing any states in the Contract.
Import the @kaiachain/ethers-ext modules to add kaia features on web3.
Initializes a public client for read-only interactions with the Kaia blockchain.
Set the Abi generated from solidity code
Define contract address to interact with
The readContract
method is called on the public client to query the number function (a view function that doesn’t modify state) from the contract at the specified address.