chainId method

Future<String> chainId({
  1. Duration? timeout,
})

Implementation

Future<String> chainId({Duration? timeout}) async {
  final block = await getLatestBlock(timeout: timeout);
  final chainId = block.block?.header?.chainId;
  if (chainId == null) {
    throw const RPCError(
      message: "Unexpected service response. missing chaind id.",
    );
  }
  return chainId;
}