PHP WebShell
Текущая директория: /opt/BitGoJS/modules/abstract-lightning/dist/src/wallet
Просмотр файла: lightning.d.ts
import * as sdkcore from '@bitgo/sdk-core';
import { PendingApprovalData, TxRequestState } from '@bitgo/sdk-core';
import { CreateInvoiceBody, Invoice, InvoiceInfo, InvoiceQuery, LightningAuthKeychain, LightningKeychain, LndCreatePaymentResponse, SubmitPaymentParams, Transaction, TransactionQuery, PaymentInfo, PaymentQuery, LightningOnchainWithdrawParams, LightningOnchainWithdrawResponse } 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;
/**
* Latest transfer details for this payment request (if available).
* - Provides the current state of the transfer.
* - To track the final payment status, monitor `transfer` asynchronously.
* This field is absent if approval is required before processing.
*/
transfer?: any;
};
/**
* Get the lightning keychain for the given wallet.
*/
export declare function getLightningKeychain(wallet: sdkcore.IWallet): Promise<LightningKeychain>;
/**
* 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<Invoice>} A promise that resolves to the created invoice
*/
createInvoice(params: CreateInvoiceBody): Promise<Invoice>;
/**
* Get invoice details by payment hash
* @param {string} paymentHash - Payment hash to lookup
* @returns {Promise<InvoiceInfo>} Invoice details
* @throws {InvalidPaymentHash} When payment hash is not valid
*/
getInvoice(paymentHash: string): Promise<InvoiceInfo>;
/**
* 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
* @returns {Promise<InvoiceInfo[]>} List of invoices
*/
listInvoices(params: InvoiceQuery): Promise<InvoiceInfo[]>;
/**
* 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<PayInvoiceResponse>} Payment result containing transaction request details and payment status
*/
payInvoice(params: SubmitPaymentParams): Promise<PayInvoiceResponse>;
/**
* On chain withdrawal
* @param {LightningOnchainWithdrawParams} params - Withdraw parameters
* @param {LightningOnchainRecipient[]} params.recipients - The recipients to pay
* @param {bigint} params.satsPerVbyte - Value for sats per virtual byte
* @returns {Promise<LightningOnchainWithdrawResponse>} Withdraw result containing transaction request details and status
*/
withdrawOnchain(params: LightningOnchainWithdrawParams): Promise<LightningOnchainWithdrawResponse>;
/**
* Get payment details by payment hash
* @param {string} paymentHash - Payment hash to lookup
* @returns {Promise<PaymentInfo>} Payment details
* @throws {InvalidPaymentHash} When payment hash is not valid
*/
getPayment(paymentHash: string): Promise<PaymentInfo>;
/**
* 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
* @returns {Promise<PaymentInfo[]>} List of payments
*/
listPayments(params: PaymentQuery): Promise<PaymentInfo[]>;
/**
* Get transaction details by ID
* @param {string} txId - Transaction ID to lookup
* @returns {Promise<Transaction>} Transaction details
* @throws {InvalidTxId} When transaction ID is not valid
*/
getTransaction(txId: string): Promise<Transaction>;
/**
* List transactions for a wallet with optional filtering
* @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
* @returns {Promise<Transaction[]>} List of transactions
*/
listTransactions(params: TransactionQuery): Promise<Transaction[]>;
}
export declare class LightningWallet implements ILightningWallet {
wallet: sdkcore.IWallet;
constructor(wallet: sdkcore.IWallet);
createInvoice(params: CreateInvoiceBody): Promise<Invoice>;
getInvoice(paymentHash: string): Promise<InvoiceInfo>;
listInvoices(params: InvoiceQuery): Promise<InvoiceInfo[]>;
payInvoice(params: SubmitPaymentParams): Promise<PayInvoiceResponse>;
withdrawOnchain(params: LightningOnchainWithdrawParams): Promise<LightningOnchainWithdrawResponse>;
getPayment(paymentHash: string): Promise<PaymentInfo>;
listPayments(params: PaymentQuery): Promise<PaymentInfo[]>;
getTransaction(txId: string): Promise<Transaction>;
listTransactions(params: TransactionQuery): Promise<Transaction[]>;
}
//# sourceMappingURL=lightning.d.ts.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!