Avalanche
Avalanche
Avalanche
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_chainId returns the EIP-155 chain ID of the network the endpoint is serving. For the Avalanche C-Chain — the EVM chain where gas is paid in AVAX — that value is 43114, returned as the hex string "0xa86a". Calling https://avalanche.therpc.io/YOUR_API_KEY should always echo "0xa86a"; this is the identifier wallets and signers fold into the EIP-155 signature so an AVAX transaction can never be replayed on Ethereum, BSC, or any other EVM network.
eth_blockNumber for a full "alive and on the right chain" probe of your Avalanche C-Chain endpoint."0xa86a".Diese Methode erwartet keine Parameter. Übergib ein leeres Array [].
| Typ | Beschreibung |
|---|---|
| string (hex) | Hex-encoded chain ID integer (e.g. "0x1" for Ethereum mainnet). |
Try it live in the Avalanche playground.
| Code | Meldung | Ursache |
|---|---|---|
-32603 | Internal error | Node failed to retrieve chain configuration. |
net_version, which returns a network ID as a decimal string; on the Avalanche C-Chain both happen to be 43114, but treating them as interchangeable is a portability bug."0xa86a" — compare with BigInt(result) === 43114n rather than string-matching, so casing or zero-padding differences never cause a false mismatch.