From 9205f4cd631689e573786a92b29902485f40bca0 Mon Sep 17 00:00:00 2001 From: Aleksandr Kraiz Date: Thu, 19 May 2022 01:15:31 +0400 Subject: [PATCH] Fix build issue --- src/OrionUnit/index.ts | 1 - src/services/OrionAggregator/index.ts | 6 +++--- src/services/OrionAggregator/ws/index.ts | 7 ++----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/OrionUnit/index.ts b/src/OrionUnit/index.ts index f374a57..ebdfc02 100644 --- a/src/OrionUnit/index.ts +++ b/src/OrionUnit/index.ts @@ -113,7 +113,6 @@ export default class OrionUnit { const oaWsProtocol = oaUrl.protocol === 'https:' ? 'wss' : 'ws'; const orionAggregatorWsUrl = `${oaWsProtocol}://${oaUrl.host + (oaUrl.pathname === '/' ? '' : oaUrl.pathname)}/v1`; this.orionAggregator = new OrionAggregator( - chainId, options?.services?.orionAggregator?.api ?? `${options?.api ?? apiUrl}/backend`, orionAggregatorWsUrl, ); diff --git a/src/services/OrionAggregator/index.ts b/src/services/OrionAggregator/index.ts index 610d26f..55bfe84 100644 --- a/src/services/OrionAggregator/index.ts +++ b/src/services/OrionAggregator/index.ts @@ -9,7 +9,7 @@ import errorSchema from './schemas/errorSchema'; import placeAtomicSwapSchema from './schemas/placeAtomicSwapSchema'; import { OrionAggregatorWS } from './ws'; import { atomicSwapHistorySchema } from './schemas/atomicSwapHistorySchema'; -import { SignedCancelOrderRequest, SignedOrder, SupportedChainId } from '../../types'; +import { SignedCancelOrderRequest, SignedOrder } from '../../types'; import { pairConfigSchema } from './schemas'; import { aggregatedOrderbookSchema, exchangeOrderbookSchema, @@ -20,9 +20,9 @@ class OrionAggregator { readonly ws: OrionAggregatorWS; - constructor(chainId: SupportedChainId, apiUrl: string, apiWsUrl: string) { + constructor(apiUrl: string, apiWsUrl: string) { this.apiUrl = apiUrl; - this.ws = new OrionAggregatorWS(apiWsUrl, chainId); + this.ws = new OrionAggregatorWS(apiWsUrl); this.getHistoryAtomicSwaps = this.getHistoryAtomicSwaps.bind(this); this.getPairConfig = this.getPairConfig.bind(this); diff --git a/src/services/OrionAggregator/ws/index.ts b/src/services/OrionAggregator/ws/index.ts index 2bfa80a..0e3d5bc 100644 --- a/src/services/OrionAggregator/ws/index.ts +++ b/src/services/OrionAggregator/ws/index.ts @@ -11,7 +11,7 @@ import { } from './schemas'; import UnsubscriptionType from './UnsubscriptionType'; import { - SwapInfoByAmountIn, SwapInfoByAmountOut, SupportedChainId, SwapInfoBase, + SwapInfoByAmountIn, SwapInfoByAmountOut, SwapInfoBase, } from '../../../types'; import { orderStatuses, subOrderStatuses } from '../../../constants'; // import errorSchema from './schemas/errorSchema'; @@ -167,17 +167,14 @@ type Subscriptions = { [K in T]: Subscription[K] } class OrionAggregatorWS { private ws: WebSocket | undefined; - private chainId: SupportedChainId; - private subscriptions: Partial> = {}; private onError?: (err: string) => void; private readonly wsUrl: string; - constructor(wsUrl: string, chainId: SupportedChainId, onError?: (err: string) => void) { + constructor(wsUrl: string, onError?: (err: string) => void) { this.wsUrl = wsUrl; - this.chainId = chainId; this.onError = onError; }