useDAppuseDApp
  • 开始
  • 指南
  • 代币
⌘ K
指南
连接
只读模式
浏览器钱包
本地区块链
自定义区块链
最后更新时间:
帮助改进此文档
Made with ❤️ by 紫升

只读模式

为了以只读模式连接到网络,请在应用程序配置中提供 readOnlyChainId 和 readOnlyUrls 字段。

以下是示例配置:

import { Mainnet } from '@usedapp/core'
const config = {
readOnlyChainId: Mainnet.chainId,
readOnlyUrls: {
[Mainnet.chainId]: 'https://mainnet.infura.io/v3/62687d1a985d4508b2b7a24827551934',
},
}