import { BitcoinRpc } from "crosslightning-base"; 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 { Command } from "crosslightning-server-base"; import { FromBtcLnTrustedRequestType } from "../swaps/frombtcln_trusted/FromBtcLnTrusted"; export type QuoteThrow = { type: "throw"; message: string; }; export declare function isQuoteThrow(obj: any): obj is QuoteThrow; export type QuoteSetFees = { type: "fees"; baseFee?: BN; feePPM?: BN; }; export declare function isQuoteSetFees(obj: any): obj is QuoteSetFees; export type QuoteAmountTooLow = { type: "low"; data: { min: BN; max: BN; }; }; export declare function isQuoteAmountTooLow(obj: any): obj is QuoteAmountTooLow; export type QuoteAmountTooHigh = { type: "high"; data: { min: BN; max: BN; }; }; export declare function isQuoteAmountTooHigh(obj: any): obj is QuoteAmountTooHigh; export type PluginQuote = { type: "success"; amount: { input: boolean; amount: BN; }; swapFee: { inInputTokens: BN; inOutputTokens: BN; }; }; export declare function isPluginQuote(obj: any): obj is PluginQuote; export type ToBtcPluginQuote = PluginQuote & { networkFee: { inInputTokens: BN; inOutputTokens: BN; }; }; export declare function isToBtcPluginQuote(obj: any): obj is ToBtcPluginQuote; export interface IPlugin { name: string; author: string; description: string; onEnable(chainsData: MultichainData, bitcoinRpc: BitcoinRpc, lnd: AuthenticatedLnd, swapPricing: ISwapPrice, tokens: { [ticker: string]: { [chainId: string]: { address: string; decimals: number; }; }; }, directory: string): Promise; onDisable(): Promise; onServiceInitialize(service: SwapHandler): Promise; onHttpServerStarted?(expressServer: any): Promise; onSwapStateChange?(swap: SwapHandlerSwap): Promise; onSwapCreate?(swap: SwapHandlerSwap): Promise; onSwapRemove?(swap: SwapHandlerSwap): Promise; onHandlePreFromBtcQuote?(request: RequestData, requestedAmount: { input: boolean; amount: BN; }, chainIdentifier: string, token: string, constraints: { minInBtc: BN; maxInBtc: BN; }, fees: { baseFeeInBtc: BN; feePPM: BN; }): Promise; 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; onHandlePreToBtcQuote?(request: RequestData, requestedAmount: { input: boolean; amount: BN; }, chainIdentifier: string, token: string, constraints: { minInBtc: BN; maxInBtc: BN; }, fees: { baseFeeInBtc: BN; feePPM: BN; }): Promise; 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; /** * Returns whitelisted bitcoin txIds that are OK to spend even with 0-confs */ getWhitelistedTxIds?(): string[]; getCommands?(): Command[]; }