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