+ public static class LDKEvent {
+ private LDKEvent() {}
+ public final static class FundingGenerationReady extends LDKEvent {
+ public byte[] temporary_channel_id;
+ public long channel_value_satoshis;
+ public byte[] output_script;
+ public long user_channel_id;
+ FundingGenerationReady(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; }
+ }
+ public final static class PaymentReceived extends LDKEvent {
+ public byte[] payment_hash;
+ public byte[] payment_secret;
+ public long amt;
+ PaymentReceived(byte[] payment_hash, byte[] payment_secret, long amt) { this.payment_hash = payment_hash; this.payment_secret = payment_secret; this.amt = amt; }
+ }
+ public final static class PaymentSent extends LDKEvent {
+ public byte[] payment_preimage;
+ PaymentSent(byte[] payment_preimage) { this.payment_preimage = payment_preimage; }
+ }
+ public final static class PaymentFailed extends LDKEvent {
+ public byte[] payment_hash;
+ public boolean rejected_by_dest;
+ PaymentFailed(byte[] payment_hash, boolean rejected_by_dest) { this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; }
+ }
+ public final static class PendingHTLCsForwardable extends LDKEvent {
+ public long time_forwardable;
+ PendingHTLCsForwardable(long time_forwardable) { this.time_forwardable = time_forwardable; }
+ }
+ public final static class SpendableOutputs extends LDKEvent {
+ public long[] outputs;
+ SpendableOutputs(long[] outputs) { this.outputs = outputs; }
+ }
+ static native void init();
+ }
+ static { LDKEvent.init(); }
+ public static native LDKEvent LDKEvent_ref_from_ptr(long ptr);
+ public static native long LDKCVec_EventZ_new(long[] elems);
+ public static native long LDKC2Tuple_usizeTransactionZ_new(long a, byte[] b);
+ public static native long LDKC2Tuple_usizeTransactionZ_get_a(long ptr);
+ public static native byte[] LDKC2Tuple_usizeTransactionZ_get_b(long ptr);
+ public static native long LDKCVec_C2Tuple_usizeTransactionZZ_new(long[] elems);
+ public static native long LDKC2Tuple_u32TxOutZ_new(int a, long b);
+ public static native int LDKC2Tuple_u32TxOutZ_get_a(long ptr);
+ public static native long LDKC2Tuple_u32TxOutZ_get_b(long ptr);
+ public static native long LDKCVec_C2Tuple_u32TxOutZZ_new(long[] elems);
+ public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(byte[] a, long[] b);
+ public static native byte[] LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(long ptr);
+ public static native long[] LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(long ptr);
+ public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new(long[] elems);
+ public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg);
+ public static native void LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(long arg);
+ public static native LDKChannelMonitorUpdateErr LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(long arg);
+ public static native long LDKC2Tuple_SignatureCVec_SignatureZZ_new(byte[] a, byte[][] b);
+ public static native byte[] LDKC2Tuple_SignatureCVec_SignatureZZ_get_a(long ptr);
+ public static native byte[][] LDKC2Tuple_SignatureCVec_SignatureZZ_get_b(long ptr);
+ public static native boolean LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(long arg);
+ public static native long LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(long arg);
+ public static native void LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(long arg);
+ public static native boolean LDKCResult_SignatureNoneZ_result_ok(long arg);
+ public static native byte[] LDKCResult_SignatureNoneZ_get_ok(long arg);
+ public static native void LDKCResult_SignatureNoneZ_get_err(long arg);
+ public interface LDKBaseSign {
+ byte[] get_per_commitment_point(long idx);
+ byte[] release_commitment_secret(long idx);
+ byte[] channel_keys_id();
+ long sign_counterparty_commitment(long commitment_tx);
+ long sign_holder_commitment_and_htlcs(long commitment_tx);
+ long sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
+ long sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
+ long sign_closing_transaction(byte[] closing_tx);
+ long sign_channel_announcement(long msg);
+ void ready_channel(long channel_parameters);
+ }
+ public static native long LDKBaseSign_new(LDKBaseSign impl, long pubkeys);
+ // LDKPublicKey BaseSign_get_per_commitment_point LDKBaseSign *NONNULL_PTR this_arg, uint64_t idx
+ public static native byte[] BaseSign_get_per_commitment_point(long this_arg, long idx);
+ // LDKThirtyTwoBytes BaseSign_release_commitment_secret LDKBaseSign *NONNULL_PTR this_arg, uint64_t idx
+ public static native byte[] BaseSign_release_commitment_secret(long this_arg, long idx);
+ // LDKThirtyTwoBytes BaseSign_channel_keys_id LDKBaseSign *NONNULL_PTR this_arg
+ public static native byte[] BaseSign_channel_keys_id(long this_arg);
+ // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ BaseSign_sign_counterparty_commitment LDKBaseSign *NONNULL_PTR this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx
+ public static native long BaseSign_sign_counterparty_commitment(long this_arg, long commitment_tx);
+ // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ BaseSign_sign_holder_commitment_and_htlcs LDKBaseSign *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx
+ public static native long BaseSign_sign_holder_commitment_and_htlcs(long this_arg, long commitment_tx);
+ // LDKCResult_SignatureNoneZ BaseSign_sign_justice_transaction LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc
+ public static native long BaseSign_sign_justice_transaction(long this_arg, byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
+ // LDKCResult_SignatureNoneZ BaseSign_sign_counterparty_htlc_transaction LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc
+ public static native long BaseSign_sign_counterparty_htlc_transaction(long this_arg, byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
+ // LDKCResult_SignatureNoneZ BaseSign_sign_closing_transaction LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction closing_tx
+ public static native long BaseSign_sign_closing_transaction(long this_arg, byte[] closing_tx);
+ // LDKCResult_SignatureNoneZ BaseSign_sign_channel_announcement LDKBaseSign *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg
+ public static native long BaseSign_sign_channel_announcement(long this_arg, long msg);
+ // void BaseSign_ready_channel LDKBaseSign *NONNULL_PTR this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters
+ public static native void BaseSign_ready_channel(long this_arg, long channel_parameters);
+ // LDKChannelPublicKeys BaseSign_get_pubkeys LDKBaseSign *NONNULL_PTR this_arg
+ public static native long BaseSign_get_pubkeys(long this_arg);
+ public interface LDKSign {
+ byte[] write();
+ }
+ public static native long LDKSign_new(LDKSign impl, LDKBaseSign BaseSign, long pubkeys);
+ // LDKCVec_u8Z Sign_write LDKSign *NONNULL_PTR this_arg
+ public static native byte[] Sign_write(long this_arg);
+ public static native long LDKC2Tuple_BlockHashChannelMonitorZ_new(byte[] a, long b);
+ public static native byte[] LDKC2Tuple_BlockHashChannelMonitorZ_get_a(long ptr);
+ public static native long LDKC2Tuple_BlockHashChannelMonitorZ_get_b(long ptr);
+ public static native boolean LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(long arg);
+ public static native long LDKCVec_RouteHopZ_new(long[] elems);
+ public static native boolean LDKCResult_RouteDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_RouteDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_RouteDecodeErrorZ_get_err(long arg);
+ public static class LDKCOption_u64Z {
+ private LDKCOption_u64Z() {}
+ public final static class Some extends LDKCOption_u64Z {
+ public long some;
+ Some(long some) { this.some = some; }
+ }
+ public final static class None extends LDKCOption_u64Z {
+ None() { }
+ }
+ static native void init();
+ }
+ static { LDKCOption_u64Z.init(); }
+ public static native LDKCOption_u64Z LDKCOption_u64Z_ref_from_ptr(long ptr);
+ public static native long LDKCVec_ChannelDetailsZ_new(long[] elems);
+ public static native long LDKCVec_RouteHintZ_new(long[] elems);
+ public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg);
+ public static native long LDKCResult_RouteLightningErrorZ_get_ok(long arg);
+ public static native long LDKCResult_RouteLightningErrorZ_get_err(long arg);