Skip to content

Commit f6fb847

Browse files
committed
Make chainId mandatory
1 parent 810359e commit f6fb847

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/scripts/utils/tokens.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,15 @@ export function mergeErc20Info(onchainInfo: Erc20Info, tokenOverride: PartialTok
136136
}
137137

138138
/**
139-
* Partial token information. It will have at least the address of the token.
139+
* Partial token information. It will have at least the address and chainId of the token.
140140
*/
141141
export interface PartialTokenInfo extends Partial<Omit<TokenInfo, 'address'>> {
142+
chainId: number
142143
address: string
143144
}
144145

145146
interface PartialTokenInfoCsv extends Omit<PartialTokenInfo, 'chainId' | 'decimals' | 'extensions'> {
146-
chainId?: string
147+
chainId: string
147148
decimals?: string
148149
extensions?: string
149150
}
@@ -164,7 +165,7 @@ export async function readTokensCsv(csvPath: string): Promise<PartialTokenInfo[]
164165
return {
165166
...token,
166167
address: token.address,
167-
chainId: token.chainId ? parseInt(token.chainId) : undefined,
168+
chainId: parseInt(token.chainId),
168169
decimals: token.decimals ? parseInt(token.decimals) : undefined,
169170
extensions: token.extensions ? JSON.parse(token.extensions) : undefined,
170171
logoURI: token.logoURI || undefined,

0 commit comments

Comments
 (0)