import * as sdkcore from '@bitgo/sdk-core'; import { PendingApprovalData, TxRequestState } from '@bitgo/sdk-core'; import { CreateInvoiceBody, Invoice, InvoiceQuery, LightningAuthKeychain, LightningKeychain, LndCreatePaymentResponse, SubmitPaymentParams, Transaction, TransactionQuery, ListTransactionsResponse, PaymentInfo, PaymentQuery, LightningOnchainWithdrawParams, LightningOnchainWithdrawResponse, ListInvoicesResponse, ListPaymentsResponse } from '../codecs'; export type PayInvoiceResponse = { /** * Unique identifier for the payment request submitted to BitGo. */ txRequestId: string; /** * Status of the payment request submission to BitGo. * - `'delivered'`: Successfully received by BitGo, but may or may not have been sent to the Lightning Network yet. * - For the actual payment status, refer to `paymentStatus` and track `transfer`. */ txRequestState: TxRequestState; /** * Pending approval details, if applicable. * - If present, the payment has not been initiated yet. */ pendingApproval?: PendingApprovalData; /** * Current snapshot of payment status (if available). * - **`'in_flight'`**: Payment is in progress. * - **`'settled'`**: Payment was successfully completed. * - **`'failed'`**: Payment failed. * This field is absent if approval is required before processing. */ paymentStatus?: LndCreatePaymentResponse; }; /** * Get the lightning keychain for the given wallet. */ export declare function getLightningKeychain(wallet: sdkcore.IWallet): Promise; /** * Get the lightning auth keychains for the given wallet. */ export declare function getLightningAuthKeychains(wallet: sdkcore.IWallet): Promise<{ userAuthKey: LightningAuthKeychain; nodeAuthKey: LightningAuthKeychain; }>; export interface ILightningWallet { /** * Creates a lightning invoice * @param {object} params Invoice parameters * @param {bigint} params.valueMsat The value of the invoice in millisatoshis * @param {string} [params.memo] A memo or description for the invoice * @param {number} [params.expiry] The expiry time of the invoice in seconds * @returns {Promise} A promise that resolves to the created invoice */ createInvoice(params: CreateInvoiceBody): Promise; /** * Get invoice details by payment hash * @param {string} paymentHash - Payment hash to lookup * @returns {Promise} Invoice details * @throws {InvalidPaymentHash} When payment hash is not valid */ getInvoice(paymentHash: string): Promise; /** * Lists current lightning invoices * @param {InvoiceQuery} params Query parameters for filtering invoices * @param {string} [params.status] The status of the invoice (open, settled, canceled) * @param {bigint} [params.limit] The maximum number of invoices to return * @param {Date} [params.startDate] The start date for the query * @param {Date} [params.endDate] The end date for the query * @param {string} [params.prevId] Continue iterating (provided by nextBatchPrevId in the previous list) * @returns {Promise} List of invoices and nextBatchPrevId */ listInvoices(params: InvoiceQuery): Promise; /** * Pay a lightning invoice * @param {SubmitPaymentParams} params - Payment parameters * @param {string} params.invoice - The invoice to pay * @param {string} params.amountMsat - The amount to pay in millisatoshis * @param {string} params.passphrase - The wallet passphrase * @param {string} [params.sequenceId] - Optional sequence ID for the respective payment transfer * @param {string} [params.comment] - Optional comment for the respective payment transfer * @returns {Promise} Payment result containing transaction request details and payment status */ payInvoice(params: SubmitPaymentParams): Promise; /** * On chain withdrawal * @param {LightningOnchainWithdrawParams} params - Withdraw parameters * @param {LightningOnchainRecipient[]} params.recipients - The recipients to pay * @param {bigint} [params.satsPerVbyte] - Optional value for sats per virtual byte. If not present, it will be estimated. * @param {number} [params.numBlocks] - Target blocks for the transaction to be confirmed * @param {string} params.passphrase - The wallet passphrase * @param {string} [params.sequenceId] - Optional sequence ID for the respective withdraw transfer * @param {string} [params.comment] - Optional comment for the respective withdraw transfer * @returns {Promise} Withdraw result containing transaction request details and status */ withdrawOnchain(params: LightningOnchainWithdrawParams): Promise; /** * Get payment details by payment id * @param {string} paymentId - Payment id to lookup * @returns {Promise} Payment details * @throws {InvalidPaymentId} When payment id is not valid */ getPayment(paymentId: string): Promise; /** * List payments for a wallet with optional filtering * @param {PaymentQuery} params Query parameters for filtering payments * @param {string} [params.status] The status of the payment * @param {bigint} [params.limit] The maximum number of payments to return * @param {Date} [params.startDate] The start date for the query * @param {Date} [params.endDate] The end date for the query * @param {string} [params.paymentHash] The payment hash of the payments * @param {string} [params.prevId] Continue iterating (provided by nextBatchPrevId in the previous list) * @returns {Promise} List of payments and nextBatchPrevId */ listPayments(params: PaymentQuery): Promise; /** * Get transaction details by ID * @param {string} txId - Transaction ID to lookup * @returns {Promise} Transaction details * @throws {InvalidTxId} When transaction ID is not valid */ getTransaction(txId: string): Promise; /** * List transactions for a wallet with optional filtering and cursor-based pagination * @param {TransactionQuery} params Query parameters for filtering transactions * @param {bigint} [params.limit] The maximum number of transactions to return * @param {Date} [params.startDate] The start date for the query * @param {Date} [params.endDate] The end date for the query * @param {string} [params.prevId] Transaction ID for cursor-based pagination (from nextBatchPrevId) * @returns {Promise} List of transactions with pagination info */ listTransactions(params: TransactionQuery): Promise; } export declare class LightningWallet implements ILightningWallet { wallet: sdkcore.IWallet; constructor(wallet: sdkcore.IWallet); createInvoice(params: CreateInvoiceBody): Promise; getInvoice(paymentHash: string): Promise; listInvoices(params: InvoiceQuery): Promise; payInvoice(params: SubmitPaymentParams): Promise; withdrawOnchain(params: LightningOnchainWithdrawParams): Promise; getPayment(paymentId: string): Promise; listPayments(params: PaymentQuery): Promise; getTransaction(txId: string): Promise; listTransactions(params: TransactionQuery): Promise; } //# sourceMappingURL=lightning.d.ts.map