Fix build issue

This commit is contained in:
Aleksandr Kraiz
2022-05-19 01:15:31 +04:00
parent 80067abfc9
commit 9205f4cd63
3 changed files with 5 additions and 9 deletions

View File

@@ -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,
);

View File

@@ -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);

View File

@@ -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<T extends SubscriptionType> = { [K in T]: Subscription[K] }
class OrionAggregatorWS {
private ws: WebSocket | undefined;
private chainId: SupportedChainId;
private subscriptions: Partial<Subscriptions<SubscriptionType>> = {};
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;
}