lightningdevkit
Version:
Lightning Development Kit
54 lines (53 loc) • 2.28 kB
text/typescript
import { Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ } from '../structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* Builds a [`Bolt12Invoice`] from either:
* - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
* - a [`Refund`] for the \"offer for money\" flow.
*
* See [module-level documentation] for usage.
*
* [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
* [`Refund`]: crate::offers::refund::Refund
* [module-level documentation]: self
*/
export declare class InvoiceWithExplicitSigningPubkeyBuilder extends CommonBase {
/**
* Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics.
*/
build(): Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ;
/**
* Sets the [`Bolt12Invoice::relative_expiry`]
* as seconds since [`Bolt12Invoice::created_at`].
* Any expiry that has already passed is valid and can be checked for using
*
* Successive calls to this method will override the previous setting.
*/
relative_expiry(relative_expiry_secs: number): void;
/**
* Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
*
* Successive calls to this method will add another address. Caller is responsible for not
* adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
*/
fallback_v0_p2wsh(script_hash: Uint8Array): void;
/**
* Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
*
* Successive calls to this method will add another address. Caller is responsible for not
* adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
*/
fallback_v0_p2wpkh(pubkey_hash: Uint8Array): void;
/**
* Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
*
* Successive calls to this method will add another address. Caller is responsible for not
* adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
*/
fallback_v1_p2tr_tweaked(utput_key: Uint8Array): void;
/**
* Sets [`Bolt12Invoice::invoice_features`]
* to indicate MPP may be used. Otherwise, MPP is disallowed.
*/
allow_mpp(): void;
}