Skip to content
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

ParameterTypeDescription
ctxSDKContextThe SDK context.

Returns

Promise<bigint>

The chain ID.

Throws

ProviderConnectionError if the underlying RPC call fails.