注意: 此页面尚未翻译成中文。以下内容为英文原版。The Quais SDK is a complete Quai Network interaction library for JavaScript and TypeScript. Quais was built using the Ethers v6 framework, with significant changes made to support Quai Network’s multi-chain environment. This will be a very short introduction to the SDK’s features, installation, and important concepts.
Quai Specific Features
API Compatibility
Quais utilizes the
quai_
namespace, which allows developers to correctly make calls to any Quai RPC endpoint or wallet. Quai APIs also
return different data types in comparison to Ethereum APIs, which the SDK is built to handle.Utilities
The quais SDK has a number of additional utility functions designed to make handling the hierarchy much easier.
Contract Address Grinding
Similar to the address sharding mentioned above, contract addresses must have a shard prefix. During deployment, Quais handles address
grinding to ensure the contract address has the correct shard prefix.
NOTE if the contract you are interacting with uses the CREATE2 opcode, quais is unable to handle the address grinding for you. You
must ensure that when deploying a new contract using CREATE2 that the deployed contract will be in the proper address scope of the shard
that you intend to deploy to. For more information and examples please refer to Sharding
in the docs.
Installation
To install Quais, simply install via NPM:To use the Quais SDK, you need to be running NodeJS with a version higher than 17.
quais
object. Exports are also available for each module, which allows for more granular control of method imports.
Quais supports imports in both Node.js and ESM in browser environments.
- import in Node.js
- import in ESM