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

266
Views
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 answers
Answer question

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 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!