I have a problem to type an abi key "5777" in typescript. When i get a netwotkId and then set in networks key, the linter show me the next error
i need to type "networkId" and that it is not a always a fixed value as like "5777"
let networkId = await web3.eth.net.getId();
// type network = "5777";
let networkId = await web3.eth.net.getId();
DeluxerContract = new web3.eth.Contract(
artifact.abi,
artifact.networks[networkId].address
);
This is not a viable solution because the networkId is variable.
type network = "5777";
let networkId: network = await web3.eth.net.getId();
DeluxerContract = new web3.eth.Contract(
artifact.abi,
artifact.networks[networkId].address
);