lightningdevkit
Version:
Lightning Development Kit
66 lines (65 loc) • 2.51 kB
text/typescript
import { UntrustedString } from '../structs/UntrustedString.mjs';
import { Result_InvoiceErrorDecodeErrorZ } from '../structs/Result_InvoiceErrorDecodeErrorZ.mjs';
import { ErroneousField } from '../structs/ErroneousField.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
*
* [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
* [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
*/
export declare class InvoiceError extends CommonBase {
/**
* The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
*
* [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
* [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
*
* Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
get_erroneous_field(): ErroneousField;
/**
* The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
*
* [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
* [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
*
* Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
set_erroneous_field(val: ErroneousField | null): void;
/**
* An explanation of the error.
*/
get_message(): UntrustedString;
/**
* An explanation of the error.
*/
set_message(val: UntrustedString): void;
/**
* Constructs a new InvoiceError given each field
*
* Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
static constructor_new(erroneous_field_arg: ErroneousField | null, message_arg: UntrustedString): InvoiceError;
clone_ptr(): bigint;
/**
* Creates a copy of the InvoiceError
*/
clone(): InvoiceError;
/**
* Creates an [`InvoiceError`] with the given message.
*/
static constructor_from_string(s: string): InvoiceError;
/**
* Get the string representation of a InvoiceError object
*/
to_str(): string;
/**
* Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
*/
write(): Uint8Array;
/**
* Read a InvoiceError from a byte array, created by InvoiceError_write
*/
static constructor_read(ser: Uint8Array): Result_InvoiceErrorDecodeErrorZ;
}