BNB Smart Chain
BNB Smart Chain
BNB Smart Chain
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_chainId returns the EIP-155 identifier of whatever network an endpoint serves. BNB Smart Chain runs PoSA consensus and settles fees in BNB, and it answers this call with "0x38", decimal 56, for mainnet. The Chapel testnet replies "0x61" (decimal 97). Query https://bsc.therpc.io/YOUR_API_KEY to read it. That same number is folded into every signed BSC transaction, binding it to one network so it cannot be replayed across chains.
0x38 so a BSC transaction is not accidentally built for another EVM network.eth_blockNumber for a combined "alive and serving chain 56" health probe.Este método não aceita parâmetros. Passe um array vazio [].
| Tipo | Descrição |
|---|---|
| string (hex) | Hex-encoded chain ID integer (e.g. "0x1" for Ethereum mainnet). |
Try it live in the BNB Smart Chain playground.
| Código | Mensagem | Causa |
|---|---|---|
-32603 | Internal error | Node failed to retrieve chain configuration. |
net_version; on BSC the network ID happens to match, but the two RPCs are conceptually distinct and can diverge on other networks."0x38"), so compare via BigInt(result) === 56n rather than string equality to dodge leading-zero and case mismatches.