Skip to content

Commit

Permalink
add mint address check for addJupiterTokensCmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagaprasadvr committed Feb 22, 2024
1 parent 8cecd21 commit aecb791
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cli/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit aecb791

Please sign in to comment.