import { EmitterSubscription } from "react-native"; export interface AcceptPaymentProposedFeesRequest { response: FetchPaymentProposedFeesResponse; } export interface AesSuccessActionData { description: string; ciphertext: string; iv: string; } export interface AesSuccessActionDataDecrypted { description: string; plaintext: string; } export interface AssetBalance { assetId: string; balanceSat: number; name?: string; ticker?: string; balance?: number; } export interface AssetInfo { name: string; ticker: string; amount: number; fees?: number; } export interface AssetMetadata { assetId: string; name: string; ticker: string; precision: number; fiatId?: string; } export interface BackupRequest { backupPath?: string; } export interface BitcoinAddressData { address: string; network: Network; amountSat?: number; label?: string; message?: string; } export interface BlockchainInfo { liquidTip: number; bitcoinTip: number; } export interface BuyBitcoinRequest { prepareResponse: PrepareBuyBitcoinResponse; redirectUrl?: string; } export interface CheckMessageRequest { message: string; pubkey: string; signature: string; } export interface CheckMessageResponse { isValid: boolean; } export interface Config { liquidExplorer: BlockchainExplorer; bitcoinExplorer: BlockchainExplorer; workingDir: string; network: LiquidNetwork; paymentTimeoutSec: number; syncServiceUrl?: string; breezApiKey?: string; zeroConfMaxAmountSat?: number; useDefaultExternalInputParsers: boolean; useMagicRoutingHints: boolean; externalInputParsers?: ExternalInputParser[]; onchainFeeRateLeewaySat?: number; assetMetadata?: AssetMetadata[]; sideswapApiKey?: string; onchainSyncPeriodSec: number; onchainSyncRequestTimeoutSec: number; } export interface ConnectRequest { config: Config; mnemonic?: string; passphrase?: string; seed?: number[]; } export interface ConnectWithSignerRequest { config: Config; } export interface CreateBolt12InvoiceRequest { offer: string; invoiceRequest: string; } export interface CreateBolt12InvoiceResponse { invoice: string; } export interface CurrencyInfo { name: string; fractionSize: number; spacing?: number; symbol?: SymbolType; uniqSymbol?: SymbolType; localizedName: LocalizedName[]; localeOverrides: LocaleOverrides[]; } export interface ExternalInputParser { providerId: string; inputRegex: string; parserUrl: string; } export interface FetchPaymentProposedFeesRequest { swapId: string; } export interface FetchPaymentProposedFeesResponse { swapId: string; feesSat: number; payerAmountSat: number; receiverAmountSat: number; } export interface FiatCurrency { id: string; info: CurrencyInfo; } export interface GetInfoResponse { walletInfo: WalletInfo; blockchainInfo: BlockchainInfo; } export interface LnInvoice { bolt11: string; network: Network; payeePubkey: string; paymentHash: string; description?: string; descriptionHash?: string; amountMsat?: number; timestamp: number; expiry: number; routingHints: RouteHint[]; paymentSecret: number[]; minFinalCltvExpiryDelta: number; } export interface LnOffer { offer: string; chains: string[]; paths: LnOfferBlindedPath[]; description?: string; signingPubkey?: string; minAmount?: Amount; absoluteExpiry?: number; issuer?: string; } export interface LightningPaymentLimitsResponse { send: Limits; receive: Limits; } export interface Limits { minSat: number; maxSat: number; maxZeroConfSat: number; } export interface LiquidAddressData { address: string; network: Network; assetId?: string; amount?: number; amountSat?: number; label?: string; message?: string; } export interface ListPaymentsRequest { filters?: PaymentType[]; states?: PaymentState[]; fromTimestamp?: number; toTimestamp?: number; offset?: number; limit?: number; details?: ListPaymentDetails; sortAscending?: boolean; } export interface LnOfferBlindedPath { blindedHops: string[]; } export interface LnUrlAuthRequestData { k1: string; domain: string; url: string; action?: string; } export interface LnUrlErrorData { reason: string; } export interface LnUrlInfo { lnAddress?: string; lnurlPayComment?: string; lnurlPayDomain?: string; lnurlPayMetadata?: string; lnurlPaySuccessAction?: SuccessActionProcessed; lnurlPayUnprocessedSuccessAction?: SuccessAction; lnurlWithdrawEndpoint?: string; } export interface LnUrlPayErrorData { paymentHash: string; reason: string; } export interface LnUrlPayRequest { prepareResponse: PrepareLnUrlPayResponse; } export interface LnUrlPayRequestData { callback: string; minSendable: number; maxSendable: number; metadataStr: string; commentAllowed: number; domain: string; allowsNostr: boolean; nostrPubkey?: string; lnAddress?: string; } export interface LnUrlPaySuccessData { successAction?: SuccessActionProcessed; payment: Payment; } export interface LnUrlWithdrawRequest { data: LnUrlWithdrawRequestData; amountMsat: number; description?: string; } export interface LnUrlWithdrawRequestData { callback: string; k1: string; defaultDescription: string; minWithdrawable: number; maxWithdrawable: number; } export interface LnUrlWithdrawSuccessData { invoice: LnInvoice; } export interface LocaleOverrides { locale: string; spacing?: number; symbol: SymbolType; } export interface LocalizedName { locale: string; name: string; } export interface LogEntry { line: string; level: string; } export interface MessageSuccessActionData { message: string; } export interface OnchainPaymentLimitsResponse { send: Limits; receive: Limits; } export interface PayOnchainRequest { address: string; prepareResponse: PreparePayOnchainResponse; } export interface Payment { timestamp: number; amountSat: number; feesSat: number; paymentType: PaymentType; status: PaymentState; details: PaymentDetails; swapperFeesSat?: number; destination?: string; txId?: string; unblindingData?: string; } export interface PrepareBuyBitcoinRequest { provider: BuyBitcoinProvider; amountSat: number; } export interface PrepareBuyBitcoinResponse { provider: BuyBitcoinProvider; amountSat: number; feesSat: number; } export interface PrepareLnUrlPayRequest { data: LnUrlPayRequestData; amount: PayAmount; bip353Address?: string; comment?: string; validateSuccessActionUrl?: boolean; } export interface PrepareLnUrlPayResponse { destination: SendDestination; feesSat: number; data: LnUrlPayRequestData; amount: PayAmount; comment?: string; successAction?: SuccessAction; } export interface PreparePayOnchainRequest { amount: PayAmount; feeRateSatPerVbyte?: number; } export interface PreparePayOnchainResponse { receiverAmountSat: number; claimFeesSat: number; totalFeesSat: number; } export interface PrepareReceiveRequest { paymentMethod: PaymentMethod; amount?: ReceiveAmount; } export interface PrepareReceiveResponse { paymentMethod: PaymentMethod; feesSat: number; amount?: ReceiveAmount; minPayerAmountSat?: number; maxPayerAmountSat?: number; swapperFeerate?: number; } export interface PrepareRefundRequest { swapAddress: string; refundAddress: string; feeRateSatPerVbyte: number; } export interface PrepareRefundResponse { txVsize: number; txFeeSat: number; lastRefundTxId?: string; } export interface PrepareSendRequest { destination: string; amount?: PayAmount; } export interface PrepareSendResponse { destination: SendDestination; amount?: PayAmount; feesSat?: number; estimatedAssetFees?: number; exchangeAmountSat?: number; } export interface Rate { coin: string; value: number; } export interface ReceivePaymentRequest { prepareResponse: PrepareReceiveResponse; description?: string; useDescriptionHash?: boolean; payerNote?: string; } export interface ReceivePaymentResponse { destination: string; liquidExpirationBlockheight?: number; bitcoinExpirationBlockheight?: number; } export interface RecommendedFees { fastestFee: number; halfHourFee: number; hourFee: number; economyFee: number; minimumFee: number; } export interface RefundRequest { swapAddress: string; refundAddress: string; feeRateSatPerVbyte: number; } export interface RefundResponse { refundTxId: string; } export interface RefundableSwap { swapAddress: string; timestamp: number; amountSat: number; lastRefundTxId?: string; } export interface RestoreRequest { backupPath?: string; } export interface RouteHint { hops: RouteHintHop[]; } export interface RouteHintHop { srcNodeId: string; shortChannelId: string; feesBaseMsat: number; feesProportionalMillionths: number; cltvExpiryDelta: number; htlcMinimumMsat?: number; htlcMaximumMsat?: number; } export interface SendPaymentRequest { prepareResponse: PrepareSendResponse; useAssetFees?: boolean; payerNote?: string; } export interface SendPaymentResponse { payment: Payment; } export interface SignMessageRequest { message: string; } export interface SignMessageResponse { signature: string; } export interface SymbolType { grapheme?: string; template?: string; rtl?: boolean; position?: number; } export interface UrlSuccessActionData { description: string; url: string; matchesCallbackDomain: boolean; } export interface WalletInfo { balanceSat: number; pendingSendSat: number; pendingReceiveSat: number; fingerprint: string; pubkey: string; assetBalances: AssetBalance[]; } export declare enum AesSuccessActionDataResultVariant { DECRYPTED = "decrypted", ERROR_STATUS = "errorStatus" } export type AesSuccessActionDataResult = { type: AesSuccessActionDataResultVariant.DECRYPTED; data: AesSuccessActionDataDecrypted; } | { type: AesSuccessActionDataResultVariant.ERROR_STATUS; reason: string; }; export declare enum AmountVariant { BITCOIN = "bitcoin", CURRENCY = "currency" } export type Amount = { type: AmountVariant.BITCOIN; amountMsat: number; } | { type: AmountVariant.CURRENCY; iso4217Code: string; fractionalAmount: number; }; export declare enum BlockchainExplorerVariant { ELECTRUM = "electrum", ESPLORA = "esplora" } export type BlockchainExplorer = { type: BlockchainExplorerVariant.ELECTRUM; url: string; } | { type: BlockchainExplorerVariant.ESPLORA; url: string; useWaterfalls: boolean; }; export declare enum BuyBitcoinProvider { MOONPAY = "moonpay" } export declare enum GetPaymentRequestVariant { PAYMENT_HASH = "paymentHash", SWAP_ID = "swapId" } export type GetPaymentRequest = { type: GetPaymentRequestVariant.PAYMENT_HASH; paymentHash: string; } | { type: GetPaymentRequestVariant.SWAP_ID; swapId: string; }; export declare enum InputTypeVariant { BITCOIN_ADDRESS = "bitcoinAddress", LIQUID_ADDRESS = "liquidAddress", BOLT11 = "bolt11", BOLT12_OFFER = "bolt12Offer", NODE_ID = "nodeId", URL = "url", LN_URL_PAY = "lnUrlPay", LN_URL_WITHDRAW = "lnUrlWithdraw", LN_URL_AUTH = "lnUrlAuth", LN_URL_ERROR = "lnUrlError" } export type InputType = { type: InputTypeVariant.BITCOIN_ADDRESS; address: BitcoinAddressData; } | { type: InputTypeVariant.LIQUID_ADDRESS; address: LiquidAddressData; } | { type: InputTypeVariant.BOLT11; invoice: LnInvoice; } | { type: InputTypeVariant.BOLT12_OFFER; offer: LnOffer; bip353Address?: string; } | { type: InputTypeVariant.NODE_ID; nodeId: string; } | { type: InputTypeVariant.URL; url: string; } | { type: InputTypeVariant.LN_URL_PAY; data: LnUrlPayRequestData; bip353Address?: string; } | { type: InputTypeVariant.LN_URL_WITHDRAW; data: LnUrlWithdrawRequestData; } | { type: InputTypeVariant.LN_URL_AUTH; data: LnUrlAuthRequestData; } | { type: InputTypeVariant.LN_URL_ERROR; data: LnUrlErrorData; }; export declare enum LiquidNetwork { MAINNET = "mainnet", TESTNET = "testnet", REGTEST = "regtest" } export declare enum ListPaymentDetailsVariant { LIQUID = "liquid", BITCOIN = "bitcoin" } export type ListPaymentDetails = { type: ListPaymentDetailsVariant.LIQUID; assetId?: string; destination?: string; } | { type: ListPaymentDetailsVariant.BITCOIN; address?: string; }; export declare enum LnUrlCallbackStatusVariant { OK = "ok", ERROR_STATUS = "errorStatus" } export type LnUrlCallbackStatus = { type: LnUrlCallbackStatusVariant.OK; } | { type: LnUrlCallbackStatusVariant.ERROR_STATUS; data: LnUrlErrorData; }; export declare enum LnUrlPayResultVariant { ENDPOINT_SUCCESS = "endpointSuccess", ENDPOINT_ERROR = "endpointError", PAY_ERROR = "payError" } export type LnUrlPayResult = { type: LnUrlPayResultVariant.ENDPOINT_SUCCESS; data: LnUrlPaySuccessData; } | { type: LnUrlPayResultVariant.ENDPOINT_ERROR; data: LnUrlErrorData; } | { type: LnUrlPayResultVariant.PAY_ERROR; data: LnUrlPayErrorData; }; export declare enum LnUrlWithdrawResultVariant { OK = "ok", TIMEOUT = "timeout", ERROR_STATUS = "errorStatus" } export type LnUrlWithdrawResult = { type: LnUrlWithdrawResultVariant.OK; data: LnUrlWithdrawSuccessData; } | { type: LnUrlWithdrawResultVariant.TIMEOUT; data: LnUrlWithdrawSuccessData; } | { type: LnUrlWithdrawResultVariant.ERROR_STATUS; data: LnUrlErrorData; }; export declare enum Network { BITCOIN = "bitcoin", TESTNET = "testnet", SIGNET = "signet", REGTEST = "regtest" } export declare enum PayAmountVariant { BITCOIN = "bitcoin", ASSET = "asset", DRAIN = "drain" } export type PayAmount = { type: PayAmountVariant.BITCOIN; receiverAmountSat: number; } | { type: PayAmountVariant.ASSET; toAsset: string; receiverAmount: number; estimateAssetFees?: boolean; fromAsset?: string; } | { type: PayAmountVariant.DRAIN; }; export declare enum PaymentDetailsVariant { LIGHTNING = "lightning", LIQUID = "liquid", BITCOIN = "bitcoin" } export type PaymentDetails = { type: PaymentDetailsVariant.LIGHTNING; swapId: string; description: string; liquidExpirationBlockheight: number; preimage?: string; invoice?: string; bolt12Offer?: string; paymentHash?: string; destinationPubkey?: string; lnurlInfo?: LnUrlInfo; bip353Address?: string; payerNote?: string; claimTxId?: string; refundTxId?: string; refundTxAmountSat?: number; } | { type: PaymentDetailsVariant.LIQUID; assetId: string; destination: string; description: string; assetInfo?: AssetInfo; lnurlInfo?: LnUrlInfo; bip353Address?: string; payerNote?: string; } | { type: PaymentDetailsVariant.BITCOIN; swapId: string; bitcoinAddress: string; description: string; autoAcceptedFees: boolean; bitcoinExpirationBlockheight: number; liquidExpirationBlockheight: number; lockupTxId?: string; claimTxId?: string; refundTxId?: string; refundTxAmountSat?: number; }; export declare enum PaymentMethod { LIGHTNING = "lightning", BOLT11_INVOICE = "bolt11Invoice", BOLT12_OFFER = "bolt12Offer", BITCOIN_ADDRESS = "bitcoinAddress", LIQUID_ADDRESS = "liquidAddress" } export declare enum PaymentState { CREATED = "created", PENDING = "pending", COMPLETE = "complete", FAILED = "failed", TIMED_OUT = "timedOut", REFUNDABLE = "refundable", REFUND_PENDING = "refundPending", WAITING_FEE_ACCEPTANCE = "waitingFeeAcceptance" } export declare enum PaymentType { RECEIVE = "receive", SEND = "send" } export declare enum ReceiveAmountVariant { BITCOIN = "bitcoin", ASSET = "asset" } export type ReceiveAmount = { type: ReceiveAmountVariant.BITCOIN; payerAmountSat: number; } | { type: ReceiveAmountVariant.ASSET; assetId: string; payerAmount?: number; }; export declare enum SdkEventVariant { PAYMENT_FAILED = "paymentFailed", PAYMENT_PENDING = "paymentPending", PAYMENT_REFUNDABLE = "paymentRefundable", PAYMENT_REFUNDED = "paymentRefunded", PAYMENT_REFUND_PENDING = "paymentRefundPending", PAYMENT_SUCCEEDED = "paymentSucceeded", PAYMENT_WAITING_CONFIRMATION = "paymentWaitingConfirmation", PAYMENT_WAITING_FEE_ACCEPTANCE = "paymentWaitingFeeAcceptance", SYNCED = "synced", SYNC_FAILED = "syncFailed", DATA_SYNCED = "dataSynced" } export type SdkEvent = { type: SdkEventVariant.PAYMENT_FAILED; details: Payment; } | { type: SdkEventVariant.PAYMENT_PENDING; details: Payment; } | { type: SdkEventVariant.PAYMENT_REFUNDABLE; details: Payment; } | { type: SdkEventVariant.PAYMENT_REFUNDED; details: Payment; } | { type: SdkEventVariant.PAYMENT_REFUND_PENDING; details: Payment; } | { type: SdkEventVariant.PAYMENT_SUCCEEDED; details: Payment; } | { type: SdkEventVariant.PAYMENT_WAITING_CONFIRMATION; details: Payment; } | { type: SdkEventVariant.PAYMENT_WAITING_FEE_ACCEPTANCE; details: Payment; } | { type: SdkEventVariant.SYNCED; } | { type: SdkEventVariant.SYNC_FAILED; error: string; } | { type: SdkEventVariant.DATA_SYNCED; didPullNewRecords: boolean; }; export declare enum SendDestinationVariant { LIQUID_ADDRESS = "liquidAddress", BOLT11 = "bolt11", BOLT12 = "bolt12" } export type SendDestination = { type: SendDestinationVariant.LIQUID_ADDRESS; addressData: LiquidAddressData; bip353Address?: string; } | { type: SendDestinationVariant.BOLT11; invoice: LnInvoice; bip353Address?: string; } | { type: SendDestinationVariant.BOLT12; offer: LnOffer; receiverAmountSat: number; bip353Address?: string; }; export declare enum SuccessActionVariant { AES = "aes", MESSAGE = "message", URL = "url" } export type SuccessAction = { type: SuccessActionVariant.AES; data: AesSuccessActionData; } | { type: SuccessActionVariant.MESSAGE; data: MessageSuccessActionData; } | { type: SuccessActionVariant.URL; data: UrlSuccessActionData; }; export declare enum SuccessActionProcessedVariant { AES = "aes", MESSAGE = "message", URL = "url" } export type SuccessActionProcessed = { type: SuccessActionProcessedVariant.AES; result: AesSuccessActionDataResult; } | { type: SuccessActionProcessedVariant.MESSAGE; data: MessageSuccessActionData; } | { type: SuccessActionProcessedVariant.URL; data: UrlSuccessActionData; }; export type EventListener = (e: SdkEvent) => void; export type Logger = (logEntry: LogEntry) => void; export declare const connect: (req: ConnectRequest) => Promise; export declare const addEventListener: (listener: EventListener) => Promise; export declare const setLogger: (logger: Logger) => Promise; export declare const defaultConfig: (network: LiquidNetwork, breezApiKey?: string) => Promise; export declare const parseInvoice: (input: string) => Promise; export declare const removeEventListener: (id: string) => Promise; export declare const getInfo: () => Promise; export declare const signMessage: (req: SignMessageRequest) => Promise; export declare const checkMessage: (req: CheckMessageRequest) => Promise; export declare const parse: (input: string) => Promise; export declare const prepareSendPayment: (req: PrepareSendRequest) => Promise; export declare const sendPayment: (req: SendPaymentRequest) => Promise; export declare const prepareReceivePayment: (req: PrepareReceiveRequest) => Promise; export declare const receivePayment: (req: ReceivePaymentRequest) => Promise; export declare const createBolt12Invoice: (req: CreateBolt12InvoiceRequest) => Promise; export declare const fetchLightningLimits: () => Promise; export declare const fetchOnchainLimits: () => Promise; export declare const preparePayOnchain: (req: PreparePayOnchainRequest) => Promise; export declare const payOnchain: (req: PayOnchainRequest) => Promise; export declare const prepareBuyBitcoin: (req: PrepareBuyBitcoinRequest) => Promise; export declare const buyBitcoin: (req: BuyBitcoinRequest) => Promise; export declare const listPayments: (req: ListPaymentsRequest) => Promise; export declare const getPayment: (req: GetPaymentRequest) => Promise; export declare const fetchPaymentProposedFees: (req: FetchPaymentProposedFeesRequest) => Promise; export declare const acceptPaymentProposedFees: (req: AcceptPaymentProposedFeesRequest) => Promise; export declare const listRefundables: () => Promise; export declare const prepareRefund: (req: PrepareRefundRequest) => Promise; export declare const refund: (req: RefundRequest) => Promise; export declare const rescanOnchainSwaps: () => Promise; export declare const sync: () => Promise; export declare const recommendedFees: () => Promise; export declare const backup: (req: BackupRequest) => Promise; export declare const restore: (req: RestoreRequest) => Promise; export declare const disconnect: () => Promise; export declare const prepareLnurlPay: (req: PrepareLnUrlPayRequest) => Promise; export declare const lnurlPay: (req: LnUrlPayRequest) => Promise; export declare const lnurlWithdraw: (req: LnUrlWithdrawRequest) => Promise; export declare const lnurlAuth: (reqData: LnUrlAuthRequestData) => Promise; export declare const registerWebhook: (webhookUrl: string) => Promise; export declare const unregisterWebhook: () => Promise; export declare const fetchFiatRates: () => Promise; export declare const listFiatCurrencies: () => Promise;