Skip to content

Commit

Permalink
Remove deprecated poolLegacyDetail$ service (#1569)
Browse files Browse the repository at this point in the history
  • Loading branch information
luxuereal authored Jun 23, 2021
1 parent 0e3eff1 commit 5f877c3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
34 changes: 0 additions & 34 deletions src/renderer/services/midgard/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
GetLiquidityHistoryRequest,
GetPoolsRequest,
GetPoolsStatusEnum,
GetPoolStatsLegacyRequest,
GetPoolStatsPeriodEnum,
GetPoolStatsRequest
} from '../../types/generated/midgard/apis'
Expand All @@ -43,7 +42,6 @@ import {
PoolAddress,
PoolFilter,
PoolStatsDetailLD,
PoolLegacyDetailLD,
PoolLiquidityHistoryLD,
PoolLiquidityHistoryParams,
PoolDetailLD,
Expand Down Expand Up @@ -660,37 +658,6 @@ const createPoolsService = (
RxOp.startWith(RD.pending)
)

// Factory to get pool legacy detail from Midgard
const apiGetPoolLegacyDetail$ = (request: GetPoolStatsLegacyRequest): PoolLegacyDetailLD =>
FP.pipe(
midgardDefaultApi$,
liveData.chain((api) =>
FP.pipe(
api.getPoolStatsLegacy(request),
RxOp.map(RD.success),
RxOp.startWith(RD.pending),
RxOp.catchError((e: Error) => Rx.of(RD.failure(e)))
)
)
)

const poolLegacyDetail$: PoolLegacyDetailLD = Rx.combineLatest([selectedPoolAsset$, reloadSelectedPoolDetail$]).pipe(
RxOp.map(([oSelectedPoolAsset]) => oSelectedPoolAsset),
RxOp.switchMap((selectedPoolAsset) => {
return FP.pipe(
selectedPoolAsset,
O.fold(
() => Rx.of(RD.initial),
(asset) =>
apiGetPoolLegacyDetail$({
asset: assetToString(asset)
})
)
)
}),
RxOp.startWith(RD.pending)
)

// Factory to get earning history
const apiGetEarningHistory$ = ({ from, to, ...request }: GetEarningsHistoryRequest): EarningsHistoryLD =>
FP.pipe(
Expand Down Expand Up @@ -882,7 +849,6 @@ const createPoolsService = (
reloadSelectedPoolDetail: (delayTime = 0) => _reloadSelectedPoolDetail(delayTime),
reloadPoolStatsDetail,
poolStatsDetail$,
poolLegacyDetail$,
poolEarningHistory$,
getPoolLiquidityHistory$,
getSelectedPoolSwapHistory$,
Expand Down
5 changes: 0 additions & 5 deletions src/renderer/services/midgard/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
PoolDetail,
Health,
PoolStatsDetail,
PoolLegacyDetail,
LiquidityHistory,
GetLiquidityHistoryIntervalEnum,
SwapHistory,
Expand Down Expand Up @@ -137,9 +136,6 @@ export type PoolAddressesLD = LiveData<Error, PoolAddresses>
export type PoolStatsDetailRD = RD.RemoteData<Error, PoolStatsDetail>
export type PoolStatsDetailLD = LiveData<Error, PoolStatsDetail>

export type PoolLegacyDetailRD = RD.RemoteData<Error, PoolLegacyDetail>
export type PoolLegacyDetailLD = LiveData<Error, PoolLegacyDetail>

export type EarningsHistoryRD = RD.RemoteData<Error, EarningsHistory>
export type EarningsHistoryLD = LiveData<Error, EarningsHistory>

Expand Down Expand Up @@ -194,7 +190,6 @@ export type PoolsService = {
reloadSelectedPoolDetail: (delay?: number) => void
reloadPoolStatsDetail: FP.Lazy<void>
poolStatsDetail$: PoolStatsDetailLD
poolLegacyDetail$: PoolLegacyDetailLD
poolEarningHistory$: PoolEarningHistoryLD
getPoolLiquidityHistory$: (parmas: PoolLiquidityHistoryParams) => PoolLiquidityHistoryLD
getSelectedPoolSwapHistory$: (params: GetSwapHistoryParams) => SwapHistoryLD
Expand Down

0 comments on commit 5f877c3

Please sign in to comment.