import { ClosureReason } from '../structs/ClosureReason.mjs';
import { Option_ClosureReasonZ } from '../structs/Option_ClosureReasonZ.mjs';
import { Result_COption_ClosureReasonZDecodeErrorZ } from '../structs/Result_COption_ClosureReasonZDecodeErrorZ.mjs';
import { ClosureReason } from '../structs/ClosureReason.mjs';
import { Option_ClosureReasonZ } from '../structs/Option_ClosureReasonZ.mjs';
import { Result_COption_ClosureReasonZDecodeErrorZ } from '../structs/Result_COption_ClosureReasonZDecodeErrorZ.mjs';
import { ChannelUpdate } from '../structs/ChannelUpdate.mjs';
import { NetworkUpdate } from '../structs/NetworkUpdate.mjs';
import { Option_NetworkUpdateZ } from '../structs/Option_NetworkUpdateZ.mjs';
import { ChannelUpdate } from '../structs/ChannelUpdate.mjs';
import { NetworkUpdate } from '../structs/NetworkUpdate.mjs';
import { Option_NetworkUpdateZ } from '../structs/Option_NetworkUpdateZ.mjs';
import { Result_NoneChannelMonitorUpdateErrZ } from '../structs/Result_NoneChannelMonitorUpdateErrZ.mjs';
import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
import { MonitorEvent } from '../structs/MonitorEvent.mjs';
import { Result_NoneChannelMonitorUpdateErrZ } from '../structs/Result_NoneChannelMonitorUpdateErrZ.mjs';
import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
import { MonitorEvent } from '../structs/MonitorEvent.mjs';
import { Option_C2Tuple_usizeTransactionZZ } from '../structs/Option_C2Tuple_usizeTransactionZZ.mjs';
import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs';
import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs';
import { Option_C2Tuple_usizeTransactionZZ } from '../structs/Option_C2Tuple_usizeTransactionZZ.mjs';
import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs';
import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs';
import { Result_ChannelInfoDecodeErrorZ } from '../structs/Result_ChannelInfoDecodeErrorZ.mjs';
import { RoutingFees } from '../structs/RoutingFees.mjs';
import { Result_RoutingFeesDecodeErrorZ } from '../structs/Result_RoutingFeesDecodeErrorZ.mjs';
import { Result_ChannelInfoDecodeErrorZ } from '../structs/Result_ChannelInfoDecodeErrorZ.mjs';
import { RoutingFees } from '../structs/RoutingFees.mjs';
import { Result_RoutingFeesDecodeErrorZ } from '../structs/Result_RoutingFeesDecodeErrorZ.mjs';
import { NetAddress } from '../structs/NetAddress.mjs';
import { NodeAnnouncementInfo } from '../structs/NodeAnnouncementInfo.mjs';
import { Result_NodeAnnouncementInfoDecodeErrorZ } from '../structs/Result_NodeAnnouncementInfoDecodeErrorZ.mjs';
import { NetAddress } from '../structs/NetAddress.mjs';
import { NodeAnnouncementInfo } from '../structs/NodeAnnouncementInfo.mjs';
import { Result_NodeAnnouncementInfoDecodeErrorZ } from '../structs/Result_NodeAnnouncementInfoDecodeErrorZ.mjs';
const raw_ty: number = bindings.LDKErrorAction_ty_from_ptr(ptr);
switch (raw_ty) {
case 0: return new ErrorAction_DisconnectPeer(ptr);
const raw_ty: number = bindings.LDKErrorAction_ty_from_ptr(ptr);
switch (raw_ty) {
case 0: return new ErrorAction_DisconnectPeer(ptr);
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
* Utility method to constructs a new DisconnectPeer-variant ErrorAction
*/
public static constructor_disconnect_peer(msg: ErrorMessage): ErrorAction {
* Utility method to constructs a new DisconnectPeer-variant ErrorAction
*/
public static constructor_disconnect_peer(msg: ErrorMessage): ErrorAction {
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
* Utility method to constructs a new IgnoreError-variant ErrorAction
*/
public static constructor_ignore_error(): ErrorAction {
* Utility method to constructs a new IgnoreError-variant ErrorAction
*/
public static constructor_ignore_error(): ErrorAction {
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
return ret_hu_conv;
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
return ret_hu_conv;
* Utility method to constructs a new IgnoreAndLog-variant ErrorAction
*/
public static constructor_ignore_and_log(a: Level): ErrorAction {
* Utility method to constructs a new IgnoreAndLog-variant ErrorAction
*/
public static constructor_ignore_and_log(a: Level): ErrorAction {
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
return ret_hu_conv;
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
return ret_hu_conv;
* Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
*/
public static constructor_ignore_duplicate_gossip(): ErrorAction {
* Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
*/
public static constructor_ignore_duplicate_gossip(): ErrorAction {
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
return ret_hu_conv;
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
return ret_hu_conv;
* Utility method to constructs a new SendErrorMessage-variant ErrorAction
*/
public static constructor_send_error_message(msg: ErrorMessage): ErrorAction {
* Utility method to constructs a new SendErrorMessage-variant ErrorAction
*/
public static constructor_send_error_message(msg: ErrorMessage): ErrorAction {
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
* Utility method to constructs a new SendWarningMessage-variant ErrorAction
*/
public static constructor_send_warning_message(msg: WarningMessage, log_level: Level): ErrorAction {
* Utility method to constructs a new SendWarningMessage-variant ErrorAction
*/
public static constructor_send_warning_message(msg: WarningMessage, log_level: Level): ErrorAction {
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
const msg_hu_conv: ErrorMessage = new ErrorMessage(null, msg);
CommonBase.add_ref_from(msg_hu_conv, this);
this.msg = msg_hu_conv;
const msg_hu_conv: ErrorMessage = new ErrorMessage(null, msg);
CommonBase.add_ref_from(msg_hu_conv, this);
this.msg = msg_hu_conv;
/** A ErrorAction of type IgnoreDuplicateGossip */
export class ErrorAction_IgnoreDuplicateGossip extends ErrorAction {
/* @internal */
/** A ErrorAction of type IgnoreDuplicateGossip */
export class ErrorAction_IgnoreDuplicateGossip extends ErrorAction {
/* @internal */
const msg_hu_conv: ErrorMessage = new ErrorMessage(null, msg);
CommonBase.add_ref_from(msg_hu_conv, this);
this.msg = msg_hu_conv;
const msg_hu_conv: ErrorMessage = new ErrorMessage(null, msg);
CommonBase.add_ref_from(msg_hu_conv, this);
this.msg = msg_hu_conv;
const msg_hu_conv: WarningMessage = new WarningMessage(null, msg);
CommonBase.add_ref_from(msg_hu_conv, this);
this.msg = msg_hu_conv;
const msg_hu_conv: WarningMessage = new WarningMessage(null, msg);
CommonBase.add_ref_from(msg_hu_conv, this);
this.msg = msg_hu_conv;