rubic-sdk-next
Version:
Simplify dApp creation
31 lines (30 loc) • 1.66 kB
TypeScript
import { QuoteAllInterface, QuoteRequestInterface, SwapRequestInterface, WsQuoteRequestInterface } from '@cryptorubic/core';
import { Observable } from 'rxjs';
import { EnvType } from '../../core/sdk/models/env-type';
import { WrappedAsyncTradeOrNull } from './models/wrapped-async-trade-or-null';
import { TransferSwapRequestInterface } from './chains/transfer-trade/models/transfer-swap-request-interface';
import { CrossChainTxStatusConfig } from './models/cross-chain-tx-status-config';
import { SwapResponseInterface } from './models/swap-response-interface';
export declare class RubicApiService {
private readonly envType;
private get apiUrl();
private readonly client;
private latestQuoteParams;
constructor(envType: EnvType);
private getSocket;
calculateAsync(params: WsQuoteRequestInterface, attempt?: number): void;
stopCalculation(): void;
fetchSwapData<T>(body: SwapRequestInterface | TransferSwapRequestInterface): Promise<SwapResponseInterface<T>>;
fetchRoutes(body: QuoteRequestInterface): Promise<QuoteAllInterface>;
fetchBestSwapData<T>(body: SwapRequestInterface | TransferSwapRequestInterface): Promise<SwapResponseInterface<T>>;
fetchCelerRefundData(): void;
disconnectSocket(): void;
closetSocket(): void;
handleQuotesAsync(): Observable<WrappedAsyncTradeOrNull>;
fetchCrossChainTxStatus(srcTxHash: string): Promise<CrossChainTxStatusConfig>;
fetchCrossChainTxStatusExtended(srcTxHash: string, rubicId: string): Promise<CrossChainTxStatusConfig>;
getMessageToAuthWallet(walletAddress: string): Promise<{
messageToAuth: string;
}>;
private getApiError;
}