import { LNURLPay, LNURLWithdraw } from "../../utils/LNURL"; import { IntermediaryDiscovery, SwapBounds } from "../../intermediaries/IntermediaryDiscovery"; import { SwapType } from "../enums/SwapType"; import { LnForGasSwap } from "../trusted/ln/LnForGasSwap"; import { ISwap } from "../ISwap"; import { IToBTCSwap } from "../escrow_swaps/tobtc/IToBTCSwap"; import { ChainIds, MultiChain, SupportsSwapType } from "./Swapper"; import { FromBTCLNSwap } from "../escrow_swaps/frombtc/ln/FromBTCLNSwap"; import { FromBTCSwap } from "../escrow_swaps/frombtc/onchain/FromBTCSwap"; import { ToBTCLNSwap } from "../escrow_swaps/tobtc/ln/ToBTCLNSwap"; import { ToBTCSwap } from "../escrow_swaps/tobtc/onchain/ToBTCSwap"; import { SwapPriceWithChain } from "../../prices/SwapPriceWithChain"; import { MempoolApi } from "../../btc/mempool/MempoolApi"; import { MempoolBitcoinRpc } from "../../btc/mempool/MempoolBitcoinRpc"; import { BtcToken, SCToken, Token, TokenAmount } from "../../Tokens"; import { BTC_NETWORK } from "@scure/btc-signer/utils"; import { ToBTCOptions } from "../escrow_swaps/tobtc/onchain/ToBTCWrapper"; import { ToBTCLNOptions } from "../escrow_swaps/tobtc/ln/ToBTCLNWrapper"; import { FromBTCOptions } from "../escrow_swaps/frombtc/onchain/FromBTCWrapper"; import { FromBTCLNOptions } from "../escrow_swaps/frombtc/ln/FromBTCLNWrapper"; import { SwapperUtils } from "./utils/SwapperUtils"; import { SpvFromBTCSwap } from "../spv_swaps/SpvFromBTCSwap"; import { SwapperWithChain } from "./SwapperWithChain"; import { SwapWithSigner } from "./SwapWithSigner"; import { OnchainForGasSwap } from "../trusted/onchain/OnchainForGasSwap"; import { FromBTCLNAutoSwap } from "../escrow_swaps/frombtc/ln_auto/FromBTCLNAutoSwap"; import { FromBTCLNAutoOptions } from "../escrow_swaps/frombtc/ln_auto/FromBTCLNAutoWrapper"; export declare class SwapperWithSigner> { readonly chainIdentifier: ChainIdentifier; readonly swapper: SwapperWithChain; readonly signer: T[ChainIdentifier]["Signer"]; get prices(): SwapPriceWithChain; get intermediaryDiscovery(): IntermediaryDiscovery; get mempoolApi(): MempoolApi; get bitcoinRpc(): MempoolBitcoinRpc; get bitcoinNetwork(): BTC_NETWORK; get Utils(): SwapperUtils; get SwapTypeInfo(): { readonly 2: { readonly requiresInputWallet: true; readonly requiresOutputWallet: false; readonly supportsGasDrop: false; }; readonly 3: { readonly requiresInputWallet: true; readonly requiresOutputWallet: false; readonly supportsGasDrop: false; }; readonly 0: { readonly requiresInputWallet: false; readonly requiresOutputWallet: true; readonly supportsGasDrop: false; }; readonly 1: { readonly requiresInputWallet: false; readonly requiresOutputWallet: true; readonly supportsGasDrop: false; }; readonly 6: { readonly requiresInputWallet: true; readonly requiresOutputWallet: false; readonly supportsGasDrop: true; }; readonly 7: { readonly requiresInputWallet: false; readonly requiresOutputWallet: false; readonly supportsGasDrop: true; }; readonly 4: { readonly requiresInputWallet: false; readonly requiresOutputWallet: false; readonly supportsGasDrop: false; }; readonly 5: { readonly requiresInputWallet: false; readonly requiresOutputWallet: false; readonly supportsGasDrop: false; }; }; constructor(swapper: SwapperWithChain, signer: T[ChainIdentifier]["Signer"]); createToBTCSwap(tokenAddress: string, address: string, amount: bigint, exactIn?: boolean, additionalParams?: Record, options?: ToBTCOptions): Promise>>; createToBTCLNSwap(tokenAddress: string, paymentRequest: string, additionalParams?: Record, options?: ToBTCLNOptions & { comment?: string; }): Promise>>; createToBTCLNSwapViaLNURL(tokenAddress: string, lnurlPay: string | LNURLPay, amount: bigint, exactIn?: boolean, additionalParams?: Record, options?: ToBTCLNOptions): Promise>>; createFromBTCSwap(tokenAddress: string, amount: bigint, exactOut?: boolean, additionalParams?: Record, options?: FromBTCOptions): Promise>>; createFromBTCLNSwap(tokenAddress: string, amount: bigint, exactOut?: boolean, additionalParams?: Record, options?: FromBTCLNOptions): Promise>>; createFromBTCLNSwapViaLNURL(tokenAddress: string, lnurl: string | LNURLWithdraw, amount: bigint, exactOut?: boolean, additionalParams?: Record): Promise>>; createFromBTCLNSwapNew(tokenAddress: string, amount: bigint, exactOut?: boolean, additionalParams?: Record, options?: FromBTCLNAutoOptions): Promise>>; createFromBTCLNSwapNewViaLNURL(tokenAddress: string, lnurl: string | LNURLWithdraw, amount: bigint, exactOut?: boolean, additionalParams?: Record, options?: FromBTCLNAutoOptions): Promise>>; createTrustedLNForGasSwap(amount: bigint, trustedIntermediaryUrl?: string): Promise>; createTrustedOnchainForGasSwap(amount: bigint, refundAddress?: string, trustedIntermediaryUrl?: string): Promise>; create(srcToken: BtcToken, dstToken: SCToken, amount: bigint, exactIn: boolean, lnurlWithdraw?: string | LNURLWithdraw): Promise<(SupportsSwapType extends true ? FromBTCLNAutoSwap : FromBTCLNSwap)>; create(srcToken: BtcToken, dstToken: SCToken, amount: bigint, exactIn: boolean): Promise<(SupportsSwapType extends true ? SpvFromBTCSwap : FromBTCSwap)>; create(srcToken: SCToken, dstToken: BtcToken, amount: bigint, exactIn: boolean, address: string): Promise>; create(srcToken: SCToken, dstToken: BtcToken, amount: bigint, exactIn: boolean, lnurlPay: string | LNURLPay): Promise>; create(srcToken: SCToken, dstToken: BtcToken, amount: bigint, exactIn: false, lightningInvoice: string | LNURLWithdraw | LNURLPay): Promise>; /** * Returns swaps that are in-progress and are claimable for the specific chain, optionally also for a specific signer's address */ getAllSwaps(): Promise[]>; /** * Returns swaps that are in-progress and are claimable for the specific chain, optionally also for a specific signer's address */ getActionableSwaps(): Promise[]>; /** * Returns swaps that are refundable for the specific chain, optionally also for a specific signer's address */ getRefundableSwaps(): Promise[]>; /** * Returns swap with a specific id (identifier) on a specific chain and optionally with a signer */ getSwapById(id: string): Promise>; /** * Synchronizes swaps from chain, this is usually ran when SDK is initialized, deletes expired quotes */ _syncSwaps(): Promise; supportsSwapType(swapType: Type): SupportsSwapType; /** * Returns type of the swap based on input and output tokens specified * * @param srcToken * @param dstToken */ getSwapType(srcToken: BtcToken, dstToken: SCToken): (SupportsSwapType extends true ? SwapType.FROM_BTCLN_AUTO : SwapType.FROM_BTCLN); getSwapType(srcToken: BtcToken, dstToken: SCToken): (SupportsSwapType extends true ? SwapType.SPV_VAULT_FROM_BTC : SwapType.FROM_BTC); getSwapType(srcToken: SCToken, dstToken: BtcToken): SwapType.TO_BTC; getSwapType(srcToken: SCToken, dstToken: BtcToken): SwapType.TO_BTCLN; getSwapType(srcToken: Token, dstToken: Token): SwapType.FROM_BTCLN_AUTO | SwapType.FROM_BTCLN | SwapType.SPV_VAULT_FROM_BTC | SwapType.FROM_BTC | SwapType.TO_BTC | SwapType.TO_BTCLN; /** * Returns minimum/maximum limits for inputs and outputs for a swap between given tokens * * @param srcToken * @param dstToken */ getSwapLimits, B extends Token>(srcToken: A, dstToken: B): { input: { min: TokenAmount; max: TokenAmount; }; output: { min: TokenAmount; max: TokenAmount; }; }; /** * Returns tokens that you can swap to (if input=true) from a given token, * or tokens that you can swap from (if input=false) to a given token */ getSwapCounterTokens(token: Token, input: boolean): Token[]; /** * Returns swap bounds (minimums & maximums) for different swap types & tokens * @deprecated Use getSwapLimits() instead! */ getSwapBounds(): SwapBounds; /** * Returns maximum possible swap amount * @deprecated Use getSwapLimits() instead! * * @param type Type of the swap * @param token Token of the swap */ getMaximum(type: SwapType, token: string): bigint; /** * Returns minimum possible swap amount * @deprecated Use getSwapLimits() instead! * * @param type Type of swap * @param token Token of the swap */ getMinimum(type: SwapType, token: string): bigint; }