From 1e48d798db010f97a9979faef1bb66a3191deeaa Mon Sep 17 00:00:00 2001 From: lumtis Date: Thu, 20 Jun 2024 10:50:16 +0200 Subject: [PATCH] try fixing iterator error --- scripts/generate_addresses_types.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/generate_addresses_types.ts b/scripts/generate_addresses_types.ts index 2c0622be..e15ae4d1 100644 --- a/scripts/generate_addresses_types.ts +++ b/scripts/generate_addresses_types.ts @@ -1,13 +1,17 @@ import mainnet from "../data/addresses.mainnet.json"; import testnet from "../data/addresses.testnet.json"; +// Ensure that mainnet and testnet are typed as arrays +const mainnetData: any[] = mainnet as any[]; +const testnetData: any[] = testnet as any[]; + const extractUniqueValues = (data: any[], key: string): string[] => { const allValues = data.filter((item) => item[key] !== undefined).map((item) => item[key].toString()); return [...new Set(allValues)]; }; const generateTypesForKeys = (keys: string[]) => { - const networks = [...mainnet, ...testnet]; + const networks = [...mainnetData, ...testnetData]; let typeDefs = "";