lightningdevkit
Version:
Lightning Development Kit
55 lines (54 loc) • 2.33 kB
text/typescript
import { Network } from '../enums/Network.mjs';
import { HumanReadableName } from '../structs/HumanReadableName.mjs';
import { Result_NoneBolt12SemanticErrorZ } from '../structs/Result_NoneBolt12SemanticErrorZ.mjs';
import { Result_InvoiceRequestBolt12SemanticErrorZ } from '../structs/Result_InvoiceRequestBolt12SemanticErrorZ.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
*
* See [module-level documentation] for usage.
*
* [module-level documentation]: self
*/
export declare class InvoiceRequestWithDerivedPayerSigningPubkeyBuilder extends CommonBase {
/**
* Builds a signed [`InvoiceRequest`] after checking for valid semantics.
*/
build_and_sign(): Result_InvoiceRequestBolt12SemanticErrorZ;
/**
* Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
* called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
* by the offer.
*
* Successive calls to this method will override the previous setting.
*/
chain(network: Network): Result_NoneBolt12SemanticErrorZ;
/**
* Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
* not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
*
* Successive calls to this method will override the previous setting.
*
* [`quantity`]: Self::quantity
*/
amount_msats(amount_msats: bigint): Result_NoneBolt12SemanticErrorZ;
/**
* Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
* does not conform to [`Offer::is_valid_quantity`].
*
* Successive calls to this method will override the previous setting.
*/
quantity(quantity: bigint): Result_NoneBolt12SemanticErrorZ;
/**
* Sets the [`InvoiceRequest::payer_note`].
*
* Successive calls to this method will override the previous setting.
*/
payer_note(payer_note: string): void;
/**
* Sets the [`InvoiceRequest::offer_from_hrn`].
*
* Successive calls to this method will override the previous setting.
*/
sourced_from_human_readable_name(hrn: HumanReadableName): void;
}