const hiroHeaders = { 'x-hiro-product' : 'stacks-wallet-web' , 'x-hiro-version' : VERSION , } ; export function fetcher ( input , init = { } ) { const initHeaders = init . headers || { } ; return fetch ( input , { credentials : 'omit' , ... init , headers : { ... initHeaders , ... hiroHeaders } , } ) ; } export async function fetchWithTimeout ( input , init = { } ) { const { timeout = 8000 , ... options } = init ; const controller = new AbortController ( ) ; const id = setTimeout ( ( ) => controller . abort ( ) , timeout ) ; const response = await fetcher ( input , { ... options , signal : controller . signal , } ) ; clearTimeout ( id ) ; return response ; }