mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-15 14:42:38 +03:00
Fix build issue
This commit is contained in:
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user