Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

263
Views
El elemento tiene implícitamente un tipo 'cualquiera' porque la expresión de tipo 'cualquiera' no se puede usar para indexar el tipo en nodejs y solidity

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

ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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>; ^^^^^^

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

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!