From aecb791a0495418b45cf4e1ea0d13515ee3a5bae Mon Sep 17 00:00:00 2001 From: Nagaprasadvr Date: Thu, 22 Feb 2024 20:22:20 +0530 Subject: [PATCH] add mint address check for addJupiterTokensCmd --- packages/cli/src/actions.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/actions.ts b/packages/cli/src/actions.ts index f696cb989..aec3c4446 100644 --- a/packages/cli/src/actions.ts +++ b/packages/cli/src/actions.ts @@ -507,11 +507,15 @@ export const addBaseAssetsFromJupiter = async (opts: Opts) => { // eslint-disable-next-line no-console console.log('Base assets:', baseAssets); const baseAssetsSymbols = baseAssets.map((b) => b.ticker); + const baseAssetAddresses = baseAssets.map((b) => b.address.toBase58()); const res = await fetch('https://token.jup.ag/all'); const jupTokens: JupTokenList[] = await res.json(); const jupTokensToAdd = jupTokens.filter( - (t) => !baseAssetsSymbols.includes(t.symbol) + (t) => + !baseAssetsSymbols.includes(t.symbol) && + !baseAssetAddresses.includes(t.address) ); + let baseAssetIndexToStart = Math.max(...baseAssets.map((b) => b.index)) + 1; // eslint-disable-next-line no-console console.log('last baseAssetIndex', baseAssetIndexToStart - 1);