Merge pull request #29 from TheBlueMatt/main
[ldk-java] / ts / structs / MessageSendEvent.ts
index cab57130e1b41913d1f5a4c24c3a06bc9af7199c..b5b708c1ee0f94597b610a6a1f746ccee69815f1 100644 (file)
@@ -52,6 +52,9 @@ export default class MessageSendEvent extends CommonBase {
                if (raw_val instanceof bindings.LDKMessageSendEvent.BroadcastChannelUpdate) {
                        return new BroadcastChannelUpdate(this.ptr, raw_val);
                }
+               if (raw_val instanceof bindings.LDKMessageSendEvent.SendChannelUpdate) {
+                       return new SendChannelUpdate(this.ptr, raw_val);
+               }
                if (raw_val instanceof bindings.LDKMessageSendEvent.HandleError) {
                        return new HandleError(this.ptr, raw_val);
                }
@@ -64,6 +67,9 @@ export default class MessageSendEvent extends CommonBase {
                if (raw_val instanceof bindings.LDKMessageSendEvent.SendShortIdsQuery) {
                        return new SendShortIdsQuery(this.ptr, raw_val);
                }
+               if (raw_val instanceof bindings.LDKMessageSendEvent.SendReplyChannelRange) {
+                       return new SendReplyChannelRange(this.ptr, raw_val);
+               }
                throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
        }
 
@@ -76,6 +82,7 @@ export class SendAcceptChannel extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: AcceptChannel = new AcceptChannel(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -87,6 +94,7 @@ export class SendOpenChannel extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: OpenChannel = new OpenChannel(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -98,6 +106,7 @@ export class SendFundingCreated extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: FundingCreated = new FundingCreated(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -109,6 +118,7 @@ export class SendFundingSigned extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: FundingSigned = new FundingSigned(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -120,6 +130,7 @@ export class SendFundingLocked extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: FundingLocked = new FundingLocked(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -131,6 +142,7 @@ export class SendAnnouncementSignatures extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -142,6 +154,7 @@ export class UpdateHTLCs extends MessageSendEvent {
                this.node_id = obj.node_id;
                const updates: number = obj.updates;
                const updates_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, updates);
+                       updates_hu_conv.ptrs_to.add(this);
                this.updates = updates_hu_conv;
        }
 }
@@ -153,6 +166,7 @@ export class SendRevokeAndACK extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: RevokeAndACK = new RevokeAndACK(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -164,6 +178,7 @@ export class SendClosingSigned extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: ClosingSigned = new ClosingSigned(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -175,6 +190,7 @@ export class SendShutdown extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: Shutdown = new Shutdown(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -186,6 +202,7 @@ export class SendChannelReestablish extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: ChannelReestablish = new ChannelReestablish(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -196,9 +213,11 @@ export class BroadcastChannelAnnouncement extends MessageSendEvent {
                super(null, ptr);
                const msg: number = obj.msg;
                const msg_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
                const update_msg: number = obj.update_msg;
                const update_msg_hu_conv: ChannelUpdate = new ChannelUpdate(null, update_msg);
+                       update_msg_hu_conv.ptrs_to.add(this);
                this.update_msg = update_msg_hu_conv;
        }
 }
@@ -208,6 +227,7 @@ export class BroadcastNodeAnnouncement extends MessageSendEvent {
                super(null, ptr);
                const msg: number = obj.msg;
                const msg_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -217,6 +237,19 @@ export class BroadcastChannelUpdate extends MessageSendEvent {
                super(null, ptr);
                const msg: number = obj.msg;
                const msg_hu_conv: ChannelUpdate = new ChannelUpdate(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
+               this.msg = msg_hu_conv;
+       }
+}
+export class SendChannelUpdate extends MessageSendEvent {
+       public node_id: Uint8Array;
+       public msg: ChannelUpdate;
+       private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendChannelUpdate) {
+               super(null, ptr);
+               this.node_id = obj.node_id;
+               const msg: number = obj.msg;
+               const msg_hu_conv: ChannelUpdate = new ChannelUpdate(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -250,6 +283,7 @@ export class SendChannelRangeQuery extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: QueryChannelRange = new QueryChannelRange(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
@@ -261,6 +295,27 @@ export class SendShortIdsQuery extends MessageSendEvent {
                this.node_id = obj.node_id;
                const msg: number = obj.msg;
                const msg_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
                this.msg = msg_hu_conv;
        }
 }
+export class SendReplyChannelRange extends MessageSendEvent {
+       public node_id: Uint8Array;
+       public msg: ReplyChannelRange;
+       private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendReplyChannelRange) {
+               super(null, ptr);
+               this.node_id = obj.node_id;
+               const msg: number = obj.msg;
+               const msg_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, msg);
+                       msg_hu_conv.ptrs_to.add(this);
+               this.msg = msg_hu_conv;
+       }
+}
+       public MessageSendEvent clone() {
+               number ret = bindings.MessageSendEvent_clone(this.ptr);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
+}