Fix CI failures due to faketime breaking PKI time checks
[ldk-java] / ts / structs / Event.ts
index e24c66e20e3d3e0f0d596a13eca74746dc341a56..ef27cde9b5b7236497a115993e0df867df011c4b 100644 (file)
@@ -13,9 +13,6 @@ export default class Event extends CommonBase {
                if (raw_val instanceof bindings.LDKEvent.FundingGenerationReady) {
                        return new FundingGenerationReady(this.ptr, raw_val);
                }
-               if (raw_val instanceof bindings.LDKEvent.FundingBroadcastSafe) {
-                       return new FundingBroadcastSafe(this.ptr, raw_val);
-               }
                if (raw_val instanceof bindings.LDKEvent.PaymentReceived) {
                        return new PaymentReceived(this.ptr, raw_val);
                }
@@ -31,6 +28,9 @@ export default class Event extends CommonBase {
                if (raw_val instanceof bindings.LDKEvent.SpendableOutputs) {
                        return new SpendableOutputs(this.ptr, raw_val);
                }
+               if (raw_val instanceof bindings.LDKEvent.PaymentForwarded) {
+                       return new PaymentForwarded(this.ptr, raw_val);
+               }
                throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
        }
 
@@ -48,27 +48,18 @@ export class FundingGenerationReady extends Event {
                this.user_channel_id = obj.user_channel_id;
        }
 }
-export class FundingBroadcastSafe extends Event {
-       public funding_txo: OutPoint;
-       public user_channel_id: number;
-       private constructor(ptr: number, obj: bindings.LDKEvent.FundingBroadcastSafe) {
-               super(null, ptr);
-               const funding_txo: number = obj.funding_txo;
-               const funding_txo_hu_conv: OutPoint = new OutPoint(null, funding_txo);
-                       funding_txo_hu_conv.ptrs_to.add(this);
-               this.funding_txo = funding_txo_hu_conv;
-               this.user_channel_id = obj.user_channel_id;
-       }
-}
 export class PaymentReceived extends Event {
        public payment_hash: Uint8Array;
-       public payment_secret: Uint8Array;
        public amt: number;
+       public purpose: PaymentPurpose;
        private constructor(ptr: number, obj: bindings.LDKEvent.PaymentReceived) {
                super(null, ptr);
                this.payment_hash = obj.payment_hash;
-               this.payment_secret = obj.payment_secret;
                this.amt = obj.amt;
+               const purpose: number = obj.purpose;
+               PaymentPurpose purpose_hu_conv = PaymentPurpose.constr_from_ptr(purpose);
+                       purpose_hu_conv.ptrs_to.add(this);
+               this.purpose = purpose_hu_conv;
        }
 }
 export class PaymentSent extends Event {
@@ -109,3 +100,78 @@ export class SpendableOutputs extends Event {
                this.outputs = outputs_conv_27_arr;
        }
 }
+export class PaymentForwarded extends Event {
+       public fee_earned_msat: Option_u64Z;
+       public claim_from_onchain_tx: boolean;
+       private constructor(ptr: number, obj: bindings.LDKEvent.PaymentForwarded) {
+               super(null, ptr);
+               const fee_earned_msat: number = obj.fee_earned_msat;
+               Option_u64Z fee_earned_msat_hu_conv = Option_u64Z.constr_from_ptr(fee_earned_msat);
+                       fee_earned_msat_hu_conv.ptrs_to.add(this);
+               this.fee_earned_msat = fee_earned_msat_hu_conv;
+               this.claim_from_onchain_tx = obj.claim_from_onchain_tx;
+       }
+}
+       public Event clone() {
+               number ret = bindings.Event_clone(this.ptr);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_funding_generation_ready(Uint8Array temporary_channel_id, number channel_value_satoshis, Uint8Array output_script, number user_channel_id) {
+               number ret = bindings.Event_funding_generation_ready(temporary_channel_id, channel_value_satoshis, output_script, user_channel_id);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_payment_received(Uint8Array payment_hash, number amt, PaymentPurpose purpose) {
+               number ret = bindings.Event_payment_received(payment_hash, amt, purpose.ptr);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_payment_sent(Uint8Array payment_preimage) {
+               number ret = bindings.Event_payment_sent(payment_preimage);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_payment_failed(Uint8Array payment_hash, boolean rejected_by_dest) {
+               number ret = bindings.Event_payment_failed(payment_hash, rejected_by_dest);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_pending_htlcs_forwardable(number time_forwardable) {
+               number ret = bindings.Event_pending_htlcs_forwardable(time_forwardable);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_spendable_outputs(SpendableOutputDescriptor[] outputs) {
+               number ret = bindings.Event_spendable_outputs(outputs != null ? Arrays.stream(outputs).map(outputs_conv_27 -> outputs_conv_27.ptr).toArray(number[]::new) : null);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               /* TODO 2 SpendableOutputDescriptor  */;
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_payment_forwarded(Option_u64Z fee_earned_msat, boolean claim_from_onchain_tx) {
+               number ret = bindings.Event_payment_forwarded(fee_earned_msat.ptr, claim_from_onchain_tx);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public Uint8Array write() {
+               Uint8Array ret = bindings.Event_write(this.ptr);
+               return ret;
+       }
+
+}