API ReferenceSetup and configurationFunction
getChainId()
function getChainId(ctx): Promise<bigint>;Gets the chain ID from the configured public client, as a bigint (viem returns number), fetched
live on every call rather than cached.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | SDKContext | The SDK context. |
Returns
Promise<bigint>
The chain ID.
Throws
ProviderConnectionError if the underlying RPC call fails.