UNPKG

lightningdevkit

Version:
67 lines (66 loc) 2.63 kB
import { RawBolt11Invoice } from '../structs/RawBolt11Invoice.mjs'; import { Result_SignedRawBolt11InvoiceBolt11ParseErrorZ } from '../structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.mjs'; import { Bolt11InvoiceSignature } from '../structs/Bolt11InvoiceSignature.mjs'; import { ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ } from '../structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.mjs'; import { Result_PayeePubKeySecp256k1ErrorZ } from '../structs/Result_PayeePubKeySecp256k1ErrorZ.mjs'; import { CommonBase } from './CommonBase.mjs'; /** * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be * invalid. * * # Invariants * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`]. */ export declare class SignedRawBolt11Invoice extends CommonBase { /** * Checks if two SignedRawBolt11Invoices contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. * Two objects with NULL inner values will be considered "equal" here. */ eq(b: SignedRawBolt11Invoice): boolean; clone_ptr(): bigint; /** * Creates a copy of the SignedRawBolt11Invoice */ clone(): SignedRawBolt11Invoice; /** * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice. */ hash(): bigint; /** * Disassembles the `SignedRawBolt11Invoice` into its three parts: * 1. raw invoice * 2. hash of the raw invoice * 3. signature */ into_parts(): ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ; /** * The [`RawBolt11Invoice`] which was signed. */ raw_invoice(): RawBolt11Invoice; /** * The hash of the [`RawBolt11Invoice`] that was signed. */ signable_hash(): Uint8Array; /** * Signature for the invoice. */ signature(): Bolt11InvoiceSignature; /** * Recovers the public key used for signing the invoice from the recoverable signature. */ recover_payee_pub_key(): Result_PayeePubKeySecp256k1ErrorZ; /** * Checks if the signature is valid for the included payee public key or if none exists if it's * valid for the recovered signature (which should always be true?). */ check_signature(): boolean; /** * Read a SignedRawBolt11Invoice object from a string */ static constructor_from_str(s: string): Result_SignedRawBolt11InvoiceBolt11ParseErrorZ; /** * Get the string representation of a SignedRawBolt11Invoice object */ to_str(): string; }