import fetch from 'node-fetch' ; const baseUrl = 'https://www.4byte.directory/api/v1' ; export async function searchSignature ( hexSignature ) { const response = await fetch ( `${ baseUrl }/signatures/?hex_signature=${ hexSignature }` , { headers : { 'Content-Type' : 'application/json' , } , } ) ; const data = await response . json ( ) ; return data . results . sort ( ( a , b ) => a . id - b . id ) . map ( ( result ) => result . text_signature ) ; }