logoAnt Design Web3

Ethereum (web3js)

熟悉 web3js 的开发者可以安装 @ant-design/web3-eth-web3js 配合组件库使用,其中绝大部份用法都与 wagmi 适配器一致。

bash
npm install @ant-design/web3 @ant-design/web3-eth-web3js web3 --save

基本使用

这个例子展示了使用 web3js 适配器的基本用法。我们提供了 useWeb3js react hooks 来获取 web3 实例,你可以在组件中使用它们来进行链上操作。

Current block height: 0x

签名消息

这个例子展示了如何使用 web3js 适配器签名消息,更多实例方法请参考 web3js 文档

👆 Please connect wallet.

EthWeb3jsConfigProvider

属性描述类型默认值版本
wallets钱包配置WalletFactory[]--
chains链的配置Chain[]--
ens是否显示 ENSboolean--
balance是否显示余额boolean--
locale多语言设置Locale--
eip6963是否采用 EIP6963 协议钱包以及相关配置boolean | EIP6963Configfalse
walletConnect是否采用 Wallet Connect 协议false | WalletConnectOptionsfalse
storage在 session 之间同步状态的存储配置false | WagmiStorage-next
  • 最后更新时间:
    Ethereum (ethersjs)以太坊Solana索拉纳