import getConfig from "next/config" ; import { PixelMapTile } from "@pixelmap/common/types/PixelMapTile" ; const { publicRuntimeConfig } = getConfig ( ) ; export const fetchTiles = async ( ) => { try { const res = await fetch ( "https://pixelmap.art/tiledata.json" ) ; const tiles = await res . json ( ) ; return tiles ; } catch ( err ) { return [ ] ; } } ; export const fetchSingleTile = async ( id ) => { let tile ; if ( id != undefined ) { try { const res = await fetch ( `https://pixelmap.art/tile/${ id }.json` ) ; tile = await res . json ( ) ; } catch ( err ) { } } return tile ; } ; export interface TimeCapsuleTile { tileId ? : number ; orderImageSetOnTile ? : number ; currentOwner ? : number ; claimed ? : boolean ; } export const fetchTimeCapsuleTiles = async ( ) => { try { const res = await fetch ( "https://pixelmap.art/timecapsuleI.json" ) ; const tiles = await res . json ( ) ; return tiles ; } catch ( err ) { return [ ] ; } } ;