Necesito establecer redes en mi contrato. Uso nodejs y escribo script.
Escribí este código:
let networkId: any = await global.web3.eth.net.getId(); let tetherData = await Tether.networks[networkId];pero me muestra este error:
El elemento tiene implícitamente un tipo 'cualquiera' porque la expresión de tipo 'cualquiera' no se puede usar para indexar el tipo '{}'.ts(7053)
ahora como puedo solucionar el problema
este es el archivo json de mi contrato
let networkId: number = await global.web3.eth.net.getId(); let tetherData = await Tether.networks[(networkId as number)];Por qué:
getId(callback?: (error: Error, id: number) => void): Promise<number>; ^^^^^^