@@ -101,6 +101,16 @@ async function fetchRegistrarActions(parentNode: Node | undefined, query: Regist
101101 */
102102app . openapi ( getRegistrarActionsRoute , async ( c ) => {
103103 try {
104+ // Defensive: `registrarActionsApiMiddleware` already short-circuits with a
105+ // serialized 503 when indexingStatus is an Error, so this branch is
106+ // unreachable at runtime — kept only for TypeScript type narrowing.
107+ if ( c . var . indexingStatus instanceof Error ) {
108+ throw new Error ( "Indexing status has not been loaded yet" ) ;
109+ }
110+
111+ // Get the accurateAsOf timestamp from the omnichain indexing cursor
112+ const accurateAsOf = c . var . indexingStatus . snapshot . omnichainSnapshot . omnichainIndexingCursor ;
113+
104114 const query = c . req . valid ( "query" ) ;
105115 const { registrarActions, pageContext } = await fetchRegistrarActions ( undefined , query ) ;
106116
@@ -110,6 +120,7 @@ app.openapi(getRegistrarActionsRoute, async (c) => {
110120 responseCode : RegistrarActionsResponseCodes . Ok ,
111121 registrarActions,
112122 pageContext,
123+ accurateAsOf,
113124 } satisfies RegistrarActionsResponseOk ) ,
114125 ) ;
115126 } catch ( error ) {
@@ -163,17 +174,20 @@ app.openapi(getRegistrarActionsRoute, async (c) => {
163174 */
164175app . openapi ( getRegistrarActionsByParentNodeRoute , async ( c ) => {
165176 try {
177+ // Defensive: `registrarActionsApiMiddleware` already short-circuits with a
178+ // serialized 503 when indexingStatus is an Error, so this branch is
179+ // unreachable at runtime — kept only for TypeScript type narrowing.
166180 if ( c . var . indexingStatus instanceof Error ) {
167181 throw new Error ( "Indexing status has not been loaded yet" ) ;
168182 }
169183
184+ // Get the accurateAsOf timestamp from the omnichain indexing cursor
185+ const accurateAsOf = c . var . indexingStatus . snapshot . omnichainSnapshot . omnichainIndexingCursor ;
186+
170187 const { parentNode } = c . req . valid ( "param" ) ;
171188 const query = c . req . valid ( "query" ) ;
172189 const { registrarActions, pageContext } = await fetchRegistrarActions ( parentNode , query ) ;
173190
174- // Get the accurateAsOf timestamp from the slowest chain indexing cursor
175- const accurateAsOf = c . var . indexingStatus . snapshot . slowestChainIndexingCursor ;
176-
177191 // respond with success response
178192 return c . json (
179193 serializeRegistrarActionsResponse ( {
0 commit comments