import { Transaction } from '@chainify/types'; import { ThorchainAPIErrorParser } from '@liquality/error-parser'; import BN, { BigNumber } from 'bignumber.js'; import { ActionContext } from '../../store'; import { Asset, Network, SwapHistoryItem, WalletId } from '../../store/types'; import { SwapProvider } from '../SwapProvider'; import { BaseSwapProviderConfig, EstimateFeeRequest, EstimateFeeResponse, NextSwapActionRequest, QuoteRequest, SwapQuote, SwapRequest, SwapStatus } from '../types'; export interface ThorchainSwapProviderConfig extends BaseSwapProviderConfig { thornode: string; } export interface ThorchainPool { balance_rune: string; balance_asset: string; asset: string; LP_units: string; pool_units: string; status: string; synth_units: string; synth_supply: string; pending_inbound_rune: string; pending_inbound_asset: string; } export interface ThorchainInboundAddress { chain: string; pub_key: string; address: string; halted: boolean; gas_rate: string; router?: string; } export interface ThorchainTx { id: string; chain: string; from_address: string; to_address: string; coins: { asset: string; amount: string; }[]; gas: { asset: string; amount: string; }[]; memo: string; } export interface ThorchainObservedTx { tx: ThorchainTx; status: string; block_height: number; signers: string[]; observed_pub_key: string; finalise_height: number; out_hashes: string[]; } export interface ThorchainTransactionResponse { keysign_metric: { tx_id: string; node_tss_times?: any; }; observed_tx: ThorchainObservedTx; } export declare enum ThorchainTxTypes { SWAP = "SWAP" } export interface ThorchainSwapHistoryItem extends SwapHistoryItem { receiveFee: string; approveTxHash: string; approveTx: Transaction; fromFundHash: string; fromFundTx: Transaction; receiveTxHash: string; receiveTx: Transaction; } export interface ThorchainSwapQuote extends SwapQuote { receiveFee: string; slippage: number; } declare class ThorchainSwapProvider extends SwapProvider { config: ThorchainSwapProviderConfig; private _httpClient; thorchainAPIErrorParser: ThorchainAPIErrorParser; constructor(config: ThorchainSwapProviderConfig); getSupportedPairs(): Promise; _getPools(): Promise; _getInboundAddresses(): Promise; _getTransaction(hash: string): Promise; getInboundAddress(chain: string): Promise; getRouterAddress(chain: string): Promise; getOutput({ from, to, fromAmountInUnit, slippage, network, }: { from: Asset; to: Asset; fromAmountInUnit: BigNumber; slippage: number; network: Network; }): Promise; getQuote(quoteRequest: QuoteRequest): Promise<{ fromAmount: string; toAmount: string; slippage: number; } | null>; networkFees(asset: Asset, network: Network): Promise<{ type: import("@xchainjs/xchain-util").Denomination.Base; amount: () => BN; plus: (value: BN.Value | any, decimal?: number | undefined) => any; minus: (value: BN.Value | any, decimal?: number | undefined) => any; times: (value: BN.Value | any, decimal?: number | undefined) => any; div: (value: BN.Value | any, decimal?: number | undefined) => any; gt: (value: BN.Value | any) => boolean; gte: (value: BN.Value | any) => boolean; lt: (value: BN.Value | any) => boolean; lte: (value: BN.Value | any) => boolean; eq: (value: BN.Value | any) => boolean; decimal: number; } | undefined>; approveTokens({ network, walletId, swap }: NextSwapActionRequest): Promise<{ status: string; approveTx?: undefined; approveTxHash?: undefined; } | { status: string; approveTx: Transaction; approveTxHash: string; }>; sendBitcoinSwap({ quote, network, walletId, memo, }: { quote: ThorchainSwapHistoryItem; network: Network; walletId: WalletId; memo: string; }): Promise>; sendEthereumSwap({ quote, network, walletId, memo, }: { quote: ThorchainSwapHistoryItem; network: Network; walletId: WalletId; memo: string; }): Promise>; makeMemo({ network, walletId, swap }: NextSwapActionRequest): Promise; sendSwap({ network, walletId, swap }: NextSwapActionRequest): Promise<{ status: string; fromFundTx: Transaction; fromFundHash: string; }>; newSwap({ network, walletId, quote }: SwapRequest): Promise<{ status: string; approveTx?: undefined; approveTxHash?: undefined; id: string; fee: number; } | { status: string; approveTx: Transaction; approveTxHash: string; id: string; fee: number; } | { status: string; fromFundTx: Transaction; fromFundHash: string; id: string; fee: number; }>; estimateFees({ network, walletId, asset, txType, quote, feePrices, max, }: EstimateFeeRequest): Promise; getMin(quote: QuoteRequest): Promise; waitForApproveConfirmations({ swap, network, walletId }: NextSwapActionRequest): Promise<{ endTime: number; status: string; } | undefined>; waitForSendConfirmations({ swap, network, walletId }: NextSwapActionRequest): Promise<{ endTime: number; status: string; } | undefined>; waitForReceive({ swap, network, walletId }: NextSwapActionRequest): Promise<{ receiveTxHash: string; receiveTx: Transaction; endTime: number; status: string; } | { receiveTxHash: string; receiveTx: Transaction; endTime?: undefined; status?: undefined; } | undefined>; performNextSwapAction(store: ActionContext, { network, walletId, swap }: NextSwapActionRequest): Promise | undefined>; private feeUnits; protected _getStatuses(): Record; protected _txTypes(): typeof ThorchainTxTypes; protected _fromTxType(): string | null; protected _toTxType(): string | null; protected _timelineDiagramSteps(): string[]; protected _totalSteps(): number; } export { ThorchainSwapProvider };