-1

Hi i'm struggling to create a type for networkConfig, i tried the following one but it's not working properly, notice that property is an Integer!!

type networkConfigType = { number: { name: string; ethUsdPriceFeed: string; }; };

const networkConfig = { 4: { name : "rinkeby", ethUsdPriceFeed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e", }, 137: { name: "polygon", ethUsdPriceFeed: "0xF9680D99D6C9589e2a93a78A04A279e509205945", }, };

1 Answer 1

2
type networkConfigType = Record<number, { name: string; ethUsdPriceFeed: string; }>; 
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you so much broo!!!, big cheeeeer to youuuu
@LajosArpad i already accepted it
@ABDELLATIFANAFLOUS if you accept an answer, then a green check mark appears below the vote counter.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.