Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

274
Vistas
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type in nodejs and solidity

i need set networks in my contract . i use the nodejs and type script .

i wrote this code :

    let networkId: any = await global.web3.eth.net.getId();
    let tetherData = await Tether.networks[networkId];

but it show me this error :

Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{}'.ts(7053)

now how can i solve the problem ?

this is json file of my contract

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

let networkId: number = await global.web3.eth.net.getId();
let tetherData = await Tether.networks[(networkId as number)];

Why:

getId(callback?: (error: Error, id: number) => void): Promise<number>;
                                                              ^^^^^^

https://github.com/ChainSafe/web3.js/blob/ed1011438c3a7e35da8390998f6d1cb9b34db014/packages/web3-core/types/index.d.ts#L253

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda