参数
此方法没有参数。
返回值
string Chain ID, hex: "0x1" for Ethereum mainnet.
适用场景
Confirm which network an endpoint serves before signing or writing data.
如何解读结果
Hex chain ID: "0x1" Ethereum, "0xa4b1" Arbitrum One, "0x38" BNB Chain, "0x89" Polygon, "0x2105" Base, "0xa" OP Mainnet, "0xa86a" Avalanche C-Chain.
提示
- Check it at startup and refuse to run if it does not match your config.