import { EmitterSubscription } from "react-native"; export interface AesSuccessActionDataDecrypted { description: string; plaintext: string; } export interface BackupRequest { backupPath?: string; } export interface BitcoinAddressData { address: string; network: Network; amountSat?: number; label?: string; message?: string; } export interface Config { liquidElectrumUrl: string; bitcoinElectrumUrl: string; workingDir: string; network: LiquidNetwork; paymentTimeoutSec: number; zeroConfMinFeeRate: number; zeroConfMaxAmountSat?: number; } export interface ConnectRequest { config: Config; mnemonic: string; } export interface CurrencyInfo { name: string; fractionSize: number; spacing?: number; symbol?: SymbolType; uniqSymbol?: SymbolType; localizedName: LocalizedName[]; localeOverrides: LocaleOverrides[]; } export interface FiatCurrency { id: string; info: CurrencyInfo; } export interface GetInfoResponse { balanceSat: number; pendingSendSat: number; pendingReceiveSat: number; pubkey: string; } 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 LightningPaymentLimitsResponse { send: Limits; receive: Limits; } export interface Limits { minSat: number; maxSat: number; maxZeroConfSat: number; } export interface LnUrlAuthRequestData { k1: string; domain: string; url: string; action?: string; } export interface LnUrlErrorData { reason: string; } export interface LnUrlPayErrorData { paymentHash: string; reason: string; } export interface LnUrlPayRequest { data: LnUrlPayRequestData; amountMsat: number; comment?: string; paymentLabel?: string; } 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; prepareRes: PreparePayOnchainResponse; } export interface Payment { txId?: string; swapId?: string; timestamp: number; amountSat: number; feesSat: number; preimage?: string; bolt11?: string; refundTxId?: string; refundTxAmountSat?: number; paymentType: PaymentType; status: PaymentState; } export interface PreparePayOnchainRequest { receiverAmountSat: number; } export interface PreparePayOnchainResponse { receiverAmountSat: number; feesSat: number; } export interface PrepareReceiveOnchainRequest { payerAmountSat: number; } export interface PrepareReceiveOnchainResponse { payerAmountSat: number; feesSat: number; } export interface PrepareReceiveRequest { payerAmountSat: number; } export interface PrepareReceiveResponse { payerAmountSat: number; feesSat: number; } export interface PrepareRefundRequest { swapAddress: string; refundAddress: string; satPerVbyte: number; } export interface PrepareRefundResponse { txVsize: number; txFeeSat: number; refundTxId?: string; } export interface PrepareSendRequest { invoice: string; } export interface PrepareSendResponse { invoice: string; feesSat: number; } export interface Rate { coin: string; value: number; } export interface ReceiveOnchainResponse { address: string; bip21: string; } export interface ReceivePaymentResponse { id: string; invoice: string; } export interface RefundRequest { swapAddress: string; refundAddress: string; satPerVbyte: number; } export interface RefundResponse { refundTxId: string; } export interface RefundableSwap { swapAddress: string; timestamp: number; amountSat: number; } export interface RestoreRequest { backupPath?: string; } export interface RouteHint { hops: RouteHintHop[]; } export interface RouteHintHop { srcNodeId: string; shortChannelId: number; feesBaseMsat: number; feesProportionalMillionths: number; cltvExpiryDelta: number; htlcMinimumMsat?: number; htlcMaximumMsat?: number; } export interface SendPaymentResponse { payment: Payment; } export interface SymbolType { grapheme?: string; template?: string; rtl?: boolean; position?: number; } export interface UrlSuccessActionData { description: string; url: string; } 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 InputTypeVariant { BITCOIN_ADDRESS = "bitcoinAddress", BOLT11 = "bolt11", 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.BOLT11; invoice: LnInvoice; } | { type: InputTypeVariant.NODE_ID; nodeId: string; } | { type: InputTypeVariant.URL; url: string; } | { type: InputTypeVariant.LN_URL_PAY; data: LnUrlPayRequestData; } | { 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" } export declare enum LiquidSdkEventVariant { PAYMENT_FAILED = "paymentFailed", PAYMENT_PENDING = "paymentPending", PAYMENT_REFUNDED = "paymentRefunded", PAYMENT_REFUND_PENDING = "paymentRefundPending", PAYMENT_SUCCEEDED = "paymentSucceeded", PAYMENT_WAITING_CONFIRMATION = "paymentWaitingConfirmation", SYNCED = "synced" } export type LiquidSdkEvent = { type: LiquidSdkEventVariant.PAYMENT_FAILED; details: Payment; } | { type: LiquidSdkEventVariant.PAYMENT_PENDING; details: Payment; } | { type: LiquidSdkEventVariant.PAYMENT_REFUNDED; details: Payment; } | { type: LiquidSdkEventVariant.PAYMENT_REFUND_PENDING; details: Payment; } | { type: LiquidSdkEventVariant.PAYMENT_SUCCEEDED; details: Payment; } | { type: LiquidSdkEventVariant.PAYMENT_WAITING_CONFIRMATION; details: Payment; } | { type: LiquidSdkEventVariant.SYNCED; }; 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 PaymentState { CREATED = "created", PENDING = "pending", COMPLETE = "complete", FAILED = "failed", TIMED_OUT = "timedOut", REFUNDABLE = "refundable", REFUND_PENDING = "refundPending" } export declare enum PaymentType { RECEIVE = "receive", SEND = "send" } 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: LiquidSdkEvent) => 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) => Promise; export declare const parse: (input: string) => Promise; export declare const parseInvoice: (input: string) => Promise; export declare const removeEventListener: (id: string) => Promise; export declare const getInfo: () => Promise; export declare const prepareSendPayment: (req: PrepareSendRequest) => Promise; export declare const sendPayment: (req: PrepareSendResponse) => Promise; export declare const prepareReceivePayment: (req: PrepareReceiveRequest) => Promise; export declare const receivePayment: (req: PrepareReceiveResponse) => 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 prepareReceiveOnchain: (req: PrepareReceiveOnchainRequest) => Promise; export declare const receiveOnchain: (req: PrepareReceiveOnchainResponse) => Promise; export declare const listPayments: () => 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 backup: (req: BackupRequest) => Promise; export declare const restore: (req: RestoreRequest) => Promise; export declare const disconnect: () => 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 fetchFiatRates: () => Promise; export declare const listFiatCurrencies: () => Promise;