+ static { LDKHTLCFailChannelUpdate.init(); }
+ public static native LDKHTLCFailChannelUpdate LDKHTLCFailChannelUpdate_ref_from_ptr(long ptr);
+ public static class LDKMessageSendEvent {
+ private LDKMessageSendEvent() {}
+ public final static class SendAcceptChannel extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendAcceptChannel(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class SendOpenChannel extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendOpenChannel(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class SendFundingCreated extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendFundingCreated(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class SendFundingSigned extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendFundingSigned(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class SendFundingLocked extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendFundingLocked(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class SendAnnouncementSignatures extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendAnnouncementSignatures(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class UpdateHTLCs extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long updates;
+ UpdateHTLCs(byte[] node_id, long updates) { this.node_id = node_id; this.updates = updates; }
+ }
+ public final static class SendRevokeAndACK extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendRevokeAndACK(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class SendClosingSigned extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendClosingSigned(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class SendShutdown extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendShutdown(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class SendChannelReestablish extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendChannelReestablish(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class BroadcastChannelAnnouncement extends LDKMessageSendEvent {
+ public long msg;
+ public long update_msg;
+ BroadcastChannelAnnouncement(long msg, long update_msg) { this.msg = msg; this.update_msg = update_msg; }
+ }
+ public final static class BroadcastNodeAnnouncement extends LDKMessageSendEvent {
+ public long msg;
+ BroadcastNodeAnnouncement(long msg) { this.msg = msg; }
+ }
+ public final static class BroadcastChannelUpdate extends LDKMessageSendEvent {
+ public long msg;
+ BroadcastChannelUpdate(long msg) { this.msg = msg; }
+ }
+ public final static class HandleError extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long action;
+ HandleError(byte[] node_id, long action) { this.node_id = node_id; this.action = action; }
+ }
+ public final static class PaymentFailureNetworkUpdate extends LDKMessageSendEvent {
+ public long update;
+ PaymentFailureNetworkUpdate(long update) { this.update = update; }
+ }
+ public final static class SendChannelRangeQuery extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendChannelRangeQuery(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ public final static class SendShortIdsQuery extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendShortIdsQuery(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
+ static native void init();
+ }
+ static { LDKMessageSendEvent.init(); }
+ public static native LDKMessageSendEvent LDKMessageSendEvent_ref_from_ptr(long ptr);
+ public static native long LDKCVec_MessageSendEventZ_new(long[] elems);
+ 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 FundingBroadcastSafe extends LDKEvent {
+ public long funding_txo;
+ public long user_channel_id;
+ FundingBroadcastSafe(long funding_txo, long user_channel_id) { this.funding_txo = funding_txo; 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 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 LDKCVec_MonitorEventZ_new(long[] elems);
+ public static native boolean LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg);
+ public static native void LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg);
+ public static native long LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg);
+ public static native long LDKC2Tuple_OutPointScriptZ_new(long a, byte[] b);
+ public static native long LDKC2Tuple_OutPointScriptZ_get_a(long ptr);
+ public static native byte[] LDKC2Tuple_OutPointScriptZ_get_b(long ptr);
+ 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 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 LDKChannelKeys {
+ byte[] get_per_commitment_point(long idx);
+ byte[] release_commitment_secret(long idx);
+ long key_derivation_params();
+ 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);
+ byte[] write();
+ }
+ public static native long LDKChannelKeys_new(LDKChannelKeys impl, long pubkeys);
+ // LDKPublicKey ChannelKeys_get_per_commitment_point LDKChannelKeys* this_arg, uint64_t idx
+ public static native byte[] ChannelKeys_get_per_commitment_point(long this_arg, long idx);
+ // LDKThirtyTwoBytes ChannelKeys_release_commitment_secret LDKChannelKeys* this_arg, uint64_t idx
+ public static native byte[] ChannelKeys_release_commitment_secret(long this_arg, long idx);
+ // LDKC2Tuple_u64u64Z ChannelKeys_key_derivation_params LDKChannelKeys* this_arg
+ public static native long ChannelKeys_key_derivation_params(long this_arg);
+ // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ChannelKeys_sign_counterparty_commitment LDKChannelKeys* this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx
+ public static native long ChannelKeys_sign_counterparty_commitment(long this_arg, long commitment_tx);
+ // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ChannelKeys_sign_holder_commitment_and_htlcs LDKChannelKeys* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx
+ public static native long ChannelKeys_sign_holder_commitment_and_htlcs(long this_arg, long commitment_tx);
+ // LDKCResult_SignatureNoneZ ChannelKeys_sign_justice_transaction LDKChannelKeys* 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 ChannelKeys_sign_justice_transaction(long this_arg, byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
+ // LDKCResult_SignatureNoneZ ChannelKeys_sign_counterparty_htlc_transaction LDKChannelKeys* 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 ChannelKeys_sign_counterparty_htlc_transaction(long this_arg, byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
+ // LDKCResult_SignatureNoneZ ChannelKeys_sign_closing_transaction LDKChannelKeys* this_arg, struct LDKTransaction closing_tx
+ public static native long ChannelKeys_sign_closing_transaction(long this_arg, byte[] closing_tx);
+ // LDKCResult_SignatureNoneZ ChannelKeys_sign_channel_announcement LDKChannelKeys* this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg
+ public static native long ChannelKeys_sign_channel_announcement(long this_arg, long msg);
+ // void ChannelKeys_ready_channel LDKChannelKeys* this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters
+ public static native void ChannelKeys_ready_channel(long this_arg, long channel_parameters);
+ // LDKCVec_u8Z ChannelKeys_write LDKChannelKeys* this_arg
+ public static native byte[] ChannelKeys_write(long this_arg);
+ // LDKChannelPublicKeys ChannelKeys_get_pubkeys LDKChannelKeys* this_arg
+ public static native long ChannelKeys_get_pubkeys(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 boolean LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_ChanKeySignerDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_ChanKeySignerDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_ChanKeySignerDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_TxOutAccessErrorZ_result_ok(long arg);
+ public static native long LDKCResult_TxOutAccessErrorZ_get_ok(long arg);
+ public static native LDKAccessError LDKCResult_TxOutAccessErrorZ_get_err(long arg);
+ public static class LDKAPIError {
+ private LDKAPIError() {}
+ public final static class APIMisuseError extends LDKAPIError {
+ public byte[] err;
+ APIMisuseError(byte[] err) { this.err = err; }
+ }
+ public final static class FeeRateTooHigh extends LDKAPIError {
+ public byte[] err;
+ public int feerate;
+ FeeRateTooHigh(byte[] err, int feerate) { this.err = err; this.feerate = feerate; }
+ }
+ public final static class RouteError extends LDKAPIError {
+ public String err;
+ RouteError(String err) { this.err = err; }
+ }
+ public final static class ChannelUnavailable extends LDKAPIError {
+ public byte[] err;
+ ChannelUnavailable(byte[] err) { this.err = err; }
+ }
+ public final static class MonitorUpdateFailed extends LDKAPIError {
+ MonitorUpdateFailed() { }
+ }
+ static native void init();
+ }
+ static { LDKAPIError.init(); }
+ public static native LDKAPIError LDKAPIError_ref_from_ptr(long ptr);
+ public static native boolean LDKCResult_NoneAPIErrorZ_result_ok(long arg);
+ public static native void LDKCResult_NoneAPIErrorZ_get_ok(long arg);
+ public static native long LDKCResult_NoneAPIErrorZ_get_err(long arg);
+ public static native long LDKCVec_ChannelDetailsZ_new(long[] elems);
+ public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg);
+ public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg);
+ public static native long LDKCResult_NonePaymentSendFailureZ_get_err(long arg);
+ public static class LDKNetAddress {
+ private LDKNetAddress() {}
+ public final static class IPv4 extends LDKNetAddress {
+ public byte[] addr;
+ public short port;
+ IPv4(byte[] addr, short port) { this.addr = addr; this.port = port; }
+ }
+ public final static class IPv6 extends LDKNetAddress {
+ public byte[] addr;
+ public short port;
+ IPv6(byte[] addr, short port) { this.addr = addr; this.port = port; }
+ }
+ public final static class OnionV2 extends LDKNetAddress {
+ public byte[] addr;
+ public short port;
+ OnionV2(byte[] addr, short port) { this.addr = addr; this.port = port; }
+ }
+ public final static class OnionV3 extends LDKNetAddress {
+ public byte[] ed25519_pubkey;
+ public short checksum;
+ public byte version;
+ public short port;
+ OnionV3(byte[] ed25519_pubkey, short checksum, byte version, short port) { this.ed25519_pubkey = ed25519_pubkey; this.checksum = checksum; this.version = version; this.port = port; }
+ }
+ static native void init();