Skip to content

Commit

Permalink
disable verify pool request
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Oct 2, 2023
1 parent b46efb8 commit 8b3943e
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions src/network/cardano/api/ammPools/ammPools.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { AmmPool } from '@spectrumlabs/cardano-dex-sdk';
import { encodeHex } from '@spectrumlabs/cardano-dex-sdk/build/main/utils/hex';
import axios from 'axios';
import {
catchError,
combineLatest,
exhaustMap,
filter,
from,
map,
Observable,
of,
Expand All @@ -16,7 +13,6 @@ import {
} from 'rxjs';

import { applicationConfig } from '../../../../applicationConfig';
import { isLbspAmmPool } from '../../../../utils/lbsp';
import { ammPoolsStats$ } from '../ammPoolsStats/ammPoolsStats';
import { mapAssetClassToAssetInfo } from '../common/cardanoAssetInfo/getCardanoAssetInfo';
import { networkContext$ } from '../networkContext/networkContext';
Expand Down Expand Up @@ -91,28 +87,29 @@ export const allAmmPools$ = combineLatest([rawAmmPools$, ammPoolsStats$]).pipe(
const filterUnverifiedPools = (
ammPools: CardanoAmmPool[],
): Observable<CardanoAmmPool[]> => {
return from(
axios.post(
'https://meta.spectrum.fi/cardano/minting/data/verifyPool/',
ammPools.map((ammPool) => ({
nftCs: ammPool.pool.id.policyId,
nftTn: encodeHex(new TextEncoder().encode(ammPool.pool.id.name)),
lqCs: ammPool.pool.lp.asset.policyId,
lqTn: encodeHex(new TextEncoder().encode(ammPool.pool.lp.asset.name)),
})),
),
).pipe(
map((res) => {
return ammPools.filter(
(ammPool) =>
res.data.find(
([{ nftCs }]: [{ nftCs: string }, boolean]) =>
nftCs === ammPool.pool.id.policyId,
)?.[1] || isLbspAmmPool(ammPool.id),
);
}),
catchError(() => of(ammPools)),
);
// return from(
// axios.post(
// 'https://meta.spectrum.fi/cardano/minting/data/verifyPool/',
// ammPools.map((ammPool) => ({
// nftCs: ammPool.pool.id.policyId,
// nftTn: encodeHex(new TextEncoder().encode(ammPool.pool.id.name)),
// lqCs: ammPool.pool.lp.asset.policyId,
// lqTn: encodeHex(new TextEncoder().encode(ammPool.pool.lp.asset.name)),
// })),
// ),
// ).pipe(
// map((res) => {
// return ammPools.filter(
// (ammPool) =>
// res.data.find(
// ([{ nftCs }]: [{ nftCs: string }, boolean]) =>
// nftCs === ammPool.pool.id.policyId,
// )?.[1] || isLbspAmmPool(ammPool.id),
// );
// }),
// catchError(() => of(ammPools)),
// );
return of(ammPools);
};

export const ammPools$ = allAmmPools$.pipe(
Expand Down

0 comments on commit 8b3943e

Please sign in to comment.