@@ -285,13 +285,14 @@ export function createTokenHostRegistryDirectReadAdapter({
285285
286286 async function readDatasetPage ( { offset = 0n , limit = maxLimit } = { } ) {
287287 const normalizedLimit = normalizePageLimit ( limit , maxLimit ) ;
288- const keys = Array . from (
288+ const rawKeys = Array . from (
289289 await readContract (
290290 registryDatasetKeysPageRead ( registryAddress , { offset, limit : normalizedLimit } ) ,
291291 ) ,
292292 ) ;
293+ const keys = rawKeys . map ( registryDatasetKeyId ) ;
293294 const datasets = await mapWithConcurrency (
294- keys ,
295+ rawKeys ,
295296 maxDetailConcurrency ,
296297 async ( key ) => {
297298 const dataset = normalizeRegistryDatasetRecord (
@@ -306,7 +307,7 @@ export function createTokenHostRegistryDirectReadAdapter({
306307
307308 return {
308309 sourceOfTruth : DIRECT_READ_SOURCE ,
309- pagination : offsetPagination ( { offset, limit : normalizedLimit , rows : keys } ) ,
310+ pagination : offsetPagination ( { offset, limit : normalizedLimit , rows : rawKeys } ) ,
310311 keys,
311312 datasets,
312313 } ;
@@ -478,7 +479,7 @@ export function createTokenHostRegistryDirectReadAdapter({
478479 { model } ,
479480 {
480481 ...options ,
481- now : options . now ?? now ,
482+ now : options . now ?? now ?? currentUnixSeconds ( ) ,
482483 } ,
483484 ) ;
484485 }
@@ -758,6 +759,10 @@ function normalizeConcurrency(concurrency) {
758759 return value ;
759760}
760761
762+ function currentUnixSeconds ( ) {
763+ return Math . floor ( Date . now ( ) / 1000 ) ;
764+ }
765+
761766function decimalString ( value ) {
762767 return BigInt ( value ) . toString ( ) ;
763768}
0 commit comments