UNPKG

lightningdevkit

Version:
42 lines (41 loc) 1.57 kB
import { ResponseInstruction } from '../structs/ResponseInstruction.mjs'; import { MessageContext } from '../structs/MessageContext.mjs'; import { Result_ResponderDecodeErrorZ } from '../structs/Result_ResponderDecodeErrorZ.mjs'; import { CommonBase } from './CommonBase.mjs'; /** * The `Responder` struct creates an appropriate [`ResponseInstruction`] for responding to a * message. */ export declare class Responder extends CommonBase { clone_ptr(): bigint; /** * Creates a copy of the Responder */ clone(): Responder; /** * Checks if two Responders 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: Responder): boolean; /** * Serialize the Responder object into a byte array which can be read by Responder_read */ write(): Uint8Array; /** * Read a Responder from a byte array, created by Responder_write */ static constructor_read(ser: Uint8Array): Result_ResponderDecodeErrorZ; /** * Creates a [`ResponseInstruction`] for responding without including a reply path. * * Use when the recipient doesn't need to send back a reply to us. */ respond(): ResponseInstruction; /** * Creates a [`ResponseInstruction`] for responding including a reply path. * * Use when the recipient needs to send back a reply to us. */ respond_with_reply_path(context: MessageContext): ResponseInstruction; }