diff --git a/src/lib/token_list_gen.ts b/src/lib/token_list_gen.ts index ca5a0ad1..895ff56b 100644 --- a/src/lib/token_list_gen.ts +++ b/src/lib/token_list_gen.ts @@ -56,6 +56,7 @@ export const generateTokenList = async ( includeOldDataFields?: boolean; sourceListURL?: string; skipValidation?: boolean; + preserveListName?: boolean } ) => { if (options?.includeAllL1Tokens && options.includeUnbridgedL1Tokens) { @@ -334,7 +335,7 @@ export const generateTokenList = async ( })(); const sourceListURL = getFormattedSourceURL(options?.sourceListURL); const arbTokenList: ArbTokenList = { - name: listNameToArbifiedListName(name), + name: (options && options.preserveListName) ? name : listNameToArbifiedListName(name), timestamp: new Date().toISOString(), version, tokens: arbifiedTokenList, @@ -365,7 +366,7 @@ export const generateTokenList = async ( export const arbifyL1List = async ( pathOrUrl: string, - includeOldDataFields?: boolean + includeOldDataFields: boolean ): Promise<{ newList: ArbTokenList; l1ListName: string; @@ -390,7 +391,7 @@ export const arbifyL1List = async ( }; }; -export const updateArbifiedList = async (pathOrUrl: string) => { +export const updateArbifiedList = async (pathOrUrl: string, includeOldDataFields: boolean) => { const arbTokenList = await getTokenListObj(pathOrUrl); removeInvalidTokensFromList(arbTokenList); const path = @@ -410,6 +411,8 @@ export const updateArbifiedList = async (pathOrUrl: string) => { const newList = await generateTokenList(arbTokenList, prevArbTokenList, { includeAllL1Tokens: true, sourceListURL: isValidHttpUrl(pathOrUrl) ? pathOrUrl : undefined, + includeOldDataFields, + preserveListName: true }); return { diff --git a/src/main.ts b/src/main.ts index f79a40f2..43a77fb6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,16 +22,17 @@ const main = async () => { let tokenList: ArbTokenList; let path: string; + const includeOldDataFields:boolean = !!args.includeOldDataFields if (args.action === 'arbify') { const { newList, l1ListName } = await arbifyL1List( args.tokenList, - !!args.includeOldDataFields + includeOldDataFields ); tokenList = newList; path = getPath(l1ListName); } else if (args.action === 'update') { - const { newList, path: _path } = await updateArbifiedList(args.tokenList); + const { newList, path: _path } = await updateArbifiedList(args.tokenList, includeOldDataFields); tokenList = newList; path = _path; } else if (args.action === 'alltokenslist') { diff --git a/update_all b/update_all index ce4080e1..706b0d1e 100755 --- a/update_all +++ b/update_all @@ -5,6 +5,8 @@ yarn fullList --l2NetworkID 42161 yarn arbify --l2NetworkID 42161 --tokenList https://gateway.ipfs.io/ipns/tokens.uniswap.org yarn arbify --l2NetworkID 42161 --tokenList https://www.gemini.com/uniswap/manifest.json yarn arbify --l2NetworkID 42161 --tokenList https://api.coinmarketcap.com/data-api/v3/uniswap/all.json +# update whitelist era list (for e.g. changed gateways) +yarn update --l2NetworkID 42161 --tokenList ./src/ArbTokenLists/arbed_arb_whitelist_era.json --includeOldDataFields true # nova # yarn fullList --l2NetworkID 42170