+ /**Gets the list of pending messages which were generated by the custom message
+ * handler, clearing the list in the process. The first tuple element must
+ * correspond to the intended recipients node ids. If no connection to one of the
+ * specified node does not exist, the message is simply not sent to it.
+ */
export class CustomMessageHandler extends CommonBase {
/* @internal */
public bindings_instance?: bindings.LDKCustomMessageHandler;
export class CustomMessageHandler extends CommonBase {
/* @internal */
public bindings_instance?: bindings.LDKCustomMessageHandler;
- static new_impl(arg: CustomMessageHandlerInterface, customMessageReader_impl: CustomMessageReaderInterface): CustomMessageHandler {
+ /** Creates a new instance of CustomMessageHandler from a given implementation */
+ public static new_impl(arg: CustomMessageHandlerInterface, customMessageReader_impl: CustomMessageReaderInterface): CustomMessageHandler {
const impl_holder: LDKCustomMessageHandlerHolder = new LDKCustomMessageHandlerHolder();
let structImplementation = {
handle_custom_message (msg: number, sender_node_id: number): number {
const impl_holder: LDKCustomMessageHandlerHolder = new LDKCustomMessageHandlerHolder();
let structImplementation = {
handle_custom_message (msg: number, sender_node_id: number): number {
public handle_custom_message(msg: Type, sender_node_id: Uint8Array): Result_NoneLightningErrorZ {
const ret: number = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg), bindings.encodeUint8Array(bindings.check_arr_len(sender_node_id, 33)));
const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret);
public handle_custom_message(msg: Type, sender_node_id: Uint8Array): Result_NoneLightningErrorZ {
const ret: number = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg), bindings.encodeUint8Array(bindings.check_arr_len(sender_node_id, 33)));
const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret);
+ /**
+ * Gets the list of pending messages which were generated by the custom message
+ * handler, clearing the list in the process. The first tuple element must
+ * correspond to the intended recipients node ids. If no connection to one of the
+ * specified node does not exist, the message is simply not sent to it.
+ */
public get_and_clear_pending_msg(): TwoTuple_PublicKeyTypeZ[] {
const ret: number = bindings.CustomMessageHandler_get_and_clear_pending_msg(this.ptr);
const ret_conv_25_len: number = bindings.getArrayLength(ret);
public get_and_clear_pending_msg(): TwoTuple_PublicKeyTypeZ[] {
const ret: number = bindings.CustomMessageHandler_get_and_clear_pending_msg(this.ptr);
const ret_conv_25_len: number = bindings.getArrayLength(ret);
CommonBase.add_ref_from(ret_conv_25_hu_conv, this);
ret_conv_25_arr[z] = ret_conv_25_hu_conv;
}
CommonBase.add_ref_from(ret_conv_25_hu_conv, this);
ret_conv_25_arr[z] = ret_conv_25_hu_conv;
}