Base
Base
Base
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_chainId returns the EIP-155 chain ID of the network the endpoint is serving. For Base — Coinbase's OP Stack rollup that uses ETH for gas — the answer at https://base.therpc.io/YOUR_API_KEY is 0x2105, which is decimal 8453. That number is the canonical identifier you embed in signed transactions so a payload meant for Base mainnet can never be replayed on Ethereum L1 or any other chain. It takes no parameters and costs a single CU.
0x2105) and not Ethereum or another OP Stack chain.eth_blockNumber for a full "alive and on the right chain" probe of your Base endpoint in one health check.هذا الأسلوب لا يأخذ أي معاملات. مرر مصفوفة فارغة [].
| النوع | الوصف |
|---|---|
| string (hex) | Hex-encoded chain ID integer (e.g. "0x1" for Ethereum mainnet). |
Try it live in the Base playground.
| الكود | الرسالة | السبب |
|---|---|---|
-32603 | Internal error | Node failed to retrieve chain configuration. |
net_version, which returns the network ID as a decimal string; on Base both happen to map to 8453, but treat them as separate concepts and use eth_chainId for EIP-155 signing."0x2105"); compare with BigInt(result) === 8453n rather than string equality to avoid casing or zero-padding bugs.