I'm struggling to input an abi key "5777" in Typescript. When I receive a network ID and try to set it in the networks key, the linter displays an error.
My issue is that I need to specify "networkId" and it's not always a fixed value like "5777".
let networkId = await web3.eth.net.getId();
// Define network type as "5777";
let networkId = await web3.eth.net.getId();
DeluxerContract = new web3.eth.Contract(
artifact.abi,
artifact.networks[networkId].address
);
The above code isn't a suitable solution because the networkId can vary.
type network = "5777";
let networkId: network = await web3.eth.net.getId();
DeluxerContract = new web3.eth.Contract(
artifact.abi,
artifact.networks[networkId].address
);