import { BitcoinRpc, SwapData } from "crosslightning-base"; import { IPlugin, PluginQuote, QuoteAmountTooHigh, QuoteAmountTooLow, QuoteSetFees, QuoteThrow, ToBtcPluginQuote } from "./IPlugin"; import { FromBtcLnRequestType, FromBtcRequestType, ISwapPrice, MultichainData, RequestData, SwapHandler, ToBtcLnRequestType, ToBtcRequestType } from ".."; import { SwapHandlerSwap } from "../swaps/SwapHandlerSwap"; import { AuthenticatedLnd } from "lightning"; import * as BN from "bn.js"; import { FromBtcLnTrustedRequestType } from "../swaps/frombtcln_trusted/FromBtcLnTrusted"; export type FailSwapResponse = { type: "fail"; code?: number; msg?: string; }; export type FeeSwapResponse = { type: "fee"; baseFee: BN; feePPM: BN; }; export type AmountAndFeeSwapResponse = { type: "amountAndFee"; baseFee?: BN; feePPM?: BN; amount: BN; }; export type SwapResponse = FailSwapResponse | FeeSwapResponse | AmountAndFeeSwapResponse; export declare class PluginManager { static plugins: Map; static registerPlugin(name: string, plugin: IPlugin): void; static unregisterPlugin(name: string): boolean; static enable(chainsData: MultichainData, bitcoinRpc: BitcoinRpc, lnd: AuthenticatedLnd, swapPricing: ISwapPrice, tokens: { [ticker: string]: { [chainId: string]: { address: string; decimals: number; }; }; }, directory: string): Promise; static disable(): Promise; static serviceInitialize(handler: SwapHandler): Promise; static onHttpServerStarted(httpServer: any): Promise; static swapStateChange(swap: SwapHandlerSwap, oldState?: any): Promise; static swapCreate(swap: SwapHandlerSwap): Promise; static swapRemove(swap: SwapHandlerSwap): Promise; static onHandlePostFromBtcQuote(request: RequestData, requestedAmount: { input: boolean; amount: BN; }, chainIdentifier: string, token: string, constraints: { minInBtc: BN; maxInBtc: BN; }, fees: { baseFeeInBtc: BN; feePPM: BN; }, pricePrefetchPromise?: Promise | null): Promise; static onHandlePreFromBtcQuote(request: RequestData, requestedAmount: { input: boolean; amount: BN; }, chainIdentifier: string, token: string, constraints: { minInBtc: BN; maxInBtc: BN; }, fees: { baseFeeInBtc: BN; feePPM: BN; }): Promise; static onHandlePostToBtcQuote(request: RequestData, requestedAmount: { input: boolean; amount: BN; }, chainIdentifier: string, token: string, constraints: { minInBtc: BN; maxInBtc: BN; }, fees: { baseFeeInBtc: BN; feePPM: BN; networkFeeGetter: (amount: BN) => Promise; }, pricePrefetchPromise?: Promise | null): Promise; static onHandlePreToBtcQuote(request: RequestData, requestedAmount: { input: boolean; amount: BN; }, chainIdentifier: string, token: string, constraints: { minInBtc: BN; maxInBtc: BN; }, fees: { baseFeeInBtc: BN; feePPM: BN; }): Promise; static getWhitelistedTxIds(): Set; }