import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class UtilMethods {
--- /dev/null
+package org.ldk.enums;
+
+/**
+ * An enum which can either contain a or not
+ */
+public enum COption_NoneZ {
+ /**
+ * When we're in this state, this COption_NoneZ contains a
+ */
+ LDKCOption_NoneZ_Some,
+ /**
+ * When we're in this state, this COption_NoneZ contains nothing
+ */
+ LDKCOption_NoneZ_None,
+ ; static native void init();
+ static { init(); }
+}
\ No newline at end of file
* The supplied expiry time could cause an overflow if added to a `PositiveTimestamp`
*/
LDKCreationError_ExpiryTimeOutOfBounds,
+ /**
+ * The supplied millisatoshi amount was greater than the total bitcoin supply.
+ */
+ LDKCreationError_InvalidAmount,
; static native void init();
static { init(); }
}
\ No newline at end of file
* An enum representing the available verbosity levels of the logger.
*/
public enum Level {
+ /**
+ * Designates extremely verbose information, including gossip-induced messages
+ */
+ LDKLevel_Gossip,
/**
* Designates very low priority, often extremely verbose, information
*/
public static native long new_empty_slice_vec();
static { AccessError.values(); /* Force enum statics to run */ }
+ static { COption_NoneZ.values(); /* Force enum statics to run */ }
static { ChannelMonitorUpdateErr.values(); /* Force enum statics to run */ }
static { ConfirmationTarget.values(); /* Force enum statics to run */ }
static { CreationError.values(); /* Force enum statics to run */ }
public final static class CommitmentTxConfirmed extends LDKClosureReason {
CommitmentTxConfirmed() { }
}
+ public final static class FundingTimedOut extends LDKClosureReason {
+ FundingTimedOut() { }
+ }
public final static class ProcessingError extends LDKClosureReason {
public String err;
ProcessingError(String err) { this.err = err; }
public final static class InvoicePayment extends LDKPaymentPurpose {
public byte[] payment_preimage;
public byte[] payment_secret;
- public long user_payment_id;
- InvoicePayment(byte[] payment_preimage, byte[] payment_secret, long user_payment_id) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; this.user_payment_id = user_payment_id; }
+ InvoicePayment(byte[] payment_preimage, byte[] payment_secret) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; }
}
public final static class SpontaneousPayment extends LDKPaymentPurpose {
public byte[] spontaneous_payment;
public long retry;
PaymentPathFailed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, long network_update, boolean all_paths_failed, long[] path, long short_channel_id, long retry) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; this.network_update = network_update; this.all_paths_failed = all_paths_failed; this.path = path; this.short_channel_id = short_channel_id; this.retry = retry; }
}
+ public final static class PaymentFailed extends LDKEvent {
+ public byte[] payment_id;
+ public byte[] payment_hash;
+ PaymentFailed(byte[] payment_id, byte[] payment_hash) { this.payment_id = payment_id; this.payment_hash = payment_hash; }
+ }
public final static class PendingHTLCsForwardable extends LDKEvent {
public long time_forwardable;
PendingHTLCsForwardable(long time_forwardable) { this.time_forwardable = time_forwardable; }
public byte[] transaction;
DiscardFunding(byte[] channel_id, byte[] transaction) { this.channel_id = channel_id; this.transaction = transaction; }
}
+ public final static class PaymentPathSuccessful extends LDKEvent {
+ public byte[] payment_id;
+ public byte[] payment_hash;
+ public long[] path;
+ PaymentPathSuccessful(byte[] payment_id, byte[] payment_hash, long[] path) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.path = path; }
+ }
static native void init();
}
static { LDKEvent.init(); }
public Level ignore_and_log;
IgnoreAndLog(Level ignore_and_log) { this.ignore_and_log = ignore_and_log; }
}
+ public final static class IgnoreDuplicateGossip extends LDKErrorAction {
+ IgnoreDuplicateGossip() { }
+ }
public final static class SendErrorMessage extends LDKErrorAction {
public long msg;
SendErrorMessage(long msg) { this.msg = msg; }
}
static { LDKMessageSendEvent.init(); }
public static native LDKMessageSendEvent LDKMessageSendEvent_ref_from_ptr(long ptr);
+ public static native long LDKCResult_ScoringParametersDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_ScoringParametersDecodeErrorZ_get_err(long arg);
+ public static native long LDKCResult_ScorerDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_ScorerDecodeErrorZ_get_err(long arg);
public static native long LDKCResult_InitFeaturesDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_InitFeaturesDecodeErrorZ_get_err(long arg);
- public static native long LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(long arg);
- public static native long LDKCResult_NodeFeaturesDecodeErrorZ_get_err(long arg);
public static native long LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(long arg);
+ public static native long LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_NodeFeaturesDecodeErrorZ_get_err(long arg);
public static native long LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(long arg);
- public static native long LDKCResult_ScoringParametersDecodeErrorZ_get_ok(long arg);
- public static native long LDKCResult_ScoringParametersDecodeErrorZ_get_err(long arg);
- public static native long LDKCResult_ScorerDecodeErrorZ_get_ok(long arg);
- public static native long LDKCResult_ScorerDecodeErrorZ_get_err(long arg);
+ public static native long LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_err(long arg);
public static native long LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(long arg);
public static native long LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(long arg);
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 byte[] onion_v2;
+ OnionV2(byte[] onion_v2) { this.onion_v2 = onion_v2; }
}
public final static class OnionV3 extends LDKNetAddress {
public byte[] ed25519_pubkey;
public static native byte[] C2Tuple_PaymentHashPaymentSecretZ_get_a(long tuple);
// struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_PaymentHashPaymentSecretZ_get_b(long tuple);
+ public static native long LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(long arg);
+ public static native void LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(long arg);
+ public static native long LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(long arg);
+ public static native long LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(long arg);
+ public static native byte[] LDKCResult_PaymentSecretNoneZ_get_ok(long arg);
+ public static native void LDKCResult_PaymentSecretNoneZ_get_err(long arg);
public static native byte[] LDKCResult_PaymentSecretAPIErrorZ_get_ok(long arg);
public static native long LDKCResult_PaymentSecretAPIErrorZ_get_err(long arg);
+ public static native byte[] LDKCResult_PaymentPreimageAPIErrorZ_get_ok(long arg);
+ public static native long LDKCResult_PaymentPreimageAPIErrorZ_get_err(long arg);
public interface LDKWatch {
long watch_channel(long funding_txo, long monitor);
long update_channel(long funding_txo, long update);
byte[] get_secure_random_bytes();
long read_chan_signer(byte[] reader);
long sign_invoice(byte[] invoice_preimage);
+ byte[] get_inbound_payment_key_material();
}
public static native long LDKKeysInterface_new(LDKKeysInterface impl);
// LDKSecretKey KeysInterface_get_node_secret LDKKeysInterface *NONNULL_PTR this_arg
public static native long KeysInterface_read_chan_signer(long this_arg, byte[] reader);
// LDKCResult_RecoverableSignatureNoneZ KeysInterface_sign_invoice LDKKeysInterface *NONNULL_PTR this_arg, struct LDKCVec_u8Z invoice_preimage
public static native long KeysInterface_sign_invoice(long this_arg, byte[] invoice_preimage);
+ // LDKThirtyTwoBytes KeysInterface_get_inbound_payment_key_material LDKKeysInterface *NONNULL_PTR this_arg
+ public static native byte[] KeysInterface_get_inbound_payment_key_material(long this_arg);
public interface LDKFeeEstimator {
int get_est_sat_per_1000_weight(ConfirmationTarget confirmation_target);
}
public static native long LDKCResult_COption_MonitorEventZDecodeErrorZ_get_err(long arg);
public static native long LDKCResult_HTLCUpdateDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_HTLCUpdateDecodeErrorZ_get_err(long arg);
- public static native void LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg);
- public static native long LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg);
// struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple);
public static native long C2Tuple_OutPointScriptZ_get_a(long tuple);
// struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple);
// uint64_t SocketDescriptor_hash LDKSocketDescriptor *NONNULL_PTR this_arg
public static native long SocketDescriptor_hash(long this_arg);
public interface LDKScore {
- long channel_penalty_msat(long short_channel_id, long source, long target);
+ long channel_penalty_msat(long short_channel_id, long send_amt_msat, long channel_capacity_msat, long source, long target);
void payment_path_failed(long[] path, long short_channel_id);
+ void payment_path_successful(long[] path);
byte[] write();
}
public static native long LDKScore_new(LDKScore impl);
- // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target
- public static native long Score_channel_penalty_msat(long this_arg, long short_channel_id, long source, long target);
+ // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, struct LDKCOption_u64Z channel_capacity_msat, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target
+ public static native long Score_channel_penalty_msat(long this_arg, long short_channel_id, long send_amt_msat, long channel_capacity_msat, long source, long target);
// void Score_payment_path_failed LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id
public static native void Score_payment_path_failed(long this_arg, long[] path, long short_channel_id);
+ // void Score_payment_path_successful LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path
+ public static native void Score_payment_path_successful(long this_arg, long[] path);
// LDKCVec_u8Z Score_write LDKScore *NONNULL_PTR this_arg
public static native byte[] Score_write(long this_arg);
+ public interface LDKLockableScore {
+ long lock();
+ }
+ public static native long LDKLockableScore_new(LDKLockableScore impl);
+ // LDKScore LockableScore_lock LDKLockableScore *NONNULL_PTR this_arg
+ public static native long LockableScore_lock(long this_arg);
public interface LDKChannelManagerPersister {
long persist_manager(long channel_manager);
}
byte[] node_id();
long[] first_hops();
long send_payment(long route, byte[] payment_hash, byte[] payment_secret);
+ long send_spontaneous_payment(long route, byte[] payment_preimage);
long retry_payment(long route, byte[] payment_id);
+ void abandon_payment(byte[] payment_id);
}
public static native long LDKPayer_new(LDKPayer impl);
// LDKPublicKey Payer_node_id LDKPayer *NONNULL_PTR this_arg
public static native long[] Payer_first_hops(long this_arg);
// LDKCResult_PaymentIdPaymentSendFailureZ Payer_send_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret
public static native long Payer_send_payment(long this_arg, long route, byte[] payment_hash, byte[] payment_secret);
+ // LDKCResult_PaymentIdPaymentSendFailureZ Payer_send_spontaneous_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage
+ public static native long Payer_send_spontaneous_payment(long this_arg, long route, byte[] payment_preimage);
// LDKCResult_NonePaymentSendFailureZ Payer_retry_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id
public static native long Payer_retry_payment(long this_arg, long route, byte[] payment_id);
+ // void Payer_abandon_payment LDKPayer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id
+ public static native void Payer_abandon_payment(long this_arg, byte[] payment_id);
public interface LDKRouter {
- long find_route(byte[] payer, long params, long[] first_hops, long scorer);
+ long find_route(byte[] payer, long params, byte[] payment_hash, long[] first_hops, long scorer);
}
public static native long LDKRouter_new(LDKRouter impl);
- // LDKCResult_RouteLightningErrorZ Router_find_route LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer
- public static native long Router_find_route(long this_arg, byte[] payer, long params, long[] first_hops, long scorer);
+ // LDKCResult_RouteLightningErrorZ Router_find_route LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer
+ public static native long Router_find_route(long this_arg, byte[] payer, long params, byte[] payment_hash, long[] first_hops, long scorer);
// struct LDKStr _ldk_get_compiled_version(void);
public static native String _ldk_get_compiled_version();
// struct LDKStr _ldk_c_bindings_get_compiled_version(void);
public static native long CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(long arg);
// struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
public static native long CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(long orig);
+ // enum LDKCOption_NoneZ COption_NoneZ_some(void);
+ public static native COption_NoneZ COption_NoneZ_some();
+ // enum LDKCOption_NoneZ COption_NoneZ_none(void);
+ public static native COption_NoneZ COption_NoneZ_none();
+ // void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
+ public static native void COption_NoneZ_free(COption_NoneZ _res);
// struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
public static native long CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(long o);
// struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
public static native long CResult_COption_EventZDecodeErrorZ_clone(long orig);
// void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
public static native void CVec_MessageSendEventZ_free(long[] _res);
+ // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o);
+ public static native long CResult_ScoringParametersDecodeErrorZ_ok(long o);
+ // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_ScoringParametersDecodeErrorZ_err(long e);
+ // bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o);
+ public static native boolean CResult_ScoringParametersDecodeErrorZ_is_ok(long o);
+ // void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res);
+ public static native void CResult_ScoringParametersDecodeErrorZ_free(long _res);
+ // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o);
+ public static native long CResult_ScorerDecodeErrorZ_ok(long o);
+ // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_ScorerDecodeErrorZ_err(long e);
+ // bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o);
+ public static native boolean CResult_ScorerDecodeErrorZ_is_ok(long o);
+ // void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res);
+ public static native void CResult_ScorerDecodeErrorZ_free(long _res);
// struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
public static native long CResult_InitFeaturesDecodeErrorZ_ok(long o);
// struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
public static native boolean CResult_InitFeaturesDecodeErrorZ_is_ok(long o);
// void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
public static native void CResult_InitFeaturesDecodeErrorZ_free(long _res);
- // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
- public static native long CResult_NodeFeaturesDecodeErrorZ_ok(long o);
- // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
- public static native long CResult_NodeFeaturesDecodeErrorZ_err(long e);
- // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
- public static native boolean CResult_NodeFeaturesDecodeErrorZ_is_ok(long o);
- // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
- public static native void CResult_NodeFeaturesDecodeErrorZ_free(long _res);
// struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
public static native long CResult_ChannelFeaturesDecodeErrorZ_ok(long o);
// struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
public static native boolean CResult_ChannelFeaturesDecodeErrorZ_is_ok(long o);
// void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
public static native void CResult_ChannelFeaturesDecodeErrorZ_free(long _res);
+ // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
+ public static native long CResult_NodeFeaturesDecodeErrorZ_ok(long o);
+ // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_NodeFeaturesDecodeErrorZ_err(long e);
+ // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
+ public static native boolean CResult_NodeFeaturesDecodeErrorZ_is_ok(long o);
+ // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
+ public static native void CResult_NodeFeaturesDecodeErrorZ_free(long _res);
// struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
public static native long CResult_InvoiceFeaturesDecodeErrorZ_ok(long o);
// struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
public static native boolean CResult_InvoiceFeaturesDecodeErrorZ_is_ok(long o);
// void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
public static native void CResult_InvoiceFeaturesDecodeErrorZ_free(long _res);
- // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o);
- public static native long CResult_ScoringParametersDecodeErrorZ_ok(long o);
- // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e);
- public static native long CResult_ScoringParametersDecodeErrorZ_err(long e);
- // bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o);
- public static native boolean CResult_ScoringParametersDecodeErrorZ_is_ok(long o);
- // void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res);
- public static native void CResult_ScoringParametersDecodeErrorZ_free(long _res);
- // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o);
- public static native long CResult_ScorerDecodeErrorZ_ok(long o);
- // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e);
- public static native long CResult_ScorerDecodeErrorZ_err(long e);
- // bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o);
- public static native boolean CResult_ScorerDecodeErrorZ_is_ok(long o);
- // void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res);
- public static native void CResult_ScorerDecodeErrorZ_free(long _res);
+ // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
+ public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_ok(long o);
+ // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_ChannelTypeFeaturesDecodeErrorZ_err(long e);
+ // bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
+ public static native boolean CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(long o);
+ // void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
+ public static native void CResult_ChannelTypeFeaturesDecodeErrorZ_free(long _res);
// struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
public static native long CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(long o);
// struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
public static native long C2Tuple_PaymentHashPaymentSecretZ_new(byte[] a, byte[] b);
// void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
public static native void C2Tuple_PaymentHashPaymentSecretZ_free(long _res);
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
+ public static native long CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(long o);
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
+ public static native long CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
+ // bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
+ public static native boolean CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(long o);
+ // void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
+ public static native void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(long _res);
+ // uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg);
+ public static native long CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(long arg);
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
+ public static native long CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(long orig);
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
+ public static native long CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(long o);
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
+ public static native long CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(long e);
+ // bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
+ public static native boolean CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(long o);
+ // void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
+ public static native void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(long _res);
+ // uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg);
+ public static native long CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(long arg);
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
+ public static native long CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(long orig);
+ // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
+ public static native long CResult_PaymentSecretNoneZ_ok(byte[] o);
+ // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
+ public static native long CResult_PaymentSecretNoneZ_err();
+ // bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
+ public static native boolean CResult_PaymentSecretNoneZ_is_ok(long o);
+ // void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
+ public static native void CResult_PaymentSecretNoneZ_free(long _res);
+ // uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg);
+ public static native long CResult_PaymentSecretNoneZ_clone_ptr(long arg);
+ // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
+ public static native long CResult_PaymentSecretNoneZ_clone(long orig);
// struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
public static native long CResult_PaymentSecretAPIErrorZ_ok(byte[] o);
// struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
public static native long CResult_PaymentSecretAPIErrorZ_clone_ptr(long arg);
// struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
public static native long CResult_PaymentSecretAPIErrorZ_clone(long orig);
+ // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
+ public static native long CResult_PaymentPreimageAPIErrorZ_ok(byte[] o);
+ // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
+ public static native long CResult_PaymentPreimageAPIErrorZ_err(long e);
+ // bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
+ public static native boolean CResult_PaymentPreimageAPIErrorZ_is_ok(long o);
+ // void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
+ public static native void CResult_PaymentPreimageAPIErrorZ_free(long _res);
+ // uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg);
+ public static native long CResult_PaymentPreimageAPIErrorZ_clone_ptr(long arg);
+ // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
+ public static native long CResult_PaymentPreimageAPIErrorZ_clone(long orig);
// void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
public static native void CVec_ChannelMonitorZ_free(long[] _res);
// struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
public static native long CResult_HTLCUpdateDecodeErrorZ_clone_ptr(long arg);
// struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
public static native long CResult_HTLCUpdateDecodeErrorZ_clone(long orig);
- // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
- public static native long CResult_NoneMonitorUpdateErrorZ_ok();
- // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
- public static native long CResult_NoneMonitorUpdateErrorZ_err(long e);
- // bool CResult_NoneMonitorUpdateErrorZ_is_ok(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR o);
- public static native boolean CResult_NoneMonitorUpdateErrorZ_is_ok(long o);
- // void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
- public static native void CResult_NoneMonitorUpdateErrorZ_free(long _res);
- // uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg);
- public static native long CResult_NoneMonitorUpdateErrorZ_clone_ptr(long arg);
- // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
- public static native long CResult_NoneMonitorUpdateErrorZ_clone(long orig);
// uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg);
public static native long C2Tuple_OutPointScriptZ_clone_ptr(long arg);
// struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
public static native long PaymentPurpose_clone_ptr(long arg);
// struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
public static native long PaymentPurpose_clone(long orig);
- // struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t user_payment_id);
- public static native long PaymentPurpose_invoice_payment(byte[] payment_preimage, byte[] payment_secret, long user_payment_id);
+ // struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
+ public static native long PaymentPurpose_invoice_payment(byte[] payment_preimage, byte[] payment_secret);
// struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
public static native long PaymentPurpose_spontaneous_payment(byte[] a);
// void ClosureReason_free(struct LDKClosureReason this_ptr);
public static native long ClosureReason_cooperative_closure();
// struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
public static native long ClosureReason_commitment_tx_confirmed();
+ // struct LDKClosureReason ClosureReason_funding_timed_out(void);
+ public static native long ClosureReason_funding_timed_out();
// struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
public static native long ClosureReason_processing_error(String err);
// struct LDKClosureReason ClosureReason_disconnected_peer(void);
public static native long Event_payment_sent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, long fee_paid_msat);
// struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry);
public static native long Event_payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, long network_update, boolean all_paths_failed, long[] path, long short_channel_id, long retry);
+ // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
+ public static native long Event_payment_failed(byte[] payment_id, byte[] payment_hash);
// struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
public static native long Event_pending_htlcs_forwardable(long time_forwardable);
// struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
public static native long Event_channel_closed(byte[] channel_id, long user_channel_id, long reason);
// struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
public static native long Event_discard_funding(byte[] channel_id, byte[] transaction);
+ // struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
+ public static native long Event_payment_path_successful(byte[] payment_id, byte[] payment_hash, long[] path);
// struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
public static native byte[] Event_write(long obj);
// struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
public static native boolean verify(byte[] msg, String sig, byte[] pk);
// enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
public static native Level Level_clone(long orig);
+ // enum LDKLevel Level_gossip(void);
+ public static native Level Level_gossip();
// enum LDKLevel Level_trace(void);
public static native Level Level_trace();
// enum LDKLevel Level_debug(void);
public static native boolean UserConfig_get_accept_forwards_to_priv_channels(long this_ptr);
// void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
public static native void UserConfig_set_accept_forwards_to_priv_channels(long this_ptr, boolean val);
- // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg);
- public static native long UserConfig_new(long own_channel_config_arg, long peer_channel_config_limits_arg, long channel_options_arg, boolean accept_forwards_to_priv_channels_arg);
+ // bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+ public static native boolean UserConfig_get_accept_inbound_channels(long this_ptr);
+ // void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+ public static native void UserConfig_set_accept_inbound_channels(long this_ptr, boolean val);
+ // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg);
+ public static native long UserConfig_new(long own_channel_config_arg, long peer_channel_config_limits_arg, long channel_options_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg);
// uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg);
public static native long UserConfig_clone_ptr(long arg);
// struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
public static native byte[] ChannelMonitorUpdate_write(long obj);
// struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
public static native long ChannelMonitorUpdate_read(byte[] ser);
- // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
- public static native void MonitorUpdateError_free(long this_obj);
- // struct LDKStr MonitorUpdateError_get_a(const struct LDKMonitorUpdateError *NONNULL_PTR this_ptr);
- public static native String MonitorUpdateError_get_a(long this_ptr);
- // void MonitorUpdateError_set_a(struct LDKMonitorUpdateError *NONNULL_PTR this_ptr, struct LDKStr val);
- public static native void MonitorUpdateError_set_a(long this_ptr, String val);
- // MUST_USE_RES struct LDKMonitorUpdateError MonitorUpdateError_new(struct LDKStr a_arg);
- public static native long MonitorUpdateError_new(String a_arg);
- // uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg);
- public static native long MonitorUpdateError_clone_ptr(long arg);
- // struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
- public static native long MonitorUpdateError_clone(long orig);
// void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
public static native void MonitorEvent_free(long this_ptr);
// uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg);
public static native long ChannelMonitor_clone(long orig);
// struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
public static native byte[] ChannelMonitor_write(long obj);
- // MUST_USE_RES struct LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+ // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
public static native long ChannelMonitor_update_monitor(long this_arg, long updates, long broadcaster, long fee_estimator, long logger);
// MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
public static native long ChannelMonitor_get_latest_update_id(long this_arg);
public static native long InMemorySigner_funding_outpoint(long this_arg);
// MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
public static native long InMemorySigner_get_channel_parameters(long this_arg);
+ // MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ public static native boolean InMemorySigner_opt_anchors(long this_arg);
// MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
public static native long InMemorySigner_sign_counterparty_payment_input(long this_arg, byte[] spend_tx, long input_idx, long descriptor);
// MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
public static native long ChannelDetails_get_user_channel_id(long this_ptr);
// void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
public static native void ChannelDetails_set_user_channel_id(long this_ptr, long val);
+ // uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+ public static native long ChannelDetails_get_balance_msat(long this_ptr);
+ // void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+ public static native void ChannelDetails_set_balance_msat(long this_ptr, long val);
// uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
public static native long ChannelDetails_get_outbound_capacity_msat(long this_ptr);
// void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
public static native boolean ChannelDetails_get_is_public(long this_ptr);
// void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
public static native void ChannelDetails_set_is_public(long this_ptr, boolean val);
- // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
- public static native long ChannelDetails_new(byte[] channel_id_arg, long counterparty_arg, long funding_txo_arg, long short_channel_id_arg, long channel_value_satoshis_arg, long unspendable_punishment_reserve_arg, long user_channel_id_arg, long outbound_capacity_msat_arg, long inbound_capacity_msat_arg, long confirmations_required_arg, long force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg);
+ // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
+ public static native long ChannelDetails_new(byte[] channel_id_arg, long counterparty_arg, long funding_txo_arg, long short_channel_id_arg, long channel_value_satoshis_arg, long unspendable_punishment_reserve_arg, long user_channel_id_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long inbound_capacity_msat_arg, long confirmations_required_arg, long force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg);
// uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg);
public static native long ChannelDetails_clone_ptr(long arg);
// struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
public static native long ChannelManager_send_payment(long this_arg, long route, byte[] payment_hash, byte[] payment_secret);
// MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
public static native long ChannelManager_retry_payment(long this_arg, long route, byte[] payment_id);
+ // void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
+ public static native void ChannelManager_abandon_payment(long this_arg, byte[] payment_id);
// MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
public static native long ChannelManager_send_spontaneous_payment(long this_arg, long route, byte[] payment_preimage);
// MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKTransaction funding_transaction);
public static native boolean ChannelManager_claim_funds(long this_arg, byte[] payment_preimage);
// MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
public static native byte[] ChannelManager_get_our_node_id(long this_arg);
- // MUST_USE_RES struct LDKC2Tuple_PaymentHashPaymentSecretZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, uint64_t user_payment_id);
- public static native long ChannelManager_create_inbound_payment(long this_arg, long min_value_msat, int invoice_expiry_delta_secs, long user_payment_id);
- // MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, uint64_t user_payment_id);
- public static native long ChannelManager_create_inbound_payment_for_hash(long this_arg, byte[] payment_hash, long min_value_msat, int invoice_expiry_delta_secs, long user_payment_id);
+ // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+ public static native long ChannelManager_create_inbound_payment(long this_arg, long min_value_msat, int invoice_expiry_delta_secs);
+ // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ChannelManager_create_inbound_payment_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+ public static native long ChannelManager_create_inbound_payment_legacy(long this_arg, long min_value_msat, int invoice_expiry_delta_secs);
+ // MUST_USE_RES struct LDKCResult_PaymentSecretNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+ public static native long ChannelManager_create_inbound_payment_for_hash(long this_arg, byte[] payment_hash, long min_value_msat, int invoice_expiry_delta_secs);
+ // MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+ public static native long ChannelManager_create_inbound_payment_for_hash_legacy(long this_arg, byte[] payment_hash, long min_value_msat, int invoice_expiry_delta_secs);
+ // MUST_USE_RES struct LDKCResult_PaymentPreimageAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
+ public static native long ChannelManager_get_payment_preimage(long this_arg, byte[] payment_hash, byte[] payment_secret);
// struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
public static native long ChannelManager_as_MessageSendEventsProvider(long this_arg);
// struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
public static native byte OpenChannel_get_channel_flags(long this_ptr);
// void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
public static native void OpenChannel_set_channel_flags(long this_ptr, byte val);
+ // struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+ public static native long OpenChannel_get_channel_type(long this_ptr);
+ // void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+ public static native void OpenChannel_set_channel_type(long this_ptr, long val);
// uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg);
public static native long OpenChannel_clone_ptr(long arg);
// struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
public static native long NetAddress_ipv4(byte[] addr, short port);
// struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
public static native long NetAddress_ipv6(byte[] addr, short port);
- // struct LDKNetAddress NetAddress_onion_v2(struct LDKTenBytes addr, uint16_t port);
- public static native long NetAddress_onion_v2(byte[] addr, short port);
+ // struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
+ public static native long NetAddress_onion_v2(byte[] a);
// struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
public static native long NetAddress_onion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port);
// struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
public static native long ErrorAction_ignore_error();
// struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
public static native long ErrorAction_ignore_and_log(Level a);
+ // struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
+ public static native long ErrorAction_ignore_duplicate_gossip();
// struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
public static native long ErrorAction_send_error_message(long msg);
// void LightningError_free(struct LDKLightningError this_obj);
public static native void PeerManager_disconnect_all_peers(long this_arg);
// void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
public static native void PeerManager_timer_tick_occurred(long this_arg);
+ // uint64_t htlc_success_tx_weight(bool opt_anchors);
+ public static native long htlc_success_tx_weight(boolean opt_anchors);
+ // uint64_t htlc_timeout_tx_weight(bool opt_anchors);
+ public static native long htlc_timeout_tx_weight(boolean opt_anchors);
// struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
public static native byte[] build_commitment_secret(byte[] commitment_seed, long idx);
// struct LDKTransaction build_closing_transaction(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
public static native byte[] HTLCOutputInCommitment_write(long obj);
// struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
public static native long HTLCOutputInCommitment_read(byte[] ser);
- // struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
- public static native byte[] get_htlc_redeemscript(long htlc, long keys);
+ // struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
+ public static native byte[] get_htlc_redeemscript(long htlc, boolean opt_anchors, long keys);
// struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
public static native byte[] make_funding_redeemscript(byte[] broadcaster, byte[] countersignatory);
- // struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
- public static native byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, long htlc, byte[] broadcaster_delayed_payment_key, byte[] revocation_key);
+ // struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
+ public static native byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, long htlc, boolean opt_anchors, byte[] broadcaster_delayed_payment_key, byte[] revocation_key);
+ // struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
+ public static native byte[] get_anchor_redeemscript(byte[] funding_pubkey);
// void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
public static native void ChannelTransactionParameters_free(long this_obj);
// struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
public static native long ChannelTransactionParameters_get_funding_outpoint(long this_ptr);
// void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
public static native void ChannelTransactionParameters_set_funding_outpoint(long this_ptr, long val);
- // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg);
- public static native long ChannelTransactionParameters_new(long holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, long counterparty_parameters_arg, long funding_outpoint_arg);
+ // enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
+ public static native COption_NoneZ ChannelTransactionParameters_get_opt_anchors(long this_ptr);
+ // void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
+ public static native void ChannelTransactionParameters_set_opt_anchors(long this_ptr, COption_NoneZ val);
+ // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, enum LDKCOption_NoneZ opt_anchors_arg);
+ public static native long ChannelTransactionParameters_new(long holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, long counterparty_parameters_arg, long funding_outpoint_arg, COption_NoneZ opt_anchors_arg);
// uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg);
public static native long ChannelTransactionParameters_clone_ptr(long arg);
// struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
public static native boolean DirectedChannelTransactionParameters_is_outbound(long this_arg);
// MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
public static native long DirectedChannelTransactionParameters_funding_outpoint(long this_arg);
+ // MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
+ public static native boolean DirectedChannelTransactionParameters_opt_anchors(long this_arg);
// void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
public static native void HolderCommitmentTransaction_free(long this_obj);
// struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
public static native long TrustedCommitmentTransaction_built_transaction(long this_arg);
// MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
public static native long TrustedCommitmentTransaction_keys(long this_arg);
+ // MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
+ public static native boolean TrustedCommitmentTransaction_opt_anchors(long this_arg);
// MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters);
public static native long TrustedCommitmentTransaction_get_htlc_sigs(long this_arg, byte[] htlc_base_key, long channel_parameters);
// uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
public static native boolean ChannelFeatures_eq(long a, long b);
// bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
public static native boolean InvoiceFeatures_eq(long a, long b);
+ // bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
+ public static native boolean ChannelTypeFeatures_eq(long a, long b);
// uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg);
public static native long InitFeatures_clone_ptr(long arg);
// struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
public static native long InvoiceFeatures_clone_ptr(long arg);
// struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
public static native long InvoiceFeatures_clone(long orig);
+ // uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg);
+ public static native long ChannelTypeFeatures_clone_ptr(long arg);
+ // struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
+ public static native long ChannelTypeFeatures_clone(long orig);
// void InitFeatures_free(struct LDKInitFeatures this_obj);
public static native void InitFeatures_free(long this_obj);
// void NodeFeatures_free(struct LDKNodeFeatures this_obj);
public static native void ChannelFeatures_free(long this_obj);
// void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
public static native void InvoiceFeatures_free(long this_obj);
+ // void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
+ public static native void ChannelTypeFeatures_free(long this_obj);
// MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
public static native long InitFeatures_empty();
// MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
public static native long InvoiceFeatures_known();
// MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
public static native boolean InvoiceFeatures_requires_unknown_bits(long this_arg);
- // MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
- public static native boolean InitFeatures_supports_payment_secret(long this_arg);
- // MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
- public static native boolean NodeFeatures_supports_payment_secret(long this_arg);
- // MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
- public static native boolean InvoiceFeatures_supports_payment_secret(long this_arg);
+ // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
+ public static native long ChannelTypeFeatures_empty();
+ // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
+ public static native long ChannelTypeFeatures_known();
+ // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+ public static native boolean ChannelTypeFeatures_requires_unknown_bits(long this_arg);
// struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
public static native byte[] InitFeatures_write(long obj);
- // struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
- public static native byte[] NodeFeatures_write(long obj);
- // struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
- public static native byte[] ChannelFeatures_write(long obj);
- // struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
- public static native byte[] InvoiceFeatures_write(long obj);
// struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
public static native long InitFeatures_read(byte[] ser);
- // struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
- public static native long NodeFeatures_read(byte[] ser);
+ // struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
+ public static native byte[] ChannelFeatures_write(long obj);
// struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
public static native long ChannelFeatures_read(byte[] ser);
+ // struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
+ public static native byte[] NodeFeatures_write(long obj);
+ // struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
+ public static native long NodeFeatures_read(byte[] ser);
+ // struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
+ public static native byte[] InvoiceFeatures_write(long obj);
// struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
public static native long InvoiceFeatures_read(byte[] ser);
+ // struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
+ public static native byte[] ChannelTypeFeatures_write(long obj);
+ // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
+ public static native long ChannelTypeFeatures_read(byte[] ser);
// void ShutdownScript_free(struct LDKShutdownScript this_obj);
public static native void ShutdownScript_free(long this_obj);
// uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg);
public static native long Type_clone(long orig);
// void Type_free(struct LDKType this_ptr);
public static native void Type_free(long this_ptr);
- // void Score_free(struct LDKScore this_ptr);
- public static native void Score_free(long this_ptr);
- // void LockableScore_free(struct LDKLockableScore this_obj);
- public static native void LockableScore_free(long this_obj);
- // MUST_USE_RES struct LDKLockableScore LockableScore_new(struct LDKScore score);
- public static native long LockableScore_new(long score);
- // struct LDKCVec_u8Z LockableScore_write(const struct LDKLockableScore *NONNULL_PTR obj);
- public static native byte[] LockableScore_write(long obj);
// void NodeId_free(struct LDKNodeId this_obj);
public static native void NodeId_free(long this_obj);
// uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg);
public static native long ChannelInfo_get_announcement_message(long this_ptr);
// void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
public static native void ChannelInfo_set_announcement_message(long this_ptr, long val);
- // MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKNodeId node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKNodeId node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg);
- public static native long ChannelInfo_new(long features_arg, long node_one_arg, long one_to_two_arg, long node_two_arg, long two_to_one_arg, long capacity_sats_arg, long announcement_message_arg);
// uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg);
public static native long ChannelInfo_clone_ptr(long arg);
// struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
public static native void NetworkGraph_close_channel_from_update(long this_arg, long short_channel_id, boolean is_permanent);
// void NetworkGraph_fail_node(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
public static native void NetworkGraph_fail_node(long this_arg, byte[] _node_id, boolean is_permanent);
+ // void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
+ public static native void NetworkGraph_remove_stale_channels_with_time(long this_arg, long current_time_unix);
// MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
public static native long NetworkGraph_update_channel(long this_arg, long msg);
// MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
public static native long RouteHintHop_read(byte[] ser);
// struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR params, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer);
public static native long find_route(byte[] our_node_pubkey, long params, long network, long[] first_hops, long logger, long scorer);
+ // void Score_free(struct LDKScore this_ptr);
+ public static native void Score_free(long this_ptr);
+ // void LockableScore_free(struct LDKLockableScore this_ptr);
+ public static native void LockableScore_free(long this_ptr);
+ // void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
+ public static native void MultiThreadedLockableScore_free(long this_obj);
+ // MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
+ public static native long MultiThreadedLockableScore_new(long score);
// void Scorer_free(struct LDKScorer this_obj);
public static native void Scorer_free(long this_obj);
// void ScoringParameters_free(struct LDKScoringParameters this_obj);
public static native long ScoringParameters_get_failure_penalty_msat(long this_ptr);
// void ScoringParameters_set_failure_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
public static native void ScoringParameters_set_failure_penalty_msat(long this_ptr, long val);
+ // uint16_t ScoringParameters_get_overuse_penalty_start_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+ public static native short ScoringParameters_get_overuse_penalty_start_1024th(long this_ptr);
+ // void ScoringParameters_set_overuse_penalty_start_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint16_t val);
+ public static native void ScoringParameters_set_overuse_penalty_start_1024th(long this_ptr, short val);
+ // uint64_t ScoringParameters_get_overuse_penalty_msat_per_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+ public static native long ScoringParameters_get_overuse_penalty_msat_per_1024th(long this_ptr);
+ // void ScoringParameters_set_overuse_penalty_msat_per_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+ public static native void ScoringParameters_set_overuse_penalty_msat_per_1024th(long this_ptr, long val);
// uint64_t ScoringParameters_get_failure_penalty_half_life(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
public static native long ScoringParameters_get_failure_penalty_half_life(long this_ptr);
// void ScoringParameters_set_failure_penalty_half_life(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
public static native void ScoringParameters_set_failure_penalty_half_life(long this_ptr, long val);
- // MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint64_t failure_penalty_half_life_arg);
- public static native long ScoringParameters_new(long base_penalty_msat_arg, long failure_penalty_msat_arg, long failure_penalty_half_life_arg);
+ // MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint16_t overuse_penalty_start_1024th_arg, uint64_t overuse_penalty_msat_per_1024th_arg, uint64_t failure_penalty_half_life_arg);
+ public static native long ScoringParameters_new(long base_penalty_msat_arg, long failure_penalty_msat_arg, short overuse_penalty_start_1024th_arg, long overuse_penalty_msat_per_1024th_arg, long failure_penalty_half_life_arg);
// struct LDKCVec_u8Z ScoringParameters_write(const struct LDKScoringParameters *NONNULL_PTR obj);
public static native byte[] ScoringParameters_write(long obj);
// struct LDKCResult_ScoringParametersDecodeErrorZ ScoringParameters_read(struct LDKu8slice ser);
public static native CreationError CreationError_timestamp_out_of_bounds();
// enum LDKCreationError CreationError_expiry_time_out_of_bounds(void);
public static native CreationError CreationError_expiry_time_out_of_bounds();
+ // enum LDKCreationError CreationError_invalid_amount(void);
+ public static native CreationError CreationError_invalid_amount();
// bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
public static native boolean CreationError_eq(long a, long b);
// struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
public static native long PaymentError_routing(long a);
// struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
public static native long PaymentError_sending(long a);
- // MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts);
+ // MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts);
public static native long InvoicePayer_new(long payer, long router, long scorer, long logger, long event_handler, long retry_attempts);
// MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
public static native long InvoicePayer_pay_invoice(long this_arg, long invoice);
// MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_zero_value_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats);
public static native long InvoicePayer_pay_zero_value_invoice(long this_arg, long invoice, long amount_msats);
+ // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_pubkey(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, uint64_t amount_msats, uint32_t final_cltv_expiry_delta);
+ public static native long InvoicePayer_pay_pubkey(long this_arg, byte[] pubkey, byte[] payment_preimage, long amount_msats, int final_cltv_expiry_delta);
// void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
public static native void InvoicePayer_remove_cached_payment(long this_arg, byte[] payment_hash);
// struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
long clone_ptr() {
long ret = bindings.APIError_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public APIError clone() {
long ret = bindings.APIError_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static APIError apimisuse_error(java.lang.String err) {
long ret = bindings.APIError_apimisuse_error(err);
+ Reference.reachabilityFence(err);
if (ret >= 0 && ret <= 4096) { return null; }
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static APIError fee_rate_too_high(java.lang.String err, int feerate) {
long ret = bindings.APIError_fee_rate_too_high(err, feerate);
+ Reference.reachabilityFence(err);
+ Reference.reachabilityFence(feerate);
if (ret >= 0 && ret <= 4096) { return null; }
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static APIError route_error(java.lang.String err) {
long ret = bindings.APIError_route_error(err);
+ Reference.reachabilityFence(err);
if (ret >= 0 && ret <= 4096) { return null; }
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static APIError channel_unavailable(java.lang.String err) {
long ret = bindings.APIError_channel_unavailable(err);
+ Reference.reachabilityFence(err);
if (ret >= 0 && ret <= 4096) { return null; }
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static APIError incompatible_shutdown_script(ShutdownScript script) {
long ret = bindings.APIError_incompatible_shutdown_script(script == null ? 0 : script.ptr & ~1);
+ Reference.reachabilityFence(script);
if (ret >= 0 && ret <= 4096) { return null; }
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_temporary_channel_id() {
byte[] ret = bindings.AcceptChannel_get_temporary_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_temporary_channel_id(byte[] val) {
bindings.AcceptChannel_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_dust_limit_satoshis() {
long ret = bindings.AcceptChannel_get_dust_limit_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_dust_limit_satoshis(long val) {
bindings.AcceptChannel_set_dust_limit_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_max_htlc_value_in_flight_msat() {
long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_max_htlc_value_in_flight_msat(long val) {
bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_channel_reserve_satoshis() {
long ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_reserve_satoshis(long val) {
bindings.AcceptChannel_set_channel_reserve_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_htlc_minimum_msat() {
long ret = bindings.AcceptChannel_get_htlc_minimum_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_minimum_msat(long val) {
bindings.AcceptChannel_set_htlc_minimum_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_minimum_depth() {
int ret = bindings.AcceptChannel_get_minimum_depth(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_minimum_depth(int val) {
bindings.AcceptChannel_set_minimum_depth(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_to_self_delay() {
short ret = bindings.AcceptChannel_get_to_self_delay(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_to_self_delay(short val) {
bindings.AcceptChannel_set_to_self_delay(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_max_accepted_htlcs() {
short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_max_accepted_htlcs(short val) {
bindings.AcceptChannel_set_max_accepted_htlcs(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_funding_pubkey() {
byte[] ret = bindings.AcceptChannel_get_funding_pubkey(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_funding_pubkey(byte[] val) {
bindings.AcceptChannel_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_revocation_basepoint() {
byte[] ret = bindings.AcceptChannel_get_revocation_basepoint(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_revocation_basepoint(byte[] val) {
bindings.AcceptChannel_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_payment_point() {
byte[] ret = bindings.AcceptChannel_get_payment_point(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_payment_point(byte[] val) {
bindings.AcceptChannel_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_delayed_payment_basepoint() {
byte[] ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_delayed_payment_basepoint(byte[] val) {
bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_htlc_basepoint() {
byte[] ret = bindings.AcceptChannel_get_htlc_basepoint(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_basepoint(byte[] val) {
bindings.AcceptChannel_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_first_per_commitment_point() {
byte[] ret = bindings.AcceptChannel_get_first_per_commitment_point(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_first_per_commitment_point(byte[] val) {
bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.AcceptChannel_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public AcceptChannel clone() {
long ret = bindings.AcceptChannel_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new AcceptChannel(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.AcceptChannel_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_AcceptChannelDecodeErrorZ read(byte[] ser) {
long ret = bindings.AcceptChannel_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) {
long ret = bindings.Access_get_utxo(this.ptr, InternalUtils.check_arr_len(genesis_hash, 32), short_channel_id);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(genesis_hash);
+ Reference.reachabilityFence(short_channel_id);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.AnnouncementSignatures_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.AnnouncementSignatures_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_short_channel_id() {
long ret = bindings.AnnouncementSignatures_get_short_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_short_channel_id(long val) {
bindings.AnnouncementSignatures_set_short_channel_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_node_signature() {
byte[] ret = bindings.AnnouncementSignatures_get_node_signature(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_node_signature(byte[] val) {
bindings.AnnouncementSignatures_set_node_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_bitcoin_signature() {
byte[] ret = bindings.AnnouncementSignatures_get_bitcoin_signature(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_bitcoin_signature(byte[] val) {
bindings.AnnouncementSignatures_set_bitcoin_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static AnnouncementSignatures of(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg) {
long ret = bindings.AnnouncementSignatures_new(InternalUtils.check_arr_len(channel_id_arg, 32), short_channel_id_arg, InternalUtils.check_arr_len(node_signature_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_arg, 64));
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(short_channel_id_arg);
+ Reference.reachabilityFence(node_signature_arg);
+ Reference.reachabilityFence(bitcoin_signature_arg);
if (ret >= 0 && ret <= 4096) { return null; }
AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new AnnouncementSignatures(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.AnnouncementSignatures_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public AnnouncementSignatures clone() {
long ret = bindings.AnnouncementSignatures_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new AnnouncementSignatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.AnnouncementSignatures_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_AnnouncementSignaturesDecodeErrorZ read(byte[] ser) {
long ret = bindings.AnnouncementSignatures_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
* [`ChannelManager`] persistence should be done in the background.
* Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
* at the appropriate intervals.
+ * Calling [`NetworkGraph::remove_stale_channels`] (if a [`NetGraphMsgHandler`] is provided to
+ * [`BackgroundProcessor::start`]).
*
* It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
* upon as doing so may result in high latency.
* functionality implemented by other handlers.
* [`NetGraphMsgHandler`] if given will update the [`NetworkGraph`] based on payment failures.
*
- * [top-level documentation]: Self
+ * [top-level documentation]: BackgroundProcessor
* [`join`]: Self::join
* [`stop`]: Self::stop
* [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
*/
public static BackgroundProcessor start(ChannelManagerPersister persister, EventHandler event_handler, ChainMonitor chain_monitor, ChannelManager channel_manager, @Nullable NetGraphMsgHandler net_graph_msg_handler, PeerManager peer_manager, Logger logger) {
long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr & ~1, channel_manager == null ? 0 : channel_manager.ptr & ~1, net_graph_msg_handler == null ? 0 : net_graph_msg_handler.ptr & ~1, peer_manager == null ? 0 : peer_manager.ptr & ~1, logger == null ? 0 : logger.ptr);
+ Reference.reachabilityFence(persister);
+ Reference.reachabilityFence(event_handler);
+ Reference.reachabilityFence(chain_monitor);
+ Reference.reachabilityFence(channel_manager);
+ Reference.reachabilityFence(net_graph_msg_handler);
+ Reference.reachabilityFence(peer_manager);
+ Reference.reachabilityFence(logger);
if (ret >= 0 && ret <= 4096) { return null; }
BackgroundProcessor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BackgroundProcessor(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public Result_NoneErrorZ join() {
long ret = bindings.BackgroundProcessor_join(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(this);
*/
public Result_NoneErrorZ stop() {
long ret = bindings.BackgroundProcessor_stop(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
long clone_ptr() {
long ret = bindings.Balance_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Balance clone() {
long ret = bindings.Balance_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static Balance claimable_on_channel_close(long claimable_amount_satoshis) {
long ret = bindings.Balance_claimable_on_channel_close(claimable_amount_satoshis);
+ Reference.reachabilityFence(claimable_amount_satoshis);
if (ret >= 0 && ret <= 4096) { return null; }
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Balance claimable_awaiting_confirmations(long claimable_amount_satoshis, int confirmation_height) {
long ret = bindings.Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
+ Reference.reachabilityFence(claimable_amount_satoshis);
+ Reference.reachabilityFence(confirmation_height);
if (ret >= 0 && ret <= 4096) { return null; }
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Balance contentious_claimable(long claimable_amount_satoshis, int timeout_height) {
long ret = bindings.Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
+ Reference.reachabilityFence(claimable_amount_satoshis);
+ Reference.reachabilityFence(timeout_height);
if (ret >= 0 && ret <= 4096) { return null; }
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Balance maybe_claimable_htlcawaiting_timeout(long claimable_amount_satoshis, int claimable_height) {
long ret = bindings.Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height);
+ Reference.reachabilityFence(claimable_amount_satoshis);
+ Reference.reachabilityFence(claimable_height);
if (ret >= 0 && ret <= 4096) { return null; }
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public boolean eq(Balance b) {
boolean ret = bindings.Balance_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Balance)) return false;
+ return this.eq((Balance)o);
+ }
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public byte[] get_per_commitment_point(long idx) {
byte[] ret = bindings.BaseSign_get_per_commitment_point(this.ptr, idx);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(idx);
return ret;
}
*/
public byte[] release_commitment_secret(long idx) {
byte[] ret = bindings.BaseSign_release_commitment_secret(this.ptr, idx);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(idx);
return ret;
}
*/
public Result_NoneNoneZ validate_holder_commitment(HolderCommitmentTransaction holder_tx) {
long ret = bindings.BaseSign_validate_holder_commitment(this.ptr, holder_tx == null ? 0 : holder_tx.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(holder_tx);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(holder_tx);
*/
public byte[] channel_keys_id() {
byte[] ret = bindings.BaseSign_channel_keys_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx) {
long ret = bindings.BaseSign_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(commitment_tx);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(commitment_tx);
*/
public Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret) {
long ret = bindings.BaseSign_validate_counterparty_revocation(this.ptr, idx, InternalUtils.check_arr_len(secret, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(idx);
+ Reference.reachabilityFence(secret);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx) {
long ret = bindings.BaseSign_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(commitment_tx);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(commitment_tx);
*/
public Result_SignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) {
long ret = bindings.BaseSign_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(justice_tx);
+ Reference.reachabilityFence(input);
+ Reference.reachabilityFence(amount);
+ Reference.reachabilityFence(per_commitment_key);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc) {
long ret = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32), htlc == null ? 0 : htlc.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(justice_tx);
+ Reference.reachabilityFence(input);
+ Reference.reachabilityFence(amount);
+ Reference.reachabilityFence(per_commitment_key);
+ Reference.reachabilityFence(htlc);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(htlc);
*/
public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc) {
long ret = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, InternalUtils.check_arr_len(per_commitment_point, 33), htlc == null ? 0 : htlc.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(htlc_tx);
+ Reference.reachabilityFence(input);
+ Reference.reachabilityFence(amount);
+ Reference.reachabilityFence(per_commitment_point);
+ Reference.reachabilityFence(htlc);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(htlc);
*/
public Result_SignatureNoneZ sign_closing_transaction(ClosingTransaction closing_tx) {
long ret = bindings.BaseSign_sign_closing_transaction(this.ptr, closing_tx == null ? 0 : closing_tx.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(closing_tx);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(closing_tx);
*/
public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) {
long ret = bindings.BaseSign_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
*/
public void ready_channel(ChannelTransactionParameters channel_parameters) {
bindings.BaseSign_ready_channel(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(channel_parameters);
this.ptrs_to.add(channel_parameters);
}
*/
public ChannelPublicKeys get_pubkeys() {
long ret = bindings.BaseSign_get_pubkeys(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.BestBlock_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public BestBlock clone() {
long ret = bindings.BestBlock_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public static BestBlock from_genesis(org.ldk.enums.Network network) {
long ret = bindings.BestBlock_from_genesis(network);
+ Reference.reachabilityFence(network);
if (ret >= 0 && ret <= 4096) { return null; }
BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static BestBlock of(byte[] block_hash, int height) {
long ret = bindings.BestBlock_new(InternalUtils.check_arr_len(block_hash, 32), height);
+ Reference.reachabilityFence(block_hash);
+ Reference.reachabilityFence(height);
if (ret >= 0 && ret <= 4096) { return null; }
BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public byte[] block_hash() {
byte[] ret = bindings.BestBlock_block_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public int height() {
int ret = bindings.BestBlock_height(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public void broadcast_transaction(byte[] tx) {
bindings.BroadcasterInterface_broadcast_transaction(this.ptr, tx);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(tx);
}
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_transaction() {
byte[] ret = bindings.BuiltCommitmentTransaction_get_transaction(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_transaction(byte[] val) {
bindings.BuiltCommitmentTransaction_set_transaction(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_txid() {
byte[] ret = bindings.BuiltCommitmentTransaction_get_txid(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_txid(byte[] val) {
bindings.BuiltCommitmentTransaction_set_txid(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static BuiltCommitmentTransaction of(byte[] transaction_arg, byte[] txid_arg) {
long ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, InternalUtils.check_arr_len(txid_arg, 32));
+ Reference.reachabilityFence(transaction_arg);
+ Reference.reachabilityFence(txid_arg);
if (ret >= 0 && ret <= 4096) { return null; }
BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BuiltCommitmentTransaction(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.BuiltCommitmentTransaction_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public BuiltCommitmentTransaction clone() {
long ret = bindings.BuiltCommitmentTransaction_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BuiltCommitmentTransaction(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.BuiltCommitmentTransaction_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_BuiltCommitmentTransactionDecodeErrorZ read(byte[] ser) {
long ret = bindings.BuiltCommitmentTransaction_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public byte[] get_sighash_all(byte[] funding_redeemscript, long channel_value_satoshis) {
byte[] ret = bindings.BuiltCommitmentTransaction_get_sighash_all(this.ptr, funding_redeemscript, channel_value_satoshis);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(funding_redeemscript);
+ Reference.reachabilityFence(channel_value_satoshis);
return ret;
}
*/
public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) {
byte[] ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(funding_key);
+ Reference.reachabilityFence(funding_redeemscript);
+ Reference.reachabilityFence(channel_value_satoshis);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static ChainMonitor of(Option_FilterZ chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) {
long ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr);
+ Reference.reachabilityFence(chain_source);
+ Reference.reachabilityFence(broadcaster);
+ Reference.reachabilityFence(logger);
+ Reference.reachabilityFence(feeest);
+ Reference.reachabilityFence(persister);
if (ret >= 0 && ret <= 4096) { return null; }
ChainMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChainMonitor(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public Balance[] get_claimable_balances(ChannelDetails[] ignored_channels) {
long[] ret = bindings.ChainMonitor_get_claimable_balances(this.ptr, ignored_channels != null ? Arrays.stream(ignored_channels).mapToLong(ignored_channels_conv_16 -> ignored_channels_conv_16 == null ? 0 : ignored_channels_conv_16.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(ignored_channels);
Balance[] ret_conv_9_arr = new Balance[ret.length];
for (int j = 0; j < ret.length; j++) {
long ret_conv_9 = ret[j];
*/
public Result_LockedChannelMonitorNoneZ get_monitor(OutPoint funding_txo) {
long ret = bindings.ChainMonitor_get_monitor(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(funding_txo);
if (ret >= 0 && ret <= 4096) { return null; }
Result_LockedChannelMonitorNoneZ ret_hu_conv = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public OutPoint[] list_monitors() {
long[] ret = bindings.ChainMonitor_list_monitors(this.ptr);
+ Reference.reachabilityFence(this);
OutPoint[] ret_conv_10_arr = new OutPoint[ret.length];
for (int k = 0; k < ret.length; k++) {
long ret_conv_10 = ret[k];
*/
public Result_NoneAPIErrorZ channel_monitor_updated(OutPoint funding_txo, MonitorUpdateId completed_update_id) {
long ret = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, completed_update_id == null ? 0 : completed_update_id.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(funding_txo);
+ Reference.reachabilityFence(completed_update_id);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Listen as_Listen() {
long ret = bindings.ChainMonitor_as_Listen(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Listen ret_hu_conv = new Listen(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public Confirm as_Confirm() {
long ret = bindings.ChainMonitor_as_Confirm(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Confirm ret_hu_conv = new Confirm(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public Watch as_Watch() {
long ret = bindings.ChainMonitor_as_Watch(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Watch ret_hu_conv = new Watch(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public EventsProvider as_EventsProvider() {
long ret = bindings.ChainMonitor_as_EventsProvider(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
EventsProvider ret_hu_conv = new EventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public Network get_network() {
Network ret = bindings.ChainParameters_get_network(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_network(org.ldk.enums.Network val) {
bindings.ChainParameters_set_network(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public BestBlock get_best_block() {
long ret = bindings.ChainParameters_get_best_block(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_best_block(BestBlock val) {
bindings.ChainParameters_set_best_block(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ChainParameters of(org.ldk.enums.Network network_arg, BestBlock best_block_arg) {
long ret = bindings.ChainParameters_new(network_arg, best_block_arg == null ? 0 : best_block_arg.ptr & ~1);
+ Reference.reachabilityFence(network_arg);
+ Reference.reachabilityFence(best_block_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ChainParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChainParameters(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ChainParameters_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChainParameters clone() {
long ret = bindings.ChainParameters_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChainParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChainParameters(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_node_signature_1() {
byte[] ret = bindings.ChannelAnnouncement_get_node_signature_1(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_node_signature_1(byte[] val) {
bindings.ChannelAnnouncement_set_node_signature_1(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_node_signature_2() {
byte[] ret = bindings.ChannelAnnouncement_get_node_signature_2(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_node_signature_2(byte[] val) {
bindings.ChannelAnnouncement_set_node_signature_2(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_bitcoin_signature_1() {
byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_1(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_bitcoin_signature_1(byte[] val) {
bindings.ChannelAnnouncement_set_bitcoin_signature_1(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_bitcoin_signature_2() {
byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_2(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_bitcoin_signature_2(byte[] val) {
bindings.ChannelAnnouncement_set_bitcoin_signature_2(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public UnsignedChannelAnnouncement get_contents() {
long ret = bindings.ChannelAnnouncement_get_contents(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_contents(UnsignedChannelAnnouncement val) {
bindings.ChannelAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ChannelAnnouncement of(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) {
long ret = bindings.ChannelAnnouncement_new(InternalUtils.check_arr_len(node_signature_1_arg, 64), InternalUtils.check_arr_len(node_signature_2_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_1_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_2_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1);
+ Reference.reachabilityFence(node_signature_1_arg);
+ Reference.reachabilityFence(node_signature_2_arg);
+ Reference.reachabilityFence(bitcoin_signature_1_arg);
+ Reference.reachabilityFence(bitcoin_signature_2_arg);
+ Reference.reachabilityFence(contents_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ChannelAnnouncement_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelAnnouncement clone() {
long ret = bindings.ChannelAnnouncement_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ChannelAnnouncement_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ChannelAnnouncementDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelAnnouncement_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public int get_forwarding_fee_proportional_millionths() {
int ret = bindings.ChannelConfig_get_forwarding_fee_proportional_millionths(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_forwarding_fee_proportional_millionths(int val) {
bindings.ChannelConfig_set_forwarding_fee_proportional_millionths(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_forwarding_fee_base_msat() {
int ret = bindings.ChannelConfig_get_forwarding_fee_base_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_forwarding_fee_base_msat(int val) {
bindings.ChannelConfig_set_forwarding_fee_base_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_cltv_expiry_delta() {
short ret = bindings.ChannelConfig_get_cltv_expiry_delta(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_cltv_expiry_delta(short val) {
bindings.ChannelConfig_set_cltv_expiry_delta(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_announced_channel() {
boolean ret = bindings.ChannelConfig_get_announced_channel(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_announced_channel(boolean val) {
bindings.ChannelConfig_set_announced_channel(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_commit_upfront_shutdown_pubkey() {
boolean ret = bindings.ChannelConfig_get_commit_upfront_shutdown_pubkey(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_commit_upfront_shutdown_pubkey(boolean val) {
bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_max_dust_htlc_exposure_msat() {
long ret = bindings.ChannelConfig_get_max_dust_htlc_exposure_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_max_dust_htlc_exposure_msat(long val) {
bindings.ChannelConfig_set_max_dust_htlc_exposure_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_force_close_avoidance_max_fee_satoshis() {
long ret = bindings.ChannelConfig_get_force_close_avoidance_max_fee_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_force_close_avoidance_max_fee_satoshis(long val) {
bindings.ChannelConfig_set_force_close_avoidance_max_fee_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ChannelConfig of(int forwarding_fee_proportional_millionths_arg, int forwarding_fee_base_msat_arg, short cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg, long max_dust_htlc_exposure_msat_arg, long force_close_avoidance_max_fee_satoshis_arg) {
long ret = bindings.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg);
+ Reference.reachabilityFence(forwarding_fee_proportional_millionths_arg);
+ Reference.reachabilityFence(forwarding_fee_base_msat_arg);
+ Reference.reachabilityFence(cltv_expiry_delta_arg);
+ Reference.reachabilityFence(announced_channel_arg);
+ Reference.reachabilityFence(commit_upfront_shutdown_pubkey_arg);
+ Reference.reachabilityFence(max_dust_htlc_exposure_msat_arg);
+ Reference.reachabilityFence(force_close_avoidance_max_fee_satoshis_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelConfig(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ChannelConfig_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelConfig clone() {
long ret = bindings.ChannelConfig_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelConfig(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ChannelConfig_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ChannelConfigDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelConfig_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_node_id() {
byte[] ret = bindings.ChannelCounterparty_get_node_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_node_id(byte[] val) {
bindings.ChannelCounterparty_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public InitFeatures get_features() {
long ret = bindings.ChannelCounterparty_get_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_features(InitFeatures val) {
bindings.ChannelCounterparty_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_unspendable_punishment_reserve() {
long ret = bindings.ChannelCounterparty_get_unspendable_punishment_reserve(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_unspendable_punishment_reserve(long val) {
bindings.ChannelCounterparty_set_unspendable_punishment_reserve(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public CounterpartyForwardingInfo get_forwarding_info() {
long ret = bindings.ChannelCounterparty_get_forwarding_info(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyForwardingInfo(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_forwarding_info(@Nullable CounterpartyForwardingInfo val) {
bindings.ChannelCounterparty_set_forwarding_info(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ChannelCounterparty of(byte[] node_id_arg, InitFeatures features_arg, long unspendable_punishment_reserve_arg, CounterpartyForwardingInfo forwarding_info_arg) {
long ret = bindings.ChannelCounterparty_new(InternalUtils.check_arr_len(node_id_arg, 33), features_arg == null ? 0 : features_arg.ptr & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr & ~1);
+ Reference.reachabilityFence(node_id_arg);
+ Reference.reachabilityFence(features_arg);
+ Reference.reachabilityFence(unspendable_punishment_reserve_arg);
+ Reference.reachabilityFence(forwarding_info_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelCounterparty(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ChannelCounterparty_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelCounterparty clone() {
long ret = bindings.ChannelCounterparty_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelCounterparty(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.ChannelDetails_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.ChannelDetails_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public ChannelCounterparty get_counterparty() {
long ret = bindings.ChannelDetails_get_counterparty(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelCounterparty ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelCounterparty(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_counterparty(ChannelCounterparty val) {
bindings.ChannelDetails_set_counterparty(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public OutPoint get_funding_txo() {
long ret = bindings.ChannelDetails_get_funding_txo(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_funding_txo(@Nullable OutPoint val) {
bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public Option_u64Z get_short_channel_id() {
long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_short_channel_id(Option_u64Z val) {
bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_channel_value_satoshis() {
long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_value_satoshis(long val) {
bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public Option_u64Z get_unspendable_punishment_reserve() {
long ret = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_unspendable_punishment_reserve(Option_u64Z val) {
bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_user_channel_id() {
long ret = bindings.ChannelDetails_get_user_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_user_channel_id(long val) {
bindings.ChannelDetails_set_user_channel_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
+ /**
+ * Our total balance. This is the amount we would get if we close the channel.
+ * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
+ * amount is not likely to be recoverable on close.
+ *
+ * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
+ * balance is not available for inclusion in new outbound HTLCs). This further does not include
+ * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
+ * This does not consider any on-chain fees.
+ *
+ * See also [`ChannelDetails::outbound_capacity_msat`]
+ */
+ public long get_balance_msat() {
+ long ret = bindings.ChannelDetails_get_balance_msat(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Our total balance. This is the amount we would get if we close the channel.
+ * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
+ * amount is not likely to be recoverable on close.
+ *
+ * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
+ * balance is not available for inclusion in new outbound HTLCs). This further does not include
+ * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
+ * This does not consider any on-chain fees.
+ *
+ * See also [`ChannelDetails::outbound_capacity_msat`]
+ */
+ public void set_balance_msat(long val) {
+ bindings.ChannelDetails_set_balance_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
* The available outbound capacity for sending HTLCs to the remote peer. This does not include
- * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+ * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
* available for inclusion in new outbound HTLCs). This further does not include any pending
* outgoing HTLCs which are awaiting some other resolution to be sent.
*
+ * See also [`ChannelDetails::balance_msat`]
+ *
* This value is not exact. Due to various in-flight changes, feerate changes, and our
* conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
* should be able to spend nearly this amount.
*/
public long get_outbound_capacity_msat() {
long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
/**
* The available outbound capacity for sending HTLCs to the remote peer. This does not include
- * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+ * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
* available for inclusion in new outbound HTLCs). This further does not include any pending
* outgoing HTLCs which are awaiting some other resolution to be sent.
*
+ * See also [`ChannelDetails::balance_msat`]
+ *
* This value is not exact. Due to various in-flight changes, feerate changes, and our
* conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
* should be able to spend nearly this amount.
*/
public void set_outbound_capacity_msat(long val) {
bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
* The available inbound capacity for the remote peer to send HTLCs to us. This does not
- * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+ * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
* available for inclusion in new inbound HTLCs).
* Note that there are some corner cases not fully handled here, so the actual available
* inbound capacity may be slightly higher than this.
*/
public long get_inbound_capacity_msat() {
long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
/**
* The available inbound capacity for the remote peer to send HTLCs to us. This does not
- * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
+ * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
* available for inclusion in new inbound HTLCs).
* Note that there are some corner cases not fully handled here, so the actual available
* inbound capacity may be slightly higher than this.
*/
public void set_inbound_capacity_msat(long val) {
bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public Option_u32Z get_confirmations_required() {
long ret = bindings.ChannelDetails_get_confirmations_required(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_confirmations_required(Option_u32Z val) {
bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public Option_u16Z get_force_close_spend_delay() {
long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u16Z ret_hu_conv = Option_u16Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_force_close_spend_delay(Option_u16Z val) {
bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_is_outbound() {
boolean ret = bindings.ChannelDetails_get_is_outbound(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_is_outbound(boolean val) {
bindings.ChannelDetails_set_is_outbound(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_is_funding_locked() {
boolean ret = bindings.ChannelDetails_get_is_funding_locked(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_is_funding_locked(boolean val) {
bindings.ChannelDetails_set_is_funding_locked(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_is_usable() {
boolean ret = bindings.ChannelDetails_get_is_usable(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_is_usable(boolean val) {
bindings.ChannelDetails_set_is_usable(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_is_public() {
boolean ret = bindings.ChannelDetails_get_is_public(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_is_public(boolean val) {
bindings.ChannelDetails_set_is_public(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
* Constructs a new ChannelDetails given each field
*/
- public static ChannelDetails of(byte[] channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, Option_u64Z short_channel_id_arg, long channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, long user_channel_id_arg, long outbound_capacity_msat_arg, long inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg) {
- long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, short_channel_id_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
+ public static ChannelDetails of(byte[] channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, Option_u64Z short_channel_id_arg, long channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, long user_channel_id_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg) {
+ long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, short_channel_id_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(counterparty_arg);
+ Reference.reachabilityFence(funding_txo_arg);
+ Reference.reachabilityFence(short_channel_id_arg);
+ Reference.reachabilityFence(channel_value_satoshis_arg);
+ Reference.reachabilityFence(unspendable_punishment_reserve_arg);
+ Reference.reachabilityFence(user_channel_id_arg);
+ Reference.reachabilityFence(balance_msat_arg);
+ Reference.reachabilityFence(outbound_capacity_msat_arg);
+ Reference.reachabilityFence(inbound_capacity_msat_arg);
+ Reference.reachabilityFence(confirmations_required_arg);
+ Reference.reachabilityFence(force_close_spend_delay_arg);
+ Reference.reachabilityFence(is_outbound_arg);
+ Reference.reachabilityFence(is_funding_locked_arg);
+ Reference.reachabilityFence(is_usable_arg);
+ Reference.reachabilityFence(is_public_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelDetails(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ChannelDetails_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelDetails clone() {
long ret = bindings.ChannelDetails_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelDetails(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public boolean eq(ChannelFeatures b) {
boolean ret = bindings.ChannelFeatures_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ChannelFeatures)) return false;
+ return this.eq((ChannelFeatures)o);
+ }
long clone_ptr() {
long ret = bindings.ChannelFeatures_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelFeatures clone() {
long ret = bindings.ChannelFeatures_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public boolean requires_unknown_bits() {
boolean ret = bindings.ChannelFeatures_requires_unknown_bits(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] write() {
byte[] ret = bindings.ChannelFeatures_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ChannelFeaturesDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelFeatures_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public int get_minimum_depth() {
int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_minimum_depth(int val) {
bindings.ChannelHandshakeConfig_set_minimum_depth(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_our_to_self_delay() {
short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_our_to_self_delay(short val) {
bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_our_htlc_minimum_msat() {
long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_our_htlc_minimum_msat(long val) {
bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg) {
long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
+ Reference.reachabilityFence(minimum_depth_arg);
+ Reference.reachabilityFence(our_to_self_delay_arg);
+ Reference.reachabilityFence(our_htlc_minimum_msat_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ChannelHandshakeConfig_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelHandshakeConfig clone() {
long ret = bindings.ChannelHandshakeConfig_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public long get_min_funding_satoshis() {
long ret = bindings.ChannelHandshakeLimits_get_min_funding_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_min_funding_satoshis(long val) {
bindings.ChannelHandshakeLimits_set_min_funding_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_max_htlc_minimum_msat() {
long ret = bindings.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_max_htlc_minimum_msat(long val) {
bindings.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_min_max_htlc_value_in_flight_msat() {
long ret = bindings.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_min_max_htlc_value_in_flight_msat(long val) {
bindings.ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_max_channel_reserve_satoshis() {
long ret = bindings.ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_max_channel_reserve_satoshis(long val) {
bindings.ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_min_max_accepted_htlcs() {
short ret = bindings.ChannelHandshakeLimits_get_min_max_accepted_htlcs(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_min_max_accepted_htlcs(short val) {
bindings.ChannelHandshakeLimits_set_min_max_accepted_htlcs(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_max_minimum_depth() {
int ret = bindings.ChannelHandshakeLimits_get_max_minimum_depth(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_max_minimum_depth(int val) {
bindings.ChannelHandshakeLimits_set_max_minimum_depth(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_force_announced_channel_preference() {
boolean ret = bindings.ChannelHandshakeLimits_get_force_announced_channel_preference(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_force_announced_channel_preference(boolean val) {
bindings.ChannelHandshakeLimits_set_force_announced_channel_preference(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_their_to_self_delay() {
short ret = bindings.ChannelHandshakeLimits_get_their_to_self_delay(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_their_to_self_delay(short val) {
bindings.ChannelHandshakeLimits_set_their_to_self_delay(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ChannelHandshakeLimits of(long min_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, int max_minimum_depth_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg) {
long ret = bindings.ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg);
+ Reference.reachabilityFence(min_funding_satoshis_arg);
+ Reference.reachabilityFence(max_htlc_minimum_msat_arg);
+ Reference.reachabilityFence(min_max_htlc_value_in_flight_msat_arg);
+ Reference.reachabilityFence(max_channel_reserve_satoshis_arg);
+ Reference.reachabilityFence(min_max_accepted_htlcs_arg);
+ Reference.reachabilityFence(max_minimum_depth_arg);
+ Reference.reachabilityFence(force_announced_channel_preference_arg);
+ Reference.reachabilityFence(their_to_self_delay_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeLimits(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ChannelHandshakeLimits_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelHandshakeLimits clone() {
long ret = bindings.ChannelHandshakeLimits_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeLimits(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public ChannelFeatures get_features() {
long ret = bindings.ChannelInfo_get_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_features(ChannelFeatures val) {
bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public NodeId get_node_one() {
long ret = bindings.ChannelInfo_get_node_one(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_node_one(NodeId val) {
bindings.ChannelInfo_set_node_one(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public DirectionalChannelInfo get_one_to_two() {
long ret = bindings.ChannelInfo_get_one_to_two(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
DirectionalChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectionalChannelInfo(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_one_to_two(@Nullable DirectionalChannelInfo val) {
bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public NodeId get_node_two() {
long ret = bindings.ChannelInfo_get_node_two(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_node_two(NodeId val) {
bindings.ChannelInfo_set_node_two(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public DirectionalChannelInfo get_two_to_one() {
long ret = bindings.ChannelInfo_get_two_to_one(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
DirectionalChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectionalChannelInfo(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_two_to_one(@Nullable DirectionalChannelInfo val) {
bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public Option_u64Z get_capacity_sats() {
long ret = bindings.ChannelInfo_get_capacity_sats(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_capacity_sats(Option_u64Z val) {
bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public ChannelAnnouncement get_announcement_message() {
long ret = bindings.ChannelInfo_get_announcement_message(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_announcement_message(@Nullable ChannelAnnouncement val) {
bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
- }
-
- /**
- * Constructs a new ChannelInfo given each field
- */
- public static ChannelInfo of(ChannelFeatures features_arg, NodeId node_one_arg, DirectionalChannelInfo one_to_two_arg, NodeId node_two_arg, DirectionalChannelInfo two_to_one_arg, Option_u64Z capacity_sats_arg, ChannelAnnouncement announcement_message_arg) {
- long ret = bindings.ChannelInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, node_one_arg == null ? 0 : node_one_arg.ptr & ~1, one_to_two_arg == null ? 0 : one_to_two_arg.ptr & ~1, node_two_arg == null ? 0 : node_two_arg.ptr & ~1, two_to_one_arg == null ? 0 : two_to_one_arg.ptr & ~1, capacity_sats_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
- if (ret >= 0 && ret <= 4096) { return null; }
- ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelInfo(null, ret); }
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- return ret_hu_conv;
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.ChannelInfo_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelInfo clone() {
long ret = bindings.ChannelInfo_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelInfo(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ChannelInfo_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ChannelInfoDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelInfo_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static ChannelManager of(FeeEstimator fee_est, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, KeysInterface keys_manager, UserConfig config, ChainParameters params) {
long ret = bindings.ChannelManager_new(fee_est == null ? 0 : fee_est.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, keys_manager == null ? 0 : keys_manager.ptr, config == null ? 0 : config.ptr & ~1, params == null ? 0 : params.ptr & ~1);
+ Reference.reachabilityFence(fee_est);
+ Reference.reachabilityFence(chain_monitor);
+ Reference.reachabilityFence(tx_broadcaster);
+ Reference.reachabilityFence(logger);
+ Reference.reachabilityFence(keys_manager);
+ Reference.reachabilityFence(config);
+ Reference.reachabilityFence(params);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelManager(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public UserConfig get_current_default_configuration() {
long ret = bindings.ChannelManager_get_current_default_configuration(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public Result__u832APIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_channel_id, @Nullable UserConfig override_config) {
long ret = bindings.ChannelManager_create_channel(this.ptr, InternalUtils.check_arr_len(their_network_key, 33), channel_value_satoshis, push_msat, user_channel_id, override_config == null ? 0 : override_config.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_network_key);
+ Reference.reachabilityFence(channel_value_satoshis);
+ Reference.reachabilityFence(push_msat);
+ Reference.reachabilityFence(user_channel_id);
+ Reference.reachabilityFence(override_config);
if (ret >= 0 && ret <= 4096) { return null; }
Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public ChannelDetails[] list_channels() {
long[] ret = bindings.ChannelManager_list_channels(this.ptr);
+ Reference.reachabilityFence(this);
ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
for (int q = 0; q < ret.length; q++) {
long ret_conv_16 = ret[q];
*/
public ChannelDetails[] list_usable_channels() {
long[] ret = bindings.ChannelManager_list_usable_channels(this.ptr);
+ Reference.reachabilityFence(this);
ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
for (int q = 0; q < ret.length; q++) {
long ret_conv_16 = ret[q];
*/
public Result_NoneAPIErrorZ close_channel(byte[] channel_id) {
long ret = bindings.ChannelManager_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(channel_id);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Result_NoneAPIErrorZ close_channel_with_target_feerate(byte[] channel_id, int target_feerate_sats_per_1000_weight) {
long ret = bindings.ChannelManager_close_channel_with_target_feerate(this.ptr, InternalUtils.check_arr_len(channel_id, 32), target_feerate_sats_per_1000_weight);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(channel_id);
+ Reference.reachabilityFence(target_feerate_sats_per_1000_weight);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Result_NoneAPIErrorZ force_close_channel(byte[] channel_id) {
long ret = bindings.ChannelManager_force_close_channel(this.ptr, InternalUtils.check_arr_len(channel_id, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(channel_id);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public void force_close_all_channels() {
bindings.ChannelManager_force_close_all_channels(this.ptr);
+ Reference.reachabilityFence(this);
}
/**
*/
public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, byte[] payment_hash, @Nullable byte[] payment_secret) {
long ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(route);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(payment_secret);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
this.ptrs_to.add(route);
*
* Errors returned are a superset of those returned from [`send_payment`], so see
* [`send_payment`] documentation for more details on errors. This method will also error if the
- * retry amount puts the payment more than 10% over the payment's total amount, or if the payment
- * for the given `payment_id` cannot be found (likely due to timeout or success).
+ * retry amount puts the payment more than 10% over the payment's total amount, if the payment
+ * for the given `payment_id` cannot be found (likely due to timeout or success), or if
+ * further retries have been disabled with [`abandon_payment`].
*
* [`send_payment`]: [`ChannelManager::send_payment`]
+ * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
*/
public Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id) {
long ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(route);
+ Reference.reachabilityFence(payment_id);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
this.ptrs_to.add(route);
return ret_hu_conv;
}
+ /**
+ * Signals that no further retries for the given payment will occur.
+ *
+ * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
+ * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
+ * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
+ * pending HTLCs for this payment.
+ *
+ * Note that calling this method does *not* prevent a payment from succeeding. You must still
+ * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
+ * determine the ultimate status of a payment.
+ *
+ * [`retry_payment`]: Self::retry_payment
+ * [`Event::PaymentFailed`]: events::Event::PaymentFailed
+ * [`Event::PaymentSent`]: events::Event::PaymentSent
+ */
+ public void abandon_payment(byte[] payment_id) {
+ bindings.ChannelManager_abandon_payment(this.ptr, InternalUtils.check_arr_len(payment_id, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(payment_id);
+ }
+
/**
* Send a spontaneous payment, which is a payment that does not require the recipient to have
* generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
*/
public Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ send_spontaneous_payment(Route route, @Nullable byte[] payment_preimage) {
long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_preimage, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(route);
+ Reference.reachabilityFence(payment_preimage);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret);
this.ptrs_to.add(route);
* Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
* or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
*
- * Panics if a funding transaction has already been provided for this channel.
+ * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
+ * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
*
* May panic if the output found in the funding transaction is duplicative with some other
* channel (note that this should be trivially prevented by using unique funding transaction
* create a new channel with a conflicting funding transaction.
*
* [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
+ * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
*/
public Result_NoneAPIErrorZ funding_transaction_generated(byte[] temporary_channel_id, byte[] funding_transaction) {
long ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, InternalUtils.check_arr_len(temporary_channel_id, 32), funding_transaction);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(temporary_channel_id);
+ Reference.reachabilityFence(funding_transaction);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public void broadcast_node_announcement(byte[] rgb, byte[] alias, NetAddress[] addresses) {
bindings.ChannelManager_broadcast_node_announcement(this.ptr, InternalUtils.check_arr_len(rgb, 3), InternalUtils.check_arr_len(alias, 32), addresses != null ? Arrays.stream(addresses).mapToLong(addresses_conv_12 -> addresses_conv_12.ptr).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(rgb);
+ Reference.reachabilityFence(alias);
+ Reference.reachabilityFence(addresses);
}
/**
*/
public void process_pending_htlc_forwards() {
bindings.ChannelManager_process_pending_htlc_forwards(this.ptr);
+ Reference.reachabilityFence(this);
}
/**
*/
public void timer_tick_occurred() {
bindings.ChannelManager_timer_tick_occurred(this.ptr);
+ Reference.reachabilityFence(this);
}
/**
*/
public boolean fail_htlc_backwards(byte[] payment_hash) {
boolean ret = bindings.ChannelManager_fail_htlc_backwards(this.ptr, InternalUtils.check_arr_len(payment_hash, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(payment_hash);
return ret;
}
/**
- * Provides a payment preimage in response to a PaymentReceived event, returning true and
- * generating message events for the net layer to claim the payment, if possible. Thus, you
- * should probably kick the net layer to go send messages if this returns true!
+ * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
+ * [`MessageSendEvent`]s needed to claim the payment.
*
* Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
* [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
* event matches your expectation. If you fail to do so and call this method, you may provide
* the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
*
- * May panic if called except in response to a PaymentReceived event.
+ * Returns whether any HTLCs were claimed, and thus if any new [`MessageSendEvent`]s are now
+ * pending for processing via [`get_and_clear_pending_msg_events`].
*
+ * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
* [`create_inbound_payment`]: Self::create_inbound_payment
* [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
+ * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
*/
public boolean claim_funds(byte[] payment_preimage) {
boolean ret = bindings.ChannelManager_claim_funds(this.ptr, InternalUtils.check_arr_len(payment_preimage, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(payment_preimage);
return ret;
}
*/
public byte[] get_our_node_id() {
byte[] ret = bindings.ChannelManager_get_our_node_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
* to pay us.
*
* This differs from [`create_inbound_payment_for_hash`] only in that it generates the
- * [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
+ * [`PaymentHash`] and [`PaymentPreimage`] for you.
*
* The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
* will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
*
* See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
*
+ * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
+ * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+ *
+ * # Note
+ *
+ * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
+ * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+ *
+ * Errors if `min_value_msat` is greater than total bitcoin supply.
+ *
* [`claim_funds`]: Self::claim_funds
* [`PaymentReceived`]: events::Event::PaymentReceived
* [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
* [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
*/
- public TwoTuple_PaymentHashPaymentSecretZ create_inbound_payment(Option_u64Z min_value_msat, int invoice_expiry_delta_secs, long user_payment_id) {
- long ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id);
+ public Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create_inbound_payment(Option_u64Z min_value_msat, int invoice_expiry_delta_secs) {
+ long ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(min_value_msat);
+ Reference.reachabilityFence(invoice_expiry_delta_secs);
if (ret >= 0 && ret <= 4096) { return null; }
- TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret);
- ret_hu_conv.ptrs_to.add(this);
+ Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
+ * serialized state with LDK node(s) running 0.0.103 and earlier.
+ *
+ * # Note
+ * This method is deprecated and will be removed soon.
+ *
+ * [`create_inbound_payment`]: Self::create_inbound_payment
+ */
+ public Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ create_inbound_payment_legacy(Option_u64Z min_value_msat, int invoice_expiry_delta_secs) {
+ long ret = bindings.ChannelManager_create_inbound_payment_legacy(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(min_value_msat);
+ Reference.reachabilityFence(invoice_expiry_delta_secs);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
* payment secret fetched via this method or [`create_inbound_payment`], and which is at least
* the `min_value_msat` provided here, if one is provided.
*
- * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
- * method may return an Err if another payment with the same payment_hash is still pending.
- *
- * `user_payment_id` will be provided back in [`PaymentPurpose::InvoicePayment::user_payment_id`] events to
- * allow tracking of which events correspond with which calls to this and
- * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
- * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
- * with invoice metadata stored elsewhere.
+ * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
+ * note that LDK will not stop you from registering duplicate payment hashes for inbound
+ * payments.
*
* `min_value_msat` should be set if the invoice being generated contains a value. Any payment
* received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
* If you need exact expiry semantics, you should enforce them upon receipt of
* [`PaymentReceived`].
*
- * Pending inbound payments are stored in memory and in serialized versions of this
- * [`ChannelManager`]. If potentially unbounded numbers of inbound payments may exist and
- * space is limited, you may wish to rate-limit inbound payment creation.
- *
* May panic if `invoice_expiry_delta_secs` is greater than one year.
*
* Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
* set to at least [`MIN_FINAL_CLTV_EXPIRY`].
*
+ * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
+ * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+ *
+ * # Note
+ *
+ * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
+ * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+ *
+ * Errors if `min_value_msat` is greater than total bitcoin supply.
+ *
* [`create_inbound_payment`]: Self::create_inbound_payment
* [`PaymentReceived`]: events::Event::PaymentReceived
- * [`PaymentPurpose::InvoicePayment::user_payment_id`]: events::PaymentPurpose::InvoicePayment::user_payment_id
*/
- public Result_PaymentSecretAPIErrorZ create_inbound_payment_for_hash(byte[] payment_hash, Option_u64Z min_value_msat, int invoice_expiry_delta_secs, long user_payment_id) {
- long ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id);
+ public Result_PaymentSecretNoneZ create_inbound_payment_for_hash(byte[] payment_hash, Option_u64Z min_value_msat, int invoice_expiry_delta_secs) {
+ long ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(min_value_msat);
+ Reference.reachabilityFence(invoice_expiry_delta_secs);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
+ * serialized state with LDK node(s) running 0.0.103 and earlier.
+ *
+ * # Note
+ * This method is deprecated and will be removed soon.
+ *
+ * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
+ */
+ public Result_PaymentSecretAPIErrorZ create_inbound_payment_for_hash_legacy(byte[] payment_hash, Option_u64Z min_value_msat, int invoice_expiry_delta_secs) {
+ long ret = bindings.ChannelManager_create_inbound_payment_for_hash_legacy(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(min_value_msat);
+ Reference.reachabilityFence(invoice_expiry_delta_secs);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
+ /**
+ * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
+ * previously returned from [`create_inbound_payment`].
+ *
+ * [`create_inbound_payment`]: Self::create_inbound_payment
+ */
+ public Result_PaymentPreimageAPIErrorZ get_payment_preimage(byte[] payment_hash, byte[] payment_secret) {
+ long ret = bindings.ChannelManager_get_payment_preimage(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(payment_secret);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentPreimageAPIErrorZ ret_hu_conv = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
/**
* Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
* This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
*/
public MessageSendEventsProvider as_MessageSendEventsProvider() {
long ret = bindings.ChannelManager_as_MessageSendEventsProvider(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public EventsProvider as_EventsProvider() {
long ret = bindings.ChannelManager_as_EventsProvider(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
EventsProvider ret_hu_conv = new EventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public Listen as_Listen() {
long ret = bindings.ChannelManager_as_Listen(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Listen ret_hu_conv = new Listen(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public Confirm as_Confirm() {
long ret = bindings.ChannelManager_as_Confirm(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Confirm ret_hu_conv = new Confirm(null, ret);
ret_hu_conv.ptrs_to.add(this);
* indicating whether persistence is necessary. Only one listener on
* `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
* up.
- * Note that the feature `allow_wallclock_use` must be enabled to use this function.
+ *
+ * Note that this method is not available with the `no-std` feature.
*/
public boolean await_persistable_update_timeout(long max_wait) {
boolean ret = bindings.ChannelManager_await_persistable_update_timeout(this.ptr, max_wait);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(max_wait);
return ret;
}
*/
public void await_persistable_update() {
bindings.ChannelManager_await_persistable_update(this.ptr);
+ Reference.reachabilityFence(this);
}
/**
*/
public BestBlock current_best_block() {
long ret = bindings.ChannelManager_current_best_block(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public ChannelMessageHandler as_ChannelMessageHandler() {
long ret = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ChannelManager_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Payer as_Payer() {
long ret = bindings.ChannelManager_as_Payer(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Payer ret_hu_conv = new Payer(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public Result_NoneErrorZ persist_manager(ChannelManager channel_manager) {
long ret = bindings.ChannelManagerPersister_persist_manager(this.ptr, channel_manager == null ? 0 : channel_manager.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(channel_manager);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(channel_manager);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public KeysInterface get_keys_manager() {
long ret = bindings.ChannelManagerReadArgs_get_keys_manager(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
KeysInterface ret_hu_conv = new KeysInterface(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_keys_manager(KeysInterface val) {
bindings.ChannelManagerReadArgs_set_keys_manager(this.ptr, val == null ? 0 : val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
this.ptrs_to.add(val);
}
*/
public FeeEstimator get_fee_estimator() {
long ret = bindings.ChannelManagerReadArgs_get_fee_estimator(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
FeeEstimator ret_hu_conv = new FeeEstimator(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_fee_estimator(FeeEstimator val) {
bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val == null ? 0 : val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
this.ptrs_to.add(val);
}
*/
public Watch get_chain_monitor() {
long ret = bindings.ChannelManagerReadArgs_get_chain_monitor(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Watch ret_hu_conv = new Watch(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_chain_monitor(Watch val) {
bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val == null ? 0 : val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
this.ptrs_to.add(val);
}
*/
public BroadcasterInterface get_tx_broadcaster() {
long ret = bindings.ChannelManagerReadArgs_get_tx_broadcaster(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
BroadcasterInterface ret_hu_conv = new BroadcasterInterface(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_tx_broadcaster(BroadcasterInterface val) {
bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val == null ? 0 : val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
this.ptrs_to.add(val);
}
*/
public Logger get_logger() {
long ret = bindings.ChannelManagerReadArgs_get_logger(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Logger ret_hu_conv = new Logger(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_logger(Logger val) {
bindings.ChannelManagerReadArgs_set_logger(this.ptr, val == null ? 0 : val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
this.ptrs_to.add(val);
}
*/
public UserConfig get_default_config() {
long ret = bindings.ChannelManagerReadArgs_get_default_config(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_default_config(UserConfig val) {
bindings.ChannelManagerReadArgs_set_default_config(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ChannelManagerReadArgs of(KeysInterface keys_manager, FeeEstimator fee_estimator, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, UserConfig default_config, ChannelMonitor[] channel_monitors) {
long ret = bindings.ChannelManagerReadArgs_new(keys_manager == null ? 0 : keys_manager.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, default_config == null ? 0 : default_config.ptr & ~1, channel_monitors != null ? Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(keys_manager);
+ Reference.reachabilityFence(fee_estimator);
+ Reference.reachabilityFence(chain_monitor);
+ Reference.reachabilityFence(tx_broadcaster);
+ Reference.reachabilityFence(logger);
+ Reference.reachabilityFence(default_config);
+ Reference.reachabilityFence(channel_monitors);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelManagerReadArgs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelManagerReadArgs(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public void handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg) {
bindings.ChannelMessageHandler_handle_open_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(their_features);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg) {
bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(their_features);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_funding_created(byte[] their_node_id, FundingCreated msg) {
bindings.ChannelMessageHandler_handle_funding_created(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_funding_signed(byte[] their_node_id, FundingSigned msg) {
bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_funding_locked(byte[] their_node_id, FundingLocked msg) {
bindings.ChannelMessageHandler_handle_funding_locked(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_shutdown(byte[] their_node_id, InitFeatures their_features, Shutdown msg) {
bindings.ChannelMessageHandler_handle_shutdown(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(their_features);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(their_features);
this.ptrs_to.add(msg);
}
*/
public void handle_closing_signed(byte[] their_node_id, ClosingSigned msg) {
bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg) {
bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg) {
bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg) {
bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg) {
bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg) {
bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg) {
bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_update_fee(byte[] their_node_id, UpdateFee msg) {
bindings.ChannelMessageHandler_handle_update_fee(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg) {
bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void peer_disconnected(byte[] their_node_id, boolean no_connection_possible) {
bindings.ChannelMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), no_connection_possible);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(no_connection_possible);
}
/**
*/
public void peer_connected(byte[] their_node_id, Init msg) {
bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg) {
bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_channel_update(byte[] their_node_id, ChannelUpdate msg) {
bindings.ChannelMessageHandler_handle_channel_update(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
*/
public void handle_error(byte[] their_node_id, ErrorMessage msg) {
bindings.ChannelMessageHandler_handle_error(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
this.ptrs_to.add(msg);
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.ChannelMonitor_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelMonitor clone() {
long ret = bindings.ChannelMonitor_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelMonitor(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ChannelMonitor_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*
* panics if the given update is not the next update by update_id.
*/
- public Result_NoneMonitorUpdateErrorZ update_monitor(ChannelMonitorUpdate updates, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
+ public Result_NoneNoneZ update_monitor(ChannelMonitorUpdate updates, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr & ~1, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(updates);
+ Reference.reachabilityFence(broadcaster);
+ Reference.reachabilityFence(fee_estimator);
+ Reference.reachabilityFence(logger);
if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
+ Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(updates);
this.ptrs_to.add(broadcaster);
this.ptrs_to.add(fee_estimator);
*/
public long get_latest_update_id() {
long ret = bindings.ChannelMonitor_get_latest_update_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_OutPointScriptZ get_funding_txo() {
long ret = bindings.ChannelMonitor_get_funding_txo(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_OutPointScriptZ ret_hu_conv = new TwoTuple_OutPointScriptZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ[] get_outputs_to_watch() {
long[] ret = bindings.ChannelMonitor_get_outputs_to_watch(this.ptr);
+ Reference.reachabilityFence(this);
TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ[] ret_conv_40_arr = new TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ[ret.length];
for (int o = 0; o < ret.length; o++) {
long ret_conv_40 = ret[o];
*/
public void load_outputs_to_watch(Filter filter) {
bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter == null ? 0 : filter.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(filter);
this.ptrs_to.add(filter);
}
*/
public MonitorEvent[] get_and_clear_pending_monitor_events() {
long[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr);
+ Reference.reachabilityFence(this);
MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret.length];
for (int o = 0; o < ret.length; o++) {
long ret_conv_14 = ret[o];
*/
public Event[] get_and_clear_pending_events() {
long[] ret = bindings.ChannelMonitor_get_and_clear_pending_events(this.ptr);
+ Reference.reachabilityFence(this);
Event[] ret_conv_7_arr = new Event[ret.length];
for (int h = 0; h < ret.length; h++) {
long ret_conv_7 = ret[h];
*/
public byte[][] get_latest_holder_commitment_txn(Logger logger) {
byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : logger.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(logger);
this.ptrs_to.add(logger);
return ret;
}
*/
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(header);
+ Reference.reachabilityFence(txdata);
+ Reference.reachabilityFence(height);
+ Reference.reachabilityFence(broadcaster);
+ Reference.reachabilityFence(fee_estimator);
+ Reference.reachabilityFence(logger);
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length];
for (int n = 0; n < ret.length; n++) {
long ret_conv_39 = ret[n];
*/
public void block_disconnected(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
bindings.ChannelMonitor_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(header);
+ Reference.reachabilityFence(height);
+ Reference.reachabilityFence(broadcaster);
+ Reference.reachabilityFence(fee_estimator);
+ Reference.reachabilityFence(logger);
this.ptrs_to.add(broadcaster);
this.ptrs_to.add(fee_estimator);
this.ptrs_to.add(logger);
*/
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(header);
+ Reference.reachabilityFence(txdata);
+ Reference.reachabilityFence(height);
+ Reference.reachabilityFence(broadcaster);
+ Reference.reachabilityFence(fee_estimator);
+ Reference.reachabilityFence(logger);
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length];
for (int n = 0; n < ret.length; n++) {
long ret_conv_39 = ret[n];
*/
public void transaction_unconfirmed(byte[] txid, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32), broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(txid);
+ Reference.reachabilityFence(broadcaster);
+ Reference.reachabilityFence(fee_estimator);
+ Reference.reachabilityFence(logger);
this.ptrs_to.add(broadcaster);
this.ptrs_to.add(fee_estimator);
this.ptrs_to.add(logger);
*/
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] best_block_updated(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(header);
+ Reference.reachabilityFence(height);
+ Reference.reachabilityFence(broadcaster);
+ Reference.reachabilityFence(fee_estimator);
+ Reference.reachabilityFence(logger);
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret_conv_39_arr = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[ret.length];
for (int n = 0; n < ret.length; n++) {
long ret_conv_39 = ret[n];
*/
public byte[][] get_relevant_txids() {
byte[][] ret = bindings.ChannelMonitor_get_relevant_txids(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public BestBlock current_best_block() {
long ret = bindings.ChannelMonitor_current_best_block(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public Balance[] get_claimable_balances() {
long[] ret = bindings.ChannelMonitor_get_claimable_balances(this.ptr);
+ Reference.reachabilityFence(this);
Balance[] ret_conv_9_arr = new Balance[ret.length];
for (int j = 0; j < ret.length; j++) {
long ret_conv_9 = ret[j];
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public long get_update_id() {
long ret = bindings.ChannelMonitorUpdate_get_update_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_update_id(long val) {
bindings.ChannelMonitorUpdate_set_update_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.ChannelMonitorUpdate_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelMonitorUpdate clone() {
long ret = bindings.ChannelMonitorUpdate_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelMonitorUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelMonitorUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ChannelMonitorUpdate_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ChannelMonitorUpdateDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelMonitorUpdate_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_funding_pubkey() {
byte[] ret = bindings.ChannelPublicKeys_get_funding_pubkey(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_funding_pubkey(byte[] val) {
bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_revocation_basepoint() {
byte[] ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_revocation_basepoint(byte[] val) {
bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_payment_point() {
byte[] ret = bindings.ChannelPublicKeys_get_payment_point(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_payment_point(byte[] val) {
bindings.ChannelPublicKeys_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_delayed_payment_basepoint() {
byte[] ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_delayed_payment_basepoint(byte[] val) {
bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_htlc_basepoint() {
byte[] ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_basepoint(byte[] val) {
bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ChannelPublicKeys of(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg) {
long ret = bindings.ChannelPublicKeys_new(InternalUtils.check_arr_len(funding_pubkey_arg, 33), InternalUtils.check_arr_len(revocation_basepoint_arg, 33), InternalUtils.check_arr_len(payment_point_arg, 33), InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33), InternalUtils.check_arr_len(htlc_basepoint_arg, 33));
+ Reference.reachabilityFence(funding_pubkey_arg);
+ Reference.reachabilityFence(revocation_basepoint_arg);
+ Reference.reachabilityFence(payment_point_arg);
+ Reference.reachabilityFence(delayed_payment_basepoint_arg);
+ Reference.reachabilityFence(htlc_basepoint_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ChannelPublicKeys_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelPublicKeys clone() {
long ret = bindings.ChannelPublicKeys_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ChannelPublicKeys_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ChannelPublicKeysDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelPublicKeys_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.ChannelReestablish_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.ChannelReestablish_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_next_local_commitment_number() {
long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_next_local_commitment_number(long val) {
bindings.ChannelReestablish_set_next_local_commitment_number(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_next_remote_commitment_number() {
long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_next_remote_commitment_number(long val) {
bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.ChannelReestablish_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelReestablish clone() {
long ret = bindings.ChannelReestablish_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelReestablish ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelReestablish(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ChannelReestablish_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ChannelReestablishDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelReestablish_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public ChannelPublicKeys get_holder_pubkeys() {
long ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_holder_pubkeys(ChannelPublicKeys val) {
bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_holder_selected_contest_delay() {
short ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_holder_selected_contest_delay(short val) {
bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_is_outbound_from_holder() {
boolean ret = bindings.ChannelTransactionParameters_get_is_outbound_from_holder(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_is_outbound_from_holder(boolean val) {
bindings.ChannelTransactionParameters_set_is_outbound_from_holder(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public CounterpartyChannelTransactionParameters get_counterparty_parameters() {
long ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_counterparty_parameters(@Nullable CounterpartyChannelTransactionParameters val) {
bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public OutPoint get_funding_outpoint() {
long ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_funding_outpoint(@Nullable OutPoint val) {
bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
+ /**
+ * Are anchors used for this channel. Boolean is serialization backwards-compatible
+ */
+ public COption_NoneZ get_opt_anchors() {
+ COption_NoneZ ret = bindings.ChannelTransactionParameters_get_opt_anchors(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Are anchors used for this channel. Boolean is serialization backwards-compatible
+ */
+ public void set_opt_anchors(org.ldk.enums.COption_NoneZ val) {
+ bindings.ChannelTransactionParameters_set_opt_anchors(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
* Constructs a new ChannelTransactionParameters given each field
*/
- public static ChannelTransactionParameters of(ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) {
- long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1);
+ public static ChannelTransactionParameters of(ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg, org.ldk.enums.COption_NoneZ opt_anchors_arg) {
+ long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1, opt_anchors_arg);
+ Reference.reachabilityFence(holder_pubkeys_arg);
+ Reference.reachabilityFence(holder_selected_contest_delay_arg);
+ Reference.reachabilityFence(is_outbound_from_holder_arg);
+ Reference.reachabilityFence(counterparty_parameters_arg);
+ Reference.reachabilityFence(funding_outpoint_arg);
+ Reference.reachabilityFence(opt_anchors_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTransactionParameters(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ChannelTransactionParameters_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelTransactionParameters clone() {
long ret = bindings.ChannelTransactionParameters_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTransactionParameters(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public boolean is_populated() {
boolean ret = bindings.ChannelTransactionParameters_is_populated(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public DirectedChannelTransactionParameters as_holder_broadcastable() {
long ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
DirectedChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public DirectedChannelTransactionParameters as_counterparty_broadcastable() {
long ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
DirectedChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ChannelTransactionParameters_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ChannelTransactionParametersDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelTransactionParameters_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+
+/**
+ * Features used within the channel_type field in an OpenChannel message.
+ *
+ * A channel is always of some known \"type\", describing the transaction formats used and the exact
+ * semantics of our interaction with our peer.
+ *
+ * Note that because a channel is a specific type which is proposed by the opener and accepted by
+ * the counterparty, only required features are allowed here.
+ *
+ * This is serialized differently from other feature types - it is not prefixed by a length, and
+ * thus must only appear inside a TLV where its length is known in advance.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class ChannelTypeFeatures extends CommonBase {
+ ChannelTypeFeatures(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.ChannelTypeFeatures_free(ptr); }
+ }
+
+ /**
+ * Checks if two ChannelTypeFeaturess contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ChannelTypeFeatures b) {
+ boolean ret = bindings.ChannelTypeFeatures_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ this.ptrs_to.add(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ChannelTypeFeatures)) return false;
+ return this.eq((ChannelTypeFeatures)o);
+ }
+ long clone_ptr() {
+ long ret = bindings.ChannelTypeFeatures_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a copy of the ChannelTypeFeatures
+ */
+ public ChannelTypeFeatures clone() {
+ long ret = bindings.ChannelTypeFeatures_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTypeFeatures(null, ret); }
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Create a blank Features with no features set
+ */
+ public static ChannelTypeFeatures empty() {
+ long ret = bindings.ChannelTypeFeatures_empty();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTypeFeatures(null, ret); }
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a Features with the bits set which are known by the implementation
+ */
+ public static ChannelTypeFeatures known() {
+ long ret = bindings.ChannelTypeFeatures_known();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTypeFeatures(null, ret); }
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
+ */
+ public boolean requires_unknown_bits() {
+ boolean ret = bindings.ChannelTypeFeatures_requires_unknown_bits(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.ChannelTypeFeatures_write(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
+ */
+ public static Result_ChannelTypeFeaturesDecodeErrorZ read(byte[] ser) {
+ long ret = bindings.ChannelTypeFeatures_read(ser);
+ Reference.reachabilityFence(ser);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_signature() {
byte[] ret = bindings.ChannelUpdate_get_signature(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_signature(byte[] val) {
bindings.ChannelUpdate_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public UnsignedChannelUpdate get_contents() {
long ret = bindings.ChannelUpdate_get_contents(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_contents(UnsignedChannelUpdate val) {
bindings.ChannelUpdate_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ChannelUpdate of(byte[] signature_arg, UnsignedChannelUpdate contents_arg) {
long ret = bindings.ChannelUpdate_new(InternalUtils.check_arr_len(signature_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1);
+ Reference.reachabilityFence(signature_arg);
+ Reference.reachabilityFence(contents_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ChannelUpdate_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelUpdate clone() {
long ret = bindings.ChannelUpdate_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ChannelUpdate_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ChannelUpdateDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelUpdate_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.ClosingSigned_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.ClosingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_fee_satoshis() {
long ret = bindings.ClosingSigned_get_fee_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_fee_satoshis(long val) {
bindings.ClosingSigned_set_fee_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_signature() {
byte[] ret = bindings.ClosingSigned_get_signature(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_signature(byte[] val) {
bindings.ClosingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public ClosingSignedFeeRange get_fee_range() {
long ret = bindings.ClosingSigned_get_fee_range(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSignedFeeRange(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_fee_range(@Nullable ClosingSignedFeeRange val) {
bindings.ClosingSigned_set_fee_range(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ClosingSigned of(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg, ClosingSignedFeeRange fee_range_arg) {
long ret = bindings.ClosingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), fee_satoshis_arg, InternalUtils.check_arr_len(signature_arg, 64), fee_range_arg == null ? 0 : fee_range_arg.ptr & ~1);
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(fee_satoshis_arg);
+ Reference.reachabilityFence(signature_arg);
+ Reference.reachabilityFence(fee_range_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSigned(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ClosingSigned_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ClosingSigned clone() {
long ret = bindings.ClosingSigned_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSigned(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ClosingSigned_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ClosingSignedDecodeErrorZ read(byte[] ser) {
long ret = bindings.ClosingSigned_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public long get_min_fee_satoshis() {
long ret = bindings.ClosingSignedFeeRange_get_min_fee_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_min_fee_satoshis(long val) {
bindings.ClosingSignedFeeRange_set_min_fee_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_max_fee_satoshis() {
long ret = bindings.ClosingSignedFeeRange_get_max_fee_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_max_fee_satoshis(long val) {
bindings.ClosingSignedFeeRange_set_max_fee_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ClosingSignedFeeRange of(long min_fee_satoshis_arg, long max_fee_satoshis_arg) {
long ret = bindings.ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
+ Reference.reachabilityFence(min_fee_satoshis_arg);
+ Reference.reachabilityFence(max_fee_satoshis_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSignedFeeRange(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ClosingSignedFeeRange_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ClosingSignedFeeRange clone() {
long ret = bindings.ClosingSignedFeeRange_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ClosingSignedFeeRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingSignedFeeRange(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ClosingSignedFeeRange_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ClosingSignedFeeRangeDecodeErrorZ read(byte[] ser) {
long ret = bindings.ClosingSignedFeeRange_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.ClosingTransaction_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ClosingTransaction clone() {
long ret = bindings.ClosingTransaction_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingTransaction(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.ClosingTransaction_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Construct an object of the class
*/
public static ClosingTransaction of(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, OutPoint funding_outpoint) {
long ret = bindings.ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script, to_counterparty_script, funding_outpoint == null ? 0 : funding_outpoint.ptr & ~1);
+ Reference.reachabilityFence(to_holder_value_sat);
+ Reference.reachabilityFence(to_counterparty_value_sat);
+ Reference.reachabilityFence(to_holder_script);
+ Reference.reachabilityFence(to_counterparty_script);
+ Reference.reachabilityFence(funding_outpoint);
if (ret >= 0 && ret <= 4096) { return null; }
ClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ClosingTransaction(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public TrustedClosingTransaction trust() {
long ret = bindings.ClosingTransaction_trust(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TrustedClosingTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TrustedClosingTransaction(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public Result_TrustedClosingTransactionNoneZ verify(OutPoint funding_outpoint) {
long ret = bindings.ClosingTransaction_verify(this.ptr, funding_outpoint == null ? 0 : funding_outpoint.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(funding_outpoint);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TrustedClosingTransactionNoneZ ret_hu_conv = Result_TrustedClosingTransactionNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public long to_holder_value_sat() {
long ret = bindings.ClosingTransaction_to_holder_value_sat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public long to_counterparty_value_sat() {
long ret = bindings.ClosingTransaction_to_counterparty_value_sat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] to_holder_script() {
byte[] ret = bindings.ClosingTransaction_to_holder_script(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] to_counterparty_script() {
byte[] ret = bindings.ClosingTransaction_to_counterparty_script(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
if (raw_val.getClass() == bindings.LDKClosureReason.CommitmentTxConfirmed.class) {
return new CommitmentTxConfirmed(ptr, (bindings.LDKClosureReason.CommitmentTxConfirmed)raw_val);
}
+ if (raw_val.getClass() == bindings.LDKClosureReason.FundingTimedOut.class) {
+ return new FundingTimedOut(ptr, (bindings.LDKClosureReason.FundingTimedOut)raw_val);
+ }
if (raw_val.getClass() == bindings.LDKClosureReason.ProcessingError.class) {
return new ProcessingError(ptr, (bindings.LDKClosureReason.ProcessingError)raw_val);
}
super(null, ptr);
}
}
+ /**
+ * The funding transaction failed to confirm in a timely manner on an inbound channel.
+ */
+ public final static class FundingTimedOut extends ClosureReason {
+ private FundingTimedOut(long ptr, bindings.LDKClosureReason.FundingTimedOut obj) {
+ super(null, ptr);
+ }
+ }
/**
* Closure generated from processing an event, likely a HTLC forward/relay/reception.
*/
}
long clone_ptr() {
long ret = bindings.ClosureReason_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ClosureReason clone() {
long ret = bindings.ClosureReason_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static ClosureReason counterparty_force_closed(java.lang.String peer_msg) {
long ret = bindings.ClosureReason_counterparty_force_closed(peer_msg);
+ Reference.reachabilityFence(peer_msg);
if (ret >= 0 && ret <= 4096) { return null; }
ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
+ /**
+ * Utility method to constructs a new FundingTimedOut-variant ClosureReason
+ */
+ public static ClosureReason funding_timed_out() {
+ long ret = bindings.ClosureReason_funding_timed_out();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
/**
* Utility method to constructs a new ProcessingError-variant ClosureReason
*/
public static ClosureReason processing_error(java.lang.String err) {
long ret = bindings.ClosureReason_processing_error(err);
+ Reference.reachabilityFence(err);
if (ret >= 0 && ret <= 4096) { return null; }
ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public byte[] write() {
byte[] ret = bindings.ClosureReason_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.CommitmentSigned_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.CommitmentSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_signature() {
byte[] ret = bindings.CommitmentSigned_get_signature(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_signature(byte[] val) {
bindings.CommitmentSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public void set_htlc_signatures(byte[][] val) {
bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val != null ? Arrays.stream(val).map(val_conv_8 -> InternalUtils.check_arr_len(val_conv_8, 64)).toArray(byte[][]::new) : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static CommitmentSigned of(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) {
long ret = bindings.CommitmentSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(signature_arg, 64), htlc_signatures_arg != null ? Arrays.stream(htlc_signatures_arg).map(htlc_signatures_arg_conv_8 -> InternalUtils.check_arr_len(htlc_signatures_arg_conv_8, 64)).toArray(byte[][]::new) : null);
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(signature_arg);
+ Reference.reachabilityFence(htlc_signatures_arg);
if (ret >= 0 && ret <= 4096) { return null; }
CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentSigned(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.CommitmentSigned_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public CommitmentSigned clone() {
long ret = bindings.CommitmentSigned_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentSigned(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.CommitmentSigned_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_CommitmentSignedDecodeErrorZ read(byte[] ser) {
long ret = bindings.CommitmentSigned_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.CommitmentTransaction_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public CommitmentTransaction clone() {
long ret = bindings.CommitmentTransaction_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
CommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentTransaction(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.CommitmentTransaction_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_CommitmentTransactionDecodeErrorZ read(byte[] ser) {
long ret = bindings.CommitmentTransaction_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public long commitment_number() {
long ret = bindings.CommitmentTransaction_commitment_number(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public long to_broadcaster_value_sat() {
long ret = bindings.CommitmentTransaction_to_broadcaster_value_sat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public long to_countersignatory_value_sat() {
long ret = bindings.CommitmentTransaction_to_countersignatory_value_sat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public int feerate_per_kw() {
int ret = bindings.CommitmentTransaction_feerate_per_kw(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TrustedCommitmentTransaction trust() {
long ret = bindings.CommitmentTransaction_trust(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TrustedCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TrustedCommitmentTransaction(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public Result_TrustedCommitmentTransactionNoneZ verify(DirectedChannelTransactionParameters channel_parameters, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) {
long ret = bindings.CommitmentTransaction_verify(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr & ~1, broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(channel_parameters);
+ Reference.reachabilityFence(broadcaster_keys);
+ Reference.reachabilityFence(countersignatory_keys);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(channel_parameters);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public UpdateAddHTLC[] get_update_add_htlcs() {
long[] ret = bindings.CommitmentUpdate_get_update_add_htlcs(this.ptr);
+ Reference.reachabilityFence(this);
UpdateAddHTLC[] ret_conv_15_arr = new UpdateAddHTLC[ret.length];
for (int p = 0; p < ret.length; p++) {
long ret_conv_15 = ret[p];
*/
public void set_update_add_htlcs(UpdateAddHTLC[] val) {
bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_15 -> val_conv_15 == null ? 0 : val_conv_15.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public UpdateFulfillHTLC[] get_update_fulfill_htlcs() {
long[] ret = bindings.CommitmentUpdate_get_update_fulfill_htlcs(this.ptr);
+ Reference.reachabilityFence(this);
UpdateFulfillHTLC[] ret_conv_19_arr = new UpdateFulfillHTLC[ret.length];
for (int t = 0; t < ret.length; t++) {
long ret_conv_19 = ret[t];
*/
public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) {
bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_19 -> val_conv_19 == null ? 0 : val_conv_19.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public UpdateFailHTLC[] get_update_fail_htlcs() {
long[] ret = bindings.CommitmentUpdate_get_update_fail_htlcs(this.ptr);
+ Reference.reachabilityFence(this);
UpdateFailHTLC[] ret_conv_16_arr = new UpdateFailHTLC[ret.length];
for (int q = 0; q < ret.length; q++) {
long ret_conv_16 = ret[q];
*/
public void set_update_fail_htlcs(UpdateFailHTLC[] val) {
bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public UpdateFailMalformedHTLC[] get_update_fail_malformed_htlcs() {
long[] ret = bindings.CommitmentUpdate_get_update_fail_malformed_htlcs(this.ptr);
+ Reference.reachabilityFence(this);
UpdateFailMalformedHTLC[] ret_conv_25_arr = new UpdateFailMalformedHTLC[ret.length];
for (int z = 0; z < ret.length; z++) {
long ret_conv_25 = ret[z];
*/
public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) {
bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_25 -> val_conv_25 == null ? 0 : val_conv_25.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public UpdateFee get_update_fee() {
long ret = bindings.CommitmentUpdate_get_update_fee(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFee(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_update_fee(@Nullable UpdateFee val) {
bindings.CommitmentUpdate_set_update_fee(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public CommitmentSigned get_commitment_signed() {
long ret = bindings.CommitmentUpdate_get_commitment_signed(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentSigned(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_commitment_signed(CommitmentSigned val) {
bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static CommitmentUpdate of(UpdateAddHTLC[] update_add_htlcs_arg, UpdateFulfillHTLC[] update_fulfill_htlcs_arg, UpdateFailHTLC[] update_fail_htlcs_arg, UpdateFailMalformedHTLC[] update_fail_malformed_htlcs_arg, UpdateFee update_fee_arg, CommitmentSigned commitment_signed_arg) {
long ret = bindings.CommitmentUpdate_new(update_add_htlcs_arg != null ? Arrays.stream(update_add_htlcs_arg).mapToLong(update_add_htlcs_arg_conv_15 -> update_add_htlcs_arg_conv_15 == null ? 0 : update_add_htlcs_arg_conv_15.ptr & ~1).toArray() : null, update_fulfill_htlcs_arg != null ? Arrays.stream(update_fulfill_htlcs_arg).mapToLong(update_fulfill_htlcs_arg_conv_19 -> update_fulfill_htlcs_arg_conv_19 == null ? 0 : update_fulfill_htlcs_arg_conv_19.ptr & ~1).toArray() : null, update_fail_htlcs_arg != null ? Arrays.stream(update_fail_htlcs_arg).mapToLong(update_fail_htlcs_arg_conv_16 -> update_fail_htlcs_arg_conv_16 == null ? 0 : update_fail_htlcs_arg_conv_16.ptr & ~1).toArray() : null, update_fail_malformed_htlcs_arg != null ? Arrays.stream(update_fail_malformed_htlcs_arg).mapToLong(update_fail_malformed_htlcs_arg_conv_25 -> update_fail_malformed_htlcs_arg_conv_25 == null ? 0 : update_fail_malformed_htlcs_arg_conv_25.ptr & ~1).toArray() : null, update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1);
+ Reference.reachabilityFence(update_add_htlcs_arg);
+ Reference.reachabilityFence(update_fulfill_htlcs_arg);
+ Reference.reachabilityFence(update_fail_htlcs_arg);
+ Reference.reachabilityFence(update_fail_malformed_htlcs_arg);
+ Reference.reachabilityFence(update_fee_arg);
+ Reference.reachabilityFence(commitment_signed_arg);
if (ret >= 0 && ret <= 4096) { return null; }
CommitmentUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.CommitmentUpdate_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public CommitmentUpdate clone() {
long ret = bindings.CommitmentUpdate_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
CommitmentUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CommitmentUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public void transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height) {
bindings.Confirm_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(header);
+ Reference.reachabilityFence(txdata);
+ Reference.reachabilityFence(height);
}
/**
*/
public void transaction_unconfirmed(byte[] txid) {
bindings.Confirm_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(txid);
}
/**
*/
public void best_block_updated(byte[] header, int height) {
bindings.Confirm_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(header);
+ Reference.reachabilityFence(height);
}
/**
*/
public byte[][] get_relevant_txids() {
byte[][] ret = bindings.Confirm_get_relevant_txids(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public ChannelPublicKeys get_pubkeys() {
long ret = bindings.CounterpartyChannelTransactionParameters_get_pubkeys(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_pubkeys(ChannelPublicKeys val) {
bindings.CounterpartyChannelTransactionParameters_set_pubkeys(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_selected_contest_delay() {
short ret = bindings.CounterpartyChannelTransactionParameters_get_selected_contest_delay(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_selected_contest_delay(short val) {
bindings.CounterpartyChannelTransactionParameters_set_selected_contest_delay(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static CounterpartyChannelTransactionParameters of(ChannelPublicKeys pubkeys_arg, short selected_contest_delay_arg) {
long ret = bindings.CounterpartyChannelTransactionParameters_new(pubkeys_arg == null ? 0 : pubkeys_arg.ptr & ~1, selected_contest_delay_arg);
+ Reference.reachabilityFence(pubkeys_arg);
+ Reference.reachabilityFence(selected_contest_delay_arg);
if (ret >= 0 && ret <= 4096) { return null; }
CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.CounterpartyChannelTransactionParameters_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public CounterpartyChannelTransactionParameters clone() {
long ret = bindings.CounterpartyChannelTransactionParameters_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
CounterpartyChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.CounterpartyChannelTransactionParameters_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ read(byte[] ser) {
long ret = bindings.CounterpartyChannelTransactionParameters_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public int get_fee_base_msat() {
int ret = bindings.CounterpartyForwardingInfo_get_fee_base_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_fee_base_msat(int val) {
bindings.CounterpartyForwardingInfo_set_fee_base_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_fee_proportional_millionths() {
int ret = bindings.CounterpartyForwardingInfo_get_fee_proportional_millionths(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_fee_proportional_millionths(int val) {
bindings.CounterpartyForwardingInfo_set_fee_proportional_millionths(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_cltv_expiry_delta() {
short ret = bindings.CounterpartyForwardingInfo_get_cltv_expiry_delta(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_cltv_expiry_delta(short val) {
bindings.CounterpartyForwardingInfo_set_cltv_expiry_delta(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static CounterpartyForwardingInfo of(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg) {
long ret = bindings.CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
+ Reference.reachabilityFence(fee_base_msat_arg);
+ Reference.reachabilityFence(fee_proportional_millionths_arg);
+ Reference.reachabilityFence(cltv_expiry_delta_arg);
if (ret >= 0 && ret <= 4096) { return null; }
CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyForwardingInfo(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.CounterpartyForwardingInfo_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public CounterpartyForwardingInfo clone() {
long ret = bindings.CounterpartyForwardingInfo_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new CounterpartyForwardingInfo(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public Result_NoneLightningErrorZ handle_custom_message(Type msg, byte[] sender_node_id) {
long ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr, InternalUtils.check_arr_len(sender_node_id, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
+ Reference.reachabilityFence(sender_node_id);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
*/
public TwoTuple_PublicKeyTypeZ[] get_and_clear_pending_msg() {
long[] ret = bindings.CustomMessageHandler_get_and_clear_pending_msg(this.ptr);
+ Reference.reachabilityFence(this);
TwoTuple_PublicKeyTypeZ[] ret_conv_25_arr = new TwoTuple_PublicKeyTypeZ[ret.length];
for (int z = 0; z < ret.length; z++) {
long ret_conv_25 = ret[z];
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public Result_COption_TypeZDecodeErrorZ read(short message_type, byte[] buffer) {
long ret = bindings.CustomMessageReader_read(this.ptr, message_type, buffer);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(message_type);
+ Reference.reachabilityFence(buffer);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_your_last_per_commitment_secret() {
byte[] ret = bindings.DataLossProtect_get_your_last_per_commitment_secret(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_your_last_per_commitment_secret(byte[] val) {
bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_my_current_per_commitment_point() {
byte[] ret = bindings.DataLossProtect_get_my_current_per_commitment_point(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_my_current_per_commitment_point(byte[] val) {
bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static DataLossProtect of(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg) {
long ret = bindings.DataLossProtect_new(InternalUtils.check_arr_len(your_last_per_commitment_secret_arg, 32), InternalUtils.check_arr_len(my_current_per_commitment_point_arg, 33));
+ Reference.reachabilityFence(your_last_per_commitment_secret_arg);
+ Reference.reachabilityFence(my_current_per_commitment_point_arg);
if (ret >= 0 && ret <= 4096) { return null; }
DataLossProtect ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DataLossProtect(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.DataLossProtect_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public DataLossProtect clone() {
long ret = bindings.DataLossProtect_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
DataLossProtect ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DataLossProtect(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.DecodeError_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public DecodeError clone() {
long ret = bindings.DecodeError_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
DecodeError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DecodeError(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static DefaultRouter of(NetworkGraph network_graph, Logger logger) {
long ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr & ~1, logger == null ? 0 : logger.ptr);
+ Reference.reachabilityFence(network_graph);
+ Reference.reachabilityFence(logger);
if (ret >= 0 && ret <= 4096) { return null; }
DefaultRouter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DefaultRouter(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public Router as_Router() {
long ret = bindings.DefaultRouter_as_Router(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Router ret_hu_conv = new Router(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public OutPoint get_outpoint() {
long ret = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_outpoint(OutPoint val) {
bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_per_commitment_point() {
byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_per_commitment_point(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_per_commitment_point(byte[] val) {
bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_to_self_delay() {
short ret = bindings.DelayedPaymentOutputDescriptor_get_to_self_delay(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_to_self_delay(short val) {
bindings.DelayedPaymentOutputDescriptor_set_to_self_delay(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public void set_output(TxOut val) {
bindings.DelayedPaymentOutputDescriptor_set_output(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_revocation_pubkey() {
byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_revocation_pubkey(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_revocation_pubkey(byte[] val) {
bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_channel_keys_id() {
byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_channel_keys_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_keys_id(byte[] val) {
bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_channel_value_satoshis() {
long ret = bindings.DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_value_satoshis(long val) {
bindings.DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static DelayedPaymentOutputDescriptor of(OutPoint outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, TxOut output_arg, byte[] revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) {
long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, InternalUtils.check_arr_len(per_commitment_point_arg, 33), to_self_delay_arg, output_arg.ptr, InternalUtils.check_arr_len(revocation_pubkey_arg, 33), InternalUtils.check_arr_len(channel_keys_id_arg, 32), channel_value_satoshis_arg);
+ Reference.reachabilityFence(outpoint_arg);
+ Reference.reachabilityFence(per_commitment_point_arg);
+ Reference.reachabilityFence(to_self_delay_arg);
+ Reference.reachabilityFence(output_arg);
+ Reference.reachabilityFence(revocation_pubkey_arg);
+ Reference.reachabilityFence(channel_keys_id_arg);
+ Reference.reachabilityFence(channel_value_satoshis_arg);
if (ret >= 0 && ret <= 4096) { return null; }
DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.DelayedPaymentOutputDescriptor_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public DelayedPaymentOutputDescriptor clone() {
long ret = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.DelayedPaymentOutputDescriptor_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ read(byte[] ser) {
long ret = bindings.DelayedPaymentOutputDescriptor_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.Description_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Description clone() {
long ret = bindings.Description_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Description(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.Description_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two Descriptions contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(Description b) {
boolean ret = bindings.Description_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Description)) return false;
+ return this.eq((Description)o);
+ }
/**
* Creates a new `Description` if `description` is at most 1023 __bytes__ long,
* returns `CreationError::DescriptionTooLong` otherwise
*/
public static Result_DescriptionCreationErrorZ of(java.lang.String description) {
long ret = bindings.Description_new(description);
+ Reference.reachabilityFence(description);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public String into_inner() {
String ret = bindings.Description_into_inner(this.ptr);
+ Reference.reachabilityFence(this);
;
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public ChannelPublicKeys broadcaster_pubkeys() {
long ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public ChannelPublicKeys countersignatory_pubkeys() {
long ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public short contest_delay() {
short ret = bindings.DirectedChannelTransactionParameters_contest_delay(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public boolean is_outbound() {
boolean ret = bindings.DirectedChannelTransactionParameters_is_outbound(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public OutPoint funding_outpoint() {
long ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
+ /**
+ * Whether to use anchors for this channel
+ */
+ public boolean opt_anchors() {
+ boolean ret = bindings.DirectedChannelTransactionParameters_opt_anchors(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public int get_last_update() {
int ret = bindings.DirectionalChannelInfo_get_last_update(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_last_update(int val) {
bindings.DirectionalChannelInfo_set_last_update(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_enabled() {
boolean ret = bindings.DirectionalChannelInfo_get_enabled(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_enabled(boolean val) {
bindings.DirectionalChannelInfo_set_enabled(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_cltv_expiry_delta() {
short ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_cltv_expiry_delta(short val) {
bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_htlc_minimum_msat() {
long ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_minimum_msat(long val) {
bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public Option_u64Z get_htlc_maximum_msat() {
long ret = bindings.DirectionalChannelInfo_get_htlc_maximum_msat(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_htlc_maximum_msat(Option_u64Z val) {
bindings.DirectionalChannelInfo_set_htlc_maximum_msat(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public RoutingFees get_fees() {
long ret = bindings.DirectionalChannelInfo_get_fees(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_fees(RoutingFees val) {
bindings.DirectionalChannelInfo_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public ChannelUpdate get_last_update_message() {
long ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_last_update_message(@Nullable ChannelUpdate val) {
bindings.DirectionalChannelInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static DirectionalChannelInfo of(int last_update_arg, boolean enabled_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg, RoutingFees fees_arg, ChannelUpdate last_update_message_arg) {
long ret = bindings.DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg.ptr, fees_arg == null ? 0 : fees_arg.ptr & ~1, last_update_message_arg == null ? 0 : last_update_message_arg.ptr & ~1);
+ Reference.reachabilityFence(last_update_arg);
+ Reference.reachabilityFence(enabled_arg);
+ Reference.reachabilityFence(cltv_expiry_delta_arg);
+ Reference.reachabilityFence(htlc_minimum_msat_arg);
+ Reference.reachabilityFence(htlc_maximum_msat_arg);
+ Reference.reachabilityFence(fees_arg);
+ Reference.reachabilityFence(last_update_message_arg);
if (ret >= 0 && ret <= 4096) { return null; }
DirectionalChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectionalChannelInfo(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.DirectionalChannelInfo_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public DirectionalChannelInfo clone() {
long ret = bindings.DirectionalChannelInfo_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
DirectionalChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DirectionalChannelInfo(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.DirectionalChannelInfo_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_DirectionalChannelInfoDecodeErrorZ read(byte[] ser) {
long ret = bindings.DirectionalChannelInfo_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
if (raw_val.getClass() == bindings.LDKErrorAction.IgnoreAndLog.class) {
return new IgnoreAndLog(ptr, (bindings.LDKErrorAction.IgnoreAndLog)raw_val);
}
+ if (raw_val.getClass() == bindings.LDKErrorAction.IgnoreDuplicateGossip.class) {
+ return new IgnoreDuplicateGossip(ptr, (bindings.LDKErrorAction.IgnoreDuplicateGossip)raw_val);
+ }
if (raw_val.getClass() == bindings.LDKErrorAction.SendErrorMessage.class) {
return new SendErrorMessage(ptr, (bindings.LDKErrorAction.SendErrorMessage)raw_val);
}
this.ignore_and_log = obj.ignore_and_log;
}
}
+ /**
+ * The peer provided us with a gossip message which we'd already seen. In most cases this
+ * should be ignored, but it may result in the message being forwarded if it is a duplicate of
+ * our own channel announcements.
+ */
+ public final static class IgnoreDuplicateGossip extends ErrorAction {
+ private IgnoreDuplicateGossip(long ptr, bindings.LDKErrorAction.IgnoreDuplicateGossip obj) {
+ super(null, ptr);
+ }
+ }
/**
* The peer did something incorrect. Tell them.
*/
}
long clone_ptr() {
long ret = bindings.ErrorAction_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ErrorAction clone() {
long ret = bindings.ErrorAction_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static ErrorAction disconnect_peer(ErrorMessage msg) {
long ret = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static ErrorAction ignore_and_log(org.ldk.enums.Level a) {
long ret = bindings.ErrorAction_ignore_and_log(a);
+ Reference.reachabilityFence(a);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
+ */
+ public static ErrorAction ignore_duplicate_gossip() {
+ long ret = bindings.ErrorAction_ignore_duplicate_gossip();
if (ret >= 0 && ret <= 4096) { return null; }
ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static ErrorAction send_error_message(ErrorMessage msg) {
long ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.ErrorMessage_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.ErrorMessage_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public String get_data() {
String ret = bindings.ErrorMessage_get_data(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_data(java.lang.String val) {
bindings.ErrorMessage_set_data(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ErrorMessage of(byte[] channel_id_arg, java.lang.String data_arg) {
long ret = bindings.ErrorMessage_new(InternalUtils.check_arr_len(channel_id_arg, 32), data_arg);
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(data_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ErrorMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ErrorMessage(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ErrorMessage_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ErrorMessage clone() {
long ret = bindings.ErrorMessage_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ErrorMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ErrorMessage(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ErrorMessage_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ErrorMessageDecodeErrorZ read(byte[] ser) {
long ret = bindings.ErrorMessage_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public MessageSendEventsProvider as_MessageSendEventsProvider() {
long ret = bindings.ErroringMessageHandler_as_MessageSendEventsProvider(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public ChannelMessageHandler as_ChannelMessageHandler() {
long ret = bindings.ErroringMessageHandler_as_ChannelMessageHandler(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
if (raw_val.getClass() == bindings.LDKEvent.PaymentPathFailed.class) {
return new PaymentPathFailed(ptr, (bindings.LDKEvent.PaymentPathFailed)raw_val);
}
+ if (raw_val.getClass() == bindings.LDKEvent.PaymentFailed.class) {
+ return new PaymentFailed(ptr, (bindings.LDKEvent.PaymentFailed)raw_val);
+ }
if (raw_val.getClass() == bindings.LDKEvent.PendingHTLCsForwardable.class) {
return new PendingHTLCsForwardable(ptr, (bindings.LDKEvent.PendingHTLCsForwardable)raw_val);
}
if (raw_val.getClass() == bindings.LDKEvent.DiscardFunding.class) {
return new DiscardFunding(ptr, (bindings.LDKEvent.DiscardFunding)raw_val);
}
+ if (raw_val.getClass() == bindings.LDKEvent.PaymentPathSuccessful.class) {
+ return new PaymentPathSuccessful(ptr, (bindings.LDKEvent.PaymentPathSuccessful)raw_val);
+ }
assert false; return null; // Unreachable without extending the (internal) bindings interface
}
/**
* Used to indicate that the client should generate a funding transaction with the given
- * parameters and then call ChannelManager::funding_transaction_generated.
- * Generated in ChannelManager message handling.
+ * parameters and then call [`ChannelManager::funding_transaction_generated`].
+ * Generated in [`ChannelManager`] message handling.
* Note that *all inputs* in the funding transaction must spend SegWit outputs or your
* counterparty can steal your funds!
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
*/
public final static class FundingGenerationReady extends Event {
/**
* [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
* automatically failed.
*
+ * # Note
+ * LDK will not stop an inbound payment from being paid multiple times, so multiple
+ * `PaymentReceived` events may be generated for the same payment.
+ *
* [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
* [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
*/
public final static class PaymentReceived extends Event {
/**
- * The hash for which the preimage should be handed to the ChannelManager.
+ * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
+ * not stop you from registering duplicate payment hashes for inbound payments.
*/
public final byte[] payment_hash;
/**
*/
public final byte[] payment_preimage;
/**
- * The hash which was given to [`ChannelManager::send_payment`].
+ * The hash that was given to [`ChannelManager::send_payment`].
*
* [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
*/
}
}
/**
- * Indicates an outbound payment we made failed. Probably some intermediary node dropped
+ * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
* something. You may wish to retry with a different route.
+ *
+ * Note that this does *not* indicate that all paths for an MPP payment have failed, see
+ * [`Event::PaymentFailed`] and [`all_paths_failed`].
+ *
+ * [`all_paths_failed`]: Self::all_paths_failed
*/
public final static class PaymentPathFailed extends Event {
/**
* The id returned by [`ChannelManager::send_payment`] and used with
- * [`ChannelManager::retry_payment`].
+ * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
*
* [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
* [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
*
* Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
@Nullable public final byte[] payment_id;
/**
- * The hash which was given to ChannelManager::send_payment.
+ * The hash that was given to [`ChannelManager::send_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
*/
public final byte[] payment_hash;
/**
* For both single-path and multi-path payments, this is set if all paths of the payment have
* failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
* larger MPP payment were still in flight when this event was generated.
+ *
+ * Note that if you are retrying individual MPP parts, using this value to determine if a
+ * payment has fully failed is race-y. Because multiple failures can happen prior to events
+ * being processed, you may retry in response to a first failure, with a second failure
+ * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
+ * you will see `all_paths_failed` set even though the retry of the first failure still
+ * has an associated in-flight HTLC. See (1) for an example of such a failure.
+ *
+ * If you wish to retry individual MPP parts and learn when a payment has failed, you must
+ * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
+ *
+ * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
+ *
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
*/
public final boolean all_paths_failed;
/**
}
}
/**
- * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
- * time in the future.
+ * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
+ * provide failure information for each MPP part in the payment.
+ *
+ * This event is provided once there are no further pending HTLCs for the payment and the
+ * payment is no longer retryable, either due to a several-block timeout or because
+ * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
+ *
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ */
+ public final static class PaymentFailed extends Event {
+ /**
+ * The id returned by [`ChannelManager::send_payment`] and used with
+ * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ */
+ public final byte[] payment_id;
+ /**
+ * The hash that was given to [`ChannelManager::send_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ */
+ public final byte[] payment_hash;
+ private PaymentFailed(long ptr, bindings.LDKEvent.PaymentFailed obj) {
+ super(null, ptr);
+ this.payment_id = obj.payment_id;
+ this.payment_hash = obj.payment_hash;
+ }
+ }
+ /**
+ * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
+ * a time in the future.
+ *
+ * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
*/
public final static class PendingHTLCsForwardable extends Event {
/**
this.transaction = obj.transaction;
}
}
+ /**
+ * Indicates that a path for an outbound payment was successful.
+ *
+ * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
+ * [`Event::PaymentSent`] for obtaining the payment preimage.
+ */
+ public final static class PaymentPathSuccessful extends Event {
+ /**
+ * The id returned by [`ChannelManager::send_payment`] and used with
+ * [`ChannelManager::retry_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
+ */
+ public final byte[] payment_id;
+ /**
+ * The hash that was given to [`ChannelManager::send_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable public final byte[] payment_hash;
+ /**
+ * The payment path that was successful.
+ *
+ * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
+ */
+ public final RouteHop[] path;
+ private PaymentPathSuccessful(long ptr, bindings.LDKEvent.PaymentPathSuccessful obj) {
+ super(null, ptr);
+ this.payment_id = obj.payment_id;
+ this.payment_hash = obj.payment_hash;
+ long[] path = obj.path;
+ RouteHop[] path_conv_10_arr = new RouteHop[path.length];
+ for (int k = 0; k < path.length; k++) {
+ long path_conv_10 = path[k];
+ RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new RouteHop(null, path_conv_10); }
+ path_conv_10_hu_conv.ptrs_to.add(this);
+ path_conv_10_arr[k] = path_conv_10_hu_conv;
+ }
+ this.path = path_conv_10_arr;
+ }
+ }
long clone_ptr() {
long ret = bindings.Event_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Event clone() {
long ret = bindings.Event_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static Event funding_generation_ready(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) {
long ret = bindings.Event_funding_generation_ready(InternalUtils.check_arr_len(temporary_channel_id, 32), channel_value_satoshis, output_script, user_channel_id);
+ Reference.reachabilityFence(temporary_channel_id);
+ Reference.reachabilityFence(channel_value_satoshis);
+ Reference.reachabilityFence(output_script);
+ Reference.reachabilityFence(user_channel_id);
if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Event payment_received(byte[] payment_hash, long amt, PaymentPurpose purpose) {
long ret = bindings.Event_payment_received(InternalUtils.check_arr_len(payment_hash, 32), amt, purpose.ptr);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(amt);
+ Reference.reachabilityFence(purpose);
if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Event payment_sent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, Option_u64Z fee_paid_msat) {
long ret = bindings.Event_payment_sent(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_hash, 32), fee_paid_msat.ptr);
+ Reference.reachabilityFence(payment_id);
+ Reference.reachabilityFence(payment_preimage);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(fee_paid_msat);
if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id, RouteParameters retry) {
long ret = bindings.Event_payment_path_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), rejected_by_dest, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr & ~1);
+ Reference.reachabilityFence(payment_id);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(rejected_by_dest);
+ Reference.reachabilityFence(network_update);
+ Reference.reachabilityFence(all_paths_failed);
+ Reference.reachabilityFence(path);
+ Reference.reachabilityFence(short_channel_id);
+ Reference.reachabilityFence(retry);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new PaymentFailed-variant Event
+ */
+ public static Event payment_failed(byte[] payment_id, byte[] payment_hash) {
+ long ret = bindings.Event_payment_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32));
+ Reference.reachabilityFence(payment_id);
+ Reference.reachabilityFence(payment_hash);
if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Event pending_htlcs_forwardable(long time_forwardable) {
long ret = bindings.Event_pending_htlcs_forwardable(time_forwardable);
+ Reference.reachabilityFence(time_forwardable);
if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Event spendable_outputs(SpendableOutputDescriptor[] outputs) {
long ret = bindings.Event_spendable_outputs(outputs != null ? Arrays.stream(outputs).mapToLong(outputs_conv_27 -> outputs_conv_27.ptr).toArray() : null);
+ Reference.reachabilityFence(outputs);
if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Event payment_forwarded(Option_u64Z fee_earned_msat, boolean claim_from_onchain_tx) {
long ret = bindings.Event_payment_forwarded(fee_earned_msat.ptr, claim_from_onchain_tx);
+ Reference.reachabilityFence(fee_earned_msat);
+ Reference.reachabilityFence(claim_from_onchain_tx);
if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Event channel_closed(byte[] channel_id, long user_channel_id, ClosureReason reason) {
long ret = bindings.Event_channel_closed(InternalUtils.check_arr_len(channel_id, 32), user_channel_id, reason.ptr);
+ Reference.reachabilityFence(channel_id);
+ Reference.reachabilityFence(user_channel_id);
+ Reference.reachabilityFence(reason);
if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Event discard_funding(byte[] channel_id, byte[] transaction) {
long ret = bindings.Event_discard_funding(InternalUtils.check_arr_len(channel_id, 32), transaction);
+ Reference.reachabilityFence(channel_id);
+ Reference.reachabilityFence(transaction);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Event ret_hu_conv = Event.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new PaymentPathSuccessful-variant Event
+ */
+ public static Event payment_path_successful(byte[] payment_id, byte[] payment_hash, RouteHop[] path) {
+ long ret = bindings.Event_payment_path_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(payment_id);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(path);
if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public byte[] write() {
byte[] ret = bindings.Event_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public void handle_event(Event event) {
bindings.EventHandler_handle_event(this.ptr, event == null ? 0 : event.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(event);
}
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public void process_pending_events(EventHandler handler) {
bindings.EventsProvider_process_pending_events(this.ptr, handler == null ? 0 : handler.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(handler);
this.ptrs_to.add(handler);
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.ExpiryTime_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ExpiryTime clone() {
long ret = bindings.ExpiryTime_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ExpiryTime(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.ExpiryTime_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two ExpiryTimes contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(ExpiryTime b) {
boolean ret = bindings.ExpiryTime_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ExpiryTime)) return false;
+ return this.eq((ExpiryTime)o);
+ }
/**
* Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would
* overflow on adding the `EpiryTime` to it then this function will return a
*/
public static Result_ExpiryTimeCreationErrorZ from_seconds(long seconds) {
long ret = bindings.ExpiryTime_from_seconds(seconds);
+ Reference.reachabilityFence(seconds);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ExpiryTimeCreationErrorZ from_duration(long duration) {
long ret = bindings.ExpiryTime_from_duration(duration);
+ Reference.reachabilityFence(duration);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public long as_seconds() {
long ret = bindings.ExpiryTime_as_seconds(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public long as_duration() {
long ret = bindings.ExpiryTime_as_duration(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
long clone_ptr() {
long ret = bindings.Fallback_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Fallback clone() {
long ret = bindings.Fallback_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static Fallback seg_wit_program(UInt5 version, byte[] program) {
long ret = bindings.Fallback_seg_wit_program(version.getVal(), program);
+ Reference.reachabilityFence(version);
+ Reference.reachabilityFence(program);
if (ret >= 0 && ret <= 4096) { return null; }
Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Fallback pub_key_hash(byte[] a) {
long ret = bindings.Fallback_pub_key_hash(InternalUtils.check_arr_len(a, 20));
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Fallback script_hash(byte[] a) {
long ret = bindings.Fallback_script_hash(InternalUtils.check_arr_len(a, 20));
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public long hash() {
long ret = bindings.Fallback_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two Fallbacks contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(Fallback b) {
boolean ret = bindings.Fallback_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Fallback)) return false;
+ return this.eq((Fallback)o);
+ }
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
/**
* Gets estimated satoshis of fee required per 1000 Weight-Units.
*
- * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
- * don't put us below 1 satoshi-per-byte).
+ * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
+ * round-downs don't put us below 1 satoshi-per-byte).
*
- * This translates to:
- * satoshis-per-byte * 250
- * ceil(satoshis-per-kbyte / 4)
+ * This method can be implemented with the following unit conversions:
+ * max(satoshis-per-byte * 250, 253)
+ * max(satoshis-per-kbyte / 4, 253)
*/
int get_est_sat_per_1000_weight(ConfirmationTarget confirmation_target);
}
/**
* Gets estimated satoshis of fee required per 1000 Weight-Units.
*
- * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
- * don't put us below 1 satoshi-per-byte).
+ * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
+ * round-downs don't put us below 1 satoshi-per-byte).
*
- * This translates to:
- * satoshis-per-byte * 250
- * ceil(satoshis-per-kbyte / 4)
+ * This method can be implemented with the following unit conversions:
+ * max(satoshis-per-byte * 250, 253)
+ * max(satoshis-per-kbyte / 4, 253)
*/
public int get_est_sat_per_1000_weight(org.ldk.enums.ConfirmationTarget confirmation_target) {
int ret = bindings.FeeEstimator_get_est_sat_per_1000_weight(this.ptr, confirmation_target);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(confirmation_target);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static FilesystemPersister of(java.lang.String path_to_channel_data) {
long ret = bindings.FilesystemPersister_new(path_to_channel_data);
+ Reference.reachabilityFence(path_to_channel_data);
if (ret >= 0 && ret <= 4096) { return null; }
FilesystemPersister ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FilesystemPersister(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public String get_data_dir() {
String ret = bindings.FilesystemPersister_get_data_dir(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ read_channelmonitors(KeysInterface keys_manager) {
long ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, keys_manager == null ? 0 : keys_manager.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(keys_manager);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(keys_manager);
*/
public Persist as_Persist() {
long ret = bindings.FilesystemPersister_as_Persist(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Persist ret_hu_conv = new Persist(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public void register_tx(byte[] txid, byte[] script_pubkey) {
bindings.Filter_register_tx(this.ptr, InternalUtils.check_arr_len(txid, 32), script_pubkey);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(txid);
+ Reference.reachabilityFence(script_pubkey);
}
/**
*/
public Option_C2Tuple_usizeTransactionZZ register_output(WatchedOutput output) {
long ret = bindings.Filter_register_output(this.ptr, output == null ? 0 : output.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(output);
if (ret >= 0 && ret <= 4096) { return null; }
Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_temporary_channel_id() {
byte[] ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_temporary_channel_id(byte[] val) {
bindings.FundingCreated_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_funding_txid() {
byte[] ret = bindings.FundingCreated_get_funding_txid(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_funding_txid(byte[] val) {
bindings.FundingCreated_set_funding_txid(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_funding_output_index() {
short ret = bindings.FundingCreated_get_funding_output_index(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_funding_output_index(short val) {
bindings.FundingCreated_set_funding_output_index(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_signature() {
byte[] ret = bindings.FundingCreated_get_signature(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_signature(byte[] val) {
bindings.FundingCreated_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static FundingCreated of(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) {
long ret = bindings.FundingCreated_new(InternalUtils.check_arr_len(temporary_channel_id_arg, 32), InternalUtils.check_arr_len(funding_txid_arg, 32), funding_output_index_arg, InternalUtils.check_arr_len(signature_arg, 64));
+ Reference.reachabilityFence(temporary_channel_id_arg);
+ Reference.reachabilityFence(funding_txid_arg);
+ Reference.reachabilityFence(funding_output_index_arg);
+ Reference.reachabilityFence(signature_arg);
if (ret >= 0 && ret <= 4096) { return null; }
FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingCreated(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.FundingCreated_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public FundingCreated clone() {
long ret = bindings.FundingCreated_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingCreated(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.FundingCreated_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_FundingCreatedDecodeErrorZ read(byte[] ser) {
long ret = bindings.FundingCreated_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.FundingLocked_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.FundingLocked_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_next_per_commitment_point() {
byte[] ret = bindings.FundingLocked_get_next_per_commitment_point(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_next_per_commitment_point(byte[] val) {
bindings.FundingLocked_set_next_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static FundingLocked of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg) {
long ret = bindings.FundingLocked_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(next_per_commitment_point_arg, 33));
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(next_per_commitment_point_arg);
if (ret >= 0 && ret <= 4096) { return null; }
FundingLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingLocked(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.FundingLocked_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public FundingLocked clone() {
long ret = bindings.FundingLocked_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
FundingLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingLocked(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.FundingLocked_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_FundingLockedDecodeErrorZ read(byte[] ser) {
long ret = bindings.FundingLocked_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.FundingSigned_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.FundingSigned_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_signature() {
byte[] ret = bindings.FundingSigned_get_signature(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_signature(byte[] val) {
bindings.FundingSigned_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static FundingSigned of(byte[] channel_id_arg, byte[] signature_arg) {
long ret = bindings.FundingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(signature_arg, 64));
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(signature_arg);
if (ret >= 0 && ret <= 4096) { return null; }
FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingSigned(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.FundingSigned_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public FundingSigned clone() {
long ret = bindings.FundingSigned_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FundingSigned(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.FundingSigned_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_FundingSignedDecodeErrorZ read(byte[] ser) {
long ret = bindings.FundingSigned_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_chain_hash() {
byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_chain_hash(byte[] val) {
bindings.GossipTimestampFilter_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_first_timestamp() {
int ret = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_first_timestamp(int val) {
bindings.GossipTimestampFilter_set_first_timestamp(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_timestamp_range() {
int ret = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_timestamp_range(int val) {
bindings.GossipTimestampFilter_set_timestamp_range(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static GossipTimestampFilter of(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) {
long ret = bindings.GossipTimestampFilter_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_timestamp_arg, timestamp_range_arg);
+ Reference.reachabilityFence(chain_hash_arg);
+ Reference.reachabilityFence(first_timestamp_arg);
+ Reference.reachabilityFence(timestamp_range_arg);
if (ret >= 0 && ret <= 4096) { return null; }
GossipTimestampFilter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new GossipTimestampFilter(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.GossipTimestampFilter_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public GossipTimestampFilter clone() {
long ret = bindings.GossipTimestampFilter_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
GossipTimestampFilter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new GossipTimestampFilter(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.GossipTimestampFilter_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_GossipTimestampFilterDecodeErrorZ read(byte[] ser) {
long ret = bindings.GossipTimestampFilter_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public boolean get_offered() {
boolean ret = bindings.HTLCOutputInCommitment_get_offered(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_offered(boolean val) {
bindings.HTLCOutputInCommitment_set_offered(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_amount_msat() {
long ret = bindings.HTLCOutputInCommitment_get_amount_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_amount_msat(long val) {
bindings.HTLCOutputInCommitment_set_amount_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_cltv_expiry() {
int ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_cltv_expiry(int val) {
bindings.HTLCOutputInCommitment_set_cltv_expiry(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_payment_hash() {
byte[] ret = bindings.HTLCOutputInCommitment_get_payment_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_payment_hash(byte[] val) {
bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public Option_u32Z get_transaction_output_index() {
long ret = bindings.HTLCOutputInCommitment_get_transaction_output_index(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_transaction_output_index(Option_u32Z val) {
bindings.HTLCOutputInCommitment_set_transaction_output_index(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static HTLCOutputInCommitment of(boolean offered_arg, long amount_msat_arg, int cltv_expiry_arg, byte[] payment_hash_arg, Option_u32Z transaction_output_index_arg) {
long ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, InternalUtils.check_arr_len(payment_hash_arg, 32), transaction_output_index_arg.ptr);
+ Reference.reachabilityFence(offered_arg);
+ Reference.reachabilityFence(amount_msat_arg);
+ Reference.reachabilityFence(cltv_expiry_arg);
+ Reference.reachabilityFence(payment_hash_arg);
+ Reference.reachabilityFence(transaction_output_index_arg);
if (ret >= 0 && ret <= 4096) { return null; }
HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HTLCOutputInCommitment(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.HTLCOutputInCommitment_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public HTLCOutputInCommitment clone() {
long ret = bindings.HTLCOutputInCommitment_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HTLCOutputInCommitment(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.HTLCOutputInCommitment_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_HTLCOutputInCommitmentDecodeErrorZ read(byte[] ser) {
long ret = bindings.HTLCOutputInCommitment_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.HTLCUpdate_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public HTLCUpdate clone() {
long ret = bindings.HTLCUpdate_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
HTLCUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HTLCUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.HTLCUpdate_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_HTLCUpdateDecodeErrorZ read(byte[] ser) {
long ret = bindings.HTLCUpdate_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_counterparty_sig() {
byte[] ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_counterparty_sig(byte[] val) {
bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public void set_counterparty_htlc_sigs(byte[][] val) {
bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val != null ? Arrays.stream(val).map(val_conv_8 -> InternalUtils.check_arr_len(val_conv_8, 64)).toArray(byte[][]::new) : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.HolderCommitmentTransaction_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public HolderCommitmentTransaction clone() {
long ret = bindings.HolderCommitmentTransaction_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
HolderCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HolderCommitmentTransaction(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.HolderCommitmentTransaction_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_HolderCommitmentTransactionDecodeErrorZ read(byte[] ser) {
long ret = bindings.HolderCommitmentTransaction_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static HolderCommitmentTransaction of(CommitmentTransaction commitment_tx, byte[] counterparty_sig, byte[][] counterparty_htlc_sigs, byte[] holder_funding_key, byte[] counterparty_funding_key) {
long ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr & ~1, InternalUtils.check_arr_len(counterparty_sig, 64), counterparty_htlc_sigs != null ? Arrays.stream(counterparty_htlc_sigs).map(counterparty_htlc_sigs_conv_8 -> InternalUtils.check_arr_len(counterparty_htlc_sigs_conv_8, 64)).toArray(byte[][]::new) : null, InternalUtils.check_arr_len(holder_funding_key, 33), InternalUtils.check_arr_len(counterparty_funding_key, 33));
+ Reference.reachabilityFence(commitment_tx);
+ Reference.reachabilityFence(counterparty_sig);
+ Reference.reachabilityFence(counterparty_htlc_sigs);
+ Reference.reachabilityFence(holder_funding_key);
+ Reference.reachabilityFence(counterparty_funding_key);
if (ret >= 0 && ret <= 4096) { return null; }
HolderCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new HolderCommitmentTransaction(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public MessageSendEventsProvider as_MessageSendEventsProvider() {
long ret = bindings.IgnoringMessageHandler_as_MessageSendEventsProvider(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public RoutingMessageHandler as_RoutingMessageHandler() {
long ret = bindings.IgnoringMessageHandler_as_RoutingMessageHandler(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public CustomMessageReader as_CustomMessageReader() {
long ret = bindings.IgnoringMessageHandler_as_CustomMessageReader(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
CustomMessageReader ret_hu_conv = new CustomMessageReader(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public CustomMessageHandler as_CustomMessageHandler() {
long ret = bindings.IgnoringMessageHandler_as_CustomMessageHandler(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
CustomMessageHandler ret_hu_conv = new CustomMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_funding_key() {
byte[] ret = bindings.InMemorySigner_get_funding_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_funding_key(byte[] val) {
bindings.InMemorySigner_set_funding_key(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_revocation_base_key() {
byte[] ret = bindings.InMemorySigner_get_revocation_base_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_revocation_base_key(byte[] val) {
bindings.InMemorySigner_set_revocation_base_key(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_payment_key() {
byte[] ret = bindings.InMemorySigner_get_payment_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_payment_key(byte[] val) {
bindings.InMemorySigner_set_payment_key(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_delayed_payment_base_key() {
byte[] ret = bindings.InMemorySigner_get_delayed_payment_base_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_delayed_payment_base_key(byte[] val) {
bindings.InMemorySigner_set_delayed_payment_base_key(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_htlc_base_key() {
byte[] ret = bindings.InMemorySigner_get_htlc_base_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_base_key(byte[] val) {
bindings.InMemorySigner_set_htlc_base_key(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_commitment_seed() {
byte[] ret = bindings.InMemorySigner_get_commitment_seed(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_commitment_seed(byte[] val) {
bindings.InMemorySigner_set_commitment_seed(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.InMemorySigner_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public InMemorySigner clone() {
long ret = bindings.InMemorySigner_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public static InMemorySigner of(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id) {
long ret = bindings.InMemorySigner_new(InternalUtils.check_arr_len(funding_key, 32), InternalUtils.check_arr_len(revocation_base_key, 32), InternalUtils.check_arr_len(payment_key, 32), InternalUtils.check_arr_len(delayed_payment_base_key, 32), InternalUtils.check_arr_len(htlc_base_key, 32), InternalUtils.check_arr_len(commitment_seed, 32), channel_value_satoshis, InternalUtils.check_arr_len(channel_keys_id, 32));
+ Reference.reachabilityFence(funding_key);
+ Reference.reachabilityFence(revocation_base_key);
+ Reference.reachabilityFence(payment_key);
+ Reference.reachabilityFence(delayed_payment_base_key);
+ Reference.reachabilityFence(htlc_base_key);
+ Reference.reachabilityFence(commitment_seed);
+ Reference.reachabilityFence(channel_value_satoshis);
+ Reference.reachabilityFence(channel_keys_id);
if (ret >= 0 && ret <= 4096) { return null; }
InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public ChannelPublicKeys counterparty_pubkeys() {
long ret = bindings.InMemorySigner_counterparty_pubkeys(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelPublicKeys(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public short counterparty_selected_contest_delay() {
short ret = bindings.InMemorySigner_counterparty_selected_contest_delay(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public short holder_selected_contest_delay() {
short ret = bindings.InMemorySigner_holder_selected_contest_delay(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public boolean is_outbound() {
boolean ret = bindings.InMemorySigner_is_outbound(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public OutPoint funding_outpoint() {
long ret = bindings.InMemorySigner_funding_outpoint(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public ChannelTransactionParameters get_channel_parameters() {
long ret = bindings.InMemorySigner_get_channel_parameters(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTransactionParameters(null, ret); }
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
+ /**
+ * Whether anchors should be used.
+ * Will panic if ready_channel wasn't called.
+ */
+ public boolean opt_anchors() {
+ boolean ret = bindings.InMemorySigner_opt_anchors(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
/**
* Sign the single input of spend_tx at index `input_idx` which spends the output
* described by descriptor, returning the witness stack for the input.
*/
public Result_CVec_CVec_u8ZZNoneZ sign_counterparty_payment_input(byte[] spend_tx, long input_idx, StaticPaymentOutputDescriptor descriptor) {
long ret = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(spend_tx);
+ Reference.reachabilityFence(input_idx);
+ Reference.reachabilityFence(descriptor);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(descriptor);
*/
public Result_CVec_CVec_u8ZZNoneZ sign_dynamic_p2wsh_input(byte[] spend_tx, long input_idx, DelayedPaymentOutputDescriptor descriptor) {
long ret = bindings.InMemorySigner_sign_dynamic_p2wsh_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(spend_tx);
+ Reference.reachabilityFence(input_idx);
+ Reference.reachabilityFence(descriptor);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(descriptor);
*/
public BaseSign as_BaseSign() {
long ret = bindings.InMemorySigner_as_BaseSign(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
BaseSign ret_hu_conv = new BaseSign(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public Sign as_Sign() {
long ret = bindings.InMemorySigner_as_Sign(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Sign ret_hu_conv = new Sign(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.InMemorySigner_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_InMemorySignerDecodeErrorZ read(byte[] ser) {
long ret = bindings.InMemorySigner_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public InitFeatures get_features() {
long ret = bindings.Init_get_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_features(InitFeatures val) {
bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static Init of(InitFeatures features_arg) {
long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr & ~1);
+ Reference.reachabilityFence(features_arg);
if (ret >= 0 && ret <= 4096) { return null; }
Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Init(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.Init_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Init clone() {
long ret = bindings.Init_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Init(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.Init_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_InitDecodeErrorZ read(byte[] ser) {
long ret = bindings.Init_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public boolean eq(InitFeatures b) {
boolean ret = bindings.InitFeatures_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof InitFeatures)) return false;
+ return this.eq((InitFeatures)o);
+ }
long clone_ptr() {
long ret = bindings.InitFeatures_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public InitFeatures clone() {
long ret = bindings.InitFeatures_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public boolean requires_unknown_bits() {
boolean ret = bindings.InitFeatures_requires_unknown_bits(this.ptr);
- return ret;
- }
-
- /**
- * Returns whether the `payment_secret` feature is supported.
- */
- public boolean supports_payment_secret() {
- boolean ret = bindings.InitFeatures_supports_payment_secret(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] write() {
byte[] ret = bindings.InitFeatures_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) {
long ret = bindings.InitFeatures_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_script() {
byte[] ret = bindings.InvalidShutdownScript_get_script(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_script(byte[] val) {
bindings.InvalidShutdownScript_set_script(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static InvalidShutdownScript of(byte[] script_arg) {
long ret = bindings.InvalidShutdownScript_new(script_arg);
+ Reference.reachabilityFence(script_arg);
if (ret >= 0 && ret <= 4096) { return null; }
InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvalidShutdownScript(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.InvalidShutdownScript_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public InvalidShutdownScript clone() {
long ret = bindings.InvalidShutdownScript_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InvalidShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvalidShutdownScript(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public boolean eq(Invoice b) {
boolean ret = bindings.Invoice_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Invoice)) return false;
+ return this.eq((Invoice)o);
+ }
long clone_ptr() {
long ret = bindings.Invoice_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Invoice clone() {
long ret = bindings.Invoice_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Invoice(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public SignedRawInvoice into_signed_raw() {
long ret = bindings.Invoice_into_signed_raw(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new SignedRawInvoice(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public Result_NoneSemanticErrorZ check_signature() {
long ret = bindings.Invoice_check_signature(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_InvoiceSemanticErrorZ from_signed(SignedRawInvoice signed_invoice) {
long ret = bindings.Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr & ~1);
+ Reference.reachabilityFence(signed_invoice);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public long timestamp() {
long ret = bindings.Invoice_timestamp(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] payment_hash() {
byte[] ret = bindings.Invoice_payment_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
@Nullable
public byte[] payee_pub_key() {
byte[] ret = bindings.Invoice_payee_pub_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] payment_secret() {
byte[] ret = bindings.Invoice_payment_secret(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
@Nullable
public InvoiceFeatures features() {
long ret = bindings.Invoice_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] recover_payee_pub_key() {
byte[] ret = bindings.Invoice_recover_payee_pub_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public long expiry_time() {
long ret = bindings.Invoice_expiry_time(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public boolean is_expired() {
boolean ret = bindings.Invoice_is_expired(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public long min_final_cltv_expiry() {
long ret = bindings.Invoice_min_final_cltv_expiry(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public PrivateRoute[] private_routes() {
long[] ret = bindings.Invoice_private_routes(this.ptr);
+ Reference.reachabilityFence(this);
PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret.length];
for (int o = 0; o < ret.length; o++) {
long ret_conv_14 = ret[o];
*/
public RouteHint[] route_hints() {
long[] ret = bindings.Invoice_route_hints(this.ptr);
+ Reference.reachabilityFence(this);
RouteHint[] ret_conv_11_arr = new RouteHint[ret.length];
for (int l = 0; l < ret.length; l++) {
long ret_conv_11 = ret[l];
*/
public Currency currency() {
Currency ret = bindings.Invoice_currency(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_u64Z amount_milli_satoshis() {
long ret = bindings.Invoice_amount_milli_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static Result_InvoiceNoneZ from_str(java.lang.String s) {
long ret = bindings.Invoice_from_str(s);
+ Reference.reachabilityFence(s);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public String to_str() {
String ret = bindings.Invoice_to_str(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public boolean eq(InvoiceFeatures b) {
boolean ret = bindings.InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof InvoiceFeatures)) return false;
+ return this.eq((InvoiceFeatures)o);
+ }
long clone_ptr() {
long ret = bindings.InvoiceFeatures_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public InvoiceFeatures clone() {
long ret = bindings.InvoiceFeatures_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public boolean requires_unknown_bits() {
boolean ret = bindings.InvoiceFeatures_requires_unknown_bits(this.ptr);
- return ret;
- }
-
- /**
- * Returns whether the `payment_secret` feature is supported.
- */
- public boolean supports_payment_secret() {
- boolean ret = bindings.InvoiceFeatures_supports_payment_secret(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] write() {
byte[] ret = bindings.InvoiceFeatures_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_InvoiceFeaturesDecodeErrorZ read(byte[] ser) {
long ret = bindings.InvoiceFeatures_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
- * A utility for paying [`Invoice]`s.
+ * A utility for paying [`Invoice`]s and sending spontaneous payments.
+ *
+ * See [module-level documentation] for details.
+ *
+ * [module-level documentation]: crate::payment
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class InvoicePayer extends CommonBase {
* Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
* `retry_attempts` has been exceeded for a given [`Invoice`].
*/
- public static InvoicePayer of(Payer payer, Router router, LockableScore scorer, Logger logger, EventHandler event_handler, RetryAttempts retry_attempts) {
+ public static InvoicePayer of(Payer payer, Router router, MultiThreadedLockableScore scorer, Logger logger, EventHandler event_handler, RetryAttempts retry_attempts) {
long ret = bindings.InvoicePayer_new(payer == null ? 0 : payer.ptr, router == null ? 0 : router.ptr, scorer == null ? 0 : scorer.ptr & ~1, logger == null ? 0 : logger.ptr, event_handler == null ? 0 : event_handler.ptr, retry_attempts == null ? 0 : retry_attempts.ptr & ~1);
+ Reference.reachabilityFence(payer);
+ Reference.reachabilityFence(router);
+ Reference.reachabilityFence(scorer);
+ Reference.reachabilityFence(logger);
+ Reference.reachabilityFence(event_handler);
+ Reference.reachabilityFence(retry_attempts);
if (ret >= 0 && ret <= 4096) { return null; }
InvoicePayer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoicePayer(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public Result_PaymentIdPaymentErrorZ pay_invoice(Invoice invoice) {
long ret = bindings.InvoicePayer_pay_invoice(this.ptr, invoice == null ? 0 : invoice.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(invoice);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(invoice);
*/
public Result_PaymentIdPaymentErrorZ pay_zero_value_invoice(Invoice invoice, long amount_msats) {
long ret = bindings.InvoicePayer_pay_zero_value_invoice(this.ptr, invoice == null ? 0 : invoice.ptr & ~1, amount_msats);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(invoice);
+ Reference.reachabilityFence(amount_msats);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(invoice);
return ret_hu_conv;
}
+ /**
+ * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
+ * case a retry is needed.
+ *
+ * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
+ * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
+ */
+ public Result_PaymentIdPaymentErrorZ pay_pubkey(byte[] pubkey, byte[] payment_preimage, long amount_msats, int final_cltv_expiry_delta) {
+ long ret = bindings.InvoicePayer_pay_pubkey(this.ptr, InternalUtils.check_arr_len(pubkey, 33), InternalUtils.check_arr_len(payment_preimage, 32), amount_msats, final_cltv_expiry_delta);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(pubkey);
+ Reference.reachabilityFence(payment_preimage);
+ Reference.reachabilityFence(amount_msats);
+ Reference.reachabilityFence(final_cltv_expiry_delta);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
/**
* Removes the payment cached by the given payment hash.
*
*/
public void remove_cached_payment(byte[] payment_hash) {
bindings.InvoicePayer_remove_cached_payment(this.ptr, InternalUtils.check_arr_len(payment_hash, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(payment_hash);
}
/**
*/
public EventHandler as_EventHandler() {
long ret = bindings.InvoicePayer_as_EventHandler(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
EventHandler ret_hu_conv = new EventHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.InvoiceSignature_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public InvoiceSignature clone() {
long ret = bindings.InvoiceSignature_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceSignature(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public boolean eq(InvoiceSignature b) {
boolean ret = bindings.InvoiceSignature_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof InvoiceSignature)) return false;
+ return this.eq((InvoiceSignature)o);
+ }
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
* blindly signing the hash.
*/
Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);
+ /**
+ * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
+ *
+ * This method must return the same value each time it is called.
+ */
+ byte[] get_inbound_payment_key_material();
}
private static class LDKKeysInterfaceHolder { KeysInterface held; }
public static KeysInterface new_impl(KeysInterfaceInterface arg) {
long result = ret == null ? 0 : ret.clone_ptr();
return result;
}
+ @Override public byte[] get_inbound_payment_key_material() {
+ byte[] ret = arg.get_inbound_payment_key_material();
+ byte[] result = InternalUtils.check_arr_len(ret, 32);
+ return result;
+ }
});
return impl_holder.held;
}
*/
public byte[] get_node_secret() {
byte[] ret = bindings.KeysInterface_get_node_secret(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] get_destination_script() {
byte[] ret = bindings.KeysInterface_get_destination_script(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ShutdownScript get_shutdown_scriptpubkey() {
long ret = bindings.KeysInterface_get_shutdown_scriptpubkey(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public Sign get_channel_signer(boolean inbound, long channel_value_satoshis) {
long ret = bindings.KeysInterface_get_channel_signer(this.ptr, inbound, channel_value_satoshis);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(inbound);
+ Reference.reachabilityFence(channel_value_satoshis);
if (ret >= 0 && ret <= 4096) { return null; }
Sign ret_hu_conv = new Sign(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] get_secure_random_bytes() {
byte[] ret = bindings.KeysInterface_get_secure_random_bytes(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_SignDecodeErrorZ read_chan_signer(byte[] reader) {
long ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(reader);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage) {
long ret = bindings.KeysInterface_sign_invoice(this.ptr, invoice_preimage);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(invoice_preimage);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
+ /**
+ * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
+ *
+ * This method must return the same value each time it is called.
+ */
+ public byte[] get_inbound_payment_key_material() {
+ byte[] ret = bindings.KeysInterface_get_inbound_payment_key_material(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static KeysManager of(byte[] seed, long starting_time_secs, int starting_time_nanos) {
long ret = bindings.KeysManager_new(InternalUtils.check_arr_len(seed, 32), starting_time_secs, starting_time_nanos);
+ Reference.reachabilityFence(seed);
+ Reference.reachabilityFence(starting_time_secs);
+ Reference.reachabilityFence(starting_time_nanos);
if (ret >= 0 && ret <= 4096) { return null; }
KeysManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new KeysManager(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public InMemorySigner derive_channel_keys(long channel_value_satoshis, byte[] params) {
long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, InternalUtils.check_arr_len(params, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(channel_value_satoshis);
+ Reference.reachabilityFence(params);
if (ret >= 0 && ret <= 4096) { return null; }
InMemorySigner ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InMemorySigner(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight) {
long ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, descriptors != null ? Arrays.stream(descriptors).mapToLong(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray() : null, outputs != null ? Arrays.stream(outputs).mapToLong(outputs_conv_7 -> outputs_conv_7.ptr).toArray() : null, change_destination_script, feerate_sat_per_1000_weight);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(descriptors);
+ Reference.reachabilityFence(outputs);
+ Reference.reachabilityFence(change_destination_script);
+ Reference.reachabilityFence(feerate_sat_per_1000_weight);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public KeysInterface as_KeysInterface() {
long ret = bindings.KeysManager_as_KeysInterface(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
KeysInterface ret_hu_conv = new KeysInterface(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public String get_err() {
String ret = bindings.LightningError_get_err(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_err(java.lang.String val) {
bindings.LightningError_set_err(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public ErrorAction get_action() {
long ret = bindings.LightningError_get_action(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_action(ErrorAction val) {
bindings.LightningError_set_action(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static LightningError of(java.lang.String err_arg, ErrorAction action_arg) {
long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
+ Reference.reachabilityFence(err_arg);
+ Reference.reachabilityFence(action_arg);
if (ret >= 0 && ret <= 4096) { return null; }
LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new LightningError(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.LightningError_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public LightningError clone() {
long ret = bindings.LightningError_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new LightningError(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public void block_connected(byte[] block, int height) {
bindings.Listen_block_connected(this.ptr, block, height);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(block);
+ Reference.reachabilityFence(height);
}
/**
*/
public void block_disconnected(byte[] header, int height) {
bindings.Listen_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(header);
+ Reference.reachabilityFence(height);
}
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
-
/**
* A scorer that is accessed under a lock.
*
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class LockableScore extends CommonBase {
- LockableScore(Object _dummy, long ptr) { super(ptr); }
+ final bindings.LDKLockableScore bindings_instance;
+ LockableScore(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
+ private LockableScore(bindings.LDKLockableScore arg) {
+ super(bindings.LDKLockableScore_new(arg));
+ this.ptrs_to.add(arg);
+ this.bindings_instance = arg;
+ }
@Override @SuppressWarnings("deprecation")
protected void finalize() throws Throwable {
- super.finalize();
- if (ptr != 0) { bindings.LockableScore_free(ptr); }
+ if (ptr != 0) { bindings.LockableScore_free(ptr); } super.finalize();
}
+ public static interface LockableScoreInterface {
+ /**
+ * Returns the locked scorer.
+ */
+ Score lock();
+ }
+ private static class LDKLockableScoreHolder { LockableScore held; }
+ public static LockableScore new_impl(LockableScoreInterface arg) {
+ final LDKLockableScoreHolder impl_holder = new LDKLockableScoreHolder();
+ impl_holder.held = new LockableScore(new bindings.LDKLockableScore() {
+ @Override public long lock() {
+ Score ret = arg.lock();
+ long result = ret == null ? 0 : ret.ptr;
+ impl_holder.held.ptrs_to.add(ret);
+ return result;
+ }
+ });
+ return impl_holder.held;
+ }
/**
- * Constructs a new LockableScore from a Score
+ * Returns the locked scorer.
*/
- public static LockableScore of(Score score) {
- long ret = bindings.LockableScore_new(score == null ? 0 : score.ptr);
+ public Score lock() {
+ long ret = bindings.LockableScore_lock(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
- LockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new LockableScore(null, ret); }
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- ret_hu_conv.ptrs_to.add(score);
+ Score ret_hu_conv = new Score(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
- /**
- * Serialize the LockableScore object into a byte array which can be read by LockableScore_read
- */
- public byte[] write() {
- byte[] ret = bindings.LockableScore_write(this.ptr);
- return ret;
- }
-
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public ChannelMessageHandler get_chan_handler() {
long ret = bindings.MessageHandler_get_chan_handler(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_chan_handler(ChannelMessageHandler val) {
bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0 : val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
this.ptrs_to.add(val);
}
*/
public RoutingMessageHandler get_route_handler() {
long ret = bindings.MessageHandler_get_route_handler(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_route_handler(RoutingMessageHandler val) {
bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
this.ptrs_to.add(val);
}
*/
public static MessageHandler of(ChannelMessageHandler chan_handler_arg, RoutingMessageHandler route_handler_arg) {
long ret = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr);
+ Reference.reachabilityFence(chan_handler_arg);
+ Reference.reachabilityFence(route_handler_arg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MessageHandler(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
long clone_ptr() {
long ret = bindings.MessageSendEvent_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public MessageSendEvent clone() {
long ret = bindings.MessageSendEvent_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static MessageSendEvent send_accept_channel(byte[] node_id, AcceptChannel msg) {
long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_open_channel(byte[] node_id, OpenChannel msg) {
long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_funding_created(byte[] node_id, FundingCreated msg) {
long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_funding_signed(byte[] node_id, FundingSigned msg) {
long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_funding_locked(byte[] node_id, FundingLocked msg) {
long ret = bindings.MessageSendEvent_send_funding_locked(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_announcement_signatures(byte[] node_id, AnnouncementSignatures msg) {
long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent update_htlcs(byte[] node_id, CommitmentUpdate updates) {
long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(updates);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_revoke_and_ack(byte[] node_id, RevokeAndACK msg) {
long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_closing_signed(byte[] node_id, ClosingSigned msg) {
long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_shutdown(byte[] node_id, Shutdown msg) {
long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_channel_reestablish(byte[] node_id, ChannelReestablish msg) {
long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent broadcast_channel_announcement(ChannelAnnouncement msg, ChannelUpdate update_msg) {
long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr & ~1, update_msg == null ? 0 : update_msg.ptr & ~1);
+ Reference.reachabilityFence(msg);
+ Reference.reachabilityFence(update_msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent broadcast_node_announcement(NodeAnnouncement msg) {
long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent broadcast_channel_update(ChannelUpdate msg) {
long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_channel_update(byte[] node_id, ChannelUpdate msg) {
long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent handle_error(byte[] node_id, ErrorAction action) {
long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(action);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_channel_range_query(byte[] node_id, QueryChannelRange msg) {
long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_short_ids_query(byte[] node_id, QueryShortChannelIds msg) {
long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MessageSendEvent send_reply_channel_range(byte[] node_id, ReplyChannelRange msg) {
long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public MessageSendEvent[] get_and_clear_pending_msg_events() {
long[] ret = bindings.MessageSendEventsProvider_get_and_clear_pending_msg_events(this.ptr);
+ Reference.reachabilityFence(this);
MessageSendEvent[] ret_conv_18_arr = new MessageSendEvent[ret.length];
for (int s = 0; s < ret.length; s++) {
long ret_conv_18 = ret[s];
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public long get_a() {
long ret = bindings.MinFinalCltvExpiry_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
public void set_a(long val) {
bindings.MinFinalCltvExpiry_set_a(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static MinFinalCltvExpiry of(long a_arg) {
long ret = bindings.MinFinalCltvExpiry_new(a_arg);
+ Reference.reachabilityFence(a_arg);
if (ret >= 0 && ret <= 4096) { return null; }
MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MinFinalCltvExpiry(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.MinFinalCltvExpiry_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public MinFinalCltvExpiry clone() {
long ret = bindings.MinFinalCltvExpiry_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MinFinalCltvExpiry(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.MinFinalCltvExpiry_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two MinFinalCltvExpirys contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(MinFinalCltvExpiry b) {
boolean ret = bindings.MinFinalCltvExpiry_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof MinFinalCltvExpiry)) return false;
+ return this.eq((MinFinalCltvExpiry)o);
+ }
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
long clone_ptr() {
long ret = bindings.MonitorEvent_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public MonitorEvent clone() {
long ret = bindings.MonitorEvent_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static MonitorEvent htlcevent(HTLCUpdate a) {
long ret = bindings.MonitorEvent_htlcevent(a == null ? 0 : a.ptr & ~1);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MonitorEvent commitment_tx_confirmed(OutPoint a) {
long ret = bindings.MonitorEvent_commitment_tx_confirmed(a == null ? 0 : a.ptr & ~1);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MonitorEvent update_completed(OutPoint funding_txo, long monitor_update_id) {
long ret = bindings.MonitorEvent_update_completed(funding_txo == null ? 0 : funding_txo.ptr & ~1, monitor_update_id);
+ Reference.reachabilityFence(funding_txo);
+ Reference.reachabilityFence(monitor_update_id);
if (ret >= 0 && ret <= 4096) { return null; }
MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static MonitorEvent update_failed(OutPoint a) {
long ret = bindings.MonitorEvent_update_failed(a == null ? 0 : a.ptr & ~1);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public byte[] write() {
byte[] ret = bindings.MonitorEvent_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+++ /dev/null
-package org.ldk.structs;
-
-import org.ldk.impl.bindings;
-import org.ldk.enums.*;
-import org.ldk.util.*;
-import java.util.Arrays;
-import javax.annotation.Nullable;
-
-
-/**
- * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
- * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
- * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
- * corrupted.
- * Contains a developer-readable error message.
- */
-@SuppressWarnings("unchecked") // We correctly assign various generic arrays
-public class MonitorUpdateError extends CommonBase {
- MonitorUpdateError(Object _dummy, long ptr) { super(ptr); }
- @Override @SuppressWarnings("deprecation")
- protected void finalize() throws Throwable {
- super.finalize();
- if (ptr != 0) { bindings.MonitorUpdateError_free(ptr); }
- }
-
- public String get_a() {
- String ret = bindings.MonitorUpdateError_get_a(this.ptr);
- return ret;
- }
-
- public void set_a(java.lang.String val) {
- bindings.MonitorUpdateError_set_a(this.ptr, val);
- }
-
- /**
- * Constructs a new MonitorUpdateError given each field
- */
- public static MonitorUpdateError of(java.lang.String a_arg) {
- long ret = bindings.MonitorUpdateError_new(a_arg);
- if (ret >= 0 && ret <= 4096) { return null; }
- MonitorUpdateError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MonitorUpdateError(null, ret); }
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- return ret_hu_conv;
- }
-
- long clone_ptr() {
- long ret = bindings.MonitorUpdateError_clone_ptr(this.ptr);
- return ret;
- }
-
- /**
- * Creates a copy of the MonitorUpdateError
- */
- public MonitorUpdateError clone() {
- long ret = bindings.MonitorUpdateError_clone(this.ptr);
- if (ret >= 0 && ret <= 4096) { return null; }
- MonitorUpdateError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MonitorUpdateError(null, ret); }
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
-}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.MonitorUpdateId_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public MonitorUpdateId clone() {
long ret = bindings.MonitorUpdateId_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
MonitorUpdateId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MonitorUpdateId(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.MonitorUpdateId_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two MonitorUpdateIds contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(MonitorUpdateId b) {
boolean ret = bindings.MonitorUpdateId_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof MonitorUpdateId)) return false;
+ return this.eq((MonitorUpdateId)o);
+ }
}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+
+/**
+ * A concrete implementation of [`LockableScore`] which supports multi-threading.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class MultiThreadedLockableScore extends CommonBase {
+ MultiThreadedLockableScore(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.MultiThreadedLockableScore_free(ptr); }
+ }
+
+ /**
+ * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
+ */
+ public static MultiThreadedLockableScore of(Score score) {
+ long ret = bindings.MultiThreadedLockableScore_new(score == null ? 0 : score.ptr);
+ Reference.reachabilityFence(score);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ MultiThreadedLockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MultiThreadedLockableScore(null, ret); }
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(score);
+ return ret_hu_conv;
+ }
+
+}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
/**
* An old-style Tor onion address/port on which the peer is listening.
+ *
+ * This field is deprecated and the Tor network generally no longer supports V2 Onion
+ * addresses. Thus, the details are not parsed here.
*/
public final static class OnionV2 extends NetAddress {
- /**
- * The bytes (usually encoded in base32 with \".onion\" appended)
- */
- public final byte[] addr;
- /**
- * The port on which the node is listening
- */
- public final short port;
+ public final byte[] onion_v2;
private OnionV2(long ptr, bindings.LDKNetAddress.OnionV2 obj) {
super(null, ptr);
- this.addr = obj.addr;
- this.port = obj.port;
+ this.onion_v2 = obj.onion_v2;
}
}
/**
}
long clone_ptr() {
long ret = bindings.NetAddress_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public NetAddress clone() {
long ret = bindings.NetAddress_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static NetAddress ipv4(byte[] addr, short port) {
long ret = bindings.NetAddress_ipv4(InternalUtils.check_arr_len(addr, 4), port);
+ Reference.reachabilityFence(addr);
+ Reference.reachabilityFence(port);
if (ret >= 0 && ret <= 4096) { return null; }
NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static NetAddress ipv6(byte[] addr, short port) {
long ret = bindings.NetAddress_ipv6(InternalUtils.check_arr_len(addr, 16), port);
+ Reference.reachabilityFence(addr);
+ Reference.reachabilityFence(port);
if (ret >= 0 && ret <= 4096) { return null; }
NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
/**
* Utility method to constructs a new OnionV2-variant NetAddress
*/
- public static NetAddress onion_v2(byte[] addr, short port) {
- long ret = bindings.NetAddress_onion_v2(InternalUtils.check_arr_len(addr, 10), port);
+ public static NetAddress onion_v2(byte[] a) {
+ long ret = bindings.NetAddress_onion_v2(InternalUtils.check_arr_len(a, 12));
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static NetAddress onion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port) {
long ret = bindings.NetAddress_onion_v3(InternalUtils.check_arr_len(ed25519_pubkey, 32), checksum, version, port);
+ Reference.reachabilityFence(ed25519_pubkey);
+ Reference.reachabilityFence(checksum);
+ Reference.reachabilityFence(version);
+ Reference.reachabilityFence(port);
if (ret >= 0 && ret <= 4096) { return null; }
NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public byte[] write() {
byte[] ret = bindings.NetAddress_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_NetAddressDecodeErrorZ read(byte[] ser) {
long ret = bindings.NetAddress_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public EventHandler as_EventHandler() {
long ret = bindings.NetGraphMsgHandler_as_EventHandler(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
EventHandler ret_hu_conv = new EventHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static NetGraphMsgHandler of(NetworkGraph network_graph, Option_AccessZ chain_access, Logger logger) {
long ret = bindings.NetGraphMsgHandler_new(network_graph == null ? 0 : network_graph.ptr & ~1, chain_access.ptr, logger == null ? 0 : logger.ptr);
+ Reference.reachabilityFence(network_graph);
+ Reference.reachabilityFence(chain_access);
+ Reference.reachabilityFence(logger);
if (ret >= 0 && ret <= 4096) { return null; }
NetGraphMsgHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NetGraphMsgHandler(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public void add_chain_access(Option_AccessZ chain_access) {
bindings.NetGraphMsgHandler_add_chain_access(this.ptr, chain_access.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(chain_access);
this.ptrs_to.add(chain_access);
}
*/
public RoutingMessageHandler as_RoutingMessageHandler() {
long ret = bindings.NetGraphMsgHandler_as_RoutingMessageHandler(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public MessageSendEventsProvider as_MessageSendEventsProvider() {
long ret = bindings.NetGraphMsgHandler_as_MessageSendEventsProvider(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.NetworkGraph_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public NetworkGraph clone() {
long ret = bindings.NetworkGraph_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NetworkGraph ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NetworkGraph(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.NetworkGraph_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_NetworkGraphDecodeErrorZ read(byte[] ser) {
long ret = bindings.NetworkGraph_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static NetworkGraph of(byte[] genesis_hash) {
long ret = bindings.NetworkGraph_new(InternalUtils.check_arr_len(genesis_hash, 32));
+ Reference.reachabilityFence(genesis_hash);
if (ret >= 0 && ret <= 4096) { return null; }
NetworkGraph ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NetworkGraph(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public ReadOnlyNetworkGraph read_only() {
long ret = bindings.NetworkGraph_read_only(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ReadOnlyNetworkGraph ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReadOnlyNetworkGraph(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public Result_NoneLightningErrorZ update_node_from_announcement(NodeAnnouncement msg) {
long ret = bindings.NetworkGraph_update_node_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
*/
public Result_NoneLightningErrorZ update_node_from_unsigned_announcement(UnsignedNodeAnnouncement msg) {
long ret = bindings.NetworkGraph_update_node_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
*/
public Result_NoneLightningErrorZ update_channel_from_announcement(ChannelAnnouncement msg, Option_AccessZ chain_access) {
long ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
+ Reference.reachabilityFence(chain_access);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
*/
public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(UnsignedChannelAnnouncement msg, Option_AccessZ chain_access) {
long ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
+ Reference.reachabilityFence(chain_access);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
*/
public void close_channel_from_update(long short_channel_id, boolean is_permanent) {
bindings.NetworkGraph_close_channel_from_update(this.ptr, short_channel_id, is_permanent);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(short_channel_id);
+ Reference.reachabilityFence(is_permanent);
}
/**
*/
public void fail_node(byte[] _node_id, boolean is_permanent) {
bindings.NetworkGraph_fail_node(this.ptr, InternalUtils.check_arr_len(_node_id, 33), is_permanent);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(_node_id);
+ Reference.reachabilityFence(is_permanent);
+ }
+
+ /**
+ * Removes information about channels that we haven't heard any updates about in some time.
+ * This can be used regularly to prune the network graph of channels that likely no longer
+ * exist.
+ *
+ * While there is no formal requirement that nodes regularly re-broadcast their channel
+ * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
+ * pruning occur for updates which are at least two weeks old, which we implement here.
+ *
+ * This function takes the current unix time as an argument. For users with the `std` feature
+ * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
+ */
+ public void remove_stale_channels_with_time(long current_time_unix) {
+ bindings.NetworkGraph_remove_stale_channels_with_time(this.ptr, current_time_unix);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(current_time_unix);
}
/**
* You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
* RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
* routing messages from a source using a protocol other than the lightning P2P protocol.
+ *
+ * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
+ * materially in the future will be rejected.
*/
public Result_NoneLightningErrorZ update_channel(ChannelUpdate msg) {
long ret = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
* For an already known (from announcement) channel, update info about one of the directions
* of the channel without verifying the associated signatures. Because we aren't given the
* associated signatures here we cannot relay the channel update to any of our peers.
+ *
+ * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
+ * materially in the future will be rejected.
*/
public Result_NoneLightningErrorZ update_channel_unsigned(UnsignedChannelUpdate msg) {
long ret = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
long clone_ptr() {
long ret = bindings.NetworkUpdate_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public NetworkUpdate clone() {
long ret = bindings.NetworkUpdate_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NetworkUpdate ret_hu_conv = NetworkUpdate.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static NetworkUpdate channel_update_message(ChannelUpdate msg) {
long ret = bindings.NetworkUpdate_channel_update_message(msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
NetworkUpdate ret_hu_conv = NetworkUpdate.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static NetworkUpdate channel_closed(long short_channel_id, boolean is_permanent) {
long ret = bindings.NetworkUpdate_channel_closed(short_channel_id, is_permanent);
+ Reference.reachabilityFence(short_channel_id);
+ Reference.reachabilityFence(is_permanent);
if (ret >= 0 && ret <= 4096) { return null; }
NetworkUpdate ret_hu_conv = NetworkUpdate.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static NetworkUpdate node_failure(byte[] node_id, boolean is_permanent) {
long ret = bindings.NetworkUpdate_node_failure(InternalUtils.check_arr_len(node_id, 33), is_permanent);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(is_permanent);
if (ret >= 0 && ret <= 4096) { return null; }
NetworkUpdate ret_hu_conv = NetworkUpdate.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public byte[] write() {
byte[] ret = bindings.NetworkUpdate_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_signature() {
byte[] ret = bindings.NodeAnnouncement_get_signature(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_signature(byte[] val) {
bindings.NodeAnnouncement_set_signature(this.ptr, InternalUtils.check_arr_len(val, 64));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public UnsignedNodeAnnouncement get_contents() {
long ret = bindings.NodeAnnouncement_get_contents(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UnsignedNodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_contents(UnsignedNodeAnnouncement val) {
bindings.NodeAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static NodeAnnouncement of(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) {
long ret = bindings.NodeAnnouncement_new(InternalUtils.check_arr_len(signature_arg, 64), contents_arg == null ? 0 : contents_arg.ptr & ~1);
+ Reference.reachabilityFence(signature_arg);
+ Reference.reachabilityFence(contents_arg);
if (ret >= 0 && ret <= 4096) { return null; }
NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.NodeAnnouncement_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public NodeAnnouncement clone() {
long ret = bindings.NodeAnnouncement_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.NodeAnnouncement_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_NodeAnnouncementDecodeErrorZ read(byte[] ser) {
long ret = bindings.NodeAnnouncement_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public NodeFeatures get_features() {
long ret = bindings.NodeAnnouncementInfo_get_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_features(NodeFeatures val) {
bindings.NodeAnnouncementInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_last_update() {
int ret = bindings.NodeAnnouncementInfo_get_last_update(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_last_update(int val) {
bindings.NodeAnnouncementInfo_set_last_update(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_rgb() {
byte[] ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_rgb(byte[] val) {
bindings.NodeAnnouncementInfo_set_rgb(this.ptr, InternalUtils.check_arr_len(val, 3));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_alias() {
byte[] ret = bindings.NodeAnnouncementInfo_get_alias(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_alias(byte[] val) {
bindings.NodeAnnouncementInfo_set_alias(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public void set_addresses(NetAddress[] val) {
bindings.NodeAnnouncementInfo_set_addresses(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public NodeAnnouncement get_announcement_message() {
long ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_announcement_message(@Nullable NodeAnnouncement val) {
bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static NodeAnnouncementInfo of(NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) {
long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), InternalUtils.check_arr_len(alias_arg, 32), addresses_arg != null ? Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray() : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
+ Reference.reachabilityFence(features_arg);
+ Reference.reachabilityFence(last_update_arg);
+ Reference.reachabilityFence(rgb_arg);
+ Reference.reachabilityFence(alias_arg);
+ Reference.reachabilityFence(addresses_arg);
+ Reference.reachabilityFence(announcement_message_arg);
if (ret >= 0 && ret <= 4096) { return null; }
NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncementInfo(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.NodeAnnouncementInfo_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public NodeAnnouncementInfo clone() {
long ret = bindings.NodeAnnouncementInfo_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncementInfo(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.NodeAnnouncementInfo_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_NodeAnnouncementInfoDecodeErrorZ read(byte[] ser) {
long ret = bindings.NodeAnnouncementInfo_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public boolean eq(NodeFeatures b) {
boolean ret = bindings.NodeFeatures_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof NodeFeatures)) return false;
+ return this.eq((NodeFeatures)o);
+ }
long clone_ptr() {
long ret = bindings.NodeFeatures_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public NodeFeatures clone() {
long ret = bindings.NodeFeatures_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public boolean requires_unknown_bits() {
boolean ret = bindings.NodeFeatures_requires_unknown_bits(this.ptr);
- return ret;
- }
-
- /**
- * Returns whether the `payment_secret` feature is supported.
- */
- public boolean supports_payment_secret() {
- boolean ret = bindings.NodeFeatures_supports_payment_secret(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] write() {
byte[] ret = bindings.NodeFeatures_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_NodeFeaturesDecodeErrorZ read(byte[] ser) {
long ret = bindings.NodeFeatures_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.NodeId_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public NodeId clone() {
long ret = bindings.NodeId_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public static NodeId from_pubkey(byte[] pubkey) {
long ret = bindings.NodeId_from_pubkey(InternalUtils.check_arr_len(pubkey, 33));
+ Reference.reachabilityFence(pubkey);
if (ret >= 0 && ret <= 4096) { return null; }
NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeId(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public byte[] as_slice() {
byte[] ret = bindings.NodeId_as_slice(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public long hash() {
long ret = bindings.NodeId_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Serialize the NodeId object into a byte array which can be read by NodeId_read
*/
public byte[] write() {
byte[] ret = bindings.NodeId_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_NodeIdDecodeErrorZ read(byte[] ser) {
long ret = bindings.NodeId_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public void set_channels(long[] val) {
bindings.NodeInfo_set_channels(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public RoutingFees get_lowest_inbound_channel_fees() {
long ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_lowest_inbound_channel_fees(@Nullable RoutingFees val) {
bindings.NodeInfo_set_lowest_inbound_channel_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public NodeAnnouncementInfo get_announcement_info() {
long ret = bindings.NodeInfo_get_announcement_info(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeAnnouncementInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeAnnouncementInfo(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_announcement_info(@Nullable NodeAnnouncementInfo val) {
bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static NodeInfo of(long[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeAnnouncementInfo announcement_info_arg) {
long ret = bindings.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg == null ? 0 : lowest_inbound_channel_fees_arg.ptr & ~1, announcement_info_arg == null ? 0 : announcement_info_arg.ptr & ~1);
+ Reference.reachabilityFence(channels_arg);
+ Reference.reachabilityFence(lowest_inbound_channel_fees_arg);
+ Reference.reachabilityFence(announcement_info_arg);
if (ret >= 0 && ret <= 4096) { return null; }
NodeInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeInfo(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.NodeInfo_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public NodeInfo clone() {
long ret = bindings.NodeInfo_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeInfo(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.NodeInfo_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_NodeInfoDecodeErrorZ read(byte[] ser) {
long ret = bindings.NodeInfo_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_chain_hash() {
byte[] ret = bindings.OpenChannel_get_chain_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_chain_hash(byte[] val) {
bindings.OpenChannel_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_temporary_channel_id() {
byte[] ret = bindings.OpenChannel_get_temporary_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_temporary_channel_id(byte[] val) {
bindings.OpenChannel_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_funding_satoshis() {
long ret = bindings.OpenChannel_get_funding_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_funding_satoshis(long val) {
bindings.OpenChannel_set_funding_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_push_msat() {
long ret = bindings.OpenChannel_get_push_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_push_msat(long val) {
bindings.OpenChannel_set_push_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_dust_limit_satoshis() {
long ret = bindings.OpenChannel_get_dust_limit_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_dust_limit_satoshis(long val) {
bindings.OpenChannel_set_dust_limit_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_max_htlc_value_in_flight_msat() {
long ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_max_htlc_value_in_flight_msat(long val) {
bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_channel_reserve_satoshis() {
long ret = bindings.OpenChannel_get_channel_reserve_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_reserve_satoshis(long val) {
bindings.OpenChannel_set_channel_reserve_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_htlc_minimum_msat() {
long ret = bindings.OpenChannel_get_htlc_minimum_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_minimum_msat(long val) {
bindings.OpenChannel_set_htlc_minimum_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_feerate_per_kw() {
int ret = bindings.OpenChannel_get_feerate_per_kw(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_feerate_per_kw(int val) {
bindings.OpenChannel_set_feerate_per_kw(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_to_self_delay() {
short ret = bindings.OpenChannel_get_to_self_delay(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_to_self_delay(short val) {
bindings.OpenChannel_set_to_self_delay(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_max_accepted_htlcs() {
short ret = bindings.OpenChannel_get_max_accepted_htlcs(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_max_accepted_htlcs(short val) {
bindings.OpenChannel_set_max_accepted_htlcs(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_funding_pubkey() {
byte[] ret = bindings.OpenChannel_get_funding_pubkey(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_funding_pubkey(byte[] val) {
bindings.OpenChannel_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_revocation_basepoint() {
byte[] ret = bindings.OpenChannel_get_revocation_basepoint(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_revocation_basepoint(byte[] val) {
bindings.OpenChannel_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_payment_point() {
byte[] ret = bindings.OpenChannel_get_payment_point(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_payment_point(byte[] val) {
bindings.OpenChannel_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_delayed_payment_basepoint() {
byte[] ret = bindings.OpenChannel_get_delayed_payment_basepoint(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_delayed_payment_basepoint(byte[] val) {
bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_htlc_basepoint() {
byte[] ret = bindings.OpenChannel_get_htlc_basepoint(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_basepoint(byte[] val) {
bindings.OpenChannel_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_first_per_commitment_point() {
byte[] ret = bindings.OpenChannel_get_first_per_commitment_point(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_first_per_commitment_point(byte[] val) {
bindings.OpenChannel_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte get_channel_flags() {
byte ret = bindings.OpenChannel_get_channel_flags(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_flags(byte val) {
bindings.OpenChannel_set_channel_flags(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
+ /**
+ * The channel type that this channel will represent. If none is set, we derive the channel
+ * type from the intersection of our feature bits with our counterparty's feature bits from
+ * the Init message.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable
+ public ChannelTypeFeatures get_channel_type() {
+ long ret = bindings.OpenChannel_get_channel_type(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelTypeFeatures(null, ret); }
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * The channel type that this channel will represent. If none is set, we derive the channel
+ * type from the intersection of our feature bits with our counterparty's feature bits from
+ * the Init message.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public void set_channel_type(@Nullable ChannelTypeFeatures val) {
+ bindings.OpenChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.OpenChannel_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public OpenChannel clone() {
long ret = bindings.OpenChannel_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OpenChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OpenChannel(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.OpenChannel_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_OpenChannelDecodeErrorZ read(byte[] ser) {
long ret = bindings.OpenChannel_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_AccessZ some(Access o) {
long ret = bindings.COption_AccessZ_some(o == null ? 0 : o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_AccessZ ret_hu_conv = Option_AccessZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_C2Tuple_usizeTransactionZZ some(TwoTuple_usizeTransactionZ o) {
long ret = bindings.COption_C2Tuple_usizeTransactionZZ_some(o != null ? o.ptr : 0);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.COption_C2Tuple_usizeTransactionZZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_C2Tuple_usizeTransactionZZ clone() {
long ret = bindings.COption_C2Tuple_usizeTransactionZZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_CVec_NetAddressZZ some(NetAddress[] o) {
long ret = bindings.COption_CVec_NetAddressZZ_some(o != null ? Arrays.stream(o).mapToLong(o_conv_12 -> o_conv_12.ptr).toArray() : null);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_CVec_NetAddressZZ ret_hu_conv = Option_CVec_NetAddressZZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.COption_CVec_NetAddressZZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_CVec_NetAddressZZ clone() {
long ret = bindings.COption_CVec_NetAddressZZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_CVec_NetAddressZZ ret_hu_conv = Option_CVec_NetAddressZZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_ClosureReasonZ some(ClosureReason o) {
long ret = bindings.COption_ClosureReasonZ_some(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_ClosureReasonZ ret_hu_conv = Option_ClosureReasonZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.COption_ClosureReasonZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_ClosureReasonZ clone() {
long ret = bindings.COption_ClosureReasonZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_ClosureReasonZ ret_hu_conv = Option_ClosureReasonZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_EventZ some(Event o) {
long ret = bindings.COption_EventZ_some(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.COption_EventZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_EventZ clone() {
long ret = bindings.COption_EventZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_EventZ ret_hu_conv = Option_EventZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_FilterZ some(Filter o) {
long ret = bindings.COption_FilterZ_some(o == null ? 0 : o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_FilterZ ret_hu_conv = Option_FilterZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_MonitorEventZ some(MonitorEvent o) {
long ret = bindings.COption_MonitorEventZ_some(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_MonitorEventZ ret_hu_conv = Option_MonitorEventZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.COption_MonitorEventZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_MonitorEventZ clone() {
long ret = bindings.COption_MonitorEventZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_MonitorEventZ ret_hu_conv = Option_MonitorEventZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_NetworkUpdateZ some(NetworkUpdate o) {
long ret = bindings.COption_NetworkUpdateZ_some(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_NetworkUpdateZ ret_hu_conv = Option_NetworkUpdateZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.COption_NetworkUpdateZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_NetworkUpdateZ clone() {
long ret = bindings.COption_NetworkUpdateZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_NetworkUpdateZ ret_hu_conv = Option_NetworkUpdateZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_TypeZ some(Type o) {
long ret = bindings.COption_TypeZ_some(o == null ? 0 : o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.COption_TypeZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_TypeZ clone() {
long ret = bindings.COption_TypeZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_TypeZ ret_hu_conv = Option_TypeZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_u16Z some(short o) {
long ret = bindings.COption_u16Z_some(o);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u16Z ret_hu_conv = Option_u16Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.COption_u16Z_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_u16Z clone() {
long ret = bindings.COption_u16Z_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u16Z ret_hu_conv = Option_u16Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_u32Z some(int o) {
long ret = bindings.COption_u32Z_some(o);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.COption_u32Z_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_u32Z clone() {
long ret = bindings.COption_u32Z_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static Option_u64Z some(long o) {
long ret = bindings.COption_u64Z_some(o);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.COption_u64Z_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Option_u64Z clone() {
long ret = bindings.COption_u64Z_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_txid() {
byte[] ret = bindings.OutPoint_get_txid(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_txid(byte[] val) {
bindings.OutPoint_set_txid(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_index() {
short ret = bindings.OutPoint_get_index(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_index(short val) {
bindings.OutPoint_set_index(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static OutPoint of(byte[] txid_arg, short index_arg) {
long ret = bindings.OutPoint_new(InternalUtils.check_arr_len(txid_arg, 32), index_arg);
+ Reference.reachabilityFence(txid_arg);
+ Reference.reachabilityFence(index_arg);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.OutPoint_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public OutPoint clone() {
long ret = bindings.OutPoint_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public boolean eq(OutPoint b) {
boolean ret = bindings.OutPoint_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof OutPoint)) return false;
+ return this.eq((OutPoint)o);
+ }
/**
* Checks if two OutPoints contain equal inner contents.
*/
public long hash() {
long ret = bindings.OutPoint_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Convert an `OutPoint` to a lightning channel id.
*/
public byte[] to_channel_id() {
byte[] ret = bindings.OutPoint_to_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] write() {
byte[] ret = bindings.OutPoint_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_OutPointDecodeErrorZ read(byte[] ser) {
long ret = bindings.OutPoint_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_pubkey() {
byte[] ret = bindings.Payee_get_pubkey(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_pubkey(byte[] val) {
bindings.Payee_set_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public InvoiceFeatures get_features() {
long ret = bindings.Payee_get_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_features(@Nullable InvoiceFeatures val) {
bindings.Payee_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public RouteHint[] get_route_hints() {
long[] ret = bindings.Payee_get_route_hints(this.ptr);
+ Reference.reachabilityFence(this);
RouteHint[] ret_conv_11_arr = new RouteHint[ret.length];
for (int l = 0; l < ret.length; l++) {
long ret_conv_11 = ret[l];
*/
public void set_route_hints(RouteHint[] val) {
bindings.Payee_set_route_hints(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_11 -> val_conv_11 == null ? 0 : val_conv_11.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public Option_u64Z get_expiry_time() {
long ret = bindings.Payee_get_expiry_time(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_expiry_time(Option_u64Z val) {
bindings.Payee_set_expiry_time(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static Payee of(byte[] pubkey_arg, InvoiceFeatures features_arg, RouteHint[] route_hints_arg, Option_u64Z expiry_time_arg) {
long ret = bindings.Payee_new(InternalUtils.check_arr_len(pubkey_arg, 33), features_arg == null ? 0 : features_arg.ptr & ~1, route_hints_arg != null ? Arrays.stream(route_hints_arg).mapToLong(route_hints_arg_conv_11 -> route_hints_arg_conv_11 == null ? 0 : route_hints_arg_conv_11.ptr & ~1).toArray() : null, expiry_time_arg.ptr);
+ Reference.reachabilityFence(pubkey_arg);
+ Reference.reachabilityFence(features_arg);
+ Reference.reachabilityFence(route_hints_arg);
+ Reference.reachabilityFence(expiry_time_arg);
if (ret >= 0 && ret <= 4096) { return null; }
Payee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Payee(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.Payee_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Payee clone() {
long ret = bindings.Payee_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Payee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Payee(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.Payee_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two Payees contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(Payee b) {
boolean ret = bindings.Payee_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Payee)) return false;
+ return this.eq((Payee)o);
+ }
/**
* Serialize the Payee object into a byte array which can be read by Payee_read
*/
public byte[] write() {
byte[] ret = bindings.Payee_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_PayeeDecodeErrorZ read(byte[] ser) {
long ret = bindings.Payee_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Payee from_node_id(byte[] pubkey) {
long ret = bindings.Payee_from_node_id(InternalUtils.check_arr_len(pubkey, 33));
+ Reference.reachabilityFence(pubkey);
if (ret >= 0 && ret <= 4096) { return null; }
Payee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Payee(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Payee for_keysend(byte[] pubkey) {
long ret = bindings.Payee_for_keysend(InternalUtils.check_arr_len(pubkey, 33));
+ Reference.reachabilityFence(pubkey);
if (ret >= 0 && ret <= 4096) { return null; }
Payee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Payee(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public byte[] get_a() {
byte[] ret = bindings.PayeePubKey_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
public void set_a(byte[] val) {
bindings.PayeePubKey_set_a(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static PayeePubKey of(byte[] a_arg) {
long ret = bindings.PayeePubKey_new(InternalUtils.check_arr_len(a_arg, 33));
+ Reference.reachabilityFence(a_arg);
if (ret >= 0 && ret <= 4096) { return null; }
PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.PayeePubKey_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public PayeePubKey clone() {
long ret = bindings.PayeePubKey_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.PayeePubKey_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two PayeePubKeys contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(PayeePubKey b) {
boolean ret = bindings.PayeePubKey_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof PayeePubKey)) return false;
+ return this.eq((PayeePubKey)o);
+ }
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
* Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
Result_PaymentIdPaymentSendFailureZ send_payment(Route route, byte[] payment_hash, byte[] payment_secret);
+ /**
+ * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
+ */
+ Result_PaymentIdPaymentSendFailureZ send_spontaneous_payment(Route route, byte[] payment_preimage);
/**
* Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
*/
Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id);
+ /**
+ * Signals that no further retries for the given payment will occur.
+ */
+ void abandon_payment(byte[] payment_id);
}
private static class LDKPayerHolder { Payer held; }
public static Payer new_impl(PayerInterface arg) {
long result = ret == null ? 0 : ret.clone_ptr();
return result;
}
+ @Override public long send_spontaneous_payment(long route, byte[] payment_preimage) {
+ Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new Route(null, route); }
+ Result_PaymentIdPaymentSendFailureZ ret = arg.send_spontaneous_payment(route_hu_conv, payment_preimage);
+ long result = ret == null ? 0 : ret.clone_ptr();
+ return result;
+ }
@Override public long retry_payment(long route, byte[] payment_id) {
Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new Route(null, route); }
Result_NonePaymentSendFailureZ ret = arg.retry_payment(route_hu_conv, payment_id);
long result = ret == null ? 0 : ret.clone_ptr();
return result;
}
+ @Override public void abandon_payment(byte[] payment_id) {
+ arg.abandon_payment(payment_id);
+ }
});
return impl_holder.held;
}
*/
public byte[] node_id() {
byte[] ret = bindings.Payer_node_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelDetails[] first_hops() {
long[] ret = bindings.Payer_first_hops(this.ptr);
+ Reference.reachabilityFence(this);
ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
for (int q = 0; q < ret.length; q++) {
long ret_conv_16 = ret[q];
*/
public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, byte[] payment_hash, @Nullable byte[] payment_secret) {
long ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(route);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(payment_secret);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
+ this.ptrs_to.add(route);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
+ */
+ public Result_PaymentIdPaymentSendFailureZ send_spontaneous_payment(Route route, byte[] payment_preimage) {
+ long ret = bindings.Payer_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_preimage, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(route);
+ Reference.reachabilityFence(payment_preimage);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
this.ptrs_to.add(route);
*/
public Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id) {
long ret = bindings.Payer_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(route);
+ Reference.reachabilityFence(payment_id);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
this.ptrs_to.add(route);
return ret_hu_conv;
}
+ /**
+ * Signals that no further retries for the given payment will occur.
+ */
+ public void abandon_payment(byte[] payment_id) {
+ bindings.Payer_abandon_payment(this.ptr, InternalUtils.check_arr_len(payment_id, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(payment_id);
+ }
+
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
long clone_ptr() {
long ret = bindings.PaymentError_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public PaymentError clone() {
long ret = bindings.PaymentError_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentError ret_hu_conv = PaymentError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static PaymentError invoice(java.lang.String a) {
long ret = bindings.PaymentError_invoice(a);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentError ret_hu_conv = PaymentError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static PaymentError routing(LightningError a) {
long ret = bindings.PaymentError_routing(a == null ? 0 : a.ptr & ~1);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentError ret_hu_conv = PaymentError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static PaymentError sending(PaymentSendFailure a) {
long ret = bindings.PaymentError_sending(a.ptr);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentError ret_hu_conv = PaymentError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
* [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
*/
public final byte[] payment_secret;
- /**
- * This is the `user_payment_id` which was provided to
- * [`ChannelManager::create_inbound_payment_for_hash`] or
- * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
- * simply copied here. It may be used to correlate PaymentReceived events with invoice
- * metadata stored elsewhere.
- *
- * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
- * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
- */
- public final long user_payment_id;
private InvoicePayment(long ptr, bindings.LDKPaymentPurpose.InvoicePayment obj) {
super(null, ptr);
this.payment_preimage = obj.payment_preimage;
this.payment_secret = obj.payment_secret;
- this.user_payment_id = obj.user_payment_id;
}
}
/**
}
long clone_ptr() {
long ret = bindings.PaymentPurpose_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public PaymentPurpose clone() {
long ret = bindings.PaymentPurpose_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
/**
* Utility method to constructs a new InvoicePayment-variant PaymentPurpose
*/
- public static PaymentPurpose invoice_payment(byte[] payment_preimage, byte[] payment_secret, long user_payment_id) {
- long ret = bindings.PaymentPurpose_invoice_payment(InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_secret, 32), user_payment_id);
+ public static PaymentPurpose invoice_payment(byte[] payment_preimage, byte[] payment_secret) {
+ long ret = bindings.PaymentPurpose_invoice_payment(InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_secret, 32));
+ Reference.reachabilityFence(payment_preimage);
+ Reference.reachabilityFence(payment_secret);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static PaymentPurpose spontaneous_payment(byte[] a) {
long ret = bindings.PaymentPurpose_spontaneous_payment(InternalUtils.check_arr_len(a, 32));
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
long clone_ptr() {
long ret = bindings.PaymentSendFailure_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public PaymentSendFailure clone() {
long ret = bindings.PaymentSendFailure_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static PaymentSendFailure parameter_error(APIError a) {
long ret = bindings.PaymentSendFailure_parameter_error(a.ptr);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static PaymentSendFailure path_parameter_error(Result_NoneAPIErrorZ[] a) {
long ret = bindings.PaymentSendFailure_path_parameter_error(a != null ? Arrays.stream(a).mapToLong(a_conv_22 -> a_conv_22 != null ? a_conv_22.ptr : 0).toArray() : null);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static PaymentSendFailure all_failed_retry_safe(APIError[] a) {
long ret = bindings.PaymentSendFailure_all_failed_retry_safe(a != null ? Arrays.stream(a).mapToLong(a_conv_10 -> a_conv_10.ptr).toArray() : null);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static PaymentSendFailure partial_failure(Result_NoneAPIErrorZ[] results, RouteParameters failed_paths_retry, byte[] payment_id) {
long ret = bindings.PaymentSendFailure_partial_failure(results != null ? Arrays.stream(results).mapToLong(results_conv_22 -> results_conv_22 != null ? results_conv_22.ptr : 0).toArray() : null, failed_paths_retry == null ? 0 : failed_paths_retry.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32));
+ Reference.reachabilityFence(results);
+ Reference.reachabilityFence(failed_paths_retry);
+ Reference.reachabilityFence(payment_id);
if (ret >= 0 && ret <= 4096) { return null; }
PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public boolean get_no_connection_possible() {
boolean ret = bindings.PeerHandleError_get_no_connection_possible(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_no_connection_possible(boolean val) {
bindings.PeerHandleError_set_no_connection_possible(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static PeerHandleError of(boolean no_connection_possible_arg) {
long ret = bindings.PeerHandleError_new(no_connection_possible_arg);
+ Reference.reachabilityFence(no_connection_possible_arg);
if (ret >= 0 && ret <= 4096) { return null; }
PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerHandleError(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.PeerHandleError_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public PeerHandleError clone() {
long ret = bindings.PeerHandleError_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
PeerHandleError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerHandleError(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public static PeerManager of(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, byte[] our_node_secret, byte[] ephemeral_random_data, Logger logger, CustomMessageHandler custom_message_handler) {
long ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0 : message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg == null ? 0 : message_handler_route_handler_arg.ptr), InternalUtils.check_arr_len(our_node_secret, 32), InternalUtils.check_arr_len(ephemeral_random_data, 32), logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr);
+ Reference.reachabilityFence(message_handler_chan_handler_arg);
+ Reference.reachabilityFence(message_handler_route_handler_arg);
+ Reference.reachabilityFence(our_node_secret);
+ Reference.reachabilityFence(ephemeral_random_data);
+ Reference.reachabilityFence(logger);
+ Reference.reachabilityFence(custom_message_handler);
if (ret >= 0 && ret <= 4096) { return null; }
PeerManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerManager(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public byte[][] get_peer_node_ids() {
byte[][] ret = bindings.PeerManager_get_peer_node_ids(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, SocketDescriptor descriptor) {
long ret = bindings.PeerManager_new_outbound_connection(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), descriptor == null ? 0 : descriptor.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(descriptor);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(descriptor);
*/
public Result_NonePeerHandleErrorZ new_inbound_connection(SocketDescriptor descriptor) {
long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : descriptor.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(descriptor);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(descriptor);
*/
public Result_NonePeerHandleErrorZ write_buffer_space_avail(SocketDescriptor descriptor) {
long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : descriptor.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(descriptor);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Result_boolPeerHandleErrorZ read_event(SocketDescriptor peer_descriptor, byte[] data) {
long ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0 : peer_descriptor.ptr, data);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(peer_descriptor);
+ Reference.reachabilityFence(data);
if (ret >= 0 && ret <= 4096) { return null; }
Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public void process_events() {
bindings.PeerManager_process_events(this.ptr);
+ Reference.reachabilityFence(this);
}
/**
*/
public void socket_disconnected(SocketDescriptor descriptor) {
bindings.PeerManager_socket_disconnected(this.ptr, descriptor == null ? 0 : descriptor.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(descriptor);
}
/**
*/
public void disconnect_by_node_id(byte[] node_id, boolean no_connection_possible) {
bindings.PeerManager_disconnect_by_node_id(this.ptr, InternalUtils.check_arr_len(node_id, 33), no_connection_possible);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(node_id);
+ Reference.reachabilityFence(no_connection_possible);
}
/**
*/
public void disconnect_all_peers() {
bindings.PeerManager_disconnect_all_peers(this.ptr);
+ Reference.reachabilityFence(this);
}
/**
*/
public void timer_tick_occurred() {
bindings.PeerManager_timer_tick_occurred(this.ptr);
+ Reference.reachabilityFence(this);
}
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint channel_id, ChannelMonitor data, MonitorUpdateId update_id) {
long ret = bindings.Persist_persist_new_channel(this.ptr, channel_id == null ? 0 : channel_id.ptr & ~1, data == null ? 0 : data.ptr & ~1, update_id == null ? 0 : update_id.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(channel_id);
+ Reference.reachabilityFence(data);
+ Reference.reachabilityFence(update_id);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
this.ptrs_to.add(data);
*/
public Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint channel_id, @Nullable ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id) {
long ret = bindings.Persist_update_persisted_channel(this.ptr, channel_id == null ? 0 : channel_id.ptr & ~1, update == null ? 0 : update.ptr & ~1, data == null ? 0 : data.ptr & ~1, update_id == null ? 0 : update_id.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(channel_id);
+ Reference.reachabilityFence(update);
+ Reference.reachabilityFence(data);
+ Reference.reachabilityFence(update_id);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
this.ptrs_to.add(update);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public short get_ponglen() {
short ret = bindings.Ping_get_ponglen(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_ponglen(short val) {
bindings.Ping_set_ponglen(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_byteslen() {
short ret = bindings.Ping_get_byteslen(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_byteslen(short val) {
bindings.Ping_set_byteslen(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static Ping of(short ponglen_arg, short byteslen_arg) {
long ret = bindings.Ping_new(ponglen_arg, byteslen_arg);
+ Reference.reachabilityFence(ponglen_arg);
+ Reference.reachabilityFence(byteslen_arg);
if (ret >= 0 && ret <= 4096) { return null; }
Ping ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Ping(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.Ping_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Ping clone() {
long ret = bindings.Ping_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Ping ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Ping(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.Ping_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_PingDecodeErrorZ read(byte[] ser) {
long ret = bindings.Ping_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public short get_byteslen() {
short ret = bindings.Pong_get_byteslen(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_byteslen(short val) {
bindings.Pong_set_byteslen(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static Pong of(short byteslen_arg) {
long ret = bindings.Pong_new(byteslen_arg);
+ Reference.reachabilityFence(byteslen_arg);
if (ret >= 0 && ret <= 4096) { return null; }
Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Pong(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.Pong_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Pong clone() {
long ret = bindings.Pong_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Pong ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Pong(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.Pong_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_PongDecodeErrorZ read(byte[] ser) {
long ret = bindings.Pong_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public boolean eq(PositiveTimestamp b) {
boolean ret = bindings.PositiveTimestamp_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof PositiveTimestamp)) return false;
+ return this.eq((PositiveTimestamp)o);
+ }
long clone_ptr() {
long ret = bindings.PositiveTimestamp_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public PositiveTimestamp clone() {
long ret = bindings.PositiveTimestamp_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
PositiveTimestamp ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PositiveTimestamp(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public static Result_PositiveTimestampCreationErrorZ from_unix_timestamp(long unix_seconds) {
long ret = bindings.PositiveTimestamp_from_unix_timestamp(unix_seconds);
+ Reference.reachabilityFence(unix_seconds);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PositiveTimestampCreationErrorZ from_system_time(long time) {
long ret = bindings.PositiveTimestamp_from_system_time(time);
+ Reference.reachabilityFence(time);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public long as_unix_timestamp() {
long ret = bindings.PositiveTimestamp_as_unix_timestamp(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public long as_time() {
long ret = bindings.PositiveTimestamp_as_time(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.PrivateRoute_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public PrivateRoute clone() {
long ret = bindings.PrivateRoute_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
PrivateRoute ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PrivateRoute(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.PrivateRoute_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two PrivateRoutes contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(PrivateRoute b) {
boolean ret = bindings.PrivateRoute_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof PrivateRoute)) return false;
+ return this.eq((PrivateRoute)o);
+ }
/**
* Creates a new (partial) route from a list of hops
*/
public static Result_PrivateRouteCreationErrorZ of(RouteHint hops) {
long ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr & ~1);
+ Reference.reachabilityFence(hops);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public RouteHint into_inner() {
long ret = bindings.PrivateRoute_into_inner(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_chain_hash() {
byte[] ret = bindings.QueryChannelRange_get_chain_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_chain_hash(byte[] val) {
bindings.QueryChannelRange_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_first_blocknum() {
int ret = bindings.QueryChannelRange_get_first_blocknum(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_first_blocknum(int val) {
bindings.QueryChannelRange_set_first_blocknum(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_number_of_blocks() {
int ret = bindings.QueryChannelRange_get_number_of_blocks(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_number_of_blocks(int val) {
bindings.QueryChannelRange_set_number_of_blocks(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static QueryChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg) {
long ret = bindings.QueryChannelRange_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_blocknum_arg, number_of_blocks_arg);
+ Reference.reachabilityFence(chain_hash_arg);
+ Reference.reachabilityFence(first_blocknum_arg);
+ Reference.reachabilityFence(number_of_blocks_arg);
if (ret >= 0 && ret <= 4096) { return null; }
QueryChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryChannelRange(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.QueryChannelRange_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public QueryChannelRange clone() {
long ret = bindings.QueryChannelRange_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
QueryChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryChannelRange(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public int end_blocknum() {
int ret = bindings.QueryChannelRange_end_blocknum(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] write() {
byte[] ret = bindings.QueryChannelRange_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_QueryChannelRangeDecodeErrorZ read(byte[] ser) {
long ret = bindings.QueryChannelRange_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_chain_hash() {
byte[] ret = bindings.QueryShortChannelIds_get_chain_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_chain_hash(byte[] val) {
bindings.QueryShortChannelIds_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public void set_short_channel_ids(long[] val) {
bindings.QueryShortChannelIds_set_short_channel_ids(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static QueryShortChannelIds of(byte[] chain_hash_arg, long[] short_channel_ids_arg) {
long ret = bindings.QueryShortChannelIds_new(InternalUtils.check_arr_len(chain_hash_arg, 32), short_channel_ids_arg);
+ Reference.reachabilityFence(chain_hash_arg);
+ Reference.reachabilityFence(short_channel_ids_arg);
if (ret >= 0 && ret <= 4096) { return null; }
QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryShortChannelIds(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.QueryShortChannelIds_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public QueryShortChannelIds clone() {
long ret = bindings.QueryShortChannelIds_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
QueryShortChannelIds ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new QueryShortChannelIds(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public static Result_QueryShortChannelIdsDecodeErrorZ read(byte[] ser) {
long ret = bindings.QueryShortChannelIds_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public byte[] write() {
byte[] ret = bindings.QueryShortChannelIds_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public PositiveTimestamp get_timestamp() {
long ret = bindings.RawDataPart_get_timestamp(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
PositiveTimestamp ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PositiveTimestamp(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_timestamp(PositiveTimestamp val) {
bindings.RawDataPart_set_timestamp(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean eq(RawDataPart b) {
boolean ret = bindings.RawDataPart_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof RawDataPart)) return false;
+ return this.eq((RawDataPart)o);
+ }
long clone_ptr() {
long ret = bindings.RawDataPart_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public RawDataPart clone() {
long ret = bindings.RawDataPart_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawDataPart(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public RawDataPart get_data() {
long ret = bindings.RawInvoice_get_data(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawDataPart(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_data(RawDataPart val) {
bindings.RawInvoice_set_data(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean eq(RawInvoice b) {
boolean ret = bindings.RawInvoice_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof RawInvoice)) return false;
+ return this.eq((RawInvoice)o);
+ }
long clone_ptr() {
long ret = bindings.RawInvoice_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public RawInvoice clone() {
long ret = bindings.RawInvoice_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawInvoice(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] hash() {
byte[] ret = bindings.RawInvoice_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
@Nullable
public Sha256 payment_hash() {
long ret = bindings.RawInvoice_payment_hash(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Sha256(null, ret); }
ret_hu_conv.ptrs_to.add(this);
@Nullable
public Description description() {
long ret = bindings.RawInvoice_description(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Description(null, ret); }
ret_hu_conv.ptrs_to.add(this);
@Nullable
public PayeePubKey payee_pub_key() {
long ret = bindings.RawInvoice_payee_pub_key(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); }
ret_hu_conv.ptrs_to.add(this);
@Nullable
public Sha256 description_hash() {
long ret = bindings.RawInvoice_description_hash(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Sha256(null, ret); }
ret_hu_conv.ptrs_to.add(this);
@Nullable
public ExpiryTime expiry_time() {
long ret = bindings.RawInvoice_expiry_time(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ExpiryTime(null, ret); }
ret_hu_conv.ptrs_to.add(this);
@Nullable
public MinFinalCltvExpiry min_final_cltv_expiry() {
long ret = bindings.RawInvoice_min_final_cltv_expiry(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MinFinalCltvExpiry(null, ret); }
ret_hu_conv.ptrs_to.add(this);
@Nullable
public byte[] payment_secret() {
byte[] ret = bindings.RawInvoice_payment_secret(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
@Nullable
public InvoiceFeatures features() {
long ret = bindings.RawInvoice_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
public PrivateRoute[] private_routes() {
long[] ret = bindings.RawInvoice_private_routes(this.ptr);
+ Reference.reachabilityFence(this);
PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret.length];
for (int o = 0; o < ret.length; o++) {
long ret_conv_14 = ret[o];
public Option_u64Z amount_pico_btc() {
long ret = bindings.RawInvoice_amount_pico_btc(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
public Currency currency() {
Currency ret = bindings.RawInvoice_currency(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public Option_CVec_NetAddressZZ get_addresses(byte[] pubkey) {
long ret = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, InternalUtils.check_arr_len(pubkey, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(pubkey);
if (ret >= 0 && ret <= 4096) { return null; }
Option_CVec_NetAddressZZ ret_hu_conv = Option_CVec_NetAddressZZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public Level get_level() {
Level ret = bindings.Record_get_level(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_level(org.ldk.enums.Level val) {
bindings.Record_set_level(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public String get_args() {
String ret = bindings.Record_get_args(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_args(java.lang.String val) {
bindings.Record_set_args(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public String get_module_path() {
String ret = bindings.Record_get_module_path(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_module_path(java.lang.String val) {
bindings.Record_set_module_path(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public String get_file() {
String ret = bindings.Record_get_file(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_file(java.lang.String val) {
bindings.Record_set_file(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_line() {
int ret = bindings.Record_get_line(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_line(int val) {
bindings.Record_set_line(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.Record_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Record clone() {
long ret = bindings.Record_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Record ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Record(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_chain_hash() {
byte[] ret = bindings.ReplyChannelRange_get_chain_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_chain_hash(byte[] val) {
bindings.ReplyChannelRange_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_first_blocknum() {
int ret = bindings.ReplyChannelRange_get_first_blocknum(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_first_blocknum(int val) {
bindings.ReplyChannelRange_set_first_blocknum(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_number_of_blocks() {
int ret = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_number_of_blocks(int val) {
bindings.ReplyChannelRange_set_number_of_blocks(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_sync_complete() {
boolean ret = bindings.ReplyChannelRange_get_sync_complete(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_sync_complete(boolean val) {
bindings.ReplyChannelRange_set_sync_complete(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public void set_short_channel_ids(long[] val) {
bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ReplyChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean sync_complete_arg, long[] short_channel_ids_arg) {
long ret = bindings.ReplyChannelRange_new(InternalUtils.check_arr_len(chain_hash_arg, 32), first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg);
+ Reference.reachabilityFence(chain_hash_arg);
+ Reference.reachabilityFence(first_blocknum_arg);
+ Reference.reachabilityFence(number_of_blocks_arg);
+ Reference.reachabilityFence(sync_complete_arg);
+ Reference.reachabilityFence(short_channel_ids_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ReplyChannelRange_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ReplyChannelRange clone() {
long ret = bindings.ReplyChannelRange_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ReplyChannelRange ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyChannelRange(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public static Result_ReplyChannelRangeDecodeErrorZ read(byte[] ser) {
long ret = bindings.ReplyChannelRange_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public byte[] write() {
byte[] ret = bindings.ReplyChannelRange_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_chain_hash() {
byte[] ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_chain_hash(byte[] val) {
bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_full_information() {
boolean ret = bindings.ReplyShortChannelIdsEnd_get_full_information(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_full_information(boolean val) {
bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static ReplyShortChannelIdsEnd of(byte[] chain_hash_arg, boolean full_information_arg) {
long ret = bindings.ReplyShortChannelIdsEnd_new(InternalUtils.check_arr_len(chain_hash_arg, 32), full_information_arg);
+ Reference.reachabilityFence(chain_hash_arg);
+ Reference.reachabilityFence(full_information_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.ReplyShortChannelIdsEnd_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ReplyShortChannelIdsEnd clone() {
long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ReplyShortChannelIdsEnd ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
long ret = bindings.ReplyShortChannelIdsEnd_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_AcceptChannelDecodeErrorZ extends CommonBase {
*/
public static Result_AcceptChannelDecodeErrorZ ok(AcceptChannel o) {
long ret = bindings.CResult_AcceptChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_AcceptChannelDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_AcceptChannelDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_AcceptChannelDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_AcceptChannelDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_AcceptChannelDecodeErrorZ clone() {
long ret = bindings.CResult_AcceptChannelDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase {
*/
public static Result_AnnouncementSignaturesDecodeErrorZ ok(AnnouncementSignatures o) {
long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_AnnouncementSignaturesDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_AnnouncementSignaturesDecodeErrorZ clone() {
long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase {
*/
public static Result_BuiltCommitmentTransactionDecodeErrorZ ok(BuiltCommitmentTransaction o) {
long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_BuiltCommitmentTransactionDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_BuiltCommitmentTransactionDecodeErrorZ clone() {
long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonBase {
*/
public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ok(TwoTuple_BlockHashChannelManagerZ o) {
long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o != null ? o.ptr : 0);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonBase {
*/
public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ok(TwoTuple_BlockHashChannelMonitorZ o) {
long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o != null ? o.ptr : 0);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ clone() {
long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ extends CommonBase {
*/
public static Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ok(TwoTuple_PaymentHashPaymentIdZ o) {
long ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o != null ? o.ptr : 0);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ err(PaymentSendFailure e) {
long ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e.ptr);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ clone() {
long ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+public class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ extends CommonBase {
+ private Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(ptr)) {
+ return new Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK(null, ptr);
+ } else {
+ return new Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK extends Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+ public final TwoTuple_PaymentHashPaymentSecretZ res;
+ private Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(ptr);
+ TwoTuple_PaymentHashPaymentSecretZ res_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err extends Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+ public final APIError err;
+ private Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(ptr);
+ APIError err_hu_conv = APIError.constr_from_ptr(err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ }
+
+ /**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
+ */
+ public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ok(TwoTuple_PaymentHashPaymentSecretZ o) {
+ long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o != null ? o.ptr : 0);
+ Reference.reachabilityFence(o);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
+ */
+ public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ err(APIError e) {
+ long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e.ptr);
+ Reference.reachabilityFence(e);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if the given object is currently in the success state
+ */
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ long clone_ptr() {
+ long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ clone() {
+ long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+public class Result_C2Tuple_PaymentHashPaymentSecretZNoneZ extends CommonBase {
+ private Result_C2Tuple_PaymentHashPaymentSecretZNoneZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(ptr); } super.finalize();
+ }
+
+ static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(ptr)) {
+ return new Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_OK(null, ptr);
+ } else {
+ return new Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_OK extends Result_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+ public final TwoTuple_PaymentHashPaymentSecretZ res;
+ private Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(ptr);
+ TwoTuple_PaymentHashPaymentSecretZ res_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_Err extends Result_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+ private Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ }
+ }
+
+ /**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
+ */
+ public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ok(TwoTuple_PaymentHashPaymentSecretZ o) {
+ long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o != null ? o.ptr : 0);
+ Reference.reachabilityFence(o);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
+ */
+ public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ err() {
+ long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if the given object is currently in the success state
+ */
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ long clone_ptr() {
+ long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_C2Tuple_PaymentHashPaymentSecretZNoneZ clone() {
+ long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase {
*/
public static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ok(TwoTuple_SignatureCVec_SignatureZZ o) {
long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o != null ? o.ptr : 0);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ clone() {
long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_COption_ClosureReasonZDecodeErrorZ extends CommonBase {
*/
public static Result_COption_ClosureReasonZDecodeErrorZ ok(Option_ClosureReasonZ o) {
long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_ok(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_COption_ClosureReasonZDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_COption_ClosureReasonZDecodeErrorZ clone() {
long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_COption_EventZDecodeErrorZ extends CommonBase {
*/
public static Result_COption_EventZDecodeErrorZ ok(Option_EventZ o) {
long ret = bindings.CResult_COption_EventZDecodeErrorZ_ok(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_COption_EventZDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_COption_EventZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_COption_EventZDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_COption_EventZDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_COption_EventZDecodeErrorZ clone() {
long ret = bindings.CResult_COption_EventZDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_COption_MonitorEventZDecodeErrorZ extends CommonBase {
*/
public static Result_COption_MonitorEventZDecodeErrorZ ok(Option_MonitorEventZ o) {
long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_ok(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_COption_MonitorEventZDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_COption_MonitorEventZDecodeErrorZ clone() {
long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_COption_NetworkUpdateZDecodeErrorZ extends CommonBase {
*/
public static Result_COption_NetworkUpdateZDecodeErrorZ ok(Option_NetworkUpdateZ o) {
long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_COption_NetworkUpdateZDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_COption_NetworkUpdateZDecodeErrorZ clone() {
long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_COption_TypeZDecodeErrorZ extends CommonBase {
*/
public static Result_COption_TypeZDecodeErrorZ ok(Option_TypeZ o) {
long ret = bindings.CResult_COption_TypeZDecodeErrorZ_ok(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_COption_TypeZDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_COption_TypeZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_COption_TypeZDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_COption_TypeZDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_COption_TypeZDecodeErrorZ clone() {
long ret = bindings.CResult_COption_TypeZDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonBase {
*/
public static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ok(TwoTuple_BlockHashChannelMonitorZ[] o) {
long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o != null ? Arrays.stream(o).mapToLong(o_conv_35 -> o_conv_35 != null ? o_conv_35.ptr : 0).toArray() : null);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ err(org.ldk.enums.IOError e) {
long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ clone() {
long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase {
*/
public static Result_CVec_CVec_u8ZZNoneZ ok(byte[][] o) {
long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_ok(o);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_CVec_CVec_u8ZZNoneZ clone() {
long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_CVec_SignatureZNoneZ extends CommonBase {
*/
public static Result_CVec_SignatureZNoneZ ok(byte[][] o) {
long ret = bindings.CResult_CVec_SignatureZNoneZ_ok(o != null ? Arrays.stream(o).map(o_conv_8 -> InternalUtils.check_arr_len(o_conv_8, 64)).toArray(byte[][]::new) : null);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_CVec_SignatureZNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_CVec_SignatureZNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_CVec_SignatureZNoneZ clone() {
long ret = bindings.CResult_CVec_SignatureZNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase {
*/
public static Result_CVec_u8ZPeerHandleErrorZ ok(byte[] o) {
long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(o);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_CVec_u8ZPeerHandleErrorZ err(PeerHandleError e) {
long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_CVec_u8ZPeerHandleErrorZ clone() {
long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase {
*/
public static Result_ChannelAnnouncementDecodeErrorZ ok(ChannelAnnouncement o) {
long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ChannelAnnouncementDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ChannelAnnouncementDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ChannelConfigDecodeErrorZ extends CommonBase {
*/
public static Result_ChannelConfigDecodeErrorZ ok(ChannelConfig o) {
long ret = bindings.CResult_ChannelConfigDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ChannelConfigDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ChannelConfigDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ChannelConfigDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ChannelConfigDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ChannelConfigDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelConfigDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase {
*/
public static Result_ChannelFeaturesDecodeErrorZ ok(ChannelFeatures o) {
long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ChannelFeaturesDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ChannelInfoDecodeErrorZ extends CommonBase {
*/
public static Result_ChannelInfoDecodeErrorZ ok(ChannelInfo o) {
long ret = bindings.CResult_ChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ChannelInfoDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ChannelInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ChannelInfoDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ChannelInfoDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ChannelInfoDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelInfoDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase {
*/
public static Result_ChannelMonitorUpdateDecodeErrorZ ok(ChannelMonitorUpdate o) {
long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ChannelMonitorUpdateDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ChannelMonitorUpdateDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase {
*/
public static Result_ChannelPublicKeysDecodeErrorZ ok(ChannelPublicKeys o) {
long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ChannelPublicKeysDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ChannelPublicKeysDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ChannelReestablishDecodeErrorZ extends CommonBase {
*/
public static Result_ChannelReestablishDecodeErrorZ ok(ChannelReestablish o) {
long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ChannelReestablishDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ChannelReestablishDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ChannelReestablishDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase {
*/
public static Result_ChannelTransactionParametersDecodeErrorZ ok(ChannelTransactionParameters o) {
long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ChannelTransactionParametersDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ChannelTransactionParametersDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+public class Result_ChannelTypeFeaturesDecodeErrorZ extends CommonBase {
+ private Result_ChannelTypeFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelTypeFeaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(ptr)) {
+ return new Result_ChannelTypeFeaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelTypeFeaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelTypeFeaturesDecodeErrorZ_OK extends Result_ChannelTypeFeaturesDecodeErrorZ {
+ public final ChannelTypeFeatures res;
+ private Result_ChannelTypeFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(ptr);
+ ChannelTypeFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelTypeFeatures(null, res); }
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_ChannelTypeFeaturesDecodeErrorZ_Err extends Result_ChannelTypeFeaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelTypeFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new DecodeError(null, err); }
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ }
+
+ /**
+ * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
+ */
+ public static Result_ChannelTypeFeaturesDecodeErrorZ ok(ChannelTypeFeatures o) {
+ long ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
+ */
+ public static Result_ChannelTypeFeaturesDecodeErrorZ err(DecodeError e) {
+ long ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if the given object is currently in the success state
+ */
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ChannelUpdateDecodeErrorZ extends CommonBase {
*/
public static Result_ChannelUpdateDecodeErrorZ ok(ChannelUpdate o) {
long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ChannelUpdateDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ChannelUpdateDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ChannelUpdateDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ClosingSignedDecodeErrorZ extends CommonBase {
*/
public static Result_ClosingSignedDecodeErrorZ ok(ClosingSigned o) {
long ret = bindings.CResult_ClosingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ClosingSignedDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ClosingSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ClosingSignedDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ClosingSignedDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ClosingSignedDecodeErrorZ clone() {
long ret = bindings.CResult_ClosingSignedDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase {
*/
public static Result_ClosingSignedFeeRangeDecodeErrorZ ok(ClosingSignedFeeRange o) {
long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ClosingSignedFeeRangeDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ClosingSignedFeeRangeDecodeErrorZ clone() {
long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_CommitmentSignedDecodeErrorZ extends CommonBase {
*/
public static Result_CommitmentSignedDecodeErrorZ ok(CommitmentSigned o) {
long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_CommitmentSignedDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_CommitmentSignedDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_CommitmentSignedDecodeErrorZ clone() {
long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase {
*/
public static Result_CommitmentTransactionDecodeErrorZ ok(CommitmentTransaction o) {
long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_CommitmentTransactionDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_CommitmentTransactionDecodeErrorZ clone() {
long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends CommonBase {
*/
public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ ok(CounterpartyChannelTransactionParameters o) {
long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_CounterpartyChannelTransactionParametersDecodeErrorZ clone() {
long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBase {
*/
public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ ok(DelayedPaymentOutputDescriptor o) {
long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_DelayedPaymentOutputDescriptorDecodeErrorZ clone() {
long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_DescriptionCreationErrorZ extends CommonBase {
*/
public static Result_DescriptionCreationErrorZ ok(Description o) {
long ret = bindings.CResult_DescriptionCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_DescriptionCreationErrorZ err(org.ldk.enums.CreationError e) {
long ret = bindings.CResult_DescriptionCreationErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_DescriptionCreationErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_DescriptionCreationErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_DescriptionCreationErrorZ clone() {
long ret = bindings.CResult_DescriptionCreationErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase {
*/
public static Result_DirectionalChannelInfoDecodeErrorZ ok(DirectionalChannelInfo o) {
long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_DirectionalChannelInfoDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_DirectionalChannelInfoDecodeErrorZ clone() {
long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ErrorMessageDecodeErrorZ extends CommonBase {
*/
public static Result_ErrorMessageDecodeErrorZ ok(ErrorMessage o) {
long ret = bindings.CResult_ErrorMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ErrorMessageDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ErrorMessageDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ErrorMessageDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ErrorMessageDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ErrorMessageDecodeErrorZ clone() {
long ret = bindings.CResult_ErrorMessageDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ExpiryTimeCreationErrorZ extends CommonBase {
*/
public static Result_ExpiryTimeCreationErrorZ ok(ExpiryTime o) {
long ret = bindings.CResult_ExpiryTimeCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ExpiryTimeCreationErrorZ err(org.ldk.enums.CreationError e) {
long ret = bindings.CResult_ExpiryTimeCreationErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ExpiryTimeCreationErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ExpiryTimeCreationErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ExpiryTimeCreationErrorZ clone() {
long ret = bindings.CResult_ExpiryTimeCreationErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_FundingCreatedDecodeErrorZ extends CommonBase {
*/
public static Result_FundingCreatedDecodeErrorZ ok(FundingCreated o) {
long ret = bindings.CResult_FundingCreatedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_FundingCreatedDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_FundingCreatedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_FundingCreatedDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_FundingCreatedDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_FundingCreatedDecodeErrorZ clone() {
long ret = bindings.CResult_FundingCreatedDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_FundingLockedDecodeErrorZ extends CommonBase {
*/
public static Result_FundingLockedDecodeErrorZ ok(FundingLocked o) {
long ret = bindings.CResult_FundingLockedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_FundingLockedDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_FundingLockedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_FundingLockedDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_FundingLockedDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_FundingLockedDecodeErrorZ clone() {
long ret = bindings.CResult_FundingLockedDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_FundingSignedDecodeErrorZ extends CommonBase {
*/
public static Result_FundingSignedDecodeErrorZ ok(FundingSigned o) {
long ret = bindings.CResult_FundingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_FundingSignedDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_FundingSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_FundingSignedDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_FundingSignedDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_FundingSignedDecodeErrorZ clone() {
long ret = bindings.CResult_FundingSignedDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase {
*/
public static Result_GossipTimestampFilterDecodeErrorZ ok(GossipTimestampFilter o) {
long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_GossipTimestampFilterDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_GossipTimestampFilterDecodeErrorZ clone() {
long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase {
*/
public static Result_HTLCOutputInCommitmentDecodeErrorZ ok(HTLCOutputInCommitment o) {
long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_HTLCOutputInCommitmentDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_HTLCOutputInCommitmentDecodeErrorZ clone() {
long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_HTLCUpdateDecodeErrorZ extends CommonBase {
*/
public static Result_HTLCUpdateDecodeErrorZ ok(HTLCUpdate o) {
long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_HTLCUpdateDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_HTLCUpdateDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_HTLCUpdateDecodeErrorZ clone() {
long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase {
*/
public static Result_HolderCommitmentTransactionDecodeErrorZ ok(HolderCommitmentTransaction o) {
long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_HolderCommitmentTransactionDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_HolderCommitmentTransactionDecodeErrorZ clone() {
long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_InMemorySignerDecodeErrorZ extends CommonBase {
*/
public static Result_InMemorySignerDecodeErrorZ ok(InMemorySigner o) {
long ret = bindings.CResult_InMemorySignerDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_InMemorySignerDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_InMemorySignerDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_InMemorySignerDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_InMemorySignerDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_InMemorySignerDecodeErrorZ clone() {
long ret = bindings.CResult_InMemorySignerDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_InitDecodeErrorZ extends CommonBase {
*/
public static Result_InitDecodeErrorZ ok(Init o) {
long ret = bindings.CResult_InitDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_InitDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_InitDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_InitDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_InitDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_InitDecodeErrorZ clone() {
long ret = bindings.CResult_InitDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_InitFeaturesDecodeErrorZ extends CommonBase {
*/
public static Result_InitFeaturesDecodeErrorZ ok(InitFeatures o) {
long ret = bindings.CResult_InitFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_InitFeaturesDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_InitFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_InitFeaturesDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase {
*/
public static Result_InvoiceFeaturesDecodeErrorZ ok(InvoiceFeatures o) {
long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_InvoiceFeaturesDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_InvoiceNoneZ extends CommonBase {
*/
public static Result_InvoiceNoneZ ok(Invoice o) {
long ret = bindings.CResult_InvoiceNoneZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_InvoiceNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_InvoiceNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_InvoiceNoneZ clone() {
long ret = bindings.CResult_InvoiceNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_InvoiceSemanticErrorZ extends CommonBase {
*/
public static Result_InvoiceSemanticErrorZ ok(Invoice o) {
long ret = bindings.CResult_InvoiceSemanticErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_InvoiceSemanticErrorZ err(org.ldk.enums.SemanticError e) {
long ret = bindings.CResult_InvoiceSemanticErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_InvoiceSemanticErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_InvoiceSemanticErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_InvoiceSemanticErrorZ clone() {
long ret = bindings.CResult_InvoiceSemanticErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_InvoiceSignOrCreationErrorZ extends CommonBase {
*/
public static Result_InvoiceSignOrCreationErrorZ ok(Invoice o) {
long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_InvoiceSignOrCreationErrorZ err(SignOrCreationError e) {
long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_err(e.ptr);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_InvoiceSignOrCreationErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_InvoiceSignOrCreationErrorZ clone() {
long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_LockedChannelMonitorNoneZ extends CommonBase {
*/
public static Result_LockedChannelMonitorNoneZ ok(LockedChannelMonitor o) {
long ret = bindings.CResult_LockedChannelMonitorNoneZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_LockedChannelMonitorNoneZ ret_hu_conv = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(o);
*/
public boolean is_ok() {
boolean ret = bindings.CResult_LockedChannelMonitorNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NetAddressDecodeErrorZ extends CommonBase {
*/
public static Result_NetAddressDecodeErrorZ ok(NetAddress o) {
long ret = bindings.CResult_NetAddressDecodeErrorZ_ok(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_NetAddressDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_NetAddressDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NetAddressDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NetAddressDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NetAddressDecodeErrorZ clone() {
long ret = bindings.CResult_NetAddressDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NetworkGraphDecodeErrorZ extends CommonBase {
*/
public static Result_NetworkGraphDecodeErrorZ ok(NetworkGraph o) {
long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_NetworkGraphDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_NetworkGraphDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NetworkGraphDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NetworkGraphDecodeErrorZ clone() {
long ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase {
*/
public static Result_NodeAnnouncementDecodeErrorZ ok(NodeAnnouncement o) {
long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_NodeAnnouncementDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NodeAnnouncementDecodeErrorZ clone() {
long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase {
*/
public static Result_NodeAnnouncementInfoDecodeErrorZ ok(NodeAnnouncementInfo o) {
long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_NodeAnnouncementInfoDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NodeAnnouncementInfoDecodeErrorZ clone() {
long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NodeFeaturesDecodeErrorZ extends CommonBase {
*/
public static Result_NodeFeaturesDecodeErrorZ ok(NodeFeatures o) {
long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_NodeFeaturesDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NodeFeaturesDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NodeIdDecodeErrorZ extends CommonBase {
*/
public static Result_NodeIdDecodeErrorZ ok(NodeId o) {
long ret = bindings.CResult_NodeIdDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_NodeIdDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_NodeIdDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NodeIdDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NodeIdDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NodeIdDecodeErrorZ clone() {
long ret = bindings.CResult_NodeIdDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NodeInfoDecodeErrorZ extends CommonBase {
*/
public static Result_NodeInfoDecodeErrorZ ok(NodeInfo o) {
long ret = bindings.CResult_NodeInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_NodeInfoDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_NodeInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NodeInfoDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NodeInfoDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NodeInfoDecodeErrorZ clone() {
long ret = bindings.CResult_NodeInfoDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NoneAPIErrorZ extends CommonBase {
*/
public static Result_NoneAPIErrorZ err(APIError e) {
long ret = bindings.CResult_NoneAPIErrorZ_err(e.ptr);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NoneAPIErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NoneAPIErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NoneAPIErrorZ clone() {
long ret = bindings.CResult_NoneAPIErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase {
*/
public static Result_NoneChannelMonitorUpdateErrZ err(org.ldk.enums.ChannelMonitorUpdateErr e) {
long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NoneChannelMonitorUpdateErrZ clone() {
long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NoneErrorZ extends CommonBase {
*/
public static Result_NoneErrorZ err(org.ldk.enums.IOError e) {
long ret = bindings.CResult_NoneErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NoneErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NoneErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NoneErrorZ clone() {
long ret = bindings.CResult_NoneErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NoneLightningErrorZ extends CommonBase {
*/
public static Result_NoneLightningErrorZ err(LightningError e) {
long ret = bindings.CResult_NoneLightningErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NoneLightningErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NoneLightningErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NoneLightningErrorZ clone() {
long ret = bindings.CResult_NoneLightningErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
+++ /dev/null
-package org.ldk.structs;
-
-import org.ldk.impl.bindings;
-import org.ldk.enums.*;
-import org.ldk.util.*;
-import java.util.Arrays;
-import javax.annotation.Nullable;
-
-public class Result_NoneMonitorUpdateErrorZ extends CommonBase {
- private Result_NoneMonitorUpdateErrorZ(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_NoneMonitorUpdateErrorZ_free(ptr); } super.finalize();
- }
-
- static Result_NoneMonitorUpdateErrorZ constr_from_ptr(long ptr) {
- if (bindings.CResult_NoneMonitorUpdateErrorZ_is_ok(ptr)) {
- return new Result_NoneMonitorUpdateErrorZ_OK(null, ptr);
- } else {
- return new Result_NoneMonitorUpdateErrorZ_Err(null, ptr);
- }
- }
- public static final class Result_NoneMonitorUpdateErrorZ_OK extends Result_NoneMonitorUpdateErrorZ {
- private Result_NoneMonitorUpdateErrorZ_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- }
- }
-
- public static final class Result_NoneMonitorUpdateErrorZ_Err extends Result_NoneMonitorUpdateErrorZ {
- public final MonitorUpdateError err;
- private Result_NoneMonitorUpdateErrorZ_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- long err = bindings.LDKCResult_NoneMonitorUpdateErrorZ_get_err(ptr);
- MonitorUpdateError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new MonitorUpdateError(null, err); }
- err_hu_conv.ptrs_to.add(this);
- this.err = err_hu_conv;
- }
- }
-
- /**
- * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
- */
- public static Result_NoneMonitorUpdateErrorZ ok() {
- long ret = bindings.CResult_NoneMonitorUpdateErrorZ_ok();
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- /**
- * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
- */
- public static Result_NoneMonitorUpdateErrorZ err(MonitorUpdateError e) {
- long ret = bindings.CResult_NoneMonitorUpdateErrorZ_err(e == null ? 0 : e.ptr & ~1);
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- /**
- * Checks if the given object is currently in the success state
- */
- public boolean is_ok() {
- boolean ret = bindings.CResult_NoneMonitorUpdateErrorZ_is_ok(this.ptr);
- return ret;
- }
-
- long clone_ptr() {
- long ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone_ptr(this.ptr);
- return ret;
- }
-
- /**
- * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
- public Result_NoneMonitorUpdateErrorZ clone() {
- long ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone(this.ptr);
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
-}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NoneNoneZ extends CommonBase {
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NoneNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NoneNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NoneNoneZ clone() {
long ret = bindings.CResult_NoneNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NonePaymentSendFailureZ extends CommonBase {
*/
public static Result_NonePaymentSendFailureZ err(PaymentSendFailure e) {
long ret = bindings.CResult_NonePaymentSendFailureZ_err(e.ptr);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NonePaymentSendFailureZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NonePaymentSendFailureZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NonePaymentSendFailureZ clone() {
long ret = bindings.CResult_NonePaymentSendFailureZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NonePeerHandleErrorZ extends CommonBase {
*/
public static Result_NonePeerHandleErrorZ err(PeerHandleError e) {
long ret = bindings.CResult_NonePeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NonePeerHandleErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NonePeerHandleErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NonePeerHandleErrorZ clone() {
long ret = bindings.CResult_NonePeerHandleErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_NoneSemanticErrorZ extends CommonBase {
*/
public static Result_NoneSemanticErrorZ err(org.ldk.enums.SemanticError e) {
long ret = bindings.CResult_NoneSemanticErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_NoneSemanticErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_NoneSemanticErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_NoneSemanticErrorZ clone() {
long ret = bindings.CResult_NoneSemanticErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_OpenChannelDecodeErrorZ extends CommonBase {
*/
public static Result_OpenChannelDecodeErrorZ ok(OpenChannel o) {
long ret = bindings.CResult_OpenChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_OpenChannelDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_OpenChannelDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_OpenChannelDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_OpenChannelDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_OpenChannelDecodeErrorZ clone() {
long ret = bindings.CResult_OpenChannelDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_OutPointDecodeErrorZ extends CommonBase {
*/
public static Result_OutPointDecodeErrorZ ok(OutPoint o) {
long ret = bindings.CResult_OutPointDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_OutPointDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_OutPointDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_OutPointDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_OutPointDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_OutPointDecodeErrorZ clone() {
long ret = bindings.CResult_OutPointDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_PayeeDecodeErrorZ extends CommonBase {
*/
public static Result_PayeeDecodeErrorZ ok(Payee o) {
long ret = bindings.CResult_PayeeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PayeeDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_PayeeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_PayeeDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_PayeeDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_PayeeDecodeErrorZ clone() {
long ret = bindings.CResult_PayeeDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_PayeePubKeyErrorZ extends CommonBase {
*/
public static Result_PayeePubKeyErrorZ ok(PayeePubKey o) {
long ret = bindings.CResult_PayeePubKeyErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PayeePubKeyErrorZ err(org.ldk.enums.Secp256k1Error e) {
long ret = bindings.CResult_PayeePubKeyErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_PayeePubKeyErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_PayeePubKeyErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_PayeePubKeyErrorZ clone() {
long ret = bindings.CResult_PayeePubKeyErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_PaymentIdPaymentErrorZ extends CommonBase {
*/
public static Result_PaymentIdPaymentErrorZ ok(byte[] o) {
long ret = bindings.CResult_PaymentIdPaymentErrorZ_ok(InternalUtils.check_arr_len(o, 32));
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PaymentIdPaymentErrorZ err(PaymentError e) {
long ret = bindings.CResult_PaymentIdPaymentErrorZ_err(e.ptr);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_PaymentIdPaymentErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_PaymentIdPaymentErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_PaymentIdPaymentErrorZ clone() {
long ret = bindings.CResult_PaymentIdPaymentErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_PaymentIdPaymentSendFailureZ extends CommonBase {
*/
public static Result_PaymentIdPaymentSendFailureZ ok(byte[] o) {
long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(InternalUtils.check_arr_len(o, 32));
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PaymentIdPaymentSendFailureZ err(PaymentSendFailure e) {
long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_err(e.ptr);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_PaymentIdPaymentSendFailureZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_PaymentIdPaymentSendFailureZ clone() {
long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+public class Result_PaymentPreimageAPIErrorZ extends CommonBase {
+ private Result_PaymentPreimageAPIErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PaymentPreimageAPIErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PaymentPreimageAPIErrorZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_PaymentPreimageAPIErrorZ_is_ok(ptr)) {
+ return new Result_PaymentPreimageAPIErrorZ_OK(null, ptr);
+ } else {
+ return new Result_PaymentPreimageAPIErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PaymentPreimageAPIErrorZ_OK extends Result_PaymentPreimageAPIErrorZ {
+ public final byte[] res;
+ private Result_PaymentPreimageAPIErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_PaymentPreimageAPIErrorZ_get_ok(ptr);
+ }
+ }
+
+ public static final class Result_PaymentPreimageAPIErrorZ_Err extends Result_PaymentPreimageAPIErrorZ {
+ public final APIError err;
+ private Result_PaymentPreimageAPIErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_PaymentPreimageAPIErrorZ_get_err(ptr);
+ APIError err_hu_conv = APIError.constr_from_ptr(err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ }
+
+ /**
+ * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
+ */
+ public static Result_PaymentPreimageAPIErrorZ ok(byte[] o) {
+ long ret = bindings.CResult_PaymentPreimageAPIErrorZ_ok(InternalUtils.check_arr_len(o, 32));
+ Reference.reachabilityFence(o);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentPreimageAPIErrorZ ret_hu_conv = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
+ */
+ public static Result_PaymentPreimageAPIErrorZ err(APIError e) {
+ long ret = bindings.CResult_PaymentPreimageAPIErrorZ_err(e.ptr);
+ Reference.reachabilityFence(e);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentPreimageAPIErrorZ ret_hu_conv = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if the given object is currently in the success state
+ */
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_PaymentPreimageAPIErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ long clone_ptr() {
+ long ret = bindings.CResult_PaymentPreimageAPIErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_PaymentPreimageAPIErrorZ clone() {
+ long ret = bindings.CResult_PaymentPreimageAPIErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentPreimageAPIErrorZ ret_hu_conv = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_PaymentSecretAPIErrorZ extends CommonBase {
*/
public static Result_PaymentSecretAPIErrorZ ok(byte[] o) {
long ret = bindings.CResult_PaymentSecretAPIErrorZ_ok(InternalUtils.check_arr_len(o, 32));
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PaymentSecretAPIErrorZ err(APIError e) {
long ret = bindings.CResult_PaymentSecretAPIErrorZ_err(e.ptr);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_PaymentSecretAPIErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_PaymentSecretAPIErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_PaymentSecretAPIErrorZ clone() {
long ret = bindings.CResult_PaymentSecretAPIErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+public class Result_PaymentSecretNoneZ extends CommonBase {
+ private Result_PaymentSecretNoneZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PaymentSecretNoneZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PaymentSecretNoneZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_PaymentSecretNoneZ_is_ok(ptr)) {
+ return new Result_PaymentSecretNoneZ_OK(null, ptr);
+ } else {
+ return new Result_PaymentSecretNoneZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PaymentSecretNoneZ_OK extends Result_PaymentSecretNoneZ {
+ public final byte[] res;
+ private Result_PaymentSecretNoneZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_PaymentSecretNoneZ_get_ok(ptr);
+ }
+ }
+
+ public static final class Result_PaymentSecretNoneZ_Err extends Result_PaymentSecretNoneZ {
+ private Result_PaymentSecretNoneZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ }
+ }
+
+ /**
+ * Creates a new CResult_PaymentSecretNoneZ in the success state.
+ */
+ public static Result_PaymentSecretNoneZ ok(byte[] o) {
+ long ret = bindings.CResult_PaymentSecretNoneZ_ok(InternalUtils.check_arr_len(o, 32));
+ Reference.reachabilityFence(o);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_PaymentSecretNoneZ in the error state.
+ */
+ public static Result_PaymentSecretNoneZ err() {
+ long ret = bindings.CResult_PaymentSecretNoneZ_err();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if the given object is currently in the success state
+ */
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_PaymentSecretNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ long clone_ptr() {
+ long ret = bindings.CResult_PaymentSecretNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_PaymentSecretNoneZ clone() {
+ long ret = bindings.CResult_PaymentSecretNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_PingDecodeErrorZ extends CommonBase {
*/
public static Result_PingDecodeErrorZ ok(Ping o) {
long ret = bindings.CResult_PingDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PingDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_PingDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_PingDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_PingDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_PingDecodeErrorZ clone() {
long ret = bindings.CResult_PingDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_PongDecodeErrorZ extends CommonBase {
*/
public static Result_PongDecodeErrorZ ok(Pong o) {
long ret = bindings.CResult_PongDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PongDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_PongDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_PongDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_PongDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_PongDecodeErrorZ clone() {
long ret = bindings.CResult_PongDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_PositiveTimestampCreationErrorZ extends CommonBase {
*/
public static Result_PositiveTimestampCreationErrorZ ok(PositiveTimestamp o) {
long ret = bindings.CResult_PositiveTimestampCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PositiveTimestampCreationErrorZ err(org.ldk.enums.CreationError e) {
long ret = bindings.CResult_PositiveTimestampCreationErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_PositiveTimestampCreationErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_PositiveTimestampCreationErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_PositiveTimestampCreationErrorZ clone() {
long ret = bindings.CResult_PositiveTimestampCreationErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_PrivateRouteCreationErrorZ extends CommonBase {
*/
public static Result_PrivateRouteCreationErrorZ ok(PrivateRoute o) {
long ret = bindings.CResult_PrivateRouteCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PrivateRouteCreationErrorZ err(org.ldk.enums.CreationError e) {
long ret = bindings.CResult_PrivateRouteCreationErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_PrivateRouteCreationErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_PrivateRouteCreationErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_PrivateRouteCreationErrorZ clone() {
long ret = bindings.CResult_PrivateRouteCreationErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_PublicKeyErrorZ extends CommonBase {
*/
public static Result_PublicKeyErrorZ ok(byte[] o) {
long ret = bindings.CResult_PublicKeyErrorZ_ok(InternalUtils.check_arr_len(o, 33));
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PublicKeyErrorZ err(org.ldk.enums.Secp256k1Error e) {
long ret = bindings.CResult_PublicKeyErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_PublicKeyErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_PublicKeyErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_PublicKeyErrorZ clone() {
long ret = bindings.CResult_PublicKeyErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase {
*/
public static Result_QueryChannelRangeDecodeErrorZ ok(QueryChannelRange o) {
long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_QueryChannelRangeDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_QueryChannelRangeDecodeErrorZ clone() {
long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase {
*/
public static Result_QueryShortChannelIdsDecodeErrorZ ok(QueryShortChannelIds o) {
long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_QueryShortChannelIdsDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_QueryShortChannelIdsDecodeErrorZ clone() {
long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_RecoverableSignatureNoneZ extends CommonBase {
*/
public static Result_RecoverableSignatureNoneZ ok(byte[] arg) {
long ret = bindings.CResult_RecoverableSignatureNoneZ_ok(InternalUtils.check_arr_len(arg, 68));
+ Reference.reachabilityFence(arg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_RecoverableSignatureNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_RecoverableSignatureNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_RecoverableSignatureNoneZ clone() {
long ret = bindings.CResult_RecoverableSignatureNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase {
*/
public static Result_ReplyChannelRangeDecodeErrorZ ok(ReplyChannelRange o) {
long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ReplyChannelRangeDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ReplyChannelRangeDecodeErrorZ clone() {
long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase {
*/
public static Result_ReplyShortChannelIdsEndDecodeErrorZ ok(ReplyShortChannelIdsEnd o) {
long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ReplyShortChannelIdsEndDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ReplyShortChannelIdsEndDecodeErrorZ clone() {
long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_RevokeAndACKDecodeErrorZ extends CommonBase {
*/
public static Result_RevokeAndACKDecodeErrorZ ok(RevokeAndACK o) {
long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_RevokeAndACKDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_RevokeAndACKDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_RevokeAndACKDecodeErrorZ clone() {
long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_RouteDecodeErrorZ extends CommonBase {
*/
public static Result_RouteDecodeErrorZ ok(Route o) {
long ret = bindings.CResult_RouteDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_RouteDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_RouteDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_RouteDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_RouteDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_RouteDecodeErrorZ clone() {
long ret = bindings.CResult_RouteDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_RouteHintDecodeErrorZ extends CommonBase {
*/
public static Result_RouteHintDecodeErrorZ ok(RouteHint o) {
long ret = bindings.CResult_RouteHintDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_RouteHintDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_RouteHintDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_RouteHintDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_RouteHintDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_RouteHintDecodeErrorZ clone() {
long ret = bindings.CResult_RouteHintDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_RouteHintHopDecodeErrorZ extends CommonBase {
*/
public static Result_RouteHintHopDecodeErrorZ ok(RouteHintHop o) {
long ret = bindings.CResult_RouteHintHopDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_RouteHintHopDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_RouteHintHopDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_RouteHintHopDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_RouteHintHopDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_RouteHintHopDecodeErrorZ clone() {
long ret = bindings.CResult_RouteHintHopDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_RouteHopDecodeErrorZ extends CommonBase {
*/
public static Result_RouteHopDecodeErrorZ ok(RouteHop o) {
long ret = bindings.CResult_RouteHopDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_RouteHopDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_RouteHopDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_RouteHopDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_RouteHopDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_RouteHopDecodeErrorZ clone() {
long ret = bindings.CResult_RouteHopDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_RouteLightningErrorZ extends CommonBase {
*/
public static Result_RouteLightningErrorZ ok(Route o) {
long ret = bindings.CResult_RouteLightningErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_RouteLightningErrorZ err(LightningError e) {
long ret = bindings.CResult_RouteLightningErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_RouteLightningErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_RouteLightningErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_RouteLightningErrorZ clone() {
long ret = bindings.CResult_RouteLightningErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_RouteParametersDecodeErrorZ extends CommonBase {
*/
public static Result_RouteParametersDecodeErrorZ ok(RouteParameters o) {
long ret = bindings.CResult_RouteParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_RouteParametersDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_RouteParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_RouteParametersDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_RouteParametersDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_RouteParametersDecodeErrorZ clone() {
long ret = bindings.CResult_RouteParametersDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_RoutingFeesDecodeErrorZ extends CommonBase {
*/
public static Result_RoutingFeesDecodeErrorZ ok(RoutingFees o) {
long ret = bindings.CResult_RoutingFeesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_RoutingFeesDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_RoutingFeesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_RoutingFeesDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_RoutingFeesDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_RoutingFeesDecodeErrorZ clone() {
long ret = bindings.CResult_RoutingFeesDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ScorerDecodeErrorZ extends CommonBase {
*/
public static Result_ScorerDecodeErrorZ ok(ScoringParameters o_params) {
long ret = bindings.CResult_ScorerDecodeErrorZ_ok(bindings.Scorer_new(o_params == null ? 0 : o_params.ptr & ~1));
+ Reference.reachabilityFence(o_params);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(o_params);
*/
public static Result_ScorerDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ScorerDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ScorerDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ScoringParametersDecodeErrorZ extends CommonBase {
/**
* Creates a new CResult_ScoringParametersDecodeErrorZ in the success state.
*/
- public static Result_ScoringParametersDecodeErrorZ ok(long o_base_penalty_msat_arg, long o_failure_penalty_msat_arg, long o_failure_penalty_half_life_arg) {
- long ret = bindings.CResult_ScoringParametersDecodeErrorZ_ok(bindings.ScoringParameters_new(o_base_penalty_msat_arg, o_failure_penalty_msat_arg, o_failure_penalty_half_life_arg));
+ public static Result_ScoringParametersDecodeErrorZ ok(long o_base_penalty_msat_arg, long o_failure_penalty_msat_arg, short o_overuse_penalty_start_1024th_arg, long o_overuse_penalty_msat_per_1024th_arg, long o_failure_penalty_half_life_arg) {
+ long ret = bindings.CResult_ScoringParametersDecodeErrorZ_ok(bindings.ScoringParameters_new(o_base_penalty_msat_arg, o_failure_penalty_msat_arg, o_overuse_penalty_start_1024th_arg, o_overuse_penalty_msat_per_1024th_arg, o_failure_penalty_half_life_arg));
+ Reference.reachabilityFence(o_base_penalty_msat_arg);
+ Reference.reachabilityFence(o_failure_penalty_msat_arg);
+ Reference.reachabilityFence(o_overuse_penalty_start_1024th_arg);
+ Reference.reachabilityFence(o_overuse_penalty_msat_per_1024th_arg);
+ Reference.reachabilityFence(o_failure_penalty_half_life_arg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ScoringParametersDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ScoringParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ScoringParametersDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_SecretKeyErrorZ extends CommonBase {
*/
public static Result_SecretKeyErrorZ ok(byte[] o) {
long ret = bindings.CResult_SecretKeyErrorZ_ok(InternalUtils.check_arr_len(o, 32));
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_SecretKeyErrorZ err(org.ldk.enums.Secp256k1Error e) {
long ret = bindings.CResult_SecretKeyErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_SecretKeyErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ShutdownDecodeErrorZ extends CommonBase {
*/
public static Result_ShutdownDecodeErrorZ ok(Shutdown o) {
long ret = bindings.CResult_ShutdownDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ShutdownDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ShutdownDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ShutdownDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ShutdownDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ShutdownDecodeErrorZ clone() {
long ret = bindings.CResult_ShutdownDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ShutdownScriptDecodeErrorZ extends CommonBase {
*/
public static Result_ShutdownScriptDecodeErrorZ ok(ShutdownScript o) {
long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ShutdownScriptDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ShutdownScriptDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ShutdownScriptDecodeErrorZ clone() {
long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase {
*/
public static Result_ShutdownScriptInvalidShutdownScriptZ ok(ShutdownScript o) {
long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_ShutdownScriptInvalidShutdownScriptZ err(InvalidShutdownScript e) {
long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_ShutdownScriptInvalidShutdownScriptZ clone() {
long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_SiPrefixNoneZ extends CommonBase {
*/
public static Result_SiPrefixNoneZ ok(org.ldk.enums.SiPrefix o) {
long ret = bindings.CResult_SiPrefixNoneZ_ok(o);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SiPrefixNoneZ ret_hu_conv = Result_SiPrefixNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_SiPrefixNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_SiPrefixNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_SiPrefixNoneZ clone() {
long ret = bindings.CResult_SiPrefixNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SiPrefixNoneZ ret_hu_conv = Result_SiPrefixNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_SignDecodeErrorZ extends CommonBase {
*/
public static Result_SignDecodeErrorZ ok(Sign o) {
long ret = bindings.CResult_SignDecodeErrorZ_ok(o == null ? 0 : o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(o);
*/
public static Result_SignDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_SignDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_SignDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_SignDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_SignDecodeErrorZ clone() {
long ret = bindings.CResult_SignDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_SignatureNoneZ extends CommonBase {
*/
public static Result_SignatureNoneZ ok(byte[] o) {
long ret = bindings.CResult_SignatureNoneZ_ok(InternalUtils.check_arr_len(o, 64));
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_SignatureNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_SignatureNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_SignatureNoneZ clone() {
long ret = bindings.CResult_SignatureNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_SignedRawInvoiceNoneZ extends CommonBase {
*/
public static Result_SignedRawInvoiceNoneZ ok(SignedRawInvoice o) {
long ret = bindings.CResult_SignedRawInvoiceNoneZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_SignedRawInvoiceNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_SignedRawInvoiceNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_SignedRawInvoiceNoneZ clone() {
long ret = bindings.CResult_SignedRawInvoiceNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase {
*/
public static Result_SpendableOutputDescriptorDecodeErrorZ ok(SpendableOutputDescriptor o) {
long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_SpendableOutputDescriptorDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_SpendableOutputDescriptorDecodeErrorZ clone() {
long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase {
*/
public static Result_StaticPaymentOutputDescriptorDecodeErrorZ ok(StaticPaymentOutputDescriptor o) {
long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_StaticPaymentOutputDescriptorDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_StaticPaymentOutputDescriptorDecodeErrorZ clone() {
long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_StringErrorZ extends CommonBase {
*/
public static Result_StringErrorZ ok(java.lang.String o) {
long ret = bindings.CResult_StringErrorZ_ok(o);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_StringErrorZ err(org.ldk.enums.Secp256k1Error e) {
long ret = bindings.CResult_StringErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_StringErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_TransactionNoneZ extends CommonBase {
*/
public static Result_TransactionNoneZ ok(byte[] o) {
long ret = bindings.CResult_TransactionNoneZ_ok(o);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_TransactionNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_TransactionNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_TransactionNoneZ clone() {
long ret = bindings.CResult_TransactionNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_TrustedClosingTransactionNoneZ extends CommonBase {
*/
public static Result_TrustedClosingTransactionNoneZ ok(TrustedClosingTransaction o) {
long ret = bindings.CResult_TrustedClosingTransactionNoneZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TrustedClosingTransactionNoneZ ret_hu_conv = Result_TrustedClosingTransactionNoneZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(o);
*/
public boolean is_ok() {
boolean ret = bindings.CResult_TrustedClosingTransactionNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase {
*/
public static Result_TrustedCommitmentTransactionNoneZ ok(TrustedCommitmentTransaction o) {
long ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(o);
*/
public boolean is_ok() {
boolean ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_TxCreationKeysDecodeErrorZ extends CommonBase {
*/
public static Result_TxCreationKeysDecodeErrorZ ok(TxCreationKeys o) {
long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_TxCreationKeysDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_TxCreationKeysDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_TxCreationKeysDecodeErrorZ clone() {
long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_TxCreationKeysErrorZ extends CommonBase {
*/
public static Result_TxCreationKeysErrorZ ok(TxCreationKeys o) {
long ret = bindings.CResult_TxCreationKeysErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_TxCreationKeysErrorZ err(org.ldk.enums.Secp256k1Error e) {
long ret = bindings.CResult_TxCreationKeysErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_TxCreationKeysErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_TxCreationKeysErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_TxCreationKeysErrorZ clone() {
long ret = bindings.CResult_TxCreationKeysErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_TxOutAccessErrorZ extends CommonBase {
*/
public static Result_TxOutAccessErrorZ ok(TxOut o) {
long ret = bindings.CResult_TxOutAccessErrorZ_ok(o.ptr);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_TxOutAccessErrorZ err(org.ldk.enums.AccessError e) {
long ret = bindings.CResult_TxOutAccessErrorZ_err(e);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_TxOutAccessErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_TxOutAccessErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_TxOutAccessErrorZ clone() {
long ret = bindings.CResult_TxOutAccessErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase {
*/
public static Result_UnsignedChannelAnnouncementDecodeErrorZ ok(UnsignedChannelAnnouncement o) {
long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_UnsignedChannelAnnouncementDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_UnsignedChannelAnnouncementDecodeErrorZ clone() {
long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase {
*/
public static Result_UnsignedChannelUpdateDecodeErrorZ ok(UnsignedChannelUpdate o) {
long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_UnsignedChannelUpdateDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_UnsignedChannelUpdateDecodeErrorZ clone() {
long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase {
*/
public static Result_UnsignedNodeAnnouncementDecodeErrorZ ok(UnsignedNodeAnnouncement o) {
long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_UnsignedNodeAnnouncementDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_UnsignedNodeAnnouncementDecodeErrorZ clone() {
long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase {
*/
public static Result_UpdateAddHTLCDecodeErrorZ ok(UpdateAddHTLC o) {
long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_UpdateAddHTLCDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_UpdateAddHTLCDecodeErrorZ clone() {
long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase {
*/
public static Result_UpdateFailHTLCDecodeErrorZ ok(UpdateFailHTLC o) {
long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_UpdateFailHTLCDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_UpdateFailHTLCDecodeErrorZ clone() {
long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase {
*/
public static Result_UpdateFailMalformedHTLCDecodeErrorZ ok(UpdateFailMalformedHTLC o) {
long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_UpdateFailMalformedHTLCDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_UpdateFailMalformedHTLCDecodeErrorZ clone() {
long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_UpdateFeeDecodeErrorZ extends CommonBase {
*/
public static Result_UpdateFeeDecodeErrorZ ok(UpdateFee o) {
long ret = bindings.CResult_UpdateFeeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_UpdateFeeDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_UpdateFeeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_UpdateFeeDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_UpdateFeeDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_UpdateFeeDecodeErrorZ clone() {
long ret = bindings.CResult_UpdateFeeDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase {
*/
public static Result_UpdateFulfillHTLCDecodeErrorZ ok(UpdateFulfillHTLC o) {
long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_UpdateFulfillHTLCDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_UpdateFulfillHTLCDecodeErrorZ clone() {
long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result__u832APIErrorZ extends CommonBase {
*/
public static Result__u832APIErrorZ ok(byte[] o) {
long ret = bindings.CResult__u832APIErrorZ_ok(InternalUtils.check_arr_len(o, 32));
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result__u832APIErrorZ err(APIError e) {
long ret = bindings.CResult__u832APIErrorZ_err(e.ptr);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult__u832APIErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult__u832APIErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result__u832APIErrorZ clone() {
long ret = bindings.CResult__u832APIErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_boolLightningErrorZ extends CommonBase {
*/
public static Result_boolLightningErrorZ ok(boolean o) {
long ret = bindings.CResult_boolLightningErrorZ_ok(o);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_boolLightningErrorZ err(LightningError e) {
long ret = bindings.CResult_boolLightningErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_boolLightningErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_boolLightningErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_boolLightningErrorZ clone() {
long ret = bindings.CResult_boolLightningErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class Result_boolPeerHandleErrorZ extends CommonBase {
*/
public static Result_boolPeerHandleErrorZ ok(boolean o) {
long ret = bindings.CResult_boolPeerHandleErrorZ_ok(o);
+ Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_boolPeerHandleErrorZ err(PeerHandleError e) {
long ret = bindings.CResult_boolPeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean is_ok() {
boolean ret = bindings.CResult_boolPeerHandleErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.CResult_boolPeerHandleErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Result_boolPeerHandleErrorZ clone() {
long ret = bindings.CResult_boolPeerHandleErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public long get_a() {
long ret = bindings.RetryAttempts_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
public void set_a(long val) {
bindings.RetryAttempts_set_a(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static RetryAttempts of(long a_arg) {
long ret = bindings.RetryAttempts_new(a_arg);
+ Reference.reachabilityFence(a_arg);
if (ret >= 0 && ret <= 4096) { return null; }
RetryAttempts ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RetryAttempts(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.RetryAttempts_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public RetryAttempts clone() {
long ret = bindings.RetryAttempts_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RetryAttempts ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RetryAttempts(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public boolean eq(RetryAttempts b) {
boolean ret = bindings.RetryAttempts_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof RetryAttempts)) return false;
+ return this.eq((RetryAttempts)o);
+ }
/**
* Checks if two RetryAttemptss contain equal inner contents.
*/
public long hash() {
long ret = bindings.RetryAttempts_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.RevokeAndACK_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.RevokeAndACK_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_per_commitment_secret() {
byte[] ret = bindings.RevokeAndACK_get_per_commitment_secret(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_per_commitment_secret(byte[] val) {
bindings.RevokeAndACK_set_per_commitment_secret(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_next_per_commitment_point() {
byte[] ret = bindings.RevokeAndACK_get_next_per_commitment_point(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_next_per_commitment_point(byte[] val) {
bindings.RevokeAndACK_set_next_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static RevokeAndACK of(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg) {
long ret = bindings.RevokeAndACK_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(per_commitment_secret_arg, 32), InternalUtils.check_arr_len(next_per_commitment_point_arg, 33));
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(per_commitment_secret_arg);
+ Reference.reachabilityFence(next_per_commitment_point_arg);
if (ret >= 0 && ret <= 4096) { return null; }
RevokeAndACK ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RevokeAndACK(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.RevokeAndACK_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public RevokeAndACK clone() {
long ret = bindings.RevokeAndACK_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RevokeAndACK ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RevokeAndACK(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.RevokeAndACK_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_RevokeAndACKDecodeErrorZ read(byte[] ser) {
long ret = bindings.RevokeAndACK_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public RouteHop[][] get_paths() {
long[][] ret = bindings.Route_get_paths(this.ptr);
+ Reference.reachabilityFence(this);
RouteHop[][] ret_conv_12_arr = new RouteHop[ret.length][];
for (int m = 0; m < ret.length; m++) {
long[] ret_conv_12 = ret[m];
*/
public void set_paths(RouteHop[][] val) {
bindings.Route_set_paths(this.ptr, val != null ? Arrays.stream(val).map(val_conv_12 -> val_conv_12 != null ? Arrays.stream(val_conv_12).mapToLong(val_conv_12_conv_10 -> val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr & ~1).toArray() : null).toArray(long[][]::new) : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
@Nullable
public Payee get_payee() {
long ret = bindings.Route_get_payee(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Payee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Payee(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_payee(@Nullable Payee val) {
bindings.Route_set_payee(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static Route of(RouteHop[][] paths_arg, Payee payee_arg) {
long ret = bindings.Route_new(paths_arg != null ? Arrays.stream(paths_arg).map(paths_arg_conv_12 -> paths_arg_conv_12 != null ? Arrays.stream(paths_arg_conv_12).mapToLong(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr & ~1).toArray() : null).toArray(long[][]::new) : null, payee_arg == null ? 0 : payee_arg.ptr & ~1);
+ Reference.reachabilityFence(paths_arg);
+ Reference.reachabilityFence(payee_arg);
if (ret >= 0 && ret <= 4096) { return null; }
Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Route(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.Route_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Route clone() {
long ret = bindings.Route_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Route ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Route(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.Route_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two Routes contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(Route b) {
boolean ret = bindings.Route_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Route)) return false;
+ return this.eq((Route)o);
+ }
/**
* Returns the total amount of fees paid on this [`Route`].
*
*/
public long get_total_fees() {
long ret = bindings.Route_get_total_fees(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public long get_total_amount() {
long ret = bindings.Route_get_total_amount(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] write() {
byte[] ret = bindings.Route_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_RouteDecodeErrorZ read(byte[] ser) {
long ret = bindings.Route_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public RouteHintHop[] get_a() {
long[] ret = bindings.RouteHint_get_a(this.ptr);
+ Reference.reachabilityFence(this);
RouteHintHop[] ret_conv_14_arr = new RouteHintHop[ret.length];
for (int o = 0; o < ret.length; o++) {
long ret_conv_14 = ret[o];
public void set_a(RouteHintHop[] val) {
bindings.RouteHint_set_a(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_14 -> val_conv_14 == null ? 0 : val_conv_14.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static RouteHint of(RouteHintHop[] a_arg) {
long ret = bindings.RouteHint_new(a_arg != null ? Arrays.stream(a_arg).mapToLong(a_arg_conv_14 -> a_arg_conv_14 == null ? 0 : a_arg_conv_14.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(a_arg);
if (ret >= 0 && ret <= 4096) { return null; }
RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHint(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.RouteHint_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public RouteHint clone() {
long ret = bindings.RouteHint_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.RouteHint_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two RouteHints contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(RouteHint b) {
boolean ret = bindings.RouteHint_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof RouteHint)) return false;
+ return this.eq((RouteHint)o);
+ }
/**
* Serialize the RouteHint object into a byte array which can be read by RouteHint_read
*/
public byte[] write() {
byte[] ret = bindings.RouteHint_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_RouteHintDecodeErrorZ read(byte[] ser) {
long ret = bindings.RouteHint_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_src_node_id() {
byte[] ret = bindings.RouteHintHop_get_src_node_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_src_node_id(byte[] val) {
bindings.RouteHintHop_set_src_node_id(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_short_channel_id() {
long ret = bindings.RouteHintHop_get_short_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_short_channel_id(long val) {
bindings.RouteHintHop_set_short_channel_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public RoutingFees get_fees() {
long ret = bindings.RouteHintHop_get_fees(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_fees(RoutingFees val) {
bindings.RouteHintHop_set_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_cltv_expiry_delta() {
short ret = bindings.RouteHintHop_get_cltv_expiry_delta(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_cltv_expiry_delta(short val) {
bindings.RouteHintHop_set_cltv_expiry_delta(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public Option_u64Z get_htlc_minimum_msat() {
long ret = bindings.RouteHintHop_get_htlc_minimum_msat(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_htlc_minimum_msat(Option_u64Z val) {
bindings.RouteHintHop_set_htlc_minimum_msat(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public Option_u64Z get_htlc_maximum_msat() {
long ret = bindings.RouteHintHop_get_htlc_maximum_msat(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public void set_htlc_maximum_msat(Option_u64Z val) {
bindings.RouteHintHop_set_htlc_maximum_msat(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static RouteHintHop of(byte[] src_node_id_arg, long short_channel_id_arg, RoutingFees fees_arg, short cltv_expiry_delta_arg, Option_u64Z htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg) {
long ret = bindings.RouteHintHop_new(InternalUtils.check_arr_len(src_node_id_arg, 33), short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr);
+ Reference.reachabilityFence(src_node_id_arg);
+ Reference.reachabilityFence(short_channel_id_arg);
+ Reference.reachabilityFence(fees_arg);
+ Reference.reachabilityFence(cltv_expiry_delta_arg);
+ Reference.reachabilityFence(htlc_minimum_msat_arg);
+ Reference.reachabilityFence(htlc_maximum_msat_arg);
if (ret >= 0 && ret <= 4096) { return null; }
RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHintHop(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.RouteHintHop_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public RouteHintHop clone() {
long ret = bindings.RouteHintHop_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHintHop(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.RouteHintHop_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two RouteHintHops contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(RouteHintHop b) {
boolean ret = bindings.RouteHintHop_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof RouteHintHop)) return false;
+ return this.eq((RouteHintHop)o);
+ }
/**
* Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
*/
public byte[] write() {
byte[] ret = bindings.RouteHintHop_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_RouteHintHopDecodeErrorZ read(byte[] ser) {
long ret = bindings.RouteHintHop_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_pubkey() {
byte[] ret = bindings.RouteHop_get_pubkey(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_pubkey(byte[] val) {
bindings.RouteHop_set_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public NodeFeatures get_node_features() {
long ret = bindings.RouteHop_get_node_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_node_features(NodeFeatures val) {
bindings.RouteHop_set_node_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_short_channel_id() {
long ret = bindings.RouteHop_get_short_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_short_channel_id(long val) {
bindings.RouteHop_set_short_channel_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public ChannelFeatures get_channel_features() {
long ret = bindings.RouteHop_get_channel_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_channel_features(ChannelFeatures val) {
bindings.RouteHop_set_channel_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_fee_msat() {
long ret = bindings.RouteHop_get_fee_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_fee_msat(long val) {
bindings.RouteHop_set_fee_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_cltv_expiry_delta() {
int ret = bindings.RouteHop_get_cltv_expiry_delta(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_cltv_expiry_delta(int val) {
bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static RouteHop of(byte[] pubkey_arg, NodeFeatures node_features_arg, long short_channel_id_arg, ChannelFeatures channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg) {
long ret = bindings.RouteHop_new(InternalUtils.check_arr_len(pubkey_arg, 33), node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg);
+ Reference.reachabilityFence(pubkey_arg);
+ Reference.reachabilityFence(node_features_arg);
+ Reference.reachabilityFence(short_channel_id_arg);
+ Reference.reachabilityFence(channel_features_arg);
+ Reference.reachabilityFence(fee_msat_arg);
+ Reference.reachabilityFence(cltv_expiry_delta_arg);
if (ret >= 0 && ret <= 4096) { return null; }
RouteHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHop(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.RouteHop_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public RouteHop clone() {
long ret = bindings.RouteHop_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RouteHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteHop(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.RouteHop_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two RouteHops contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(RouteHop b) {
boolean ret = bindings.RouteHop_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof RouteHop)) return false;
+ return this.eq((RouteHop)o);
+ }
/**
* Serialize the RouteHop object into a byte array which can be read by RouteHop_read
*/
public byte[] write() {
byte[] ret = bindings.RouteHop_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_RouteHopDecodeErrorZ read(byte[] ser) {
long ret = bindings.RouteHop_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public Payee get_payee() {
long ret = bindings.RouteParameters_get_payee(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Payee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Payee(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_payee(Payee val) {
bindings.RouteParameters_set_payee(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_final_value_msat() {
long ret = bindings.RouteParameters_get_final_value_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_final_value_msat(long val) {
bindings.RouteParameters_set_final_value_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_final_cltv_expiry_delta() {
int ret = bindings.RouteParameters_get_final_cltv_expiry_delta(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_final_cltv_expiry_delta(int val) {
bindings.RouteParameters_set_final_cltv_expiry_delta(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static RouteParameters of(Payee payee_arg, long final_value_msat_arg, int final_cltv_expiry_delta_arg) {
long ret = bindings.RouteParameters_new(payee_arg == null ? 0 : payee_arg.ptr & ~1, final_value_msat_arg, final_cltv_expiry_delta_arg);
+ Reference.reachabilityFence(payee_arg);
+ Reference.reachabilityFence(final_value_msat_arg);
+ Reference.reachabilityFence(final_cltv_expiry_delta_arg);
if (ret >= 0 && ret <= 4096) { return null; }
RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteParameters(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.RouteParameters_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public RouteParameters clone() {
long ret = bindings.RouteParameters_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RouteParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RouteParameters(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.RouteParameters_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_RouteParametersDecodeErrorZ read(byte[] ser) {
long ret = bindings.RouteParameters_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*
* Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
- Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters params, ChannelDetails[] first_hops, Score scorer);
+ Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters params, byte[] payment_hash, ChannelDetails[] first_hops, Score scorer);
}
private static class LDKRouterHolder { Router held; }
public static Router new_impl(RouterInterface arg) {
final LDKRouterHolder impl_holder = new LDKRouterHolder();
impl_holder.held = new Router(new bindings.LDKRouter() {
- @Override public long find_route(byte[] payer, long params, long[] first_hops, long scorer) {
+ @Override public long find_route(byte[] payer, long params, byte[] payment_hash, long[] first_hops, long scorer) {
RouteParameters params_hu_conv = null; if (params < 0 || params > 4096) { params_hu_conv = new RouteParameters(null, params); }
ChannelDetails[] first_hops_conv_16_arr = new ChannelDetails[first_hops.length];
for (int q = 0; q < first_hops.length; q++) {
}
Score ret_hu_conv = new Score(null, scorer);
ret_hu_conv.ptrs_to.add(this);
- Result_RouteLightningErrorZ ret = arg.find_route(payer, params_hu_conv, first_hops_conv_16_arr, ret_hu_conv);
+ Result_RouteLightningErrorZ ret = arg.find_route(payer, params_hu_conv, payment_hash, first_hops_conv_16_arr, ret_hu_conv);
long result = ret == null ? 0 : ret.clone_ptr();
return result;
}
*
* Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
- public Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters params, @Nullable ChannelDetails[] first_hops, Score scorer) {
- long ret = bindings.Router_find_route(this.ptr, InternalUtils.check_arr_len(payer, 33), params == null ? 0 : params.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray() : null, scorer == null ? 0 : scorer.ptr);
+ public Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters params, byte[] payment_hash, @Nullable ChannelDetails[] first_hops, Score scorer) {
+ long ret = bindings.Router_find_route(this.ptr, InternalUtils.check_arr_len(payer, 33), params == null ? 0 : params.ptr & ~1, InternalUtils.check_arr_len(payment_hash, 32), first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray() : null, scorer == null ? 0 : scorer.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(payer);
+ Reference.reachabilityFence(params);
+ Reference.reachabilityFence(payment_hash);
+ Reference.reachabilityFence(first_hops);
+ Reference.reachabilityFence(scorer);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(params);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public int get_base_msat() {
int ret = bindings.RoutingFees_get_base_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_base_msat(int val) {
bindings.RoutingFees_set_base_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_proportional_millionths() {
int ret = bindings.RoutingFees_get_proportional_millionths(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_proportional_millionths(int val) {
bindings.RoutingFees_set_proportional_millionths(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static RoutingFees of(int base_msat_arg, int proportional_millionths_arg) {
long ret = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg);
+ Reference.reachabilityFence(base_msat_arg);
+ Reference.reachabilityFence(proportional_millionths_arg);
if (ret >= 0 && ret <= 4096) { return null; }
RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public boolean eq(RoutingFees b) {
boolean ret = bindings.RoutingFees_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof RoutingFees)) return false;
+ return this.eq((RoutingFees)o);
+ }
long clone_ptr() {
long ret = bindings.RoutingFees_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public RoutingFees clone() {
long ret = bindings.RoutingFees_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RoutingFees(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.RoutingFees_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
*/
public byte[] write() {
byte[] ret = bindings.RoutingFees_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_RoutingFeesDecodeErrorZ read(byte[] ser) {
long ret = bindings.RoutingFees_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public Result_boolLightningErrorZ handle_node_announcement(NodeAnnouncement msg) {
long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
*/
public Result_boolLightningErrorZ handle_channel_announcement(ChannelAnnouncement msg) {
long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
*/
public Result_boolLightningErrorZ handle_channel_update(ChannelUpdate msg) {
long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
*/
public ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[] get_next_channel_announcements(long starting_point, byte batch_amount) {
long[] ret = bindings.RoutingMessageHandler_get_next_channel_announcements(this.ptr, starting_point, batch_amount);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(starting_point);
+ Reference.reachabilityFence(batch_amount);
ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[] ret_conv_59_arr = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[ret.length];
for (int h = 0; h < ret.length; h++) {
long ret_conv_59 = ret[h];
*/
public NodeAnnouncement[] get_next_node_announcements(@Nullable byte[] starting_point, byte batch_amount) {
long[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, InternalUtils.check_arr_len(starting_point, 33), batch_amount);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(starting_point);
+ Reference.reachabilityFence(batch_amount);
NodeAnnouncement[] ret_conv_18_arr = new NodeAnnouncement[ret.length];
for (int s = 0; s < ret.length; s++) {
long ret_conv_18 = ret[s];
*/
public void sync_routing_table(byte[] their_node_id, Init init) {
bindings.RoutingMessageHandler_sync_routing_table(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(init);
this.ptrs_to.add(init);
}
*/
public Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, ReplyChannelRange msg) {
long ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, ReplyShortChannelIdsEnd msg) {
long ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, QueryChannelRange msg) {
long ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, QueryShortChannelIds msg) {
long ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(their_node_id);
+ Reference.reachabilityFence(msg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
public static interface ScoreInterface {
/**
- * Returns the fee in msats willing to be paid to avoid routing through the given channel
- * in the direction from `source` to `target`.
+ * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
+ * given channel in the direction from `source` to `target`.
+ *
+ * The channel's capacity (less any other MPP parts which are also being considered for use in
+ * the same payment) is given by `channel_capacity_msat`. It may be guessed from various
+ * sources or assumed from no data at all.
+ *
+ * For hints provided in the invoice, we assume the channel has sufficient capacity to accept
+ * the invoice's full amount, and provide a `channel_capacity_msat` of `None`. In all other
+ * cases it is set to `Some`, even if we're guessing at the channel value.
+ *
+ * Your code should be overflow-safe through a `channel_capacity_msat` of 21 million BTC.
*/
- long channel_penalty_msat(long short_channel_id, NodeId source, NodeId target);
+ long channel_penalty_msat(long short_channel_id, long send_amt_msat, Option_u64Z channel_capacity_msat, NodeId source, NodeId target);
/**
* Handles updating channel penalties after failing to route through a channel.
*/
void payment_path_failed(RouteHop[] path, long short_channel_id);
+ /**
+ * Handles updating channel penalties after successfully routing along a path.
+ */
+ void payment_path_successful(RouteHop[] path);
/**
* Serialize the object into a byte array
*/
public static Score new_impl(ScoreInterface arg) {
final LDKScoreHolder impl_holder = new LDKScoreHolder();
impl_holder.held = new Score(new bindings.LDKScore() {
- @Override public long channel_penalty_msat(long short_channel_id, long source, long target) {
+ @Override public long channel_penalty_msat(long short_channel_id, long send_amt_msat, long channel_capacity_msat, long source, long target) {
+ Option_u64Z channel_capacity_msat_hu_conv = Option_u64Z.constr_from_ptr(channel_capacity_msat);
+ channel_capacity_msat_hu_conv.ptrs_to.add(this);
NodeId source_hu_conv = null; if (source < 0 || source > 4096) { source_hu_conv = new NodeId(null, source); }
NodeId target_hu_conv = null; if (target < 0 || target > 4096) { target_hu_conv = new NodeId(null, target); }
- long ret = arg.channel_penalty_msat(short_channel_id, source_hu_conv, target_hu_conv);
+ long ret = arg.channel_penalty_msat(short_channel_id, send_amt_msat, channel_capacity_msat_hu_conv, source_hu_conv, target_hu_conv);
return ret;
}
@Override public void payment_path_failed(long[] path, long short_channel_id) {
}
arg.payment_path_failed(path_conv_10_arr, short_channel_id);
}
+ @Override public void payment_path_successful(long[] path) {
+ RouteHop[] path_conv_10_arr = new RouteHop[path.length];
+ for (int k = 0; k < path.length; k++) {
+ long path_conv_10 = path[k];
+ RouteHop path_conv_10_hu_conv = null; if (path_conv_10 < 0 || path_conv_10 > 4096) { path_conv_10_hu_conv = new RouteHop(null, path_conv_10); }
+ path_conv_10_hu_conv.ptrs_to.add(this);
+ path_conv_10_arr[k] = path_conv_10_hu_conv;
+ }
+ arg.payment_path_successful(path_conv_10_arr);
+ }
@Override public byte[] write() {
byte[] ret = arg.write();
return ret;
return impl_holder.held;
}
/**
- * Returns the fee in msats willing to be paid to avoid routing through the given channel
- * in the direction from `source` to `target`.
+ * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
+ * given channel in the direction from `source` to `target`.
+ *
+ * The channel's capacity (less any other MPP parts which are also being considered for use in
+ * the same payment) is given by `channel_capacity_msat`. It may be guessed from various
+ * sources or assumed from no data at all.
+ *
+ * For hints provided in the invoice, we assume the channel has sufficient capacity to accept
+ * the invoice's full amount, and provide a `channel_capacity_msat` of `None`. In all other
+ * cases it is set to `Some`, even if we're guessing at the channel value.
+ *
+ * Your code should be overflow-safe through a `channel_capacity_msat` of 21 million BTC.
*/
- public long channel_penalty_msat(long short_channel_id, NodeId source, NodeId target) {
- long ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, source == null ? 0 : source.ptr & ~1, target == null ? 0 : target.ptr & ~1);
+ public long channel_penalty_msat(long short_channel_id, long send_amt_msat, Option_u64Z channel_capacity_msat, NodeId source, NodeId target) {
+ long ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, send_amt_msat, channel_capacity_msat.ptr, source == null ? 0 : source.ptr & ~1, target == null ? 0 : target.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(short_channel_id);
+ Reference.reachabilityFence(send_amt_msat);
+ Reference.reachabilityFence(channel_capacity_msat);
+ Reference.reachabilityFence(source);
+ Reference.reachabilityFence(target);
this.ptrs_to.add(source);
this.ptrs_to.add(target);
return ret;
*/
public void payment_path_failed(RouteHop[] path, long short_channel_id) {
bindings.Score_payment_path_failed(this.ptr, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null, short_channel_id);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(path);
+ Reference.reachabilityFence(short_channel_id);
+ }
+
+ /**
+ * Handles updating channel penalties after successfully routing along a path.
+ */
+ public void payment_path_successful(RouteHop[] path) {
+ bindings.Score_payment_path_successful(this.ptr, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(path);
}
/**
*/
public byte[] write() {
byte[] ret = bindings.Score_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
- * [`routing::Score`] implementation that provides reasonable default behavior.
+ * [`Score`] implementation that provides reasonable default behavior.
*
* Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with
* slightly higher fees are available. Will further penalize channels that fail to relay payments.
*
* See [module-level documentation] for usage.
*
- * [module-level documentation]: crate::routing::scorer
+ * [module-level documentation]: crate::routing::scoring
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class Scorer extends CommonBase {
/**
* Creates a new scorer using the given scoring parameters.
*/
- public static Scorer of(long params_base_penalty_msat_arg, long params_failure_penalty_msat_arg, long params_failure_penalty_half_life_arg) {
- long ret = bindings.Scorer_new(bindings.ScoringParameters_new(params_base_penalty_msat_arg, params_failure_penalty_msat_arg, params_failure_penalty_half_life_arg));
+ public static Scorer of(long params_base_penalty_msat_arg, long params_failure_penalty_msat_arg, short params_overuse_penalty_start_1024th_arg, long params_overuse_penalty_msat_per_1024th_arg, long params_failure_penalty_half_life_arg) {
+ long ret = bindings.Scorer_new(bindings.ScoringParameters_new(params_base_penalty_msat_arg, params_failure_penalty_msat_arg, params_overuse_penalty_start_1024th_arg, params_overuse_penalty_msat_per_1024th_arg, params_failure_penalty_half_life_arg));
+ Reference.reachabilityFence(params_base_penalty_msat_arg);
+ Reference.reachabilityFence(params_failure_penalty_msat_arg);
+ Reference.reachabilityFence(params_overuse_penalty_start_1024th_arg);
+ Reference.reachabilityFence(params_overuse_penalty_msat_per_1024th_arg);
+ Reference.reachabilityFence(params_failure_penalty_half_life_arg);
if (ret >= 0 && ret <= 4096) { return null; }
Scorer ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Scorer(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public Score as_Score() {
long ret = bindings.Scorer_as_Score(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Score ret_hu_conv = new Score(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.Scorer_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ScorerDecodeErrorZ read(byte[] ser) {
long ret = bindings.Scorer_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
* A fixed penalty in msats to apply to each channel.
+ *
+ * Default value: 500 msat
*/
public long get_base_penalty_msat() {
long ret = bindings.ScoringParameters_get_base_penalty_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
/**
* A fixed penalty in msats to apply to each channel.
+ *
+ * Default value: 500 msat
*/
public void set_base_penalty_msat(long val) {
bindings.ScoringParameters_set_base_penalty_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
* A penalty in msats to apply to a channel upon failing to relay a payment.
*
* This accumulates for each failure but may be reduced over time based on
- * [`failure_penalty_half_life`].
+ * [`failure_penalty_half_life`] or when successfully routing through a channel.
+ *
+ * Default value: 1,024,000 msat
*
* [`failure_penalty_half_life`]: Self::failure_penalty_half_life
*/
public long get_failure_penalty_msat() {
long ret = bindings.ScoringParameters_get_failure_penalty_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
* A penalty in msats to apply to a channel upon failing to relay a payment.
*
* This accumulates for each failure but may be reduced over time based on
- * [`failure_penalty_half_life`].
+ * [`failure_penalty_half_life`] or when successfully routing through a channel.
+ *
+ * Default value: 1,024,000 msat
*
* [`failure_penalty_half_life`]: Self::failure_penalty_half_life
*/
public void set_failure_penalty_msat(long val) {
bindings.ScoringParameters_set_failure_penalty_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
+ /**
+ * When the amount being sent over a channel is this many 1024ths of the total channel
+ * capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
+ *
+ * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
+ *
+ * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
+ */
+ public short get_overuse_penalty_start_1024th() {
+ short ret = bindings.ScoringParameters_get_overuse_penalty_start_1024th(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * When the amount being sent over a channel is this many 1024ths of the total channel
+ * capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
+ *
+ * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
+ *
+ * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
+ */
+ public void set_overuse_penalty_start_1024th(short val) {
+ bindings.ScoringParameters_set_overuse_penalty_start_1024th(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
+ /**
+ * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
+ * over the channel exceeds [`overuse_penalty_start_1024th`] by.
+ *
+ * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
+ * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
+ *
+ * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
+ */
+ public long get_overuse_penalty_msat_per_1024th() {
+ long ret = bindings.ScoringParameters_get_overuse_penalty_msat_per_1024th(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
+ * over the channel exceeds [`overuse_penalty_start_1024th`] by.
+ *
+ * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
+ * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
+ *
+ * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
+ */
+ public void set_overuse_penalty_msat_per_1024th(long val) {
+ bindings.ScoringParameters_set_overuse_penalty_msat_per_1024th(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
* The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
* cut in half.
*
+ * Successfully routing through a channel will immediately cut the penalty in half as well.
+ *
* # Note
*
- * When time is an [`Eternity`], as is default when enabling feature `no-std`, it will never
- * elapse. Therefore, this penalty will never decay.
+ * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
+ * never decay.
*
* [`failure_penalty_msat`]: Self::failure_penalty_msat
*/
public long get_failure_penalty_half_life() {
long ret = bindings.ScoringParameters_get_failure_penalty_half_life(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
* The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
* cut in half.
*
+ * Successfully routing through a channel will immediately cut the penalty in half as well.
+ *
* # Note
*
- * When time is an [`Eternity`], as is default when enabling feature `no-std`, it will never
- * elapse. Therefore, this penalty will never decay.
+ * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
+ * never decay.
*
* [`failure_penalty_msat`]: Self::failure_penalty_msat
*/
public void set_failure_penalty_half_life(long val) {
bindings.ScoringParameters_set_failure_penalty_half_life(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
* Constructs a new ScoringParameters given each field
*/
- public static ScoringParameters of(long base_penalty_msat_arg, long failure_penalty_msat_arg, long failure_penalty_half_life_arg) {
- long ret = bindings.ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, failure_penalty_half_life_arg);
+ public static ScoringParameters of(long base_penalty_msat_arg, long failure_penalty_msat_arg, short overuse_penalty_start_1024th_arg, long overuse_penalty_msat_per_1024th_arg, long failure_penalty_half_life_arg) {
+ long ret = bindings.ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg);
+ Reference.reachabilityFence(base_penalty_msat_arg);
+ Reference.reachabilityFence(failure_penalty_msat_arg);
+ Reference.reachabilityFence(overuse_penalty_start_1024th_arg);
+ Reference.reachabilityFence(overuse_penalty_msat_per_1024th_arg);
+ Reference.reachabilityFence(failure_penalty_half_life_arg);
if (ret >= 0 && ret <= 4096) { return null; }
ScoringParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ScoringParameters(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public byte[] write() {
byte[] ret = bindings.ScoringParameters_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ScoringParametersDecodeErrorZ read(byte[] ser) {
long ret = bindings.ScoringParameters_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.Sha256_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Sha256 clone() {
long ret = bindings.Sha256_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Sha256(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.Sha256_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two Sha256s contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
public boolean eq(Sha256 b) {
boolean ret = bindings.Sha256_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Sha256)) return false;
+ return this.eq((Sha256)o);
+ }
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.Shutdown_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.Shutdown_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_scriptpubkey() {
byte[] ret = bindings.Shutdown_get_scriptpubkey(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_scriptpubkey(byte[] val) {
bindings.Shutdown_set_scriptpubkey(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static Shutdown of(byte[] channel_id_arg, byte[] scriptpubkey_arg) {
long ret = bindings.Shutdown_new(InternalUtils.check_arr_len(channel_id_arg, 32), scriptpubkey_arg);
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(scriptpubkey_arg);
if (ret >= 0 && ret <= 4096) { return null; }
Shutdown ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Shutdown(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.Shutdown_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Shutdown clone() {
long ret = bindings.Shutdown_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Shutdown ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Shutdown(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.Shutdown_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ShutdownDecodeErrorZ read(byte[] ser) {
long ret = bindings.Shutdown_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
long clone_ptr() {
long ret = bindings.ShutdownScript_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ShutdownScript clone() {
long ret = bindings.ShutdownScript_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.ShutdownScript_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_ShutdownScriptDecodeErrorZ read(byte[] ser) {
long ret = bindings.ShutdownScript_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static ShutdownScript new_p2wpkh(byte[] pubkey_hash) {
long ret = bindings.ShutdownScript_new_p2wpkh(InternalUtils.check_arr_len(pubkey_hash, 20));
+ Reference.reachabilityFence(pubkey_hash);
if (ret >= 0 && ret <= 4096) { return null; }
ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static ShutdownScript new_p2wsh(byte[] script_hash) {
long ret = bindings.ShutdownScript_new_p2wsh(InternalUtils.check_arr_len(script_hash, 32));
+ Reference.reachabilityFence(script_hash);
if (ret >= 0 && ret <= 4096) { return null; }
ShutdownScript ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ShutdownScript(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static Result_ShutdownScriptInvalidShutdownScriptZ new_witness_program(byte version, byte[] program) {
long ret = bindings.ShutdownScript_new_witness_program(version, program);
+ Reference.reachabilityFence(version);
+ Reference.reachabilityFence(program);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public byte[] into_inner() {
byte[] ret = bindings.ShutdownScript_into_inner(this.ptr);
+ Reference.reachabilityFence(this);
;
return ret;
}
@Nullable
public byte[] as_legacy_pubkey() {
byte[] ret = bindings.ShutdownScript_as_legacy_pubkey(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public boolean is_compatible(InitFeatures features) {
boolean ret = bindings.ShutdownScript_is_compatible(this.ptr, features == null ? 0 : features.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(features);
this.ptrs_to.add(features);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public byte[] write() {
byte[] ret = bindings.Sign_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.Sign_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Sign clone() {
long ret = bindings.Sign_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Sign ret_hu_conv = new Sign(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
long clone_ptr() {
long ret = bindings.SignOrCreationError_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public SignOrCreationError clone() {
long ret = bindings.SignOrCreationError_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static SignOrCreationError creation_error(org.ldk.enums.CreationError a) {
long ret = bindings.SignOrCreationError_creation_error(a);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public boolean eq(SignOrCreationError b) {
boolean ret = bindings.SignOrCreationError_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof SignOrCreationError)) return false;
+ return this.eq((SignOrCreationError)o);
+ }
/**
* Get the string representation of a SignOrCreationError object
*/
public String to_str() {
String ret = bindings.SignOrCreationError_to_str(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public boolean eq(SignedRawInvoice b) {
boolean ret = bindings.SignedRawInvoice_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
this.ptrs_to.add(b);
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof SignedRawInvoice)) return false;
+ return this.eq((SignedRawInvoice)o);
+ }
long clone_ptr() {
long ret = bindings.SignedRawInvoice_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public SignedRawInvoice clone() {
long ret = bindings.SignedRawInvoice_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new SignedRawInvoice(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public ThreeTuple_RawInvoice_u832InvoiceSignatureZ into_parts() {
long ret = bindings.SignedRawInvoice_into_parts(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public RawInvoice raw_invoice() {
long ret = bindings.SignedRawInvoice_raw_invoice(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawInvoice(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] hash() {
byte[] ret = bindings.SignedRawInvoice_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public InvoiceSignature signature() {
long ret = bindings.SignedRawInvoice_signature(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceSignature(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public Result_PayeePubKeyErrorZ recover_payee_pub_key() {
long ret = bindings.SignedRawInvoice_recover_payee_pub_key(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public boolean check_signature() {
boolean ret = bindings.SignedRawInvoice_check_signature(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_SignedRawInvoiceNoneZ from_str(java.lang.String s) {
long ret = bindings.SignedRawInvoice_from_str(s);
+ Reference.reachabilityFence(s);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public String to_str() {
String ret = bindings.SignedRawInvoice_to_str(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public long send_data(byte[] data, boolean resume_read) {
long ret = bindings.SocketDescriptor_send_data(this.ptr, data, resume_read);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(data);
+ Reference.reachabilityFence(resume_read);
return ret;
}
*/
public void disconnect_socket() {
bindings.SocketDescriptor_disconnect_socket(this.ptr);
+ Reference.reachabilityFence(this);
}
/**
*/
public long hash() {
long ret = bindings.SocketDescriptor_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
long clone_ptr() {
long ret = bindings.SocketDescriptor_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public SocketDescriptor clone() {
long ret = bindings.SocketDescriptor_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
SocketDescriptor ret_hu_conv = new SocketDescriptor(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
}
long clone_ptr() {
long ret = bindings.SpendableOutputDescriptor_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public SpendableOutputDescriptor clone() {
long ret = bindings.SpendableOutputDescriptor_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static SpendableOutputDescriptor static_output(OutPoint outpoint, TxOut output) {
long ret = bindings.SpendableOutputDescriptor_static_output(outpoint == null ? 0 : outpoint.ptr & ~1, output.ptr);
+ Reference.reachabilityFence(outpoint);
+ Reference.reachabilityFence(output);
if (ret >= 0 && ret <= 4096) { return null; }
SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static SpendableOutputDescriptor delayed_payment_output(DelayedPaymentOutputDescriptor a) {
long ret = bindings.SpendableOutputDescriptor_delayed_payment_output(a == null ? 0 : a.ptr & ~1);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public static SpendableOutputDescriptor static_payment_output(StaticPaymentOutputDescriptor a) {
long ret = bindings.SpendableOutputDescriptor_static_payment_output(a == null ? 0 : a.ptr & ~1);
+ Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
*/
public byte[] write() {
byte[] ret = bindings.SpendableOutputDescriptor_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_SpendableOutputDescriptorDecodeErrorZ read(byte[] ser) {
long ret = bindings.SpendableOutputDescriptor_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public OutPoint get_outpoint() {
long ret = bindings.StaticPaymentOutputDescriptor_get_outpoint(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_outpoint(OutPoint val) {
bindings.StaticPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public void set_output(TxOut val) {
bindings.StaticPaymentOutputDescriptor_set_output(this.ptr, val.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_channel_keys_id() {
byte[] ret = bindings.StaticPaymentOutputDescriptor_get_channel_keys_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_keys_id(byte[] val) {
bindings.StaticPaymentOutputDescriptor_set_channel_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_channel_value_satoshis() {
long ret = bindings.StaticPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_value_satoshis(long val) {
bindings.StaticPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static StaticPaymentOutputDescriptor of(OutPoint outpoint_arg, TxOut output_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) {
long ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, output_arg.ptr, InternalUtils.check_arr_len(channel_keys_id_arg, 32), channel_value_satoshis_arg);
+ Reference.reachabilityFence(outpoint_arg);
+ Reference.reachabilityFence(output_arg);
+ Reference.reachabilityFence(channel_keys_id_arg);
+ Reference.reachabilityFence(channel_value_satoshis_arg);
if (ret >= 0 && ret <= 4096) { return null; }
StaticPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.StaticPaymentOutputDescriptor_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public StaticPaymentOutputDescriptor clone() {
long ret = bindings.StaticPaymentOutputDescriptor_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
StaticPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.StaticPaymentOutputDescriptor_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_StaticPaymentOutputDescriptorDecodeErrorZ read(byte[] ser) {
long ret = bindings.StaticPaymentOutputDescriptor_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public ChannelAnnouncement get_a() {
long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public ChannelUpdate get_b() {
long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public ChannelUpdate get_c() {
long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(this);
long clone_ptr() {
long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ clone() {
long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_hu_conv = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ of(ChannelAnnouncement a, ChannelUpdate b, ChannelUpdate c) {
long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a == null ? 0 : a.ptr & ~1, b == null ? 0 : b.ptr & ~1, c == null ? 0 : c.ptr & ~1);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
+ Reference.reachabilityFence(c);
if (ret >= 0 && ret <= 4096) { return null; }
ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_hu_conv = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public RawInvoice get_a() {
long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawInvoice(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] get_b() {
byte[] ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public InvoiceSignature get_c() {
long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceSignature(null, ret); }
ret_hu_conv.ptrs_to.add(this);
long clone_ptr() {
long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ThreeTuple_RawInvoice_u832InvoiceSignatureZ clone() {
long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static ThreeTuple_RawInvoice_u832InvoiceSignatureZ of(RawInvoice a, byte[] b, InvoiceSignature c) {
long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a == null ? 0 : a.ptr & ~1, InternalUtils.check_arr_len(b, 32), c == null ? 0 : c.ptr & ~1);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
+ Reference.reachabilityFence(c);
if (ret >= 0 && ret <= 4096) { return null; }
ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] built_transaction() {
byte[] ret = bindings.TrustedClosingTransaction_built_transaction(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] get_sighash_all(byte[] funding_redeemscript, long channel_value_satoshis) {
byte[] ret = bindings.TrustedClosingTransaction_get_sighash_all(this.ptr, funding_redeemscript, channel_value_satoshis);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(funding_redeemscript);
+ Reference.reachabilityFence(channel_value_satoshis);
return ret;
}
*/
public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) {
byte[] ret = bindings.TrustedClosingTransaction_sign(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(funding_key);
+ Reference.reachabilityFence(funding_redeemscript);
+ Reference.reachabilityFence(channel_value_satoshis);
return ret;
}
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] txid() {
byte[] ret = bindings.TrustedCommitmentTransaction_txid(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public BuiltCommitmentTransaction built_transaction() {
long ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BuiltCommitmentTransaction(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public TxCreationKeys keys() {
long ret = bindings.TrustedCommitmentTransaction_keys(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TxCreationKeys(null, ret); }
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
+ /**
+ * Should anchors be used.
+ */
+ public boolean opt_anchors() {
+ boolean ret = bindings.TrustedCommitmentTransaction_opt_anchors(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
/**
* Get a signature for each HTLC which was included in the commitment transaction (ie for
* which HTLCOutputInCommitment::transaction_output_index.is_some()).
*/
public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, DirectedChannelTransactionParameters channel_parameters) {
long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(htlc_base_key);
+ Reference.reachabilityFence(channel_parameters);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(channel_parameters);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_a() {
byte[] ret = bindings.C2Tuple_BlockHashChannelManagerZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelManager get_b() {
long ret = bindings.C2Tuple_BlockHashChannelManagerZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelManager(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_BlockHashChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Logger b_logger, KeysInterface b_keys_manager, UserConfig b_config, ChainParameters b_params) {
long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est == null ? 0 : b_fee_est.ptr, b_chain_monitor == null ? 0 : b_chain_monitor.ptr, b_tx_broadcaster == null ? 0 : b_tx_broadcaster.ptr, b_logger == null ? 0 : b_logger.ptr, b_keys_manager == null ? 0 : b_keys_manager.ptr, b_config == null ? 0 : b_config.ptr & ~1, b_params == null ? 0 : b_params.ptr & ~1));
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b_fee_est);
+ Reference.reachabilityFence(b_chain_monitor);
+ Reference.reachabilityFence(b_tx_broadcaster);
+ Reference.reachabilityFence(b_logger);
+ Reference.reachabilityFence(b_keys_manager);
+ Reference.reachabilityFence(b_config);
+ Reference.reachabilityFence(b_params);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_BlockHashChannelManagerZ ret_hu_conv = new TwoTuple_BlockHashChannelManagerZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_a() {
byte[] ret = bindings.C2Tuple_BlockHashChannelMonitorZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public ChannelMonitor get_b() {
long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelMonitor(null, ret); }
ret_hu_conv.ptrs_to.add(this);
long clone_ptr() {
long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_BlockHashChannelMonitorZ clone() {
long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_BlockHashChannelMonitorZ ret_hu_conv = new TwoTuple_BlockHashChannelMonitorZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_BlockHashChannelMonitorZ of(byte[] a, ChannelMonitor b) {
long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_new(InternalUtils.check_arr_len(a, 32), b == null ? 0 : b.ptr & ~1);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_BlockHashChannelMonitorZ ret_hu_conv = new TwoTuple_BlockHashChannelMonitorZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public OutPoint get_a() {
long ret = bindings.C2Tuple_OutPointScriptZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] get_b() {
byte[] ret = bindings.C2Tuple_OutPointScriptZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.C2Tuple_OutPointScriptZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_OutPointScriptZ clone() {
long ret = bindings.C2Tuple_OutPointScriptZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_OutPointScriptZ ret_hu_conv = new TwoTuple_OutPointScriptZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_OutPointScriptZ of(OutPoint a, byte[] b) {
long ret = bindings.C2Tuple_OutPointScriptZ_new(a == null ? 0 : a.ptr & ~1, b);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_OutPointScriptZ ret_hu_conv = new TwoTuple_OutPointScriptZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_a() {
byte[] ret = bindings.C2Tuple_PaymentHashPaymentIdZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] get_b() {
byte[] ret = bindings.C2Tuple_PaymentHashPaymentIdZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_PaymentHashPaymentIdZ clone() {
long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_PaymentHashPaymentIdZ ret_hu_conv = new TwoTuple_PaymentHashPaymentIdZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_PaymentHashPaymentIdZ of(byte[] a, byte[] b) {
long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32));
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_PaymentHashPaymentIdZ ret_hu_conv = new TwoTuple_PaymentHashPaymentIdZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_a() {
byte[] ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] get_b() {
byte[] ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_PaymentHashPaymentSecretZ clone() {
long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_PaymentHashPaymentSecretZ of(byte[] a, byte[] b) {
long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32));
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_a() {
byte[] ret = bindings.C2Tuple_PublicKeyTypeZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Type get_b() {
long ret = bindings.C2Tuple_PublicKeyTypeZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Type ret_hu_conv = new Type(null, ret);
ret_hu_conv.ptrs_to.add(this);
long clone_ptr() {
long ret = bindings.C2Tuple_PublicKeyTypeZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_PublicKeyTypeZ clone() {
long ret = bindings.C2Tuple_PublicKeyTypeZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_PublicKeyTypeZ ret_hu_conv = new TwoTuple_PublicKeyTypeZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_PublicKeyTypeZ of(byte[] a, Type b) {
long ret = bindings.C2Tuple_PublicKeyTypeZ_new(InternalUtils.check_arr_len(a, 33), b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_PublicKeyTypeZ ret_hu_conv = new TwoTuple_PublicKeyTypeZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_a() {
byte[] ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[][] get_b() {
byte[][] ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_SignatureCVec_SignatureZZ clone() {
long ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_SignatureCVec_SignatureZZ ret_hu_conv = new TwoTuple_SignatureCVec_SignatureZZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_SignatureCVec_SignatureZZ of(byte[] a, byte[][] b) {
long ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_new(InternalUtils.check_arr_len(a, 64), b != null ? Arrays.stream(b).map(b_conv_8 -> InternalUtils.check_arr_len(b_conv_8, 64)).toArray(byte[][]::new) : null);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_SignatureCVec_SignatureZZ ret_hu_conv = new TwoTuple_SignatureCVec_SignatureZZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_a() {
byte[] ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_u32ScriptZ[] get_b() {
long[] ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
TwoTuple_u32ScriptZ[] ret_conv_21_arr = new TwoTuple_u32ScriptZ[ret.length];
for (int v = 0; v < ret.length; v++) {
long ret_conv_21 = ret[v];
long clone_ptr() {
long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ clone() {
long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ ret_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ of(byte[] a, TwoTuple_u32ScriptZ[] b) {
long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(InternalUtils.check_arr_len(a, 32), b != null ? Arrays.stream(b).mapToLong(b_conv_21 -> b_conv_21 != null ? b_conv_21.ptr : 0).toArray() : null);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ ret_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_a() {
byte[] ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_u32TxOutZ[] get_b() {
long[] ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
TwoTuple_u32TxOutZ[] ret_conv_20_arr = new TwoTuple_u32TxOutZ[ret.length];
for (int u = 0; u < ret.length; u++) {
long ret_conv_20 = ret[u];
long clone_ptr() {
long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ clone() {
long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ ret_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ of(byte[] a, TwoTuple_u32TxOutZ[] b) {
long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(InternalUtils.check_arr_len(a, 32), b != null ? Arrays.stream(b).mapToLong(b_conv_20 -> b_conv_20 != null ? b_conv_20.ptr : 0).toArray() : null);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ ret_hu_conv = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public int get_a() {
int ret = bindings.C2Tuple_u32ScriptZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] get_b() {
byte[] ret = bindings.C2Tuple_u32ScriptZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.C2Tuple_u32ScriptZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_u32ScriptZ clone() {
long ret = bindings.C2Tuple_u32ScriptZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_u32ScriptZ ret_hu_conv = new TwoTuple_u32ScriptZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_u32ScriptZ of(int a, byte[] b) {
long ret = bindings.C2Tuple_u32ScriptZ_new(a, b);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_u32ScriptZ ret_hu_conv = new TwoTuple_u32ScriptZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public int get_a() {
int ret = bindings.C2Tuple_u32TxOutZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TxOut get_b() {
long ret = bindings.C2Tuple_u32TxOutZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TxOut ret_conv = new TxOut(null, ret);
return ret_conv;
long clone_ptr() {
long ret = bindings.C2Tuple_u32TxOutZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_u32TxOutZ clone() {
long ret = bindings.C2Tuple_u32TxOutZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_u32TxOutZ ret_hu_conv = new TwoTuple_u32TxOutZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_u32TxOutZ of(int a, TxOut b) {
long ret = bindings.C2Tuple_u32TxOutZ_new(a, b.ptr);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_u32TxOutZ ret_hu_conv = new TwoTuple_u32TxOutZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public long get_a() {
long ret = bindings.C2Tuple_usizeTransactionZ_get_a(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] get_b() {
byte[] ret = bindings.C2Tuple_usizeTransactionZ_get_b(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.C2Tuple_usizeTransactionZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TwoTuple_usizeTransactionZ clone() {
long ret = bindings.C2Tuple_usizeTransactionZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_usizeTransactionZ ret_hu_conv = new TwoTuple_usizeTransactionZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
*/
public static TwoTuple_usizeTransactionZ of(long a, byte[] b) {
long ret = bindings.C2Tuple_usizeTransactionZ_new(a, b);
+ Reference.reachabilityFence(a);
+ Reference.reachabilityFence(b);
if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_usizeTransactionZ ret_hu_conv = new TwoTuple_usizeTransactionZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_per_commitment_point() {
byte[] ret = bindings.TxCreationKeys_get_per_commitment_point(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_per_commitment_point(byte[] val) {
bindings.TxCreationKeys_set_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_revocation_key() {
byte[] ret = bindings.TxCreationKeys_get_revocation_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_revocation_key(byte[] val) {
bindings.TxCreationKeys_set_revocation_key(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_broadcaster_htlc_key() {
byte[] ret = bindings.TxCreationKeys_get_broadcaster_htlc_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_broadcaster_htlc_key(byte[] val) {
bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_countersignatory_htlc_key() {
byte[] ret = bindings.TxCreationKeys_get_countersignatory_htlc_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_countersignatory_htlc_key(byte[] val) {
bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_broadcaster_delayed_payment_key() {
byte[] ret = bindings.TxCreationKeys_get_broadcaster_delayed_payment_key(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_broadcaster_delayed_payment_key(byte[] val) {
bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static TxCreationKeys of(byte[] per_commitment_point_arg, byte[] revocation_key_arg, byte[] broadcaster_htlc_key_arg, byte[] countersignatory_htlc_key_arg, byte[] broadcaster_delayed_payment_key_arg) {
long ret = bindings.TxCreationKeys_new(InternalUtils.check_arr_len(per_commitment_point_arg, 33), InternalUtils.check_arr_len(revocation_key_arg, 33), InternalUtils.check_arr_len(broadcaster_htlc_key_arg, 33), InternalUtils.check_arr_len(countersignatory_htlc_key_arg, 33), InternalUtils.check_arr_len(broadcaster_delayed_payment_key_arg, 33));
+ Reference.reachabilityFence(per_commitment_point_arg);
+ Reference.reachabilityFence(revocation_key_arg);
+ Reference.reachabilityFence(broadcaster_htlc_key_arg);
+ Reference.reachabilityFence(countersignatory_htlc_key_arg);
+ Reference.reachabilityFence(broadcaster_delayed_payment_key_arg);
if (ret >= 0 && ret <= 4096) { return null; }
TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TxCreationKeys(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.TxCreationKeys_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public TxCreationKeys clone() {
long ret = bindings.TxCreationKeys_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TxCreationKeys(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.TxCreationKeys_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_TxCreationKeysDecodeErrorZ read(byte[] ser) {
long ret = bindings.TxCreationKeys_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_TxCreationKeysErrorZ derive_new(byte[] per_commitment_point, byte[] broadcaster_delayed_payment_base, byte[] broadcaster_htlc_base, byte[] countersignatory_revocation_base, byte[] countersignatory_htlc_base) {
long ret = bindings.TxCreationKeys_derive_new(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(broadcaster_delayed_payment_base, 33), InternalUtils.check_arr_len(broadcaster_htlc_base, 33), InternalUtils.check_arr_len(countersignatory_revocation_base, 33), InternalUtils.check_arr_len(countersignatory_htlc_base, 33));
+ Reference.reachabilityFence(per_commitment_point);
+ Reference.reachabilityFence(broadcaster_delayed_payment_base);
+ Reference.reachabilityFence(broadcaster_htlc_base);
+ Reference.reachabilityFence(countersignatory_revocation_base);
+ Reference.reachabilityFence(countersignatory_htlc_base);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_TxCreationKeysErrorZ from_channel_static_keys(byte[] per_commitment_point, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) {
long ret = bindings.TxCreationKeys_from_channel_static_keys(InternalUtils.check_arr_len(per_commitment_point, 33), broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1);
+ Reference.reachabilityFence(per_commitment_point);
+ Reference.reachabilityFence(broadcaster_keys);
+ Reference.reachabilityFence(countersignatory_keys);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(broadcaster_keys);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class TxOut extends CommonBase{
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public short type_id() {
short ret = bindings.Type_type_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public String debug_str() {
String ret = bindings.Type_debug_str(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public byte[] write() {
byte[] ret = bindings.Type_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
long clone_ptr() {
long ret = bindings.Type_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public Type clone() {
long ret = bindings.Type_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
Type ret_hu_conv = new Type(null, ret);
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public ChannelFeatures get_features() {
long ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_features(ChannelFeatures val) {
bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_chain_hash() {
byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_chain_hash(byte[] val) {
bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_short_channel_id() {
long ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_short_channel_id(long val) {
bindings.UnsignedChannelAnnouncement_set_short_channel_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_node_id_1() {
byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_node_id_1(byte[] val) {
bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_node_id_2() {
byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_node_id_2(byte[] val) {
bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_bitcoin_key_1() {
byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_bitcoin_key_1(byte[] val) {
bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_bitcoin_key_2() {
byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_bitcoin_key_2(byte[] val) {
bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.UnsignedChannelAnnouncement_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public UnsignedChannelAnnouncement clone() {
long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UnsignedChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.UnsignedChannelAnnouncement_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_UnsignedChannelAnnouncementDecodeErrorZ read(byte[] ser) {
long ret = bindings.UnsignedChannelAnnouncement_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_chain_hash() {
byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_chain_hash(byte[] val) {
bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_short_channel_id() {
long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_short_channel_id(long val) {
bindings.UnsignedChannelUpdate_set_short_channel_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_timestamp() {
int ret = bindings.UnsignedChannelUpdate_get_timestamp(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_timestamp(int val) {
bindings.UnsignedChannelUpdate_set_timestamp(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte get_flags() {
byte ret = bindings.UnsignedChannelUpdate_get_flags(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_flags(byte val) {
bindings.UnsignedChannelUpdate_set_flags(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_cltv_expiry_delta() {
short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_cltv_expiry_delta(short val) {
bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_htlc_minimum_msat() {
long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_minimum_msat(long val) {
bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_fee_base_msat() {
int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_fee_base_msat(int val) {
bindings.UnsignedChannelUpdate_set_fee_base_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_fee_proportional_millionths() {
int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_fee_proportional_millionths(int val) {
bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.UnsignedChannelUpdate_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public UnsignedChannelUpdate clone() {
long ret = bindings.UnsignedChannelUpdate_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelUpdate(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.UnsignedChannelUpdate_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_UnsignedChannelUpdateDecodeErrorZ read(byte[] ser) {
long ret = bindings.UnsignedChannelUpdate_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public NodeFeatures get_features() {
long ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new NodeFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_features(NodeFeatures val) {
bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_timestamp() {
int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_timestamp(int val) {
bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_node_id() {
byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_node_id(byte[] val) {
bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, InternalUtils.check_arr_len(val, 33));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_rgb() {
byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_rgb(byte[] val) {
bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, InternalUtils.check_arr_len(val, 3));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_alias() {
byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_alias(byte[] val) {
bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public void set_addresses(NetAddress[] val) {
bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray() : null);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.UnsignedNodeAnnouncement_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public UnsignedNodeAnnouncement clone() {
long ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UnsignedNodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.UnsignedNodeAnnouncement_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_UnsignedNodeAnnouncementDecodeErrorZ read(byte[] ser) {
long ret = bindings.UnsignedNodeAnnouncement_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.UpdateAddHTLC_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.UpdateAddHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_htlc_id() {
long ret = bindings.UpdateAddHTLC_get_htlc_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_id(long val) {
bindings.UpdateAddHTLC_set_htlc_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_amount_msat() {
long ret = bindings.UpdateAddHTLC_get_amount_msat(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_amount_msat(long val) {
bindings.UpdateAddHTLC_set_amount_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_payment_hash() {
byte[] ret = bindings.UpdateAddHTLC_get_payment_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_payment_hash(byte[] val) {
bindings.UpdateAddHTLC_set_payment_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_cltv_expiry() {
int ret = bindings.UpdateAddHTLC_get_cltv_expiry(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_cltv_expiry(int val) {
bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.UpdateAddHTLC_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public UpdateAddHTLC clone() {
long ret = bindings.UpdateAddHTLC_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UpdateAddHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateAddHTLC(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.UpdateAddHTLC_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_UpdateAddHTLCDecodeErrorZ read(byte[] ser) {
long ret = bindings.UpdateAddHTLC_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.UpdateFailHTLC_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.UpdateFailHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_htlc_id() {
long ret = bindings.UpdateFailHTLC_get_htlc_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_id(long val) {
bindings.UpdateFailHTLC_set_htlc_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.UpdateFailHTLC_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public UpdateFailHTLC clone() {
long ret = bindings.UpdateFailHTLC_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UpdateFailHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFailHTLC(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.UpdateFailHTLC_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_UpdateFailHTLCDecodeErrorZ read(byte[] ser) {
long ret = bindings.UpdateFailHTLC_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_htlc_id() {
long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_id(long val) {
bindings.UpdateFailMalformedHTLC_set_htlc_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public short get_failure_code() {
short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_failure_code(short val) {
bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
long clone_ptr() {
long ret = bindings.UpdateFailMalformedHTLC_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public UpdateFailMalformedHTLC clone() {
long ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UpdateFailMalformedHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFailMalformedHTLC(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.UpdateFailMalformedHTLC_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_UpdateFailMalformedHTLCDecodeErrorZ read(byte[] ser) {
long ret = bindings.UpdateFailMalformedHTLC_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.UpdateFee_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.UpdateFee_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public int get_feerate_per_kw() {
int ret = bindings.UpdateFee_get_feerate_per_kw(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_feerate_per_kw(int val) {
bindings.UpdateFee_set_feerate_per_kw(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static UpdateFee of(byte[] channel_id_arg, int feerate_per_kw_arg) {
long ret = bindings.UpdateFee_new(InternalUtils.check_arr_len(channel_id_arg, 32), feerate_per_kw_arg);
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(feerate_per_kw_arg);
if (ret >= 0 && ret <= 4096) { return null; }
UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFee(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.UpdateFee_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public UpdateFee clone() {
long ret = bindings.UpdateFee_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFee(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.UpdateFee_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_UpdateFeeDecodeErrorZ read(byte[] ser) {
long ret = bindings.UpdateFee_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public byte[] get_channel_id() {
byte[] ret = bindings.UpdateFulfillHTLC_get_channel_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_channel_id(byte[] val) {
bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public long get_htlc_id() {
long ret = bindings.UpdateFulfillHTLC_get_htlc_id(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_htlc_id(long val) {
bindings.UpdateFulfillHTLC_set_htlc_id(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_payment_preimage() {
byte[] ret = bindings.UpdateFulfillHTLC_get_payment_preimage(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_payment_preimage(byte[] val) {
bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static UpdateFulfillHTLC of(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) {
long ret = bindings.UpdateFulfillHTLC_new(InternalUtils.check_arr_len(channel_id_arg, 32), htlc_id_arg, InternalUtils.check_arr_len(payment_preimage_arg, 32));
+ Reference.reachabilityFence(channel_id_arg);
+ Reference.reachabilityFence(htlc_id_arg);
+ Reference.reachabilityFence(payment_preimage_arg);
if (ret >= 0 && ret <= 4096) { return null; }
UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFulfillHTLC(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.UpdateFulfillHTLC_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public UpdateFulfillHTLC clone() {
long ret = bindings.UpdateFulfillHTLC_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFulfillHTLC(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public byte[] write() {
byte[] ret = bindings.UpdateFulfillHTLC_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_UpdateFulfillHTLCDecodeErrorZ read(byte[] ser) {
long ret = bindings.UpdateFulfillHTLC_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public ChannelHandshakeConfig get_own_channel_config() {
long ret = bindings.UserConfig_get_own_channel_config(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_own_channel_config(ChannelHandshakeConfig val) {
bindings.UserConfig_set_own_channel_config(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public ChannelHandshakeLimits get_peer_channel_config_limits() {
long ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeLimits(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_peer_channel_config_limits(ChannelHandshakeLimits val) {
bindings.UserConfig_set_peer_channel_config_limits(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public ChannelConfig get_channel_options() {
long ret = bindings.UserConfig_get_channel_options(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelConfig(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_channel_options(ChannelConfig val) {
bindings.UserConfig_set_channel_options(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public boolean get_accept_forwards_to_priv_channels() {
boolean ret = bindings.UserConfig_get_accept_forwards_to_priv_channels(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_accept_forwards_to_priv_channels(boolean val) {
bindings.UserConfig_set_accept_forwards_to_priv_channels(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
+ /**
+ * If this is set to false, we do not accept inbound requests to open a new channel.
+ * Default value: true.
+ */
+ public boolean get_accept_inbound_channels() {
+ boolean ret = bindings.UserConfig_get_accept_inbound_channels(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * If this is set to false, we do not accept inbound requests to open a new channel.
+ * Default value: true.
+ */
+ public void set_accept_inbound_channels(boolean val) {
+ bindings.UserConfig_set_accept_inbound_channels(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
* Constructs a new UserConfig given each field
*/
- public static UserConfig of(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg, boolean accept_forwards_to_priv_channels_arg) {
- long ret = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1, accept_forwards_to_priv_channels_arg);
+ public static UserConfig of(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg) {
+ long ret = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg);
+ Reference.reachabilityFence(own_channel_config_arg);
+ Reference.reachabilityFence(peer_channel_config_limits_arg);
+ Reference.reachabilityFence(channel_options_arg);
+ Reference.reachabilityFence(accept_forwards_to_priv_channels_arg);
+ Reference.reachabilityFence(accept_inbound_channels_arg);
if (ret >= 0 && ret <= 4096) { return null; }
UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.UserConfig_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public UserConfig clone() {
long ret = bindings.UserConfig_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); }
ret_hu_conv.ptrs_to.add(this);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
public class UtilMethods {
+ /**
+ * Constructs a new COption_NoneZ containing a
+ */
+ public static COption_NoneZ COption_NoneZ_some() {
+ COption_NoneZ ret = bindings.COption_NoneZ_some();
+ return ret;
+ }
+
+ /**
+ * Constructs a new COption_NoneZ containing nothing
+ */
+ public static COption_NoneZ COption_NoneZ_none() {
+ COption_NoneZ ret = bindings.COption_NoneZ_none();
+ return ret;
+ }
+
/**
* Read a ClosureReason from a byte array, created by ClosureReason_write
*/
public static Result_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(byte[] ser) {
long ret = bindings.ClosureReason_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_COption_EventZDecodeErrorZ Event_read(byte[] ser) {
long ret = bindings.Event_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_StringErrorZ sign(byte[] msg, byte[] sk) {
long ret = bindings.sign(msg, InternalUtils.check_arr_len(sk, 32));
+ Reference.reachabilityFence(msg);
+ Reference.reachabilityFence(sk);
if (ret >= 0 && ret <= 4096) { return null; }
Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PublicKeyErrorZ recover_pk(byte[] msg, java.lang.String sig) {
long ret = bindings.recover_pk(msg, sig);
+ Reference.reachabilityFence(msg);
+ Reference.reachabilityFence(sig);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static boolean verify(byte[] msg, java.lang.String sig, byte[] pk) {
boolean ret = bindings.verify(msg, sig, InternalUtils.check_arr_len(pk, 33));
+ Reference.reachabilityFence(msg);
+ Reference.reachabilityFence(sig);
+ Reference.reachabilityFence(pk);
return ret;
}
*/
public static Result_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(byte[] ser) {
long ret = bindings.MonitorEvent_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(byte[] ser, KeysInterface arg) {
long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg == null ? 0 : arg.ptr);
+ Reference.reachabilityFence(ser);
+ Reference.reachabilityFence(arg);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(arg);
*/
public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(byte[] ser, KeysInterface arg_keys_manager, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) {
long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_keys_manager == null ? 0 : arg_keys_manager.ptr, arg_fee_estimator == null ? 0 : arg_fee_estimator.ptr, arg_chain_monitor == null ? 0 : arg_chain_monitor.ptr, arg_tx_broadcaster == null ? 0 : arg_tx_broadcaster.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr & ~1, arg_channel_monitors != null ? Arrays.stream(arg_channel_monitors).mapToLong(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr & ~1).toArray() : null));
+ Reference.reachabilityFence(ser);
+ Reference.reachabilityFence(arg_keys_manager);
+ Reference.reachabilityFence(arg_fee_estimator);
+ Reference.reachabilityFence(arg_chain_monitor);
+ Reference.reachabilityFence(arg_tx_broadcaster);
+ Reference.reachabilityFence(arg_logger);
+ Reference.reachabilityFence(arg_default_config);
+ Reference.reachabilityFence(arg_channel_monitors);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(arg_keys_manager);
return ret_hu_conv;
}
+ /**
+ * Gets the weight for an HTLC-Success transaction.
+ */
+ public static long htlc_success_tx_weight(boolean opt_anchors) {
+ long ret = bindings.htlc_success_tx_weight(opt_anchors);
+ Reference.reachabilityFence(opt_anchors);
+ return ret;
+ }
+
+ /**
+ * Gets the weight for an HTLC-Timeout transaction.
+ */
+ public static long htlc_timeout_tx_weight(boolean opt_anchors) {
+ long ret = bindings.htlc_timeout_tx_weight(opt_anchors);
+ Reference.reachabilityFence(opt_anchors);
+ return ret;
+ }
+
/**
* Build the commitment secret from the seed and the commitment number
*/
public static byte[] build_commitment_secret(byte[] commitment_seed, long idx) {
byte[] ret = bindings.build_commitment_secret(InternalUtils.check_arr_len(commitment_seed, 32), idx);
+ Reference.reachabilityFence(commitment_seed);
+ Reference.reachabilityFence(idx);
return ret;
}
*/
public static byte[] build_closing_transaction(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, OutPoint funding_outpoint) {
byte[] ret = bindings.build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script, to_counterparty_script, funding_outpoint == null ? 0 : funding_outpoint.ptr & ~1);
+ Reference.reachabilityFence(to_holder_value_sat);
+ Reference.reachabilityFence(to_counterparty_value_sat);
+ Reference.reachabilityFence(to_holder_script);
+ Reference.reachabilityFence(to_counterparty_script);
+ Reference.reachabilityFence(funding_outpoint);
return ret;
}
*/
public static Result_SecretKeyErrorZ derive_private_key(byte[] per_commitment_point, byte[] base_secret) {
long ret = bindings.derive_private_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(base_secret, 32));
+ Reference.reachabilityFence(per_commitment_point);
+ Reference.reachabilityFence(base_secret);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PublicKeyErrorZ derive_public_key(byte[] per_commitment_point, byte[] base_point) {
long ret = bindings.derive_public_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(base_point, 33));
+ Reference.reachabilityFence(per_commitment_point);
+ Reference.reachabilityFence(base_point);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_SecretKeyErrorZ derive_private_revocation_key(byte[] per_commitment_secret, byte[] countersignatory_revocation_base_secret) {
long ret = bindings.derive_private_revocation_key(InternalUtils.check_arr_len(per_commitment_secret, 32), InternalUtils.check_arr_len(countersignatory_revocation_base_secret, 32));
+ Reference.reachabilityFence(per_commitment_secret);
+ Reference.reachabilityFence(countersignatory_revocation_base_secret);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_PublicKeyErrorZ derive_public_revocation_key(byte[] per_commitment_point, byte[] countersignatory_revocation_base_point) {
long ret = bindings.derive_public_revocation_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(countersignatory_revocation_base_point, 33));
+ Reference.reachabilityFence(per_commitment_point);
+ Reference.reachabilityFence(countersignatory_revocation_base_point);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static byte[] get_revokeable_redeemscript(byte[] revocation_key, short contest_delay, byte[] broadcaster_delayed_payment_key) {
byte[] ret = bindings.get_revokeable_redeemscript(InternalUtils.check_arr_len(revocation_key, 33), contest_delay, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33));
+ Reference.reachabilityFence(revocation_key);
+ Reference.reachabilityFence(contest_delay);
+ Reference.reachabilityFence(broadcaster_delayed_payment_key);
return ret;
}
* Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
* does not need to have its previous_output_index filled.
*/
- public static byte[] get_htlc_redeemscript(HTLCOutputInCommitment htlc, TxCreationKeys keys) {
- byte[] ret = bindings.get_htlc_redeemscript(htlc == null ? 0 : htlc.ptr & ~1, keys == null ? 0 : keys.ptr & ~1);
+ public static byte[] get_htlc_redeemscript(HTLCOutputInCommitment htlc, boolean opt_anchors, TxCreationKeys keys) {
+ byte[] ret = bindings.get_htlc_redeemscript(htlc == null ? 0 : htlc.ptr & ~1, opt_anchors, keys == null ? 0 : keys.ptr & ~1);
+ Reference.reachabilityFence(htlc);
+ Reference.reachabilityFence(opt_anchors);
+ Reference.reachabilityFence(keys);
// this.ptrs_to.add(htlc);
// this.ptrs_to.add(keys);
return ret;
*/
public static byte[] make_funding_redeemscript(byte[] broadcaster, byte[] countersignatory) {
byte[] ret = bindings.make_funding_redeemscript(InternalUtils.check_arr_len(broadcaster, 33), InternalUtils.check_arr_len(countersignatory, 33));
+ Reference.reachabilityFence(broadcaster);
+ Reference.reachabilityFence(countersignatory);
return ret;
}
* Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
* commitment transaction).
*/
- public static byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, HTLCOutputInCommitment htlc, byte[] broadcaster_delayed_payment_key, byte[] revocation_key) {
- byte[] ret = bindings.build_htlc_transaction(InternalUtils.check_arr_len(commitment_txid, 32), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr & ~1, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33), InternalUtils.check_arr_len(revocation_key, 33));
+ public static byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, HTLCOutputInCommitment htlc, boolean opt_anchors, byte[] broadcaster_delayed_payment_key, byte[] revocation_key) {
+ byte[] ret = bindings.build_htlc_transaction(InternalUtils.check_arr_len(commitment_txid, 32), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr & ~1, opt_anchors, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33), InternalUtils.check_arr_len(revocation_key, 33));
+ Reference.reachabilityFence(commitment_txid);
+ Reference.reachabilityFence(feerate_per_kw);
+ Reference.reachabilityFence(contest_delay);
+ Reference.reachabilityFence(htlc);
+ Reference.reachabilityFence(opt_anchors);
+ Reference.reachabilityFence(broadcaster_delayed_payment_key);
+ Reference.reachabilityFence(revocation_key);
// this.ptrs_to.add(htlc);
return ret;
}
+ /**
+ * Gets the witnessScript for an anchor output from the funding public key.
+ * The witness in the spending input must be:
+ * <BIP 143 funding_signature>
+ * After 16 blocks of confirmation, an alternative satisfying witness could be:
+ * <>
+ * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
+ */
+ public static byte[] get_anchor_redeemscript(byte[] funding_pubkey) {
+ byte[] ret = bindings.get_anchor_redeemscript(InternalUtils.check_arr_len(funding_pubkey, 33));
+ Reference.reachabilityFence(funding_pubkey);
+ return ret;
+ }
+
/**
* Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
* shared secret first. This prevents on-chain observers from discovering how many commitment
*/
public static long get_commitment_transaction_number_obscure_factor(byte[] broadcaster_payment_basepoint, byte[] countersignatory_payment_basepoint, boolean outbound_from_broadcaster) {
long ret = bindings.get_commitment_transaction_number_obscure_factor(InternalUtils.check_arr_len(broadcaster_payment_basepoint, 33), InternalUtils.check_arr_len(countersignatory_payment_basepoint, 33), outbound_from_broadcaster);
+ Reference.reachabilityFence(broadcaster_payment_basepoint);
+ Reference.reachabilityFence(countersignatory_payment_basepoint);
+ Reference.reachabilityFence(outbound_from_broadcaster);
return ret;
}
*/
public static Result_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(byte[] ser) {
long ret = bindings.NetworkUpdate_read(ser);
+ Reference.reachabilityFence(ser);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, RouteParameters params, NetworkGraph network, @Nullable ChannelDetails[] first_hops, Logger logger, Score scorer) {
long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), params == null ? 0 : params.ptr & ~1, network == null ? 0 : network.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray() : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr);
+ Reference.reachabilityFence(our_node_pubkey);
+ Reference.reachabilityFence(params);
+ Reference.reachabilityFence(network);
+ Reference.reachabilityFence(first_hops);
+ Reference.reachabilityFence(logger);
+ Reference.reachabilityFence(scorer);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(params);
*/
public static Result_NoneErrorZ FilesystemPersister_persist_manager(java.lang.String data_dir, ChannelManager manager) {
long ret = bindings.FilesystemPersister_persist_manager(data_dir, manager == null ? 0 : manager.ptr & ~1);
+ Reference.reachabilityFence(data_dir);
+ Reference.reachabilityFence(manager);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(manager);
*/
public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description) {
long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description);
+ Reference.reachabilityFence(channelmanager);
+ Reference.reachabilityFence(keys_manager);
+ Reference.reachabilityFence(network);
+ Reference.reachabilityFence(amt_msat);
+ Reference.reachabilityFence(description);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(channelmanager);
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
/**
*/
public Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor) {
long ret = bindings.Watch_watch_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, monitor == null ? 0 : monitor.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(funding_txo);
+ Reference.reachabilityFence(monitor);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public Result_NoneChannelMonitorUpdateErrZ update_channel(OutPoint funding_txo, ChannelMonitorUpdate update) {
long ret = bindings.Watch_update_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, update == null ? 0 : update.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(funding_txo);
+ Reference.reachabilityFence(update);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
return ret_hu_conv;
*/
public MonitorEvent[] release_pending_monitor_events() {
long[] ret = bindings.Watch_release_pending_monitor_events(this.ptr);
+ Reference.reachabilityFence(this);
MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret.length];
for (int o = 0; o < ret.length; o++) {
long ret_conv_14 = ret[o];
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
@Nullable
public byte[] get_block_hash() {
byte[] ret = bindings.WatchedOutput_get_block_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_block_hash(@Nullable byte[] val) {
bindings.WatchedOutput_set_block_hash(this.ptr, InternalUtils.check_arr_len(val, 32));
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public OutPoint get_outpoint() {
long ret = bindings.WatchedOutput_get_outpoint(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new OutPoint(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public void set_outpoint(OutPoint val) {
bindings.WatchedOutput_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public byte[] get_script_pubkey() {
byte[] ret = bindings.WatchedOutput_get_script_pubkey(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public void set_script_pubkey(byte[] val) {
bindings.WatchedOutput_set_script_pubkey(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static WatchedOutput of(byte[] block_hash_arg, OutPoint outpoint_arg, byte[] script_pubkey_arg) {
long ret = bindings.WatchedOutput_new(InternalUtils.check_arr_len(block_hash_arg, 32), outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg);
+ Reference.reachabilityFence(block_hash_arg);
+ Reference.reachabilityFence(outpoint_arg);
+ Reference.reachabilityFence(script_pubkey_arg);
if (ret >= 0 && ret <= 4096) { return null; }
WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new WatchedOutput(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
long clone_ptr() {
long ret = bindings.WatchedOutput_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public WatchedOutput clone() {
long ret = bindings.WatchedOutput_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
WatchedOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new WatchedOutput(null, ret); }
ret_hu_conv.ptrs_to.add(this);
*/
public long hash() {
long ret = bindings.WatchedOutput_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
}
#include <stdatomic.h>
#include <stdlib.h>
+#define LIKELY(v) __builtin_expect(!!(v), 1)
+#define UNLIKELY(v) __builtin_expect(!!(v), 0)
+
#define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
#define MALLOC(a, _) malloc(a)
#define FREE(p) if ((uint64_t)(p) > 4096) { free(p); }
}
static inline struct LDKThirtyTwoBytes ThirtyTwoBytes_clone(const struct LDKThirtyTwoBytes *orig) { struct LDKThirtyTwoBytes ret; memcpy(ret.data, orig->data, 32); return ret; }
static inline LDKAccessError LDKAccessError_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to AccessError.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKAccessError_UnknownChain;
case 1: return LDKAccessError_UnknownTx;
}
- abort();
+ (*env)->FatalError(env, "A call to AccessError.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass AccessError_class = NULL;
static jfieldID AccessError_LDKAccessError_UnknownChain = NULL;
}
}
+static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_java(JNIEnv *env, jclass clz) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to COption_NoneZ.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
+ case 0: return LDKCOption_NoneZ_Some;
+ case 1: return LDKCOption_NoneZ_None;
+ }
+ (*env)->FatalError(env, "A call to COption_NoneZ.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
+}
+static jclass COption_NoneZ_class = NULL;
+static jfieldID COption_NoneZ_LDKCOption_NoneZ_Some = NULL;
+static jfieldID COption_NoneZ_LDKCOption_NoneZ_None = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_enums_COption_1NoneZ_init (JNIEnv *env, jclass clz) {
+ COption_NoneZ_class = (*env)->NewGlobalRef(env, clz);
+ CHECK(COption_NoneZ_class != NULL);
+ COption_NoneZ_LDKCOption_NoneZ_Some = (*env)->GetStaticFieldID(env, COption_NoneZ_class, "LDKCOption_NoneZ_Some", "Lorg/ldk/enums/COption_NoneZ;");
+ CHECK(COption_NoneZ_LDKCOption_NoneZ_Some != NULL);
+ COption_NoneZ_LDKCOption_NoneZ_None = (*env)->GetStaticFieldID(env, COption_NoneZ_class, "LDKCOption_NoneZ_None", "Lorg/ldk/enums/COption_NoneZ;");
+ CHECK(COption_NoneZ_LDKCOption_NoneZ_None != NULL);
+}
+static inline jclass LDKCOption_NoneZ_to_java(JNIEnv *env, LDKCOption_NoneZ val) {
+ switch (val) {
+ case LDKCOption_NoneZ_Some:
+ return (*env)->GetStaticObjectField(env, COption_NoneZ_class, COption_NoneZ_LDKCOption_NoneZ_Some);
+ case LDKCOption_NoneZ_None:
+ return (*env)->GetStaticObjectField(env, COption_NoneZ_class, COption_NoneZ_LDKCOption_NoneZ_None);
+ default: abort();
+ }
+}
+
static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to ChannelMonitorUpdateErr.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
}
- abort();
+ (*env)->FatalError(env, "A call to ChannelMonitorUpdateErr.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass ChannelMonitorUpdateErr_class = NULL;
static jfieldID ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = NULL;
}
static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKConfirmationTarget_Background;
case 1: return LDKConfirmationTarget_Normal;
case 2: return LDKConfirmationTarget_HighPriority;
}
- abort();
+ (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass ConfirmationTarget_class = NULL;
static jfieldID ConfirmationTarget_LDKConfirmationTarget_Background = NULL;
}
static inline LDKCreationError LDKCreationError_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to CreationError.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKCreationError_DescriptionTooLong;
case 1: return LDKCreationError_RouteTooLong;
case 2: return LDKCreationError_TimestampOutOfBounds;
case 3: return LDKCreationError_ExpiryTimeOutOfBounds;
+ case 4: return LDKCreationError_InvalidAmount;
}
- abort();
+ (*env)->FatalError(env, "A call to CreationError.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass CreationError_class = NULL;
static jfieldID CreationError_LDKCreationError_DescriptionTooLong = NULL;
static jfieldID CreationError_LDKCreationError_RouteTooLong = NULL;
static jfieldID CreationError_LDKCreationError_TimestampOutOfBounds = NULL;
static jfieldID CreationError_LDKCreationError_ExpiryTimeOutOfBounds = NULL;
+static jfieldID CreationError_LDKCreationError_InvalidAmount = NULL;
JNIEXPORT void JNICALL Java_org_ldk_enums_CreationError_init (JNIEnv *env, jclass clz) {
CreationError_class = (*env)->NewGlobalRef(env, clz);
CHECK(CreationError_class != NULL);
CHECK(CreationError_LDKCreationError_TimestampOutOfBounds != NULL);
CreationError_LDKCreationError_ExpiryTimeOutOfBounds = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_ExpiryTimeOutOfBounds", "Lorg/ldk/enums/CreationError;");
CHECK(CreationError_LDKCreationError_ExpiryTimeOutOfBounds != NULL);
+ CreationError_LDKCreationError_InvalidAmount = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_InvalidAmount", "Lorg/ldk/enums/CreationError;");
+ CHECK(CreationError_LDKCreationError_InvalidAmount != NULL);
}
static inline jclass LDKCreationError_to_java(JNIEnv *env, LDKCreationError val) {
switch (val) {
return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_TimestampOutOfBounds);
case LDKCreationError_ExpiryTimeOutOfBounds:
return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_ExpiryTimeOutOfBounds);
+ case LDKCreationError_InvalidAmount:
+ return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_InvalidAmount);
default: abort();
}
}
static inline LDKCurrency LDKCurrency_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to Currency.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKCurrency_Bitcoin;
case 1: return LDKCurrency_BitcoinTestnet;
case 2: return LDKCurrency_Regtest;
case 3: return LDKCurrency_Simnet;
case 4: return LDKCurrency_Signet;
}
- abort();
+ (*env)->FatalError(env, "A call to Currency.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass Currency_class = NULL;
static jfieldID Currency_LDKCurrency_Bitcoin = NULL;
}
static inline LDKIOError LDKIOError_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to IOError.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKIOError_NotFound;
case 1: return LDKIOError_PermissionDenied;
case 2: return LDKIOError_ConnectionRefused;
case 16: return LDKIOError_Other;
case 17: return LDKIOError_UnexpectedEof;
}
- abort();
+ (*env)->FatalError(env, "A call to IOError.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass IOError_class = NULL;
static jfieldID IOError_LDKIOError_NotFound = NULL;
}
static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
- case 0: return LDKLevel_Trace;
- case 1: return LDKLevel_Debug;
- case 2: return LDKLevel_Info;
- case 3: return LDKLevel_Warn;
- case 4: return LDKLevel_Error;
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to Level.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
+ case 0: return LDKLevel_Gossip;
+ case 1: return LDKLevel_Trace;
+ case 2: return LDKLevel_Debug;
+ case 3: return LDKLevel_Info;
+ case 4: return LDKLevel_Warn;
+ case 5: return LDKLevel_Error;
}
- abort();
+ (*env)->FatalError(env, "A call to Level.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass Level_class = NULL;
+static jfieldID Level_LDKLevel_Gossip = NULL;
static jfieldID Level_LDKLevel_Trace = NULL;
static jfieldID Level_LDKLevel_Debug = NULL;
static jfieldID Level_LDKLevel_Info = NULL;
JNIEXPORT void JNICALL Java_org_ldk_enums_Level_init (JNIEnv *env, jclass clz) {
Level_class = (*env)->NewGlobalRef(env, clz);
CHECK(Level_class != NULL);
+ Level_LDKLevel_Gossip = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Gossip", "Lorg/ldk/enums/Level;");
+ CHECK(Level_LDKLevel_Gossip != NULL);
Level_LDKLevel_Trace = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Trace", "Lorg/ldk/enums/Level;");
CHECK(Level_LDKLevel_Trace != NULL);
Level_LDKLevel_Debug = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Debug", "Lorg/ldk/enums/Level;");
}
static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
switch (val) {
+ case LDKLevel_Gossip:
+ return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Gossip);
case LDKLevel_Trace:
return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Trace);
case LDKLevel_Debug:
}
static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to Network.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKNetwork_Bitcoin;
case 1: return LDKNetwork_Testnet;
case 2: return LDKNetwork_Regtest;
case 3: return LDKNetwork_Signet;
}
- abort();
+ (*env)->FatalError(env, "A call to Network.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass Network_class = NULL;
static jfieldID Network_LDKNetwork_Bitcoin = NULL;
}
static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKSecp256k1Error_IncorrectSignature;
case 1: return LDKSecp256k1Error_InvalidMessage;
case 2: return LDKSecp256k1Error_InvalidPublicKey;
case 7: return LDKSecp256k1Error_TweakCheckFailed;
case 8: return LDKSecp256k1Error_NotEnoughMemory;
}
- abort();
+ (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass Secp256k1Error_class = NULL;
static jfieldID Secp256k1Error_LDKSecp256k1Error_IncorrectSignature = NULL;
}
static inline LDKSemanticError LDKSemanticError_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKSemanticError_NoPaymentHash;
case 1: return LDKSemanticError_MultiplePaymentHashes;
case 2: return LDKSemanticError_NoDescription;
case 8: return LDKSemanticError_InvalidSignature;
case 9: return LDKSemanticError_ImpreciseAmount;
}
- abort();
+ (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass SemanticError_class = NULL;
static jfieldID SemanticError_LDKSemanticError_NoPaymentHash = NULL;
}
static inline LDKSiPrefix LDKSiPrefix_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKSiPrefix_Milli;
case 1: return LDKSiPrefix_Micro;
case 2: return LDKSiPrefix_Nano;
case 3: return LDKSiPrefix_Pico;
}
- abort();
+ (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass SiPrefix_class = NULL;
static jfieldID SiPrefix_LDKSiPrefix_Milli = NULL;
static jmethodID LDKCOption_u32Z_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u32Z_init (JNIEnv *env, jclass clz) {
LDKCOption_u32Z_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u32Z$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$Some"));
CHECK(LDKCOption_u32Z_Some_class != NULL);
LDKCOption_u32Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_Some_class, "<init>", "(I)V");
CHECK(LDKCOption_u32Z_Some_meth != NULL);
LDKCOption_u32Z_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u32Z$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$None"));
CHECK(LDKCOption_u32Z_None_class != NULL);
LDKCOption_u32Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_None_class, "<init>", "()V");
CHECK(LDKCOption_u32Z_None_meth != NULL);
static jmethodID LDKCOption_u64Z_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u64Z_init (JNIEnv *env, jclass clz) {
LDKCOption_u64Z_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u64Z$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$Some"));
CHECK(LDKCOption_u64Z_Some_class != NULL);
LDKCOption_u64Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_u64Z_Some_meth != NULL);
LDKCOption_u64Z_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u64Z$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$None"));
CHECK(LDKCOption_u64Z_None_class != NULL);
LDKCOption_u64Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_None_class, "<init>", "()V");
CHECK(LDKCOption_u64Z_None_meth != NULL);
static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) {
LDKMonitorEvent_HTLCEvent_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent"));
CHECK(LDKMonitorEvent_HTLCEvent_class != NULL);
LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "<init>", "(J)V");
CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL);
LDKMonitorEvent_CommitmentTxConfirmed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed"));
CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL);
LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "<init>", "(J)V");
CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL);
LDKMonitorEvent_UpdateCompleted_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted"));
CHECK(LDKMonitorEvent_UpdateCompleted_class != NULL);
LDKMonitorEvent_UpdateCompleted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateCompleted_class, "<init>", "(JJ)V");
CHECK(LDKMonitorEvent_UpdateCompleted_meth != NULL);
LDKMonitorEvent_UpdateFailed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed"));
CHECK(LDKMonitorEvent_UpdateFailed_class != NULL);
LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "<init>", "(J)V");
CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL);
static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1usizeTransactionZZ_init (JNIEnv *env, jclass clz) {
LDKCOption_C2Tuple_usizeTransactionZZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$Some"));
CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_class != NULL);
LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth != NULL);
LDKCOption_C2Tuple_usizeTransactionZZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$None"));
CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_class != NULL);
LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, "<init>", "()V");
CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_meth != NULL);
static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL;
static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL;
static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL;
+static jclass LDKClosureReason_FundingTimedOut_class = NULL;
+static jmethodID LDKClosureReason_FundingTimedOut_meth = NULL;
static jclass LDKClosureReason_ProcessingError_class = NULL;
static jmethodID LDKClosureReason_ProcessingError_meth = NULL;
static jclass LDKClosureReason_DisconnectedPeer_class = NULL;
static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) {
LDKClosureReason_CounterpartyForceClosed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed"));
CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL);
LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL);
LDKClosureReason_HolderForceClosed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$HolderForceClosed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$HolderForceClosed"));
CHECK(LDKClosureReason_HolderForceClosed_class != NULL);
LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "<init>", "()V");
CHECK(LDKClosureReason_HolderForceClosed_meth != NULL);
LDKClosureReason_CooperativeClosure_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CooperativeClosure;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CooperativeClosure"));
CHECK(LDKClosureReason_CooperativeClosure_class != NULL);
LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "<init>", "()V");
CHECK(LDKClosureReason_CooperativeClosure_meth != NULL);
LDKClosureReason_CommitmentTxConfirmed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed"));
CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL);
LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "<init>", "()V");
CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL);
+ LDKClosureReason_FundingTimedOut_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$FundingTimedOut"));
+ CHECK(LDKClosureReason_FundingTimedOut_class != NULL);
+ LDKClosureReason_FundingTimedOut_meth = (*env)->GetMethodID(env, LDKClosureReason_FundingTimedOut_class, "<init>", "()V");
+ CHECK(LDKClosureReason_FundingTimedOut_meth != NULL);
LDKClosureReason_ProcessingError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$ProcessingError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$ProcessingError"));
CHECK(LDKClosureReason_ProcessingError_class != NULL);
LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKClosureReason_ProcessingError_meth != NULL);
LDKClosureReason_DisconnectedPeer_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer"));
CHECK(LDKClosureReason_DisconnectedPeer_class != NULL);
LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "<init>", "()V");
CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL);
LDKClosureReason_OutdatedChannelManager_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager"));
CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL);
LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "<init>", "()V");
CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL);
case LDKClosureReason_CommitmentTxConfirmed: {
return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth);
}
+ case LDKClosureReason_FundingTimedOut: {
+ return (*env)->NewObject(env, LDKClosureReason_FundingTimedOut_class, LDKClosureReason_FundingTimedOut_meth);
+ }
case LDKClosureReason_ProcessingError: {
LDKStr err_str = obj->processing_error.err;
jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
static jmethodID LDKCOption_ClosureReasonZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init (JNIEnv *env, jclass clz) {
LDKCOption_ClosureReasonZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some"));
CHECK(LDKCOption_ClosureReasonZ_Some_class != NULL);
LDKCOption_ClosureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_ClosureReasonZ_Some_meth != NULL);
LDKCOption_ClosureReasonZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None"));
CHECK(LDKCOption_ClosureReasonZ_None_class != NULL);
LDKCOption_ClosureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_None_class, "<init>", "()V");
CHECK(LDKCOption_ClosureReasonZ_None_meth != NULL);
static jmethodID LDKNetworkUpdate_NodeFailure_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JNIEnv *env, jclass clz) {
LDKNetworkUpdate_ChannelUpdateMessage_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetworkUpdate$ChannelUpdateMessage;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelUpdateMessage"));
CHECK(LDKNetworkUpdate_ChannelUpdateMessage_class != NULL);
LDKNetworkUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelUpdateMessage_class, "<init>", "(J)V");
CHECK(LDKNetworkUpdate_ChannelUpdateMessage_meth != NULL);
LDKNetworkUpdate_ChannelClosed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetworkUpdate$ChannelClosed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelClosed"));
CHECK(LDKNetworkUpdate_ChannelClosed_class != NULL);
LDKNetworkUpdate_ChannelClosed_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelClosed_class, "<init>", "(JZ)V");
CHECK(LDKNetworkUpdate_ChannelClosed_meth != NULL);
LDKNetworkUpdate_NodeFailure_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetworkUpdate$NodeFailure;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$NodeFailure"));
CHECK(LDKNetworkUpdate_NodeFailure_class != NULL);
LDKNetworkUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_NodeFailure_class, "<init>", "([BZ)V");
CHECK(LDKNetworkUpdate_NodeFailure_meth != NULL);
static jmethodID LDKCOption_NetworkUpdateZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetworkUpdateZ_init (JNIEnv *env, jclass clz) {
LDKCOption_NetworkUpdateZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$Some"));
CHECK(LDKCOption_NetworkUpdateZ_Some_class != NULL);
LDKCOption_NetworkUpdateZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_NetworkUpdateZ_Some_meth != NULL);
LDKCOption_NetworkUpdateZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$None"));
CHECK(LDKCOption_NetworkUpdateZ_None_class != NULL);
LDKCOption_NetworkUpdateZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_None_class, "<init>", "()V");
CHECK(LDKCOption_NetworkUpdateZ_None_meth != NULL);
static jmethodID LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv *env, jclass clz) {
LDKSpendableOutputDescriptor_StaticOutput_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput"));
CHECK(LDKSpendableOutputDescriptor_StaticOutput_class != NULL);
LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "<init>", "(JJ)V");
CHECK(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL);
LDKSpendableOutputDescriptor_DelayedPaymentOutput_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$DelayedPaymentOutput;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$DelayedPaymentOutput"));
CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_class != NULL);
LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, "<init>", "(J)V");
CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth != NULL);
LDKSpendableOutputDescriptor_StaticPaymentOutput_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticPaymentOutput;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticPaymentOutput"));
CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_class != NULL);
LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, "<init>", "(J)V");
CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_meth != NULL);
static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) {
LDKPaymentPurpose_InvoicePayment_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment"));
CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL);
- LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[BJ)V");
+ LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[B)V");
CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL);
LDKPaymentPurpose_SpontaneousPayment_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment"));
CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL);
LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "<init>", "([B)V");
CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL);
(*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data);
int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data);
- return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id);
+ return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr);
}
case LDKPaymentPurpose_SpontaneousPayment: {
int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32);
static jmethodID LDKEvent_PaymentSent_meth = NULL;
static jclass LDKEvent_PaymentPathFailed_class = NULL;
static jmethodID LDKEvent_PaymentPathFailed_meth = NULL;
+static jclass LDKEvent_PaymentFailed_class = NULL;
+static jmethodID LDKEvent_PaymentFailed_meth = NULL;
static jclass LDKEvent_PendingHTLCsForwardable_class = NULL;
static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL;
static jclass LDKEvent_SpendableOutputs_class = NULL;
static jmethodID LDKEvent_ChannelClosed_meth = NULL;
static jclass LDKEvent_DiscardFunding_class = NULL;
static jmethodID LDKEvent_DiscardFunding_meth = NULL;
+static jclass LDKEvent_PaymentPathSuccessful_class = NULL;
+static jmethodID LDKEvent_PaymentPathSuccessful_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) {
LDKEvent_FundingGenerationReady_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingGenerationReady"));
CHECK(LDKEvent_FundingGenerationReady_class != NULL);
LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "<init>", "([BJ[BJ)V");
CHECK(LDKEvent_FundingGenerationReady_meth != NULL);
LDKEvent_PaymentReceived_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentReceived"));
CHECK(LDKEvent_PaymentReceived_class != NULL);
LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([BJJ)V");
CHECK(LDKEvent_PaymentReceived_meth != NULL);
LDKEvent_PaymentSent_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent"));
CHECK(LDKEvent_PaymentSent_class != NULL);
LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B[B[BJ)V");
CHECK(LDKEvent_PaymentSent_meth != NULL);
LDKEvent_PaymentPathFailed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentPathFailed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathFailed"));
CHECK(LDKEvent_PaymentPathFailed_class != NULL);
LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([B[BZJZ[JJJ)V");
CHECK(LDKEvent_PaymentPathFailed_meth != NULL);
+ LDKEvent_PaymentFailed_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentFailed"));
+ CHECK(LDKEvent_PaymentFailed_class != NULL);
+ LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "<init>", "([B[B)V");
+ CHECK(LDKEvent_PaymentFailed_meth != NULL);
LDKEvent_PendingHTLCsForwardable_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable"));
CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL);
LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "<init>", "(J)V");
CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL);
LDKEvent_SpendableOutputs_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$SpendableOutputs"));
CHECK(LDKEvent_SpendableOutputs_class != NULL);
LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "<init>", "([J)V");
CHECK(LDKEvent_SpendableOutputs_meth != NULL);
LDKEvent_PaymentForwarded_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentForwarded;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentForwarded"));
CHECK(LDKEvent_PaymentForwarded_class != NULL);
LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "<init>", "(JZ)V");
CHECK(LDKEvent_PaymentForwarded_meth != NULL);
LDKEvent_ChannelClosed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$ChannelClosed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed"));
CHECK(LDKEvent_ChannelClosed_class != NULL);
LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "<init>", "([BJJ)V");
CHECK(LDKEvent_ChannelClosed_meth != NULL);
LDKEvent_DiscardFunding_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$DiscardFunding;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding"));
CHECK(LDKEvent_DiscardFunding_class != NULL);
LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "<init>", "([B[B)V");
CHECK(LDKEvent_DiscardFunding_meth != NULL);
+ LDKEvent_PaymentPathSuccessful_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful"));
+ CHECK(LDKEvent_PaymentPathSuccessful_class != NULL);
+ LDKEvent_PaymentPathSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathSuccessful_class, "<init>", "([B[B[J)V");
+ CHECK(LDKEvent_PaymentPathSuccessful_meth != NULL);
}
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
LDKEvent *obj = (LDKEvent*)(ptr & ~1);
}
return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, obj->payment_path_failed.rejected_by_dest, network_update_ref, obj->payment_path_failed.all_paths_failed, path_arr, short_channel_id_ref, retry_ref);
}
+ case LDKEvent_PaymentFailed: {
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data);
+ int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data);
+ return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr);
+ }
case LDKEvent_PendingHTLCsForwardable: {
return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable);
}
(*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data);
return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr);
}
+ case LDKEvent_PaymentPathSuccessful: {
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_successful.payment_id.data);
+ int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_successful.payment_hash.data);
+ LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
+ int64_tArray path_arr = NULL;
+ path_arr = (*env)->NewLongArray(env, path_var.datalen);
+ int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
+ for (size_t k = 0; k < path_var.datalen; k++) {
+ LDKRouteHop path_conv_10_var = path_var.data[k];
+ uint64_t path_conv_10_ref = 0;
+ CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
+ path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
+ path_arr_ptr[k] = path_conv_10_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
+ return (*env)->NewObject(env, LDKEvent_PaymentPathSuccessful_class, LDKEvent_PaymentPathSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr);
+ }
default: abort();
}
}
static jmethodID LDKCOption_EventZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init (JNIEnv *env, jclass clz) {
LDKCOption_EventZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$Some"));
CHECK(LDKCOption_EventZ_Some_class != NULL);
LDKCOption_EventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_EventZ_Some_meth != NULL);
LDKCOption_EventZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$None"));
CHECK(LDKCOption_EventZ_None_class != NULL);
LDKCOption_EventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_None_class, "<init>", "()V");
CHECK(LDKCOption_EventZ_None_meth != NULL);
static jmethodID LDKErrorAction_IgnoreError_meth = NULL;
static jclass LDKErrorAction_IgnoreAndLog_class = NULL;
static jmethodID LDKErrorAction_IgnoreAndLog_meth = NULL;
+static jclass LDKErrorAction_IgnoreDuplicateGossip_class = NULL;
+static jmethodID LDKErrorAction_IgnoreDuplicateGossip_meth = NULL;
static jclass LDKErrorAction_SendErrorMessage_class = NULL;
static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv *env, jclass clz) {
LDKErrorAction_DisconnectPeer_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$DisconnectPeer;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$DisconnectPeer"));
CHECK(LDKErrorAction_DisconnectPeer_class != NULL);
LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "<init>", "(J)V");
CHECK(LDKErrorAction_DisconnectPeer_meth != NULL);
LDKErrorAction_IgnoreError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$IgnoreError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreError"));
CHECK(LDKErrorAction_IgnoreError_class != NULL);
LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "<init>", "()V");
CHECK(LDKErrorAction_IgnoreError_meth != NULL);
LDKErrorAction_IgnoreAndLog_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$IgnoreAndLog;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreAndLog"));
CHECK(LDKErrorAction_IgnoreAndLog_class != NULL);
LDKErrorAction_IgnoreAndLog_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreAndLog_class, "<init>", "(Lorg/ldk/enums/Level;)V");
CHECK(LDKErrorAction_IgnoreAndLog_meth != NULL);
+ LDKErrorAction_IgnoreDuplicateGossip_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreDuplicateGossip"));
+ CHECK(LDKErrorAction_IgnoreDuplicateGossip_class != NULL);
+ LDKErrorAction_IgnoreDuplicateGossip_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreDuplicateGossip_class, "<init>", "()V");
+ CHECK(LDKErrorAction_IgnoreDuplicateGossip_meth != NULL);
LDKErrorAction_SendErrorMessage_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$SendErrorMessage;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$SendErrorMessage"));
CHECK(LDKErrorAction_SendErrorMessage_class != NULL);
LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "<init>", "(J)V");
CHECK(LDKErrorAction_SendErrorMessage_meth != NULL);
jclass ignore_and_log_conv = LDKLevel_to_java(env, obj->ignore_and_log);
return (*env)->NewObject(env, LDKErrorAction_IgnoreAndLog_class, LDKErrorAction_IgnoreAndLog_meth, ignore_and_log_conv);
}
+ case LDKErrorAction_IgnoreDuplicateGossip: {
+ return (*env)->NewObject(env, LDKErrorAction_IgnoreDuplicateGossip_class, LDKErrorAction_IgnoreDuplicateGossip_meth);
+ }
case LDKErrorAction_SendErrorMessage: {
LDKErrorMessage msg_var = obj->send_error_message.msg;
uint64_t msg_ref = 0;
static jmethodID LDKMessageSendEvent_SendReplyChannelRange_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv *env, jclass clz) {
LDKMessageSendEvent_SendAcceptChannel_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel"));
CHECK(LDKMessageSendEvent_SendAcceptChannel_class != NULL);
LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendAcceptChannel_meth != NULL);
LDKMessageSendEvent_SendOpenChannel_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel"));
CHECK(LDKMessageSendEvent_SendOpenChannel_class != NULL);
LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendOpenChannel_meth != NULL);
LDKMessageSendEvent_SendFundingCreated_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated"));
CHECK(LDKMessageSendEvent_SendFundingCreated_class != NULL);
LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendFundingCreated_meth != NULL);
LDKMessageSendEvent_SendFundingSigned_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned"));
CHECK(LDKMessageSendEvent_SendFundingSigned_class != NULL);
LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendFundingSigned_meth != NULL);
LDKMessageSendEvent_SendFundingLocked_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked"));
CHECK(LDKMessageSendEvent_SendFundingLocked_class != NULL);
LDKMessageSendEvent_SendFundingLocked_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingLocked_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendFundingLocked_meth != NULL);
LDKMessageSendEvent_SendAnnouncementSignatures_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures"));
CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL);
LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL);
LDKMessageSendEvent_UpdateHTLCs_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs"));
CHECK(LDKMessageSendEvent_UpdateHTLCs_class != NULL);
LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_UpdateHTLCs_meth != NULL);
LDKMessageSendEvent_SendRevokeAndACK_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK"));
CHECK(LDKMessageSendEvent_SendRevokeAndACK_class != NULL);
LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL);
LDKMessageSendEvent_SendClosingSigned_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned"));
CHECK(LDKMessageSendEvent_SendClosingSigned_class != NULL);
LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendClosingSigned_meth != NULL);
LDKMessageSendEvent_SendShutdown_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown"));
CHECK(LDKMessageSendEvent_SendShutdown_class != NULL);
LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendShutdown_meth != NULL);
LDKMessageSendEvent_SendChannelReestablish_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish"));
CHECK(LDKMessageSendEvent_SendChannelReestablish_class != NULL);
LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendChannelReestablish_meth != NULL);
LDKMessageSendEvent_BroadcastChannelAnnouncement_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement"));
CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL);
LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "<init>", "(JJ)V");
CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL);
LDKMessageSendEvent_BroadcastNodeAnnouncement_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement"));
CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_class != NULL);
LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, "<init>", "(J)V");
CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_meth != NULL);
LDKMessageSendEvent_BroadcastChannelUpdate_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate"));
CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL);
LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "<init>", "(J)V");
CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL);
LDKMessageSendEvent_SendChannelUpdate_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelUpdate;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelUpdate"));
CHECK(LDKMessageSendEvent_SendChannelUpdate_class != NULL);
LDKMessageSendEvent_SendChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelUpdate_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendChannelUpdate_meth != NULL);
LDKMessageSendEvent_HandleError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$HandleError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$HandleError"));
CHECK(LDKMessageSendEvent_HandleError_class != NULL);
LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_HandleError_meth != NULL);
LDKMessageSendEvent_SendChannelRangeQuery_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelRangeQuery;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelRangeQuery"));
CHECK(LDKMessageSendEvent_SendChannelRangeQuery_class != NULL);
LDKMessageSendEvent_SendChannelRangeQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelRangeQuery_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendChannelRangeQuery_meth != NULL);
LDKMessageSendEvent_SendShortIdsQuery_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendShortIdsQuery;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShortIdsQuery"));
CHECK(LDKMessageSendEvent_SendShortIdsQuery_class != NULL);
LDKMessageSendEvent_SendShortIdsQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShortIdsQuery_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendShortIdsQuery_meth != NULL);
LDKMessageSendEvent_SendReplyChannelRange_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendReplyChannelRange;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendReplyChannelRange"));
CHECK(LDKMessageSendEvent_SendReplyChannelRange_class != NULL);
LDKMessageSendEvent_SendReplyChannelRange_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendReplyChannelRange_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendReplyChannelRange_meth != NULL);
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKInitFeatures res_var = (*val->contents.result);
+ LDKScoringParameters res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKNodeFeatures res_var = (*val->contents.result);
+ LDKScorer res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ LDKDecodeError err_var = (*val->contents.err);
+ uint64_t err_ref = 0;
+ CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKInitFeatures res_var = (*val->contents.result);
+ uint64_t res_ref = 0;
+ CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
+ res_ref = (uint64_t)res_var.inner & ~1;
+ return res_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKInvoiceFeatures res_var = (*val->contents.result);
+ LDKNodeFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKScoringParameters res_var = (*val->contents.result);
+ LDKInvoiceFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ *val = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKScorer res_var = (*val->contents.result);
+ LDKChannelTypeFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ *val = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_per_commitment_point in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to release_commitment_secret in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_holder_commitment_meth, holder_tx_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to validate_holder_commitment in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to channel_keys_id in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_commitment_meth, commitment_tx_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_counterparty_commitment in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_counterparty_revocation_meth, idx, secret_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to validate_counterparty_revocation in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_holder_commitment_and_htlcs in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_output_meth, justice_tx_arr, input, amount, per_commitment_key_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_justice_revoked_output in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_htlc_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_justice_revoked_htlc in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_counterparty_htlc_transaction in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_closing_transaction_meth, closing_tx_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_closing_transaction in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_channel_announcement_meth, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_channel_announcement in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to ready_channel in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to write in LDKSign from rust threw an exception.");
}
static jmethodID LDKCOption_u16Z_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u16Z_init (JNIEnv *env, jclass clz) {
LDKCOption_u16Z_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u16Z$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$Some"));
CHECK(LDKCOption_u16Z_Some_class != NULL);
LDKCOption_u16Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_Some_class, "<init>", "(S)V");
CHECK(LDKCOption_u16Z_Some_meth != NULL);
LDKCOption_u16Z_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u16Z$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$None"));
CHECK(LDKCOption_u16Z_None_class != NULL);
LDKCOption_u16Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_None_class, "<init>", "()V");
CHECK(LDKCOption_u16Z_None_meth != NULL);
static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) {
LDKAPIError_APIMisuseError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$APIMisuseError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$APIMisuseError"));
CHECK(LDKAPIError_APIMisuseError_class != NULL);
LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKAPIError_APIMisuseError_meth != NULL);
LDKAPIError_FeeRateTooHigh_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh"));
CHECK(LDKAPIError_FeeRateTooHigh_class != NULL);
LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "<init>", "(Ljava/lang/String;I)V");
CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL);
LDKAPIError_RouteError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$RouteError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$RouteError"));
CHECK(LDKAPIError_RouteError_class != NULL);
LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKAPIError_RouteError_meth != NULL);
LDKAPIError_ChannelUnavailable_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$ChannelUnavailable;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable"));
CHECK(LDKAPIError_ChannelUnavailable_class != NULL);
LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKAPIError_ChannelUnavailable_meth != NULL);
LDKAPIError_MonitorUpdateFailed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed"));
CHECK(LDKAPIError_MonitorUpdateFailed_class != NULL);
LDKAPIError_MonitorUpdateFailed_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateFailed_class, "<init>", "()V");
CHECK(LDKAPIError_MonitorUpdateFailed_meth != NULL);
LDKAPIError_IncompatibleShutdownScript_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript"));
CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL);
LDKAPIError_IncompatibleShutdownScript_meth = (*env)->GetMethodID(env, LDKAPIError_IncompatibleShutdownScript_class, "<init>", "(J)V");
CHECK(LDKAPIError_IncompatibleShutdownScript_meth != NULL);
static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) {
LDKPaymentSendFailure_ParameterError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError"));
CHECK(LDKPaymentSendFailure_ParameterError_class != NULL);
LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "<init>", "(J)V");
CHECK(LDKPaymentSendFailure_ParameterError_meth != NULL);
LDKPaymentSendFailure_PathParameterError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError"));
CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL);
LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "<init>", "([J)V");
CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL);
LDKPaymentSendFailure_AllFailedRetrySafe_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedRetrySafe;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedRetrySafe"));
CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_class != NULL);
LDKPaymentSendFailure_AllFailedRetrySafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, "<init>", "([J)V");
CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_meth != NULL);
LDKPaymentSendFailure_PartialFailure_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure"));
CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL);
LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "([JJ[B)V");
CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL);
static jmethodID LDKNetAddress_OnionV3_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv *env, jclass clz) {
LDKNetAddress_IPv4_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv4;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv4"));
CHECK(LDKNetAddress_IPv4_class != NULL);
LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "<init>", "([BS)V");
CHECK(LDKNetAddress_IPv4_meth != NULL);
LDKNetAddress_IPv6_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv6;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv6"));
CHECK(LDKNetAddress_IPv6_class != NULL);
LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "<init>", "([BS)V");
CHECK(LDKNetAddress_IPv6_meth != NULL);
LDKNetAddress_OnionV2_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV2;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV2"));
CHECK(LDKNetAddress_OnionV2_class != NULL);
- LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "<init>", "([BS)V");
+ LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "<init>", "([B)V");
CHECK(LDKNetAddress_OnionV2_meth != NULL);
LDKNetAddress_OnionV3_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV3;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV3"));
CHECK(LDKNetAddress_OnionV3_class != NULL);
LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "<init>", "([BSBS)V");
CHECK(LDKNetAddress_OnionV3_meth != NULL);
return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, obj->i_pv6.port);
}
case LDKNetAddress_OnionV2: {
- int8_tArray addr_arr = (*env)->NewByteArray(env, 10);
- (*env)->SetByteArrayRegion(env, addr_arr, 0, 10, obj->onion_v2.addr.data);
- return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, addr_arr, obj->onion_v2.port);
+ int8_tArray onion_v2_arr = (*env)->NewByteArray(env, 12);
+ (*env)->SetByteArrayRegion(env, onion_v2_arr, 0, 12, obj->onion_v2.data);
+ return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, onion_v2_arr);
}
case LDKNetAddress_OnionV3: {
int8_tArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32);
return ret_arr;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKC2Tuple_PaymentHashPaymentSecretZ* res_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
+ *res_conv = (*val->contents.result);
+ *res_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(res_conv);
+ return ((uint64_t)res_conv);
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKC2Tuple_PaymentHashPaymentSecretZ* res_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
+ *res_conv = (*val->contents.result);
+ *res_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(res_conv);
+ return ((uint64_t)res_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+ return err_ref;
+}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentSecretNoneZ *val = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ int8_tArray res_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, res_arr, 0, 32, (*val->contents.result).data);
+ return res_arr;
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentSecretNoneZ *val = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PaymentSecretAPIErrorZ *val = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1);
CHECK(val->result_ok);
uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentPreimageAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ *val = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ int8_tArray res_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, res_arr, 0, 32, (*val->contents.result).data);
+ return res_arr;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentPreimageAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ *val = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+ return err_ref;
+}
static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to release_pending_monitor_events in LDKWatch from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->broadcast_transaction_meth, tx_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to broadcast_transaction in LDKBroadcasterInterface from rust threw an exception.");
}
jmethodID get_secure_random_bytes_meth;
jmethodID read_chan_signer_meth;
jmethodID sign_invoice_meth;
+ jmethodID get_inbound_payment_key_material_meth;
} LDKKeysInterface_JCalls;
static void LDKKeysInterface_JCalls_free(void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_node_secret_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_node_secret in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_destination_script in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_shutdown_scriptpubkey_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_shutdown_scriptpubkey in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_channel_signer_meth, inbound, channel_value_satoshis);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_channel_signer in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_secure_random_bytes in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to read_chan_signer in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, invoice_preimage_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_invoice in LDKKeysInterface from rust threw an exception.");
}
}
return ret_conv;
}
+LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
+ LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_inbound_payment_key_material_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to get_inbound_payment_key_material in LDKKeysInterface from rust threw an exception.");
+ }
+ LDKThirtyTwoBytes ret_ref;
+ CHECK((*env)->GetArrayLength(env, ret) == 32);
+ (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_ref;
+}
static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
CHECK(calls->read_chan_signer_meth != NULL);
calls->sign_invoice_meth = (*env)->GetMethodID(env, c, "sign_invoice", "([B)J");
CHECK(calls->sign_invoice_meth != NULL);
+ calls->get_inbound_payment_key_material_meth = (*env)->GetMethodID(env, c, "get_inbound_payment_key_material", "()[B");
+ CHECK(calls->get_inbound_payment_key_material_meth != NULL);
LDKKeysInterface ret = {
.this_arg = (void*) calls,
.get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
.read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
.sign_invoice = sign_invoice_LDKKeysInterface_jcall,
+ .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
.free = LDKKeysInterface_JCalls_free,
};
return ret;
return (uint64_t)ret_conv;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1inbound_1payment_1key_1material(JNIEnv *env, jclass clz, int64_t this_arg) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data);
+ return ret_arr;
+}
+
typedef struct LDKFeeEstimator_JCalls {
atomic_size_t refcnt;
JavaVM *vm;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int32_t ret = (*env)->CallIntMethod(env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_est_sat_per_1000_weight in LDKFeeEstimator from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int16_t ret = (*env)->CallShortMethod(env, obj, j_calls->type_id_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to type_id in LDKType from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
jstring ret = (*env)->CallObjectMethod(env, obj, j_calls->debug_str_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to debug_str in LDKType from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to write in LDKType from rust threw an exception.");
}
static jmethodID LDKCOption_TypeZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1TypeZ_init (JNIEnv *env, jclass clz) {
LDKCOption_TypeZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_TypeZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$Some"));
CHECK(LDKCOption_TypeZ_Some_class != NULL);
LDKCOption_TypeZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_TypeZ_Some_meth != NULL);
LDKCOption_TypeZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_TypeZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$None"));
CHECK(LDKCOption_TypeZ_None_class != NULL);
LDKCOption_TypeZ_None_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_None_class, "<init>", "()V");
CHECK(LDKCOption_TypeZ_None_meth != NULL);
static jmethodID LDKPaymentError_Sending_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentError_init (JNIEnv *env, jclass clz) {
LDKPaymentError_Invoice_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentError$Invoice;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Invoice"));
CHECK(LDKPaymentError_Invoice_class != NULL);
LDKPaymentError_Invoice_meth = (*env)->GetMethodID(env, LDKPaymentError_Invoice_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKPaymentError_Invoice_meth != NULL);
LDKPaymentError_Routing_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentError$Routing;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Routing"));
CHECK(LDKPaymentError_Routing_class != NULL);
LDKPaymentError_Routing_meth = (*env)->GetMethodID(env, LDKPaymentError_Routing_class, "<init>", "(J)V");
CHECK(LDKPaymentError_Routing_meth != NULL);
LDKPaymentError_Sending_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentError$Sending;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Sending"));
CHECK(LDKPaymentError_Sending_class != NULL);
LDKPaymentError_Sending_meth = (*env)->GetMethodID(env, LDKPaymentError_Sending_class, "<init>", "(J)V");
CHECK(LDKPaymentError_Sending_meth != NULL);
static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) {
LDKCOption_MonitorEventZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some"));
CHECK(LDKCOption_MonitorEventZ_Some_class != NULL);
LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL);
LDKCOption_MonitorEventZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$None"));
CHECK(LDKCOption_MonitorEventZ_None_class != NULL);
LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "<init>", "()V");
CHECK(LDKCOption_MonitorEventZ_None_meth != NULL);
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- return *val->contents.result;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKMonitorUpdateError err_var = (*val->contents.err);
- uint64_t err_ref = 0;
- CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
- err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
return OutPoint_clone(&tuple->a);
}
static jmethodID LDKBalance_MaybeClaimableHTLCAwaitingTimeout_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBalance_init (JNIEnv *env, jclass clz) {
LDKBalance_ClaimableOnChannelClose_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKBalance$ClaimableOnChannelClose;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableOnChannelClose"));
CHECK(LDKBalance_ClaimableOnChannelClose_class != NULL);
LDKBalance_ClaimableOnChannelClose_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableOnChannelClose_class, "<init>", "(J)V");
CHECK(LDKBalance_ClaimableOnChannelClose_meth != NULL);
LDKBalance_ClaimableAwaitingConfirmations_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKBalance$ClaimableAwaitingConfirmations;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableAwaitingConfirmations"));
CHECK(LDKBalance_ClaimableAwaitingConfirmations_class != NULL);
LDKBalance_ClaimableAwaitingConfirmations_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableAwaitingConfirmations_class, "<init>", "(JI)V");
CHECK(LDKBalance_ClaimableAwaitingConfirmations_meth != NULL);
LDKBalance_ContentiousClaimable_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKBalance$ContentiousClaimable;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ContentiousClaimable"));
CHECK(LDKBalance_ContentiousClaimable_class != NULL);
LDKBalance_ContentiousClaimable_meth = (*env)->GetMethodID(env, LDKBalance_ContentiousClaimable_class, "<init>", "(JI)V");
CHECK(LDKBalance_ContentiousClaimable_meth != NULL);
LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKBalance$MaybeClaimableHTLCAwaitingTimeout;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybeClaimableHTLCAwaitingTimeout"));
CHECK(LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class != NULL);
LDKBalance_MaybeClaimableHTLCAwaitingTimeout_meth = (*env)->GetMethodID(env, LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class, "<init>", "(JI)V");
CHECK(LDKBalance_MaybeClaimableHTLCAwaitingTimeout_meth != NULL);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception.");
}
static jmethodID LDKCOption_AccessZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AccessZ_init (JNIEnv *env, jclass clz) {
LDKCOption_AccessZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_AccessZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$Some"));
CHECK(LDKCOption_AccessZ_Some_class != NULL);
LDKCOption_AccessZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_AccessZ_Some_meth != NULL);
LDKCOption_AccessZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_AccessZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$None"));
CHECK(LDKCOption_AccessZ_None_class != NULL);
LDKCOption_AccessZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_None_class, "<init>", "()V");
CHECK(LDKCOption_AccessZ_None_meth != NULL);
static jmethodID LDKCOption_CVec_NetAddressZZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1NetAddressZZ_init (JNIEnv *env, jclass clz) {
LDKCOption_CVec_NetAddressZZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some"));
CHECK(LDKCOption_CVec_NetAddressZZ_Some_class != NULL);
LDKCOption_CVec_NetAddressZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_Some_class, "<init>", "([J)V");
CHECK(LDKCOption_CVec_NetAddressZZ_Some_meth != NULL);
LDKCOption_CVec_NetAddressZZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None"));
CHECK(LDKCOption_CVec_NetAddressZZ_None_class != NULL);
LDKCOption_CVec_NetAddressZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_None_class, "<init>", "()V");
CHECK(LDKCOption_CVec_NetAddressZZ_None_meth != NULL);
static jmethodID LDKSignOrCreationError_CreationError_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSignOrCreationError_init (JNIEnv *env, jclass clz) {
LDKSignOrCreationError_SignError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSignOrCreationError$SignError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$SignError"));
CHECK(LDKSignOrCreationError_SignError_class != NULL);
LDKSignOrCreationError_SignError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_SignError_class, "<init>", "()V");
CHECK(LDKSignOrCreationError_SignError_meth != NULL);
LDKSignOrCreationError_CreationError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSignOrCreationError$CreationError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$CreationError"));
CHECK(LDKSignOrCreationError_CreationError_class != NULL);
LDKSignOrCreationError_CreationError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_CreationError_class, "<init>", "(Lorg/ldk/enums/CreationError;)V");
CHECK(LDKSignOrCreationError_CreationError_meth != NULL);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to register_tx in LDKFilter from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->register_output_meth, output_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to register_output in LDKFilter from rust threw an exception.");
}
static jmethodID LDKCOption_FilterZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1FilterZ_init (JNIEnv *env, jclass clz) {
LDKCOption_FilterZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_FilterZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$Some"));
CHECK(LDKCOption_FilterZ_Some_class != NULL);
LDKCOption_FilterZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_FilterZ_Some_meth != NULL);
LDKCOption_FilterZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_FilterZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$None"));
CHECK(LDKCOption_FilterZ_None_class != NULL);
LDKCOption_FilterZ_None_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_None_class, "<init>", "()V");
CHECK(LDKCOption_FilterZ_None_meth != NULL);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_and_clear_pending_msg_events in LDKMessageSendEventsProvider from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, (uint64_t)ret_event);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->process_pending_events_meth, (uint64_t)handler_ret);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to process_pending_events in LDKEventsProvider from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_open_channel in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_accept_channel in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_funding_created in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_funding_signed in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_funding_locked in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, their_features_ref, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_shutdown in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_closing_signed in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_update_add_htlc in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_update_fulfill_htlc in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_update_fail_htlc in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_update_fail_malformed_htlc in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_commitment_signed in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_revoke_and_ack in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_update_fee in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_announcement_signatures in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to peer_disconnected in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to peer_connected in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_reestablish in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_update in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_error in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_next_channel_announcements in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_next_node_announcements in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->sync_routing_table_meth, their_node_id_arr, init_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sync_routing_table in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_reply_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_reply_short_channel_ids_end in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_query_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_query_short_channel_ids in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_meth, message_type, buffer_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to read in LDKCustomMessageReader from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_custom_message_meth, (uint64_t)msg_ret, sender_node_id_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_custom_message in LDKCustomMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_and_clear_pending_msg in LDKCustomMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_data_meth, data_arr, resume_read);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to send_data in LDKSocketDescriptor from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->disconnect_socket_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to disconnect_socket in LDKSocketDescriptor from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->eq_meth, (uint64_t)other_arg_clone);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to eq in LDKSocketDescriptor from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->hash_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to hash in LDKSocketDescriptor from rust threw an exception.");
}
jweak o;
jmethodID channel_penalty_msat_meth;
jmethodID payment_path_failed_meth;
+ jmethodID payment_path_successful_meth;
jmethodID write_meth;
} LDKScore_JCalls;
static void LDKScore_JCalls_free(void* this_arg) {
FREE(j_calls);
}
}
-uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target) {
+uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, LDKCOption_u64Z channel_capacity_msat, const LDKNodeId * source, const LDKNodeId * target) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
} else {
DO_ASSERT(get_jenv_res == JNI_OK);
}
+ LDKCOption_u64Z *channel_capacity_msat_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *channel_capacity_msat_copy = channel_capacity_msat;
+ uint64_t channel_capacity_msat_ref = (uint64_t)channel_capacity_msat_copy;
LDKNodeId source_var = *source;
uint64_t source_ref = 0;
source_var = NodeId_clone(source);
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id, source_ref, target_ref);
- if ((*env)->ExceptionCheck(env)) {
+ int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id, send_amt_msat, channel_capacity_msat_ref, source_ref, target_ref);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->payment_path_failed_meth, path_arr, short_channel_id);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to payment_path_failed in LDKScore from rust threw an exception.");
}
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
}
+void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
+ LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ LDKCVec_RouteHopZ path_var = path;
+ int64_tArray path_arr = NULL;
+ path_arr = (*env)->NewLongArray(env, path_var.datalen);
+ int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
+ for (size_t k = 0; k < path_var.datalen; k++) {
+ LDKRouteHop path_conv_10_var = path_var.data[k];
+ uint64_t path_conv_10_ref = 0;
+ CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
+ path_conv_10_ref = (uint64_t)path_conv_10_var.inner;
+ if (path_conv_10_var.is_owned) {
+ path_conv_10_ref |= 1;
+ }
+ path_arr_ptr[k] = path_conv_10_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
+ FREE(path_var.data);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ (*env)->CallVoidMethod(env, obj, j_calls->payment_path_successful_meth, path_arr);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to payment_path_successful in LDKScore from rust threw an exception.");
+ }
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+}
LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
JNIEnv *env;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception.");
}
atomic_init(&calls->refcnt, 1);
DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
calls->o = (*env)->NewWeakGlobalRef(env, o);
- calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJ)J");
+ calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJJJ)J");
CHECK(calls->channel_penalty_msat_meth != NULL);
calls->payment_path_failed_meth = (*env)->GetMethodID(env, c, "payment_path_failed", "([JJ)V");
CHECK(calls->payment_path_failed_meth != NULL);
+ calls->payment_path_successful_meth = (*env)->GetMethodID(env, c, "payment_path_successful", "([J)V");
+ CHECK(calls->payment_path_successful_meth != NULL);
calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
CHECK(calls->write_meth != NULL);
.this_arg = (void*) calls,
.channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
.payment_path_failed = payment_path_failed_LDKScore_jcall,
+ .payment_path_successful = payment_path_successful_LDKScore_jcall,
.write = write_LDKScore_jcall,
.free = LDKScore_JCalls_free,
};
*res_ptr = LDKScore_init(env, clz, o);
return (uint64_t)res_ptr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t source, int64_t target) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t send_amt_msat, int64_t channel_capacity_msat, int64_t source, int64_t target) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ void* channel_capacity_msat_ptr = (void*)(((uint64_t)channel_capacity_msat) & ~1);
+ CHECK_ACCESS(channel_capacity_msat_ptr);
+ LDKCOption_u64Z channel_capacity_msat_conv = *(LDKCOption_u64Z*)(channel_capacity_msat_ptr);
+ channel_capacity_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)channel_capacity_msat) & ~1));
LDKNodeId source_conv;
source_conv.inner = (void*)(source & (~1));
source_conv.is_owned = false;
target_conv.inner = (void*)(target & (~1));
target_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
- int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv);
+ int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, send_amt_msat, channel_capacity_msat_conv, &source_conv, &target_conv);
return ret_val;
}
(this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ LDKCVec_RouteHopZ path_constr;
+ path_constr.datalen = (*env)->GetArrayLength(env, path);
+ if (path_constr.datalen > 0)
+ path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ else
+ path_constr.data = NULL;
+ int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
+ for (size_t k = 0; k < path_constr.datalen; k++) {
+ int64_t path_conv_10 = path_vals[k];
+ LDKRouteHop path_conv_10_conv;
+ path_conv_10_conv.inner = (void*)(path_conv_10 & (~1));
+ path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
+ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
+ path_constr.data[k] = path_conv_10_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
+ (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Score_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
return ret_arr;
}
+typedef struct LDKLockableScore_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID lock_meth;
+} LDKLockableScore_JCalls;
+static void LDKLockableScore_JCalls_free(void* this_arg) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ (*env)->DeleteWeakGlobalRef(env, j_calls->o);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ FREE(j_calls);
+ }
+}
+LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->lock_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to lock in LDKLockableScore from rust threw an exception.");
+ }
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKScore ret_conv = *(LDKScore*)(ret_ptr);
+ if (ret_conv.free == LDKScore_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKScore_JCalls_cloned(&ret_conv);
+ }// Warning: we may need a move here but no clone is available for LDKScore
+
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
+static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKLockableScore LDKLockableScore_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
+ calls->o = (*env)->NewWeakGlobalRef(env, o);
+ calls->lock_meth = (*env)->GetMethodID(env, c, "lock", "()J");
+ CHECK(calls->lock_meth != NULL);
+
+ LDKLockableScore ret = {
+ .this_arg = (void*) calls,
+ .lock = lock_LDKLockableScore_jcall,
+ .free = LDKLockableScore_JCalls_free,
+ };
+ return ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLockableScore_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
+ *res_ptr = LDKLockableScore_init(env, clz, o);
+ return (uint64_t)res_ptr;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1lock(JNIEnv *env, jclass clz, int64_t this_arg) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
+ *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
+ return (uint64_t)ret_ret;
+}
+
typedef struct LDKChannelManagerPersister_JCalls {
atomic_size_t refcnt;
JavaVM *vm;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_manager in LDKChannelManagerPersister from rust threw an exception.");
}
static jmethodID LDKFallback_ScriptHash_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFallback_init (JNIEnv *env, jclass clz) {
LDKFallback_SegWitProgram_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKFallback$SegWitProgram;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$SegWitProgram"));
CHECK(LDKFallback_SegWitProgram_class != NULL);
LDKFallback_SegWitProgram_meth = (*env)->GetMethodID(env, LDKFallback_SegWitProgram_class, "<init>", "(B[B)V");
CHECK(LDKFallback_SegWitProgram_meth != NULL);
LDKFallback_PubKeyHash_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKFallback$PubKeyHash;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$PubKeyHash"));
CHECK(LDKFallback_PubKeyHash_class != NULL);
LDKFallback_PubKeyHash_meth = (*env)->GetMethodID(env, LDKFallback_PubKeyHash_class, "<init>", "([B)V");
CHECK(LDKFallback_PubKeyHash_meth != NULL);
LDKFallback_ScriptHash_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKFallback$ScriptHash;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$ScriptHash"));
CHECK(LDKFallback_ScriptHash_class != NULL);
LDKFallback_ScriptHash_meth = (*env)->GetMethodID(env, LDKFallback_ScriptHash_class, "<init>", "([B)V");
CHECK(LDKFallback_ScriptHash_meth != NULL);
jmethodID node_id_meth;
jmethodID first_hops_meth;
jmethodID send_payment_meth;
+ jmethodID send_spontaneous_payment_meth;
jmethodID retry_payment_meth;
+ jmethodID abandon_payment_meth;
} LDKPayer_JCalls;
static void LDKPayer_JCalls_free(void* this_arg) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->node_id_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to node_id in LDKPayer from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->first_hops_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to first_hops in LDKPayer from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_payment_meth, route_ref, payment_hash_arr, payment_secret_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to send_payment in LDKPayer from rust threw an exception.");
}
}
return ret_conv;
}
+LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ LDKRoute route_var = *route;
+ uint64_t route_ref = 0;
+ route_var = Route_clone(route);
+ CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_ref |= 1;
+ }
+ int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, payment_preimage.data);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_spontaneous_payment_meth, route_ref, payment_preimage_arr);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to send_spontaneous_payment in LDKPayer from rust threw an exception.");
+ }
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
+ FREE((void*)ret);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
JNIEnv *env;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->retry_payment_meth, route_ref, payment_id_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to retry_payment in LDKPayer from rust threw an exception.");
}
}
return ret_conv;
}
+void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ (*env)->CallVoidMethod(env, obj, j_calls->abandon_payment_meth, payment_id_arr);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to abandon_payment in LDKPayer from rust threw an exception.");
+ }
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+}
static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
CHECK(calls->first_hops_meth != NULL);
calls->send_payment_meth = (*env)->GetMethodID(env, c, "send_payment", "(J[B[B)J");
CHECK(calls->send_payment_meth != NULL);
+ calls->send_spontaneous_payment_meth = (*env)->GetMethodID(env, c, "send_spontaneous_payment", "(J[B)J");
+ CHECK(calls->send_spontaneous_payment_meth != NULL);
calls->retry_payment_meth = (*env)->GetMethodID(env, c, "retry_payment", "(J[B)J");
CHECK(calls->retry_payment_meth != NULL);
+ calls->abandon_payment_meth = (*env)->GetMethodID(env, c, "abandon_payment", "([B)V");
+ CHECK(calls->abandon_payment_meth != NULL);
LDKPayer ret = {
.this_arg = (void*) calls,
.node_id = node_id_LDKPayer_jcall,
.first_hops = first_hops_LDKPayer_jcall,
.send_payment = send_payment_LDKPayer_jcall,
+ .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
.retry_payment = retry_payment_LDKPayer_jcall,
+ .abandon_payment = abandon_payment_LDKPayer_jcall,
.free = LDKPayer_JCalls_free,
};
return ret;
return (uint64_t)ret_conv;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKRoute route_conv;
+ route_conv.inner = (void*)(route & (~1));
+ route_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
+ LDKThirtyTwoBytes payment_preimage_ref;
+ CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
+ (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
+ LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
return (uint64_t)ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
+ (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
+}
+
typedef struct LDKRouter_JCalls {
atomic_size_t refcnt;
JavaVM *vm;
FREE(j_calls);
}
}
-LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * params, LDKCVec_ChannelDetailsZ * first_hops, const LDKScore * scorer) {
+LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * params, const uint8_t (* payment_hash)[32], LDKCVec_ChannelDetailsZ * first_hops, const LDKScore * scorer) {
LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
if (params_var.is_owned) {
params_ref |= 1;
}
+ int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, *payment_hash);
LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
int64_tArray first_hops_arr = NULL;
if (first_hops != NULL) {
uint64_t ret_scorer = ((uint64_t)scorer) | 1;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, params_ref, first_hops_arr, ret_scorer);
- if ((*env)->ExceptionCheck(env)) {
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, params_ref, payment_hash_arr, first_hops_arr, ret_scorer);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception.");
}
atomic_init(&calls->refcnt, 1);
DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
calls->o = (*env)->NewWeakGlobalRef(env, o);
- calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[JJ)J");
+ calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[B[JJ)J");
CHECK(calls->find_route_meth != NULL);
LDKRouter ret = {
*res_ptr = LDKRouter_init(env, clz, o);
return (uint64_t)res_ptr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t params, int64_tArray first_hops, int64_t scorer) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t params, int8_tArray payment_hash, int64_tArray first_hops, int64_t scorer) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
params_conv.inner = (void*)(params & (~1));
params_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
+ unsigned char payment_hash_arr[32];
+ CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+ (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
+ unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
LDKCVec_ChannelDetailsZ first_hops_constr;
LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
if (first_hops != NULL) {
if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, ¶ms_conv, first_hops_ptr, scorer_conv);
+ *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, ¶ms_conv, payment_hash_ref, first_hops_ptr, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
return (uint64_t)ret_conv;
}
return (uint64_t)ret_conv;
}
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1some(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_some());
+ return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1none(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_none());
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1free(JNIEnv *env, jclass clz, jclass _res) {
+ LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_java(env, _res);
+ COption_NoneZ_free(_res_conv);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
LDKCounterpartyChannelTransactionParameters o_conv;
o_conv.inner = (void*)(o & (~1));
CVec_MessageSendEventZ_free(_res_constr);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKInitFeatures o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKScoringParameters o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = InitFeatures_clone(&o_conv);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
+ // Warning: we need a move here but no clone is available for LDKScoringParameters
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_ScoringParametersDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKNodeFeatures o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKScorer o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = NodeFeatures_clone(&o_conv);
- LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
- *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
+ // Warning: we need a move here but no clone is available for LDKScorer
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
- *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_ScorerDecodeErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKInitFeatures o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = InitFeatures_clone(&o_conv);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKInvoiceFeatures o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKNodeFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = InvoiceFeatures_clone(&o_conv);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
+ o_conv = NodeFeatures_clone(&o_conv);
+ LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKScoringParameters o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKInvoiceFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- // Warning: we need a move here but no clone is available for LDKScoringParameters
- LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
- *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv);
+ o_conv = InvoiceFeatures_clone(&o_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
- *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_ScoringParametersDecodeErrorZ_free(_res_conv);
+ CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKScorer o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKChannelTypeFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- // Warning: we need a move here but no clone is available for LDKScorer
- LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
- *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv);
+ o_conv = ChannelTypeFeatures_clone(&o_conv);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
- *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_ScorerDecodeErrorZ_free(_res_conv);
+ CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
+ o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err(JNIEnv *env, jclass clz) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(o & ~1);
+ jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(orig & ~1);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
+ o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
+ e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(orig & ~1);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK((*env)->GetArrayLength(env, o) == 32);
+ (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err(JNIEnv *env, jclass clz) {
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_err();
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)(o & ~1);
+ jboolean ret_val = CResult_PaymentSecretNoneZ_is_ok(o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentSecretNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ int64_t ret_val = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)(orig & ~1);
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
LDKThirtyTwoBytes o_ref;
CHECK((*env)->GetArrayLength(env, o) == 32);
return (uint64_t)ret_conv;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK((*env)->GetArrayLength(env, o) == 32);
+ (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
+ e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ int64_t ret_val = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(orig & ~1);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
LDKCVec_ChannelMonitorZ _res_constr;
_res_constr.datalen = (*env)->GetArrayLength(env, _res);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv *env, jclass clz) {
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_ok();
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKMonitorUpdateError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = MonitorUpdateError_clone(&e_conv);
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_NoneMonitorUpdateErrorZ* o_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(o & ~1);
- jboolean ret_val = CResult_NoneMonitorUpdateErrorZ_is_ok(o_conv);
- return ret_val;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
- if ((_res & 1) != 0) return;
- void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_NoneMonitorUpdateErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg) {
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(arg);
- return (uint64_t)ret_conv;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ* arg_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- int64_t ret_val = CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg_conv);
- return ret_val;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_NoneMonitorUpdateErrorZ* orig_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(orig & ~1);
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
*ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1invoice_1payment(JNIEnv *env, jclass clz, int8_tArray payment_preimage, int8_tArray payment_secret, int64_t user_payment_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1invoice_1payment(JNIEnv *env, jclass clz, int8_tArray payment_preimage, int8_tArray payment_secret) {
LDKThirtyTwoBytes payment_preimage_ref;
CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
(*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
(*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
- *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref, user_payment_id);
+ *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out(JNIEnv *env, jclass clz) {
+ LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
+ *ret_copy = ClosureReason_funding_timed_out();
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error(JNIEnv *env, jclass clz, jstring err) {
LDKStr err_conv = java_to_owned_str(env, err);
LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+ (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+ LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) {
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_tArray path) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+ (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+ LDKCVec_RouteHopZ path_constr;
+ path_constr.datalen = (*env)->GetArrayLength(env, path);
+ if (path_constr.datalen > 0)
+ path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ else
+ path_constr.data = NULL;
+ int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
+ for (size_t k = 0; k < path_constr.datalen; k++) {
+ int64_t path_conv_10 = path_vals[k];
+ LDKRouteHop path_conv_10_conv;
+ path_conv_10_conv.inner = (void*)(path_conv_10 & (~1));
+ path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
+ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
+ path_constr.data[k] = path_conv_10_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
+ LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKEvent* obj_conv = (LDKEvent*)obj;
LDKCVec_u8Z ret_var = Event_write(obj_conv);
return ret_conv;
}
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1gossip(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKLevel_to_java(env, Level_gossip());
+ return ret_conv;
+}
+
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) {
jclass ret_conv = LDKLevel_to_java(env, Level_trace());
return ret_conv;
UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t own_channel_config_arg, int64_t peer_channel_config_limits_arg, int64_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg) {
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKUserConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ jboolean ret_val = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
+ LDKUserConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t own_channel_config_arg, int64_t peer_channel_config_limits_arg, int64_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg) {
LDKChannelHandshakeConfig own_channel_config_arg_conv;
own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1));
own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0);
channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv);
channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv);
- LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg);
+ LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (uint64_t)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
- LDKMonitorUpdateError this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- MonitorUpdateError_free(this_obj_conv);
-}
-
-JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKMonitorUpdateError this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- LDKStr ret_str = MonitorUpdateError_get_a(&this_ptr_conv);
- jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
- Str_free(ret_str);
- return ret_conv;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
- LDKMonitorUpdateError this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- LDKStr val_conv = java_to_owned_str(env, val);
- MonitorUpdateError_set_a(&this_ptr_conv, val_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new(JNIEnv *env, jclass clz, jstring a_arg) {
- LDKStr a_arg_conv = java_to_owned_str(env, a_arg);
- LDKMonitorUpdateError ret_var = MonitorUpdateError_new(a_arg_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-static inline uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg) {
- LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(arg);
-uint64_t ret_ref = 0;
-CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
-CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
-ret_ref = (uint64_t)ret_var.inner;
-if (ret_var.is_owned) {
- ret_ref |= 1;
-}
- return ret_ref;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
- LDKMonitorUpdateError arg_conv;
- arg_conv.inner = (void*)(arg & (~1));
- arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
- int64_t ret_val = MonitorUpdateError_clone_ptr(&arg_conv);
- return ret_val;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKMonitorUpdateError orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
- LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
*ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
return (uint64_t)ret_conv;
}
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = InMemorySigner_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) {
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKChannelDetails this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int64_t ret_val = ChannelDetails_get_balance_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKChannelDetails this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ChannelDetails_set_balance_msat(&this_ptr_conv, val);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ChannelDetails_set_is_public(&this_ptr_conv, val);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t short_channel_id_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t short_channel_id_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) {
LDKThirtyTwoBytes channel_id_arg_ref;
CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
(*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
CHECK_ACCESS(force_close_spend_delay_arg_ptr);
LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1));
- LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
+ LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (uint64_t)ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
+ ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t user_payment_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
CHECK_ACCESS(min_value_msat_ptr);
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
- LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
- *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
- return ((uint64_t)ret_conv);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
+ min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+ (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
+ min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t user_payment_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
- *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
+ *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+ (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+ LDKThirtyTwoBytes payment_secret_ref;
+ CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
+ (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
return (uint64_t)ret_conv;
}
OpenChannel_set_channel_flags(&this_ptr_conv, val);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKOpenChannel this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
+ uint64_t ret_ref = 0;
+ if ((uint64_t)ret_var.inner > 4096) {
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ }
+ return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKOpenChannel this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKChannelTypeFeatures val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
+ val_conv = ChannelTypeFeatures_clone(&val_conv);
+ OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
+}
+
static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
LDKOpenChannel ret_var = OpenChannel_clone(arg);
uint64_t ret_ref = 0;
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
- LDKTenBytes addr_ref;
- CHECK((*env)->GetArrayLength(env, addr) == 10);
- (*env)->GetByteArrayRegion(env, addr, 0, 10, addr_ref.data);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray a) {
+ LDKTwelveBytes a_ref;
+ CHECK((*env)->GetArrayLength(env, a) == 12);
+ (*env)->GetByteArrayRegion(env, a, 0, 12, a_ref.data);
LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
- *ret_copy = NetAddress_onion_v2(addr_ref, port);
+ *ret_copy = NetAddress_onion_v2(a_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip(JNIEnv *env, jclass clz) {
+ LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+ *ret_copy = ErrorAction_ignore_duplicate_gossip();
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) {
LDKErrorMessage msg_conv;
msg_conv.inner = (void*)(msg & (~1));
PeerManager_timer_tick_occurred(&this_arg_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
+ int64_t ret_val = htlc_success_tx_weight(opt_anchors);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
+ int64_t ret_val = htlc_timeout_tx_weight(opt_anchors);
+ return ret_val;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) {
unsigned char commitment_seed_arr[32];
CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
return (uint64_t)ret_conv;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv *env, jclass clz, int64_t htlc, int64_t keys) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv *env, jclass clz, int64_t htlc, jboolean opt_anchors, int64_t keys) {
LDKHTLCOutputInCommitment htlc_conv;
htlc_conv.inner = (void*)(htlc & (~1));
htlc_conv.is_owned = false;
keys_conv.inner = (void*)(keys & (~1));
keys_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
- LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv);
+ LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
CVec_u8Z_free(ret_var);
return ret_arr;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
unsigned char commitment_txid_arr[32];
CHECK((*env)->GetArrayLength(env, commitment_txid) == 32);
(*env)->GetByteArrayRegion(env, commitment_txid, 0, 32, commitment_txid_arr);
LDKPublicKey revocation_key_ref;
CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
(*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
- LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref);
+ LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
Transaction_free(ret_var);
return ret_arr;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript(JNIEnv *env, jclass clz, int8_tArray funding_pubkey) {
+ LDKPublicKey funding_pubkey_ref;
+ CHECK((*env)->GetArrayLength(env, funding_pubkey) == 33);
+ (*env)->GetByteArrayRegion(env, funding_pubkey, 0, 33, funding_pubkey_ref.compressed_form);
+ LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelTransactionParameters this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg) {
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKChannelTransactionParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
+ LDKChannelTransactionParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val);
+ ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg, jclass opt_anchors_arg) {
LDKChannelPublicKeys holder_pubkeys_arg_conv;
holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1));
holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0);
funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
- LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv);
+ LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_anchors_arg);
+ LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKDirectedChannelTransactionParameters this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKHolderCommitmentTransaction this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKTrustedCommitmentTransaction this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_base_key, int64_t channel_parameters) {
LDKTrustedCommitmentTransaction this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return ret_val;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelTypeFeatures a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ LDKChannelTypeFeatures b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ jboolean ret_val = ChannelTypeFeatures_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
LDKInitFeatures ret_var = InitFeatures_clone(arg);
uint64_t ret_ref = 0;
return ret_ref;
}
+static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+ ret_ref |= 1;
+}
+ return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKChannelTypeFeatures arg_conv;
+ arg_conv.inner = (void*)(arg & (~1));
+ arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ int64_t ret_val = ChannelTypeFeatures_clone_ptr(&arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKChannelTypeFeatures orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKInitFeatures this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
InvoiceFeatures_free(this_obj_conv);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKChannelTypeFeatures this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ ChannelTypeFeatures_free(this_obj_conv);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) {
LDKInitFeatures ret_var = InitFeatures_empty();
uint64_t ret_ref = 0;
return ret_val;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInitFeatures this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = InitFeatures_supports_payment_secret(&this_arg_conv);
- return ret_val;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKNodeFeatures this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = NodeFeatures_supports_payment_secret(&this_arg_conv);
- return ret_val;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known(JNIEnv *env, jclass clz) {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInvoiceFeatures this_arg_conv;
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKChannelTypeFeatures this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
+ jboolean ret_val = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
return ret_val;
}
return ret_arr;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKNodeFeatures obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
- int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
- CVec_u8Z_free(ret_var);
- return ret_arr;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*env)->GetArrayLength(env, ser);
+ ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = InitFeatures_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
return ret_arr;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKInvoiceFeatures obj_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*env)->GetArrayLength(env, ser);
+ ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
+ LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
+ *ret_conv = ChannelFeatures_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKNodeFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
+ LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
CVec_u8Z_free(ret_var);
return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
- LDKu8slice ser_ref;
- ser_ref.datalen = (*env)->GetArrayLength(env, ser);
- ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = InitFeatures_read(ser_ref);
- (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
- return (uint64_t)ret_conv;
-}
-
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKInvoiceFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
- LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
- *ret_conv = ChannelFeatures_read(ser_ref);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = InvoiceFeatures_read(ser_ref);
(*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKChannelTypeFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = InvoiceFeatures_read(ser_ref);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = ChannelTypeFeatures_read(ser_ref);
(*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
return (uint64_t)ret_conv;
}
Type_free(this_ptr_conv);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
- if ((this_ptr & 1) != 0) return;
- void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
- CHECK_ACCESS(this_ptr_ptr);
- LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
- FREE((void*)this_ptr);
- Score_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
- LDKLockableScore this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- LockableScore_free(this_obj_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1new(JNIEnv *env, jclass clz, int64_t score) {
- void* score_ptr = (void*)(((uint64_t)score) & ~1);
- CHECK_ACCESS(score_ptr);
- LDKScore score_conv = *(LDKScore*)(score_ptr);
- if (score_conv.free == LDKScore_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKScore_JCalls_cloned(&score_conv);
- }
- LDKLockableScore ret_var = LockableScore_new(score_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKLockableScore obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = LockableScore_write(&obj_conv);
- int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
- CVec_u8Z_free(ret_var);
- return ret_arr;
-}
-
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKNodeId this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *env, jclass clz, int64_t features_arg, int64_t node_one_arg, int64_t one_to_two_arg, int64_t node_two_arg, int64_t two_to_one_arg, int64_t capacity_sats_arg, int64_t announcement_message_arg) {
- LDKChannelFeatures features_arg_conv;
- features_arg_conv.inner = (void*)(features_arg & (~1));
- features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
- features_arg_conv = ChannelFeatures_clone(&features_arg_conv);
- LDKNodeId node_one_arg_conv;
- node_one_arg_conv.inner = (void*)(node_one_arg & (~1));
- node_one_arg_conv.is_owned = (node_one_arg & 1) || (node_one_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(node_one_arg_conv);
- node_one_arg_conv = NodeId_clone(&node_one_arg_conv);
- LDKDirectionalChannelInfo one_to_two_arg_conv;
- one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1));
- one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(one_to_two_arg_conv);
- one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv);
- LDKNodeId node_two_arg_conv;
- node_two_arg_conv.inner = (void*)(node_two_arg & (~1));
- node_two_arg_conv.is_owned = (node_two_arg & 1) || (node_two_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(node_two_arg_conv);
- node_two_arg_conv = NodeId_clone(&node_two_arg_conv);
- LDKDirectionalChannelInfo two_to_one_arg_conv;
- two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1));
- two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(two_to_one_arg_conv);
- two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv);
- void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1);
- CHECK_ACCESS(capacity_sats_arg_ptr);
- LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(capacity_sats_arg_ptr);
- capacity_sats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1));
- LDKChannelAnnouncement announcement_message_arg_conv;
- announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
- announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
- announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv);
- LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_conv, one_to_two_arg_conv, node_two_arg_conv, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
LDKChannelInfo ret_var = ChannelInfo_clone(arg);
uint64_t ret_ref = 0;
NetworkGraph_fail_node(&this_arg_conv, _node_id_ref, is_permanent);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) {
+ LDKNetworkGraph this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return (uint64_t)ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if ((this_ptr & 1) != 0) return;
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Score_free(this_ptr_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if ((this_ptr & 1) != 0) return;
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ LockableScore_free(this_ptr_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKMultiThreadedLockableScore this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ MultiThreadedLockableScore_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) {
+ void* score_ptr = (void*)(((uint64_t)score) & ~1);
+ CHECK_ACCESS(score_ptr);
+ LDKScore score_conv = *(LDKScore*)(score_ptr);
+ if (score_conv.free == LDKScore_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKScore_JCalls_cloned(&score_conv);
+ }
+ LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Scorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKScorer this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val);
}
+JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1start_11024th(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int16_t ret_val = ScoringParameters_get_overuse_penalty_start_1024th(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1start_11024th(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ScoringParameters_set_overuse_penalty_start_1024th(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1msat_1per_11024th(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int64_t ret_val = ScoringParameters_get_overuse_penalty_msat_per_1024th(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1msat_1per_11024th(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ScoringParameters_set_overuse_penalty_msat_per_1024th(&this_ptr_conv, val);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKScoringParameters this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIEnv *env, jclass clz, int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int64_t failure_penalty_half_life_arg) {
- LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, failure_penalty_half_life_arg);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIEnv *env, jclass clz, int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int16_t overuse_penalty_start_1024th_arg, int64_t overuse_penalty_msat_per_1024th_arg, int64_t failure_penalty_half_life_arg) {
+ LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return ret_conv;
}
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1invalid_1amount(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKCreationError_to_java(env, CreationError_invalid_amount());
+ return ret_conv;
+}
+
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
LDKCreationError* a_conv = (LDKCreationError*)(a & ~1);
LDKCreationError* b_conv = (LDKCreationError*)(b & ~1);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKRouter_JCalls_cloned(&router_conv);
}
- LDKLockableScore scorer_conv;
+ LDKMultiThreadedLockableScore scorer_conv;
scorer_conv.inner = (void*)(scorer & (~1));
scorer_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
return (uint64_t)ret_conv;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int64_t amount_msats, int32_t final_cltv_expiry_delta) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKPublicKey pubkey_ref;
+ CHECK((*env)->GetArrayLength(env, pubkey) == 33);
+ (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
+ LDKThirtyTwoBytes payment_preimage_ref;
+ CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
+ (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) {
LDKInvoicePayer this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
#include <stdatomic.h>
#include <stdlib.h>
+#define LIKELY(v) __builtin_expect(!!(v), 1)
+#define UNLIKELY(v) __builtin_expect(!!(v), 0)
+
#define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
#define MALLOC(a, _) malloc(a)
#define FREE(p) if ((uint64_t)(p) > 4096) { free(p); }
}
static inline struct LDKThirtyTwoBytes ThirtyTwoBytes_clone(const struct LDKThirtyTwoBytes *orig) { struct LDKThirtyTwoBytes ret; memcpy(ret.data, orig->data, 32); return ret; }
static inline LDKAccessError LDKAccessError_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to AccessError.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKAccessError_UnknownChain;
case 1: return LDKAccessError_UnknownTx;
}
- abort();
+ (*env)->FatalError(env, "A call to AccessError.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass AccessError_class = NULL;
static jfieldID AccessError_LDKAccessError_UnknownChain = NULL;
}
}
+static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_java(JNIEnv *env, jclass clz) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to COption_NoneZ.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
+ case 0: return LDKCOption_NoneZ_Some;
+ case 1: return LDKCOption_NoneZ_None;
+ }
+ (*env)->FatalError(env, "A call to COption_NoneZ.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
+}
+static jclass COption_NoneZ_class = NULL;
+static jfieldID COption_NoneZ_LDKCOption_NoneZ_Some = NULL;
+static jfieldID COption_NoneZ_LDKCOption_NoneZ_None = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_enums_COption_1NoneZ_init (JNIEnv *env, jclass clz) {
+ COption_NoneZ_class = (*env)->NewGlobalRef(env, clz);
+ CHECK(COption_NoneZ_class != NULL);
+ COption_NoneZ_LDKCOption_NoneZ_Some = (*env)->GetStaticFieldID(env, COption_NoneZ_class, "LDKCOption_NoneZ_Some", "Lorg/ldk/enums/COption_NoneZ;");
+ CHECK(COption_NoneZ_LDKCOption_NoneZ_Some != NULL);
+ COption_NoneZ_LDKCOption_NoneZ_None = (*env)->GetStaticFieldID(env, COption_NoneZ_class, "LDKCOption_NoneZ_None", "Lorg/ldk/enums/COption_NoneZ;");
+ CHECK(COption_NoneZ_LDKCOption_NoneZ_None != NULL);
+}
+static inline jclass LDKCOption_NoneZ_to_java(JNIEnv *env, LDKCOption_NoneZ val) {
+ switch (val) {
+ case LDKCOption_NoneZ_Some:
+ return (*env)->GetStaticObjectField(env, COption_NoneZ_class, COption_NoneZ_LDKCOption_NoneZ_Some);
+ case LDKCOption_NoneZ_None:
+ return (*env)->GetStaticObjectField(env, COption_NoneZ_class, COption_NoneZ_LDKCOption_NoneZ_None);
+ default: abort();
+ }
+}
+
static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to ChannelMonitorUpdateErr.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
}
- abort();
+ (*env)->FatalError(env, "A call to ChannelMonitorUpdateErr.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass ChannelMonitorUpdateErr_class = NULL;
static jfieldID ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = NULL;
}
static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKConfirmationTarget_Background;
case 1: return LDKConfirmationTarget_Normal;
case 2: return LDKConfirmationTarget_HighPriority;
}
- abort();
+ (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass ConfirmationTarget_class = NULL;
static jfieldID ConfirmationTarget_LDKConfirmationTarget_Background = NULL;
}
static inline LDKCreationError LDKCreationError_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to CreationError.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKCreationError_DescriptionTooLong;
case 1: return LDKCreationError_RouteTooLong;
case 2: return LDKCreationError_TimestampOutOfBounds;
case 3: return LDKCreationError_ExpiryTimeOutOfBounds;
+ case 4: return LDKCreationError_InvalidAmount;
}
- abort();
+ (*env)->FatalError(env, "A call to CreationError.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass CreationError_class = NULL;
static jfieldID CreationError_LDKCreationError_DescriptionTooLong = NULL;
static jfieldID CreationError_LDKCreationError_RouteTooLong = NULL;
static jfieldID CreationError_LDKCreationError_TimestampOutOfBounds = NULL;
static jfieldID CreationError_LDKCreationError_ExpiryTimeOutOfBounds = NULL;
+static jfieldID CreationError_LDKCreationError_InvalidAmount = NULL;
JNIEXPORT void JNICALL Java_org_ldk_enums_CreationError_init (JNIEnv *env, jclass clz) {
CreationError_class = (*env)->NewGlobalRef(env, clz);
CHECK(CreationError_class != NULL);
CHECK(CreationError_LDKCreationError_TimestampOutOfBounds != NULL);
CreationError_LDKCreationError_ExpiryTimeOutOfBounds = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_ExpiryTimeOutOfBounds", "Lorg/ldk/enums/CreationError;");
CHECK(CreationError_LDKCreationError_ExpiryTimeOutOfBounds != NULL);
+ CreationError_LDKCreationError_InvalidAmount = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_InvalidAmount", "Lorg/ldk/enums/CreationError;");
+ CHECK(CreationError_LDKCreationError_InvalidAmount != NULL);
}
static inline jclass LDKCreationError_to_java(JNIEnv *env, LDKCreationError val) {
switch (val) {
return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_TimestampOutOfBounds);
case LDKCreationError_ExpiryTimeOutOfBounds:
return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_ExpiryTimeOutOfBounds);
+ case LDKCreationError_InvalidAmount:
+ return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_InvalidAmount);
default: abort();
}
}
static inline LDKCurrency LDKCurrency_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to Currency.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKCurrency_Bitcoin;
case 1: return LDKCurrency_BitcoinTestnet;
case 2: return LDKCurrency_Regtest;
case 3: return LDKCurrency_Simnet;
case 4: return LDKCurrency_Signet;
}
- abort();
+ (*env)->FatalError(env, "A call to Currency.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass Currency_class = NULL;
static jfieldID Currency_LDKCurrency_Bitcoin = NULL;
}
static inline LDKIOError LDKIOError_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to IOError.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKIOError_NotFound;
case 1: return LDKIOError_PermissionDenied;
case 2: return LDKIOError_ConnectionRefused;
case 16: return LDKIOError_Other;
case 17: return LDKIOError_UnexpectedEof;
}
- abort();
+ (*env)->FatalError(env, "A call to IOError.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass IOError_class = NULL;
static jfieldID IOError_LDKIOError_NotFound = NULL;
}
static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
- case 0: return LDKLevel_Trace;
- case 1: return LDKLevel_Debug;
- case 2: return LDKLevel_Info;
- case 3: return LDKLevel_Warn;
- case 4: return LDKLevel_Error;
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to Level.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
+ case 0: return LDKLevel_Gossip;
+ case 1: return LDKLevel_Trace;
+ case 2: return LDKLevel_Debug;
+ case 3: return LDKLevel_Info;
+ case 4: return LDKLevel_Warn;
+ case 5: return LDKLevel_Error;
}
- abort();
+ (*env)->FatalError(env, "A call to Level.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass Level_class = NULL;
+static jfieldID Level_LDKLevel_Gossip = NULL;
static jfieldID Level_LDKLevel_Trace = NULL;
static jfieldID Level_LDKLevel_Debug = NULL;
static jfieldID Level_LDKLevel_Info = NULL;
JNIEXPORT void JNICALL Java_org_ldk_enums_Level_init (JNIEnv *env, jclass clz) {
Level_class = (*env)->NewGlobalRef(env, clz);
CHECK(Level_class != NULL);
+ Level_LDKLevel_Gossip = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Gossip", "Lorg/ldk/enums/Level;");
+ CHECK(Level_LDKLevel_Gossip != NULL);
Level_LDKLevel_Trace = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Trace", "Lorg/ldk/enums/Level;");
CHECK(Level_LDKLevel_Trace != NULL);
Level_LDKLevel_Debug = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Debug", "Lorg/ldk/enums/Level;");
}
static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
switch (val) {
+ case LDKLevel_Gossip:
+ return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Gossip);
case LDKLevel_Trace:
return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Trace);
case LDKLevel_Debug:
}
static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to Network.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKNetwork_Bitcoin;
case 1: return LDKNetwork_Testnet;
case 2: return LDKNetwork_Regtest;
case 3: return LDKNetwork_Signet;
}
- abort();
+ (*env)->FatalError(env, "A call to Network.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass Network_class = NULL;
static jfieldID Network_LDKNetwork_Bitcoin = NULL;
}
static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKSecp256k1Error_IncorrectSignature;
case 1: return LDKSecp256k1Error_InvalidMessage;
case 2: return LDKSecp256k1Error_InvalidPublicKey;
case 7: return LDKSecp256k1Error_TweakCheckFailed;
case 8: return LDKSecp256k1Error_NotEnoughMemory;
}
- abort();
+ (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass Secp256k1Error_class = NULL;
static jfieldID Secp256k1Error_LDKSecp256k1Error_IncorrectSignature = NULL;
}
static inline LDKSemanticError LDKSemanticError_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKSemanticError_NoPaymentHash;
case 1: return LDKSemanticError_MultiplePaymentHashes;
case 2: return LDKSemanticError_NoDescription;
case 8: return LDKSemanticError_InvalidSignature;
case 9: return LDKSemanticError_ImpreciseAmount;
}
- abort();
+ (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass SemanticError_class = NULL;
static jfieldID SemanticError_LDKSemanticError_NoPaymentHash = NULL;
}
static inline LDKSiPrefix LDKSiPrefix_from_java(JNIEnv *env, jclass clz) {
- switch ((*env)->CallIntMethod(env, clz, ordinal_meth)) {
+ jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust threw an exception.");
+ }
+ switch (ord) {
case 0: return LDKSiPrefix_Milli;
case 1: return LDKSiPrefix_Micro;
case 2: return LDKSiPrefix_Nano;
case 3: return LDKSiPrefix_Pico;
}
- abort();
+ (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust returned an invalid value.");
+ abort(); // Unreachable, but will let the compiler know we don't return here
}
static jclass SiPrefix_class = NULL;
static jfieldID SiPrefix_LDKSiPrefix_Milli = NULL;
static jmethodID LDKCOption_u32Z_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u32Z_init (JNIEnv *env, jclass clz) {
LDKCOption_u32Z_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u32Z$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$Some"));
CHECK(LDKCOption_u32Z_Some_class != NULL);
LDKCOption_u32Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_Some_class, "<init>", "(I)V");
CHECK(LDKCOption_u32Z_Some_meth != NULL);
LDKCOption_u32Z_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u32Z$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$None"));
CHECK(LDKCOption_u32Z_None_class != NULL);
LDKCOption_u32Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_None_class, "<init>", "()V");
CHECK(LDKCOption_u32Z_None_meth != NULL);
static jmethodID LDKCOption_u64Z_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u64Z_init (JNIEnv *env, jclass clz) {
LDKCOption_u64Z_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u64Z$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$Some"));
CHECK(LDKCOption_u64Z_Some_class != NULL);
LDKCOption_u64Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_u64Z_Some_meth != NULL);
LDKCOption_u64Z_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u64Z$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$None"));
CHECK(LDKCOption_u64Z_None_class != NULL);
LDKCOption_u64Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_None_class, "<init>", "()V");
CHECK(LDKCOption_u64Z_None_meth != NULL);
static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) {
LDKMonitorEvent_HTLCEvent_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent"));
CHECK(LDKMonitorEvent_HTLCEvent_class != NULL);
LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "<init>", "(J)V");
CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL);
LDKMonitorEvent_CommitmentTxConfirmed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed"));
CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL);
LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "<init>", "(J)V");
CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL);
LDKMonitorEvent_UpdateCompleted_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted"));
CHECK(LDKMonitorEvent_UpdateCompleted_class != NULL);
LDKMonitorEvent_UpdateCompleted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateCompleted_class, "<init>", "(JJ)V");
CHECK(LDKMonitorEvent_UpdateCompleted_meth != NULL);
LDKMonitorEvent_UpdateFailed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed"));
CHECK(LDKMonitorEvent_UpdateFailed_class != NULL);
LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "<init>", "(J)V");
CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL);
static jmethodID LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1usizeTransactionZZ_init (JNIEnv *env, jclass clz) {
LDKCOption_C2Tuple_usizeTransactionZZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$Some"));
CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_class != NULL);
LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_Some_meth != NULL);
LDKCOption_C2Tuple_usizeTransactionZZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_usizeTransactionZZ$None"));
CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_class != NULL);
LDKCOption_C2Tuple_usizeTransactionZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_usizeTransactionZZ_None_class, "<init>", "()V");
CHECK(LDKCOption_C2Tuple_usizeTransactionZZ_None_meth != NULL);
static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL;
static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL;
static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL;
+static jclass LDKClosureReason_FundingTimedOut_class = NULL;
+static jmethodID LDKClosureReason_FundingTimedOut_meth = NULL;
static jclass LDKClosureReason_ProcessingError_class = NULL;
static jmethodID LDKClosureReason_ProcessingError_meth = NULL;
static jclass LDKClosureReason_DisconnectedPeer_class = NULL;
static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) {
LDKClosureReason_CounterpartyForceClosed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed"));
CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL);
LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL);
LDKClosureReason_HolderForceClosed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$HolderForceClosed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$HolderForceClosed"));
CHECK(LDKClosureReason_HolderForceClosed_class != NULL);
LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "<init>", "()V");
CHECK(LDKClosureReason_HolderForceClosed_meth != NULL);
LDKClosureReason_CooperativeClosure_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CooperativeClosure;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CooperativeClosure"));
CHECK(LDKClosureReason_CooperativeClosure_class != NULL);
LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "<init>", "()V");
CHECK(LDKClosureReason_CooperativeClosure_meth != NULL);
LDKClosureReason_CommitmentTxConfirmed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed"));
CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL);
LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "<init>", "()V");
CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL);
+ LDKClosureReason_FundingTimedOut_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$FundingTimedOut"));
+ CHECK(LDKClosureReason_FundingTimedOut_class != NULL);
+ LDKClosureReason_FundingTimedOut_meth = (*env)->GetMethodID(env, LDKClosureReason_FundingTimedOut_class, "<init>", "()V");
+ CHECK(LDKClosureReason_FundingTimedOut_meth != NULL);
LDKClosureReason_ProcessingError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$ProcessingError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$ProcessingError"));
CHECK(LDKClosureReason_ProcessingError_class != NULL);
LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKClosureReason_ProcessingError_meth != NULL);
LDKClosureReason_DisconnectedPeer_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer"));
CHECK(LDKClosureReason_DisconnectedPeer_class != NULL);
LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "<init>", "()V");
CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL);
LDKClosureReason_OutdatedChannelManager_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager"));
CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL);
LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "<init>", "()V");
CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL);
case LDKClosureReason_CommitmentTxConfirmed: {
return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth);
}
+ case LDKClosureReason_FundingTimedOut: {
+ return (*env)->NewObject(env, LDKClosureReason_FundingTimedOut_class, LDKClosureReason_FundingTimedOut_meth);
+ }
case LDKClosureReason_ProcessingError: {
LDKStr err_str = obj->processing_error.err;
jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
static jmethodID LDKCOption_ClosureReasonZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init (JNIEnv *env, jclass clz) {
LDKCOption_ClosureReasonZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some"));
CHECK(LDKCOption_ClosureReasonZ_Some_class != NULL);
LDKCOption_ClosureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_ClosureReasonZ_Some_meth != NULL);
LDKCOption_ClosureReasonZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None"));
CHECK(LDKCOption_ClosureReasonZ_None_class != NULL);
LDKCOption_ClosureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_None_class, "<init>", "()V");
CHECK(LDKCOption_ClosureReasonZ_None_meth != NULL);
static jmethodID LDKNetworkUpdate_NodeFailure_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JNIEnv *env, jclass clz) {
LDKNetworkUpdate_ChannelUpdateMessage_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetworkUpdate$ChannelUpdateMessage;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelUpdateMessage"));
CHECK(LDKNetworkUpdate_ChannelUpdateMessage_class != NULL);
LDKNetworkUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelUpdateMessage_class, "<init>", "(J)V");
CHECK(LDKNetworkUpdate_ChannelUpdateMessage_meth != NULL);
LDKNetworkUpdate_ChannelClosed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetworkUpdate$ChannelClosed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelClosed"));
CHECK(LDKNetworkUpdate_ChannelClosed_class != NULL);
LDKNetworkUpdate_ChannelClosed_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelClosed_class, "<init>", "(JZ)V");
CHECK(LDKNetworkUpdate_ChannelClosed_meth != NULL);
LDKNetworkUpdate_NodeFailure_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetworkUpdate$NodeFailure;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$NodeFailure"));
CHECK(LDKNetworkUpdate_NodeFailure_class != NULL);
LDKNetworkUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_NodeFailure_class, "<init>", "([BZ)V");
CHECK(LDKNetworkUpdate_NodeFailure_meth != NULL);
static jmethodID LDKCOption_NetworkUpdateZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetworkUpdateZ_init (JNIEnv *env, jclass clz) {
LDKCOption_NetworkUpdateZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$Some"));
CHECK(LDKCOption_NetworkUpdateZ_Some_class != NULL);
LDKCOption_NetworkUpdateZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_NetworkUpdateZ_Some_meth != NULL);
LDKCOption_NetworkUpdateZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$None"));
CHECK(LDKCOption_NetworkUpdateZ_None_class != NULL);
LDKCOption_NetworkUpdateZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_None_class, "<init>", "()V");
CHECK(LDKCOption_NetworkUpdateZ_None_meth != NULL);
static jmethodID LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv *env, jclass clz) {
LDKSpendableOutputDescriptor_StaticOutput_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput"));
CHECK(LDKSpendableOutputDescriptor_StaticOutput_class != NULL);
LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "<init>", "(JJ)V");
CHECK(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL);
LDKSpendableOutputDescriptor_DelayedPaymentOutput_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$DelayedPaymentOutput;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$DelayedPaymentOutput"));
CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_class != NULL);
LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, "<init>", "(J)V");
CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth != NULL);
LDKSpendableOutputDescriptor_StaticPaymentOutput_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticPaymentOutput;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticPaymentOutput"));
CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_class != NULL);
LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, "<init>", "(J)V");
CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_meth != NULL);
static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) {
LDKPaymentPurpose_InvoicePayment_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment"));
CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL);
- LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[BJ)V");
+ LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[B)V");
CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL);
LDKPaymentPurpose_SpontaneousPayment_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment"));
CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL);
LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "<init>", "([B)V");
CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL);
(*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data);
int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data);
- return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id);
+ return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr);
}
case LDKPaymentPurpose_SpontaneousPayment: {
int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32);
static jmethodID LDKEvent_PaymentSent_meth = NULL;
static jclass LDKEvent_PaymentPathFailed_class = NULL;
static jmethodID LDKEvent_PaymentPathFailed_meth = NULL;
+static jclass LDKEvent_PaymentFailed_class = NULL;
+static jmethodID LDKEvent_PaymentFailed_meth = NULL;
static jclass LDKEvent_PendingHTLCsForwardable_class = NULL;
static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL;
static jclass LDKEvent_SpendableOutputs_class = NULL;
static jmethodID LDKEvent_ChannelClosed_meth = NULL;
static jclass LDKEvent_DiscardFunding_class = NULL;
static jmethodID LDKEvent_DiscardFunding_meth = NULL;
+static jclass LDKEvent_PaymentPathSuccessful_class = NULL;
+static jmethodID LDKEvent_PaymentPathSuccessful_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) {
LDKEvent_FundingGenerationReady_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingGenerationReady"));
CHECK(LDKEvent_FundingGenerationReady_class != NULL);
LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "<init>", "([BJ[BJ)V");
CHECK(LDKEvent_FundingGenerationReady_meth != NULL);
LDKEvent_PaymentReceived_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentReceived"));
CHECK(LDKEvent_PaymentReceived_class != NULL);
LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([BJJ)V");
CHECK(LDKEvent_PaymentReceived_meth != NULL);
LDKEvent_PaymentSent_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent"));
CHECK(LDKEvent_PaymentSent_class != NULL);
LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B[B[BJ)V");
CHECK(LDKEvent_PaymentSent_meth != NULL);
LDKEvent_PaymentPathFailed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentPathFailed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathFailed"));
CHECK(LDKEvent_PaymentPathFailed_class != NULL);
LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([B[BZJZ[JJJ)V");
CHECK(LDKEvent_PaymentPathFailed_meth != NULL);
+ LDKEvent_PaymentFailed_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentFailed"));
+ CHECK(LDKEvent_PaymentFailed_class != NULL);
+ LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "<init>", "([B[B)V");
+ CHECK(LDKEvent_PaymentFailed_meth != NULL);
LDKEvent_PendingHTLCsForwardable_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable"));
CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL);
LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "<init>", "(J)V");
CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL);
LDKEvent_SpendableOutputs_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$SpendableOutputs"));
CHECK(LDKEvent_SpendableOutputs_class != NULL);
LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "<init>", "([J)V");
CHECK(LDKEvent_SpendableOutputs_meth != NULL);
LDKEvent_PaymentForwarded_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentForwarded;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentForwarded"));
CHECK(LDKEvent_PaymentForwarded_class != NULL);
LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "<init>", "(JZ)V");
CHECK(LDKEvent_PaymentForwarded_meth != NULL);
LDKEvent_ChannelClosed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$ChannelClosed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed"));
CHECK(LDKEvent_ChannelClosed_class != NULL);
LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "<init>", "([BJJ)V");
CHECK(LDKEvent_ChannelClosed_meth != NULL);
LDKEvent_DiscardFunding_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$DiscardFunding;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding"));
CHECK(LDKEvent_DiscardFunding_class != NULL);
LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "<init>", "([B[B)V");
CHECK(LDKEvent_DiscardFunding_meth != NULL);
+ LDKEvent_PaymentPathSuccessful_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful"));
+ CHECK(LDKEvent_PaymentPathSuccessful_class != NULL);
+ LDKEvent_PaymentPathSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathSuccessful_class, "<init>", "([B[B[J)V");
+ CHECK(LDKEvent_PaymentPathSuccessful_meth != NULL);
}
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
LDKEvent *obj = (LDKEvent*)(ptr & ~1);
}
return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, obj->payment_path_failed.rejected_by_dest, network_update_ref, obj->payment_path_failed.all_paths_failed, path_arr, short_channel_id_ref, retry_ref);
}
+ case LDKEvent_PaymentFailed: {
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data);
+ int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data);
+ return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr);
+ }
case LDKEvent_PendingHTLCsForwardable: {
return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable);
}
(*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data);
return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr);
}
+ case LDKEvent_PaymentPathSuccessful: {
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_successful.payment_id.data);
+ int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_successful.payment_hash.data);
+ LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
+ int64_tArray path_arr = NULL;
+ path_arr = (*env)->NewLongArray(env, path_var.datalen);
+ int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
+ for (size_t k = 0; k < path_var.datalen; k++) {
+ LDKRouteHop path_conv_10_var = path_var.data[k];
+ uint64_t path_conv_10_ref = 0;
+ CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
+ path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
+ path_arr_ptr[k] = path_conv_10_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
+ return (*env)->NewObject(env, LDKEvent_PaymentPathSuccessful_class, LDKEvent_PaymentPathSuccessful_meth, payment_id_arr, payment_hash_arr, path_arr);
+ }
default: abort();
}
}
static jmethodID LDKCOption_EventZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init (JNIEnv *env, jclass clz) {
LDKCOption_EventZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$Some"));
CHECK(LDKCOption_EventZ_Some_class != NULL);
LDKCOption_EventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_EventZ_Some_meth != NULL);
LDKCOption_EventZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$None"));
CHECK(LDKCOption_EventZ_None_class != NULL);
LDKCOption_EventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_None_class, "<init>", "()V");
CHECK(LDKCOption_EventZ_None_meth != NULL);
static jmethodID LDKErrorAction_IgnoreError_meth = NULL;
static jclass LDKErrorAction_IgnoreAndLog_class = NULL;
static jmethodID LDKErrorAction_IgnoreAndLog_meth = NULL;
+static jclass LDKErrorAction_IgnoreDuplicateGossip_class = NULL;
+static jmethodID LDKErrorAction_IgnoreDuplicateGossip_meth = NULL;
static jclass LDKErrorAction_SendErrorMessage_class = NULL;
static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv *env, jclass clz) {
LDKErrorAction_DisconnectPeer_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$DisconnectPeer;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$DisconnectPeer"));
CHECK(LDKErrorAction_DisconnectPeer_class != NULL);
LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "<init>", "(J)V");
CHECK(LDKErrorAction_DisconnectPeer_meth != NULL);
LDKErrorAction_IgnoreError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$IgnoreError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreError"));
CHECK(LDKErrorAction_IgnoreError_class != NULL);
LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "<init>", "()V");
CHECK(LDKErrorAction_IgnoreError_meth != NULL);
LDKErrorAction_IgnoreAndLog_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$IgnoreAndLog;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreAndLog"));
CHECK(LDKErrorAction_IgnoreAndLog_class != NULL);
LDKErrorAction_IgnoreAndLog_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreAndLog_class, "<init>", "(Lorg/ldk/enums/Level;)V");
CHECK(LDKErrorAction_IgnoreAndLog_meth != NULL);
+ LDKErrorAction_IgnoreDuplicateGossip_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreDuplicateGossip"));
+ CHECK(LDKErrorAction_IgnoreDuplicateGossip_class != NULL);
+ LDKErrorAction_IgnoreDuplicateGossip_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreDuplicateGossip_class, "<init>", "()V");
+ CHECK(LDKErrorAction_IgnoreDuplicateGossip_meth != NULL);
LDKErrorAction_SendErrorMessage_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$SendErrorMessage;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$SendErrorMessage"));
CHECK(LDKErrorAction_SendErrorMessage_class != NULL);
LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "<init>", "(J)V");
CHECK(LDKErrorAction_SendErrorMessage_meth != NULL);
jclass ignore_and_log_conv = LDKLevel_to_java(env, obj->ignore_and_log);
return (*env)->NewObject(env, LDKErrorAction_IgnoreAndLog_class, LDKErrorAction_IgnoreAndLog_meth, ignore_and_log_conv);
}
+ case LDKErrorAction_IgnoreDuplicateGossip: {
+ return (*env)->NewObject(env, LDKErrorAction_IgnoreDuplicateGossip_class, LDKErrorAction_IgnoreDuplicateGossip_meth);
+ }
case LDKErrorAction_SendErrorMessage: {
LDKErrorMessage msg_var = obj->send_error_message.msg;
uint64_t msg_ref = 0;
static jmethodID LDKMessageSendEvent_SendReplyChannelRange_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv *env, jclass clz) {
LDKMessageSendEvent_SendAcceptChannel_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel"));
CHECK(LDKMessageSendEvent_SendAcceptChannel_class != NULL);
LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendAcceptChannel_meth != NULL);
LDKMessageSendEvent_SendOpenChannel_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel"));
CHECK(LDKMessageSendEvent_SendOpenChannel_class != NULL);
LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendOpenChannel_meth != NULL);
LDKMessageSendEvent_SendFundingCreated_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated"));
CHECK(LDKMessageSendEvent_SendFundingCreated_class != NULL);
LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendFundingCreated_meth != NULL);
LDKMessageSendEvent_SendFundingSigned_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned"));
CHECK(LDKMessageSendEvent_SendFundingSigned_class != NULL);
LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendFundingSigned_meth != NULL);
LDKMessageSendEvent_SendFundingLocked_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked"));
CHECK(LDKMessageSendEvent_SendFundingLocked_class != NULL);
LDKMessageSendEvent_SendFundingLocked_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingLocked_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendFundingLocked_meth != NULL);
LDKMessageSendEvent_SendAnnouncementSignatures_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures"));
CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL);
LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL);
LDKMessageSendEvent_UpdateHTLCs_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs"));
CHECK(LDKMessageSendEvent_UpdateHTLCs_class != NULL);
LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_UpdateHTLCs_meth != NULL);
LDKMessageSendEvent_SendRevokeAndACK_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK"));
CHECK(LDKMessageSendEvent_SendRevokeAndACK_class != NULL);
LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL);
LDKMessageSendEvent_SendClosingSigned_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned"));
CHECK(LDKMessageSendEvent_SendClosingSigned_class != NULL);
LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendClosingSigned_meth != NULL);
LDKMessageSendEvent_SendShutdown_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown"));
CHECK(LDKMessageSendEvent_SendShutdown_class != NULL);
LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendShutdown_meth != NULL);
LDKMessageSendEvent_SendChannelReestablish_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish"));
CHECK(LDKMessageSendEvent_SendChannelReestablish_class != NULL);
LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendChannelReestablish_meth != NULL);
LDKMessageSendEvent_BroadcastChannelAnnouncement_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement"));
CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL);
LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "<init>", "(JJ)V");
CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL);
LDKMessageSendEvent_BroadcastNodeAnnouncement_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement"));
CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_class != NULL);
LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, "<init>", "(J)V");
CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_meth != NULL);
LDKMessageSendEvent_BroadcastChannelUpdate_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate"));
CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL);
LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "<init>", "(J)V");
CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL);
LDKMessageSendEvent_SendChannelUpdate_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelUpdate;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelUpdate"));
CHECK(LDKMessageSendEvent_SendChannelUpdate_class != NULL);
LDKMessageSendEvent_SendChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelUpdate_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendChannelUpdate_meth != NULL);
LDKMessageSendEvent_HandleError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$HandleError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$HandleError"));
CHECK(LDKMessageSendEvent_HandleError_class != NULL);
LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_HandleError_meth != NULL);
LDKMessageSendEvent_SendChannelRangeQuery_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelRangeQuery;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelRangeQuery"));
CHECK(LDKMessageSendEvent_SendChannelRangeQuery_class != NULL);
LDKMessageSendEvent_SendChannelRangeQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelRangeQuery_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendChannelRangeQuery_meth != NULL);
LDKMessageSendEvent_SendShortIdsQuery_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendShortIdsQuery;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShortIdsQuery"));
CHECK(LDKMessageSendEvent_SendShortIdsQuery_class != NULL);
LDKMessageSendEvent_SendShortIdsQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShortIdsQuery_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendShortIdsQuery_meth != NULL);
LDKMessageSendEvent_SendReplyChannelRange_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendReplyChannelRange;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendReplyChannelRange"));
CHECK(LDKMessageSendEvent_SendReplyChannelRange_class != NULL);
LDKMessageSendEvent_SendReplyChannelRange_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendReplyChannelRange_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendReplyChannelRange_meth != NULL);
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKInitFeatures res_var = (*val->contents.result);
+ LDKScoringParameters res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKNodeFeatures res_var = (*val->contents.result);
+ LDKScorer res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ LDKDecodeError err_var = (*val->contents.err);
+ uint64_t err_ref = 0;
+ CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKInitFeatures res_var = (*val->contents.result);
+ uint64_t res_ref = 0;
+ CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
+ res_ref = (uint64_t)res_var.inner & ~1;
+ return res_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKInvoiceFeatures res_var = (*val->contents.result);
+ LDKNodeFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKScoringParameters res_var = (*val->contents.result);
+ LDKInvoiceFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ *val = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKScorer res_var = (*val->contents.result);
+ LDKChannelTypeFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ *val = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_per_commitment_point in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to release_commitment_secret in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_holder_commitment_meth, holder_tx_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to validate_holder_commitment in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to channel_keys_id in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_commitment_meth, commitment_tx_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_counterparty_commitment in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_counterparty_revocation_meth, idx, secret_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to validate_counterparty_revocation in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_holder_commitment_and_htlcs in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_output_meth, justice_tx_arr, input, amount, per_commitment_key_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_justice_revoked_output in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_htlc_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_justice_revoked_htlc in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_counterparty_htlc_transaction in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_closing_transaction_meth, closing_tx_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_closing_transaction in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_channel_announcement_meth, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_channel_announcement in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to ready_channel in LDKBaseSign from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to write in LDKSign from rust threw an exception.");
}
static jmethodID LDKCOption_u16Z_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u16Z_init (JNIEnv *env, jclass clz) {
LDKCOption_u16Z_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u16Z$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$Some"));
CHECK(LDKCOption_u16Z_Some_class != NULL);
LDKCOption_u16Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_Some_class, "<init>", "(S)V");
CHECK(LDKCOption_u16Z_Some_meth != NULL);
LDKCOption_u16Z_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_u16Z$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$None"));
CHECK(LDKCOption_u16Z_None_class != NULL);
LDKCOption_u16Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_None_class, "<init>", "()V");
CHECK(LDKCOption_u16Z_None_meth != NULL);
static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) {
LDKAPIError_APIMisuseError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$APIMisuseError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$APIMisuseError"));
CHECK(LDKAPIError_APIMisuseError_class != NULL);
LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKAPIError_APIMisuseError_meth != NULL);
LDKAPIError_FeeRateTooHigh_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh"));
CHECK(LDKAPIError_FeeRateTooHigh_class != NULL);
LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "<init>", "(Ljava/lang/String;I)V");
CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL);
LDKAPIError_RouteError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$RouteError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$RouteError"));
CHECK(LDKAPIError_RouteError_class != NULL);
LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKAPIError_RouteError_meth != NULL);
LDKAPIError_ChannelUnavailable_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$ChannelUnavailable;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable"));
CHECK(LDKAPIError_ChannelUnavailable_class != NULL);
LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKAPIError_ChannelUnavailable_meth != NULL);
LDKAPIError_MonitorUpdateFailed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed"));
CHECK(LDKAPIError_MonitorUpdateFailed_class != NULL);
LDKAPIError_MonitorUpdateFailed_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateFailed_class, "<init>", "()V");
CHECK(LDKAPIError_MonitorUpdateFailed_meth != NULL);
LDKAPIError_IncompatibleShutdownScript_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript"));
CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL);
LDKAPIError_IncompatibleShutdownScript_meth = (*env)->GetMethodID(env, LDKAPIError_IncompatibleShutdownScript_class, "<init>", "(J)V");
CHECK(LDKAPIError_IncompatibleShutdownScript_meth != NULL);
static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) {
LDKPaymentSendFailure_ParameterError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError"));
CHECK(LDKPaymentSendFailure_ParameterError_class != NULL);
LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "<init>", "(J)V");
CHECK(LDKPaymentSendFailure_ParameterError_meth != NULL);
LDKPaymentSendFailure_PathParameterError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError"));
CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL);
LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "<init>", "([J)V");
CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL);
LDKPaymentSendFailure_AllFailedRetrySafe_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedRetrySafe;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedRetrySafe"));
CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_class != NULL);
LDKPaymentSendFailure_AllFailedRetrySafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, "<init>", "([J)V");
CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_meth != NULL);
LDKPaymentSendFailure_PartialFailure_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure"));
CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL);
LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "([JJ[B)V");
CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL);
static jmethodID LDKNetAddress_OnionV3_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv *env, jclass clz) {
LDKNetAddress_IPv4_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv4;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv4"));
CHECK(LDKNetAddress_IPv4_class != NULL);
LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "<init>", "([BS)V");
CHECK(LDKNetAddress_IPv4_meth != NULL);
LDKNetAddress_IPv6_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv6;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv6"));
CHECK(LDKNetAddress_IPv6_class != NULL);
LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "<init>", "([BS)V");
CHECK(LDKNetAddress_IPv6_meth != NULL);
LDKNetAddress_OnionV2_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV2;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV2"));
CHECK(LDKNetAddress_OnionV2_class != NULL);
- LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "<init>", "([BS)V");
+ LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "<init>", "([B)V");
CHECK(LDKNetAddress_OnionV2_meth != NULL);
LDKNetAddress_OnionV3_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV3;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV3"));
CHECK(LDKNetAddress_OnionV3_class != NULL);
LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "<init>", "([BSBS)V");
CHECK(LDKNetAddress_OnionV3_meth != NULL);
return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, obj->i_pv6.port);
}
case LDKNetAddress_OnionV2: {
- int8_tArray addr_arr = (*env)->NewByteArray(env, 10);
- (*env)->SetByteArrayRegion(env, addr_arr, 0, 10, obj->onion_v2.addr.data);
- return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, addr_arr, obj->onion_v2.port);
+ int8_tArray onion_v2_arr = (*env)->NewByteArray(env, 12);
+ (*env)->SetByteArrayRegion(env, onion_v2_arr, 0, 12, obj->onion_v2.data);
+ return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, onion_v2_arr);
}
case LDKNetAddress_OnionV3: {
int8_tArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32);
return ret_arr;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKC2Tuple_PaymentHashPaymentSecretZ* res_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
+ *res_conv = (*val->contents.result);
+ *res_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(res_conv);
+ return ((uint64_t)res_conv);
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKC2Tuple_PaymentHashPaymentSecretZ* res_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
+ *res_conv = (*val->contents.result);
+ *res_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(res_conv);
+ return ((uint64_t)res_conv);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+ return err_ref;
+}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentSecretNoneZ *val = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ int8_tArray res_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, res_arr, 0, 32, (*val->contents.result).data);
+ return res_arr;
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentSecretNoneZ *val = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PaymentSecretAPIErrorZ *val = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1);
CHECK(val->result_ok);
uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentPreimageAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ *val = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ int8_tArray res_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, res_arr, 0, 32, (*val->contents.result).data);
+ return res_arr;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentPreimageAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ *val = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+ return err_ref;
+}
static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to release_pending_monitor_events in LDKWatch from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->broadcast_transaction_meth, tx_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to broadcast_transaction in LDKBroadcasterInterface from rust threw an exception.");
}
jmethodID get_secure_random_bytes_meth;
jmethodID read_chan_signer_meth;
jmethodID sign_invoice_meth;
+ jmethodID get_inbound_payment_key_material_meth;
} LDKKeysInterface_JCalls;
static void LDKKeysInterface_JCalls_free(void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_node_secret_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_node_secret in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_destination_script in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_shutdown_scriptpubkey_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_shutdown_scriptpubkey in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_channel_signer_meth, inbound, channel_value_satoshis);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_channel_signer in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_secure_random_bytes in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to read_chan_signer in LDKKeysInterface from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, invoice_preimage_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_invoice in LDKKeysInterface from rust threw an exception.");
}
}
return ret_conv;
}
+LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
+ LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_inbound_payment_key_material_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to get_inbound_payment_key_material in LDKKeysInterface from rust threw an exception.");
+ }
+ LDKThirtyTwoBytes ret_ref;
+ CHECK((*env)->GetArrayLength(env, ret) == 32);
+ (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_ref;
+}
static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
CHECK(calls->read_chan_signer_meth != NULL);
calls->sign_invoice_meth = (*env)->GetMethodID(env, c, "sign_invoice", "([B)J");
CHECK(calls->sign_invoice_meth != NULL);
+ calls->get_inbound_payment_key_material_meth = (*env)->GetMethodID(env, c, "get_inbound_payment_key_material", "()[B");
+ CHECK(calls->get_inbound_payment_key_material_meth != NULL);
LDKKeysInterface ret = {
.this_arg = (void*) calls,
.get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
.read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
.sign_invoice = sign_invoice_LDKKeysInterface_jcall,
+ .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
.free = LDKKeysInterface_JCalls_free,
};
return ret;
return (uint64_t)ret_conv;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1inbound_1payment_1key_1material(JNIEnv *env, jclass clz, int64_t this_arg) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data);
+ return ret_arr;
+}
+
typedef struct LDKFeeEstimator_JCalls {
atomic_size_t refcnt;
JavaVM *vm;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int32_t ret = (*env)->CallIntMethod(env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_est_sat_per_1000_weight in LDKFeeEstimator from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int16_t ret = (*env)->CallShortMethod(env, obj, j_calls->type_id_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to type_id in LDKType from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
jstring ret = (*env)->CallObjectMethod(env, obj, j_calls->debug_str_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to debug_str in LDKType from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to write in LDKType from rust threw an exception.");
}
static jmethodID LDKCOption_TypeZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1TypeZ_init (JNIEnv *env, jclass clz) {
LDKCOption_TypeZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_TypeZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$Some"));
CHECK(LDKCOption_TypeZ_Some_class != NULL);
LDKCOption_TypeZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_TypeZ_Some_meth != NULL);
LDKCOption_TypeZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_TypeZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$None"));
CHECK(LDKCOption_TypeZ_None_class != NULL);
LDKCOption_TypeZ_None_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_None_class, "<init>", "()V");
CHECK(LDKCOption_TypeZ_None_meth != NULL);
static jmethodID LDKPaymentError_Sending_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentError_init (JNIEnv *env, jclass clz) {
LDKPaymentError_Invoice_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentError$Invoice;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Invoice"));
CHECK(LDKPaymentError_Invoice_class != NULL);
LDKPaymentError_Invoice_meth = (*env)->GetMethodID(env, LDKPaymentError_Invoice_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKPaymentError_Invoice_meth != NULL);
LDKPaymentError_Routing_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentError$Routing;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Routing"));
CHECK(LDKPaymentError_Routing_class != NULL);
LDKPaymentError_Routing_meth = (*env)->GetMethodID(env, LDKPaymentError_Routing_class, "<init>", "(J)V");
CHECK(LDKPaymentError_Routing_meth != NULL);
LDKPaymentError_Sending_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentError$Sending;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Sending"));
CHECK(LDKPaymentError_Sending_class != NULL);
LDKPaymentError_Sending_meth = (*env)->GetMethodID(env, LDKPaymentError_Sending_class, "<init>", "(J)V");
CHECK(LDKPaymentError_Sending_meth != NULL);
static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) {
LDKCOption_MonitorEventZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some"));
CHECK(LDKCOption_MonitorEventZ_Some_class != NULL);
LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL);
LDKCOption_MonitorEventZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$None"));
CHECK(LDKCOption_MonitorEventZ_None_class != NULL);
LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "<init>", "()V");
CHECK(LDKCOption_MonitorEventZ_None_meth != NULL);
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- return *val->contents.result;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKMonitorUpdateError err_var = (*val->contents.err);
- uint64_t err_ref = 0;
- CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
- err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
return OutPoint_clone(&tuple->a);
}
static jmethodID LDKBalance_MaybeClaimableHTLCAwaitingTimeout_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBalance_init (JNIEnv *env, jclass clz) {
LDKBalance_ClaimableOnChannelClose_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKBalance$ClaimableOnChannelClose;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableOnChannelClose"));
CHECK(LDKBalance_ClaimableOnChannelClose_class != NULL);
LDKBalance_ClaimableOnChannelClose_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableOnChannelClose_class, "<init>", "(J)V");
CHECK(LDKBalance_ClaimableOnChannelClose_meth != NULL);
LDKBalance_ClaimableAwaitingConfirmations_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKBalance$ClaimableAwaitingConfirmations;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableAwaitingConfirmations"));
CHECK(LDKBalance_ClaimableAwaitingConfirmations_class != NULL);
LDKBalance_ClaimableAwaitingConfirmations_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableAwaitingConfirmations_class, "<init>", "(JI)V");
CHECK(LDKBalance_ClaimableAwaitingConfirmations_meth != NULL);
LDKBalance_ContentiousClaimable_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKBalance$ContentiousClaimable;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ContentiousClaimable"));
CHECK(LDKBalance_ContentiousClaimable_class != NULL);
LDKBalance_ContentiousClaimable_meth = (*env)->GetMethodID(env, LDKBalance_ContentiousClaimable_class, "<init>", "(JI)V");
CHECK(LDKBalance_ContentiousClaimable_meth != NULL);
LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKBalance$MaybeClaimableHTLCAwaitingTimeout;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybeClaimableHTLCAwaitingTimeout"));
CHECK(LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class != NULL);
LDKBalance_MaybeClaimableHTLCAwaitingTimeout_meth = (*env)->GetMethodID(env, LDKBalance_MaybeClaimableHTLCAwaitingTimeout_class, "<init>", "(JI)V");
CHECK(LDKBalance_MaybeClaimableHTLCAwaitingTimeout_meth != NULL);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception.");
}
static jmethodID LDKCOption_AccessZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1AccessZ_init (JNIEnv *env, jclass clz) {
LDKCOption_AccessZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_AccessZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$Some"));
CHECK(LDKCOption_AccessZ_Some_class != NULL);
LDKCOption_AccessZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_AccessZ_Some_meth != NULL);
LDKCOption_AccessZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_AccessZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_AccessZ$None"));
CHECK(LDKCOption_AccessZ_None_class != NULL);
LDKCOption_AccessZ_None_meth = (*env)->GetMethodID(env, LDKCOption_AccessZ_None_class, "<init>", "()V");
CHECK(LDKCOption_AccessZ_None_meth != NULL);
static jmethodID LDKCOption_CVec_NetAddressZZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1NetAddressZZ_init (JNIEnv *env, jclass clz) {
LDKCOption_CVec_NetAddressZZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some"));
CHECK(LDKCOption_CVec_NetAddressZZ_Some_class != NULL);
LDKCOption_CVec_NetAddressZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_Some_class, "<init>", "([J)V");
CHECK(LDKCOption_CVec_NetAddressZZ_Some_meth != NULL);
LDKCOption_CVec_NetAddressZZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None"));
CHECK(LDKCOption_CVec_NetAddressZZ_None_class != NULL);
LDKCOption_CVec_NetAddressZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_None_class, "<init>", "()V");
CHECK(LDKCOption_CVec_NetAddressZZ_None_meth != NULL);
static jmethodID LDKSignOrCreationError_CreationError_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSignOrCreationError_init (JNIEnv *env, jclass clz) {
LDKSignOrCreationError_SignError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSignOrCreationError$SignError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$SignError"));
CHECK(LDKSignOrCreationError_SignError_class != NULL);
LDKSignOrCreationError_SignError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_SignError_class, "<init>", "()V");
CHECK(LDKSignOrCreationError_SignError_meth != NULL);
LDKSignOrCreationError_CreationError_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSignOrCreationError$CreationError;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$CreationError"));
CHECK(LDKSignOrCreationError_CreationError_class != NULL);
LDKSignOrCreationError_CreationError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_CreationError_class, "<init>", "(Lorg/ldk/enums/CreationError;)V");
CHECK(LDKSignOrCreationError_CreationError_meth != NULL);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to register_tx in LDKFilter from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->register_output_meth, output_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to register_output in LDKFilter from rust threw an exception.");
}
static jmethodID LDKCOption_FilterZ_None_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1FilterZ_init (JNIEnv *env, jclass clz) {
LDKCOption_FilterZ_Some_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_FilterZ$Some;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$Some"));
CHECK(LDKCOption_FilterZ_Some_class != NULL);
LDKCOption_FilterZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_Some_class, "<init>", "(J)V");
CHECK(LDKCOption_FilterZ_Some_meth != NULL);
LDKCOption_FilterZ_None_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_FilterZ$None;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$None"));
CHECK(LDKCOption_FilterZ_None_class != NULL);
LDKCOption_FilterZ_None_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_None_class, "<init>", "()V");
CHECK(LDKCOption_FilterZ_None_meth != NULL);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_and_clear_pending_msg_events in LDKMessageSendEventsProvider from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, (uint64_t)ret_event);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->process_pending_events_meth, (uint64_t)handler_ret);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to process_pending_events in LDKEventsProvider from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_open_channel in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_accept_channel in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_funding_created in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_funding_signed in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_funding_locked in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, their_features_ref, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_shutdown in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_closing_signed in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_update_add_htlc in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_update_fulfill_htlc in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_update_fail_htlc in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_update_fail_malformed_htlc in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_commitment_signed in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_revoke_and_ack in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_update_fee in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_announcement_signatures in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to peer_disconnected in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to peer_connected in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_reestablish in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_update in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_error in LDKChannelMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_next_channel_announcements in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_next_node_announcements in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->sync_routing_table_meth, their_node_id_arr, init_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sync_routing_table in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_reply_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_reply_short_channel_ids_end in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_query_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_query_short_channel_ids in LDKRoutingMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_meth, message_type, buffer_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to read in LDKCustomMessageReader from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_custom_message_meth, (uint64_t)msg_ret, sender_node_id_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_custom_message in LDKCustomMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_and_clear_pending_msg in LDKCustomMessageHandler from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_data_meth, data_arr, resume_read);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to send_data in LDKSocketDescriptor from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->disconnect_socket_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to disconnect_socket in LDKSocketDescriptor from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->eq_meth, (uint64_t)other_arg_clone);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to eq in LDKSocketDescriptor from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->hash_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to hash in LDKSocketDescriptor from rust threw an exception.");
}
jweak o;
jmethodID channel_penalty_msat_meth;
jmethodID payment_path_failed_meth;
+ jmethodID payment_path_successful_meth;
jmethodID write_meth;
} LDKScore_JCalls;
static void LDKScore_JCalls_free(void* this_arg) {
FREE(j_calls);
}
}
-uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target) {
+uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, LDKCOption_u64Z channel_capacity_msat, const LDKNodeId * source, const LDKNodeId * target) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
} else {
DO_ASSERT(get_jenv_res == JNI_OK);
}
+ LDKCOption_u64Z *channel_capacity_msat_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *channel_capacity_msat_copy = channel_capacity_msat;
+ uint64_t channel_capacity_msat_ref = (uint64_t)channel_capacity_msat_copy;
LDKNodeId source_var = *source;
uint64_t source_ref = 0;
source_var = NodeId_clone(source);
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id, source_ref, target_ref);
- if ((*env)->ExceptionCheck(env)) {
+ int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id, send_amt_msat, channel_capacity_msat_ref, source_ref, target_ref);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
(*env)->CallVoidMethod(env, obj, j_calls->payment_path_failed_meth, path_arr, short_channel_id);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to payment_path_failed in LDKScore from rust threw an exception.");
}
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
}
+void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
+ LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ LDKCVec_RouteHopZ path_var = path;
+ int64_tArray path_arr = NULL;
+ path_arr = (*env)->NewLongArray(env, path_var.datalen);
+ int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL);
+ for (size_t k = 0; k < path_var.datalen; k++) {
+ LDKRouteHop path_conv_10_var = path_var.data[k];
+ uint64_t path_conv_10_ref = 0;
+ CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
+ path_conv_10_ref = (uint64_t)path_conv_10_var.inner;
+ if (path_conv_10_var.is_owned) {
+ path_conv_10_ref |= 1;
+ }
+ path_arr_ptr[k] = path_conv_10_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0);
+ FREE(path_var.data);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ (*env)->CallVoidMethod(env, obj, j_calls->payment_path_successful_meth, path_arr);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to payment_path_successful in LDKScore from rust threw an exception.");
+ }
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+}
LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
JNIEnv *env;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception.");
}
atomic_init(&calls->refcnt, 1);
DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
calls->o = (*env)->NewWeakGlobalRef(env, o);
- calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJ)J");
+ calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJJJ)J");
CHECK(calls->channel_penalty_msat_meth != NULL);
calls->payment_path_failed_meth = (*env)->GetMethodID(env, c, "payment_path_failed", "([JJ)V");
CHECK(calls->payment_path_failed_meth != NULL);
+ calls->payment_path_successful_meth = (*env)->GetMethodID(env, c, "payment_path_successful", "([J)V");
+ CHECK(calls->payment_path_successful_meth != NULL);
calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
CHECK(calls->write_meth != NULL);
.this_arg = (void*) calls,
.channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
.payment_path_failed = payment_path_failed_LDKScore_jcall,
+ .payment_path_successful = payment_path_successful_LDKScore_jcall,
.write = write_LDKScore_jcall,
.free = LDKScore_JCalls_free,
};
*res_ptr = LDKScore_init(env, clz, o);
return (uint64_t)res_ptr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t source, int64_t target) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id, int64_t send_amt_msat, int64_t channel_capacity_msat, int64_t source, int64_t target) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ void* channel_capacity_msat_ptr = (void*)(((uint64_t)channel_capacity_msat) & ~1);
+ CHECK_ACCESS(channel_capacity_msat_ptr);
+ LDKCOption_u64Z channel_capacity_msat_conv = *(LDKCOption_u64Z*)(channel_capacity_msat_ptr);
+ channel_capacity_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)channel_capacity_msat) & ~1));
LDKNodeId source_conv;
source_conv.inner = (void*)(source & (~1));
source_conv.is_owned = false;
target_conv.inner = (void*)(target & (~1));
target_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
- int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv);
+ int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, send_amt_msat, channel_capacity_msat_conv, &source_conv, &target_conv);
return ret_val;
}
(this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ LDKCVec_RouteHopZ path_constr;
+ path_constr.datalen = (*env)->GetArrayLength(env, path);
+ if (path_constr.datalen > 0)
+ path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ else
+ path_constr.data = NULL;
+ int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
+ for (size_t k = 0; k < path_constr.datalen; k++) {
+ int64_t path_conv_10 = path_vals[k];
+ LDKRouteHop path_conv_10_conv;
+ path_conv_10_conv.inner = (void*)(path_conv_10 & (~1));
+ path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
+ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
+ path_constr.data[k] = path_conv_10_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
+ (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Score_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
return ret_arr;
}
+typedef struct LDKLockableScore_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID lock_meth;
+} LDKLockableScore_JCalls;
+static void LDKLockableScore_JCalls_free(void* this_arg) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ (*env)->DeleteWeakGlobalRef(env, j_calls->o);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ FREE(j_calls);
+ }
+}
+LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->lock_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to lock in LDKLockableScore from rust threw an exception.");
+ }
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKScore ret_conv = *(LDKScore*)(ret_ptr);
+ if (ret_conv.free == LDKScore_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKScore_JCalls_cloned(&ret_conv);
+ }// Warning: we may need a move here but no clone is available for LDKScore
+
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
+static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKLockableScore LDKLockableScore_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
+ calls->o = (*env)->NewWeakGlobalRef(env, o);
+ calls->lock_meth = (*env)->GetMethodID(env, c, "lock", "()J");
+ CHECK(calls->lock_meth != NULL);
+
+ LDKLockableScore ret = {
+ .this_arg = (void*) calls,
+ .lock = lock_LDKLockableScore_jcall,
+ .free = LDKLockableScore_JCalls_free,
+ };
+ return ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLockableScore_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
+ *res_ptr = LDKLockableScore_init(env, clz, o);
+ return (uint64_t)res_ptr;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1lock(JNIEnv *env, jclass clz, int64_t this_arg) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
+ *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
+ return (uint64_t)ret_ret;
+}
+
typedef struct LDKChannelManagerPersister_JCalls {
atomic_size_t refcnt;
JavaVM *vm;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_manager in LDKChannelManagerPersister from rust threw an exception.");
}
static jmethodID LDKFallback_ScriptHash_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFallback_init (JNIEnv *env, jclass clz) {
LDKFallback_SegWitProgram_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKFallback$SegWitProgram;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$SegWitProgram"));
CHECK(LDKFallback_SegWitProgram_class != NULL);
LDKFallback_SegWitProgram_meth = (*env)->GetMethodID(env, LDKFallback_SegWitProgram_class, "<init>", "(B[B)V");
CHECK(LDKFallback_SegWitProgram_meth != NULL);
LDKFallback_PubKeyHash_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKFallback$PubKeyHash;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$PubKeyHash"));
CHECK(LDKFallback_PubKeyHash_class != NULL);
LDKFallback_PubKeyHash_meth = (*env)->GetMethodID(env, LDKFallback_PubKeyHash_class, "<init>", "([B)V");
CHECK(LDKFallback_PubKeyHash_meth != NULL);
LDKFallback_ScriptHash_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKFallback$ScriptHash;"));
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$ScriptHash"));
CHECK(LDKFallback_ScriptHash_class != NULL);
LDKFallback_ScriptHash_meth = (*env)->GetMethodID(env, LDKFallback_ScriptHash_class, "<init>", "([B)V");
CHECK(LDKFallback_ScriptHash_meth != NULL);
jmethodID node_id_meth;
jmethodID first_hops_meth;
jmethodID send_payment_meth;
+ jmethodID send_spontaneous_payment_meth;
jmethodID retry_payment_meth;
+ jmethodID abandon_payment_meth;
} LDKPayer_JCalls;
static void LDKPayer_JCalls_free(void* this_arg) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->node_id_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to node_id in LDKPayer from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->first_hops_meth);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to first_hops in LDKPayer from rust threw an exception.");
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_payment_meth, route_ref, payment_hash_arr, payment_secret_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to send_payment in LDKPayer from rust threw an exception.");
}
}
return ret_conv;
}
+LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ LDKRoute route_var = *route;
+ uint64_t route_ref = 0;
+ route_var = Route_clone(route);
+ CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_ref |= 1;
+ }
+ int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, payment_preimage.data);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_spontaneous_payment_meth, route_ref, payment_preimage_arr);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to send_spontaneous_payment in LDKPayer from rust threw an exception.");
+ }
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
+ FREE((void*)ret);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
JNIEnv *env;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->retry_payment_meth, route_ref, payment_id_arr);
- if ((*env)->ExceptionCheck(env)) {
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to retry_payment in LDKPayer from rust threw an exception.");
}
}
return ret_conv;
}
+void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ (*env)->CallVoidMethod(env, obj, j_calls->abandon_payment_meth, payment_id_arr);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to abandon_payment in LDKPayer from rust threw an exception.");
+ }
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+}
static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
CHECK(calls->first_hops_meth != NULL);
calls->send_payment_meth = (*env)->GetMethodID(env, c, "send_payment", "(J[B[B)J");
CHECK(calls->send_payment_meth != NULL);
+ calls->send_spontaneous_payment_meth = (*env)->GetMethodID(env, c, "send_spontaneous_payment", "(J[B)J");
+ CHECK(calls->send_spontaneous_payment_meth != NULL);
calls->retry_payment_meth = (*env)->GetMethodID(env, c, "retry_payment", "(J[B)J");
CHECK(calls->retry_payment_meth != NULL);
+ calls->abandon_payment_meth = (*env)->GetMethodID(env, c, "abandon_payment", "([B)V");
+ CHECK(calls->abandon_payment_meth != NULL);
LDKPayer ret = {
.this_arg = (void*) calls,
.node_id = node_id_LDKPayer_jcall,
.first_hops = first_hops_LDKPayer_jcall,
.send_payment = send_payment_LDKPayer_jcall,
+ .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
.retry_payment = retry_payment_LDKPayer_jcall,
+ .abandon_payment = abandon_payment_LDKPayer_jcall,
.free = LDKPayer_JCalls_free,
};
return ret;
return (uint64_t)ret_conv;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKRoute route_conv;
+ route_conv.inner = (void*)(route & (~1));
+ route_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
+ LDKThirtyTwoBytes payment_preimage_ref;
+ CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
+ (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
+ LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
return (uint64_t)ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
+ (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
+}
+
typedef struct LDKRouter_JCalls {
atomic_size_t refcnt;
JavaVM *vm;
FREE(j_calls);
}
}
-LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * params, LDKCVec_ChannelDetailsZ * first_hops, const LDKScore * scorer) {
+LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * params, const uint8_t (* payment_hash)[32], LDKCVec_ChannelDetailsZ * first_hops, const LDKScore * scorer) {
LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
if (params_var.is_owned) {
params_ref |= 1;
}
+ int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, *payment_hash);
LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
int64_tArray first_hops_arr = NULL;
if (first_hops != NULL) {
uint64_t ret_scorer = ((uint64_t)scorer) | 1;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, params_ref, first_hops_arr, ret_scorer);
- if ((*env)->ExceptionCheck(env)) {
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, params_ref, payment_hash_arr, first_hops_arr, ret_scorer);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception.");
}
atomic_init(&calls->refcnt, 1);
DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
calls->o = (*env)->NewWeakGlobalRef(env, o);
- calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[JJ)J");
+ calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[B[JJ)J");
CHECK(calls->find_route_meth != NULL);
LDKRouter ret = {
*res_ptr = LDKRouter_init(env, clz, o);
return (uint64_t)res_ptr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t params, int64_tArray first_hops, int64_t scorer) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t params, int8_tArray payment_hash, int64_tArray first_hops, int64_t scorer) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
params_conv.inner = (void*)(params & (~1));
params_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
+ unsigned char payment_hash_arr[32];
+ CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+ (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
+ unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
LDKCVec_ChannelDetailsZ first_hops_constr;
LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
if (first_hops != NULL) {
if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, ¶ms_conv, first_hops_ptr, scorer_conv);
+ *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, ¶ms_conv, payment_hash_ref, first_hops_ptr, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
return (uint64_t)ret_conv;
}
return (uint64_t)ret_conv;
}
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1some(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_some());
+ return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1none(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_none());
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1free(JNIEnv *env, jclass clz, jclass _res) {
+ LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_java(env, _res);
+ COption_NoneZ_free(_res_conv);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
LDKCounterpartyChannelTransactionParameters o_conv;
o_conv.inner = (void*)(o & (~1));
CVec_MessageSendEventZ_free(_res_constr);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKInitFeatures o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKScoringParameters o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = InitFeatures_clone(&o_conv);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
+ // Warning: we need a move here but no clone is available for LDKScoringParameters
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_ScoringParametersDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKNodeFeatures o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKScorer o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = NodeFeatures_clone(&o_conv);
- LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
- *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
+ // Warning: we need a move here but no clone is available for LDKScorer
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
- *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_ScorerDecodeErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKInitFeatures o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = InitFeatures_clone(&o_conv);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKInvoiceFeatures o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKNodeFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = InvoiceFeatures_clone(&o_conv);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
+ o_conv = NodeFeatures_clone(&o_conv);
+ LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKScoringParameters o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKInvoiceFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- // Warning: we need a move here but no clone is available for LDKScoringParameters
- LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
- *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv);
+ o_conv = InvoiceFeatures_clone(&o_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
- *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_ScoringParametersDecodeErrorZ_free(_res_conv);
+ CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKScorer o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKChannelTypeFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- // Warning: we need a move here but no clone is available for LDKScorer
- LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
- *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv);
+ o_conv = ChannelTypeFeatures_clone(&o_conv);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
- *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_ScorerDecodeErrorZ_free(_res_conv);
+ CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
+ o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err(JNIEnv *env, jclass clz) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(o & ~1);
+ jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(orig & ~1);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
+ o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
+ e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(orig & ~1);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK((*env)->GetArrayLength(env, o) == 32);
+ (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err(JNIEnv *env, jclass clz) {
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_err();
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)(o & ~1);
+ jboolean ret_val = CResult_PaymentSecretNoneZ_is_ok(o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentSecretNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ int64_t ret_val = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)(orig & ~1);
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
LDKThirtyTwoBytes o_ref;
CHECK((*env)->GetArrayLength(env, o) == 32);
return (uint64_t)ret_conv;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK((*env)->GetArrayLength(env, o) == 32);
+ (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
+ e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ int64_t ret_val = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(orig & ~1);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
LDKCVec_ChannelMonitorZ _res_constr;
_res_constr.datalen = (*env)->GetArrayLength(env, _res);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv *env, jclass clz) {
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_ok();
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKMonitorUpdateError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = MonitorUpdateError_clone(&e_conv);
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_NoneMonitorUpdateErrorZ* o_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(o & ~1);
- jboolean ret_val = CResult_NoneMonitorUpdateErrorZ_is_ok(o_conv);
- return ret_val;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
- if ((_res & 1) != 0) return;
- void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_NoneMonitorUpdateErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg) {
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(arg);
- return (uint64_t)ret_conv;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ* arg_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- int64_t ret_val = CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg_conv);
- return ret_val;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_NoneMonitorUpdateErrorZ* orig_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(orig & ~1);
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
*ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1invoice_1payment(JNIEnv *env, jclass clz, int8_tArray payment_preimage, int8_tArray payment_secret, int64_t user_payment_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1invoice_1payment(JNIEnv *env, jclass clz, int8_tArray payment_preimage, int8_tArray payment_secret) {
LDKThirtyTwoBytes payment_preimage_ref;
CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
(*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
(*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
- *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref, user_payment_id);
+ *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out(JNIEnv *env, jclass clz) {
+ LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
+ *ret_copy = ClosureReason_funding_timed_out();
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error(JNIEnv *env, jclass clz, jstring err) {
LDKStr err_conv = java_to_owned_str(env, err);
LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+ (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+ LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) {
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_tArray path) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+ (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+ LDKCVec_RouteHopZ path_constr;
+ path_constr.datalen = (*env)->GetArrayLength(env, path);
+ if (path_constr.datalen > 0)
+ path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ else
+ path_constr.data = NULL;
+ int64_t* path_vals = (*env)->GetLongArrayElements (env, path, NULL);
+ for (size_t k = 0; k < path_constr.datalen; k++) {
+ int64_t path_conv_10 = path_vals[k];
+ LDKRouteHop path_conv_10_conv;
+ path_conv_10_conv.inner = (void*)(path_conv_10 & (~1));
+ path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
+ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
+ path_constr.data[k] = path_conv_10_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
+ LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKEvent* obj_conv = (LDKEvent*)obj;
LDKCVec_u8Z ret_var = Event_write(obj_conv);
return ret_conv;
}
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1gossip(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKLevel_to_java(env, Level_gossip());
+ return ret_conv;
+}
+
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) {
jclass ret_conv = LDKLevel_to_java(env, Level_trace());
return ret_conv;
UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t own_channel_config_arg, int64_t peer_channel_config_limits_arg, int64_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg) {
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKUserConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ jboolean ret_val = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
+ LDKUserConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t own_channel_config_arg, int64_t peer_channel_config_limits_arg, int64_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg) {
LDKChannelHandshakeConfig own_channel_config_arg_conv;
own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1));
own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0);
channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv);
channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv);
- LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg);
+ LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (uint64_t)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
- LDKMonitorUpdateError this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- MonitorUpdateError_free(this_obj_conv);
-}
-
-JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKMonitorUpdateError this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- LDKStr ret_str = MonitorUpdateError_get_a(&this_ptr_conv);
- jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
- Str_free(ret_str);
- return ret_conv;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
- LDKMonitorUpdateError this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- LDKStr val_conv = java_to_owned_str(env, val);
- MonitorUpdateError_set_a(&this_ptr_conv, val_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new(JNIEnv *env, jclass clz, jstring a_arg) {
- LDKStr a_arg_conv = java_to_owned_str(env, a_arg);
- LDKMonitorUpdateError ret_var = MonitorUpdateError_new(a_arg_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-static inline uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg) {
- LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(arg);
-uint64_t ret_ref = 0;
-CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
-CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
-ret_ref = (uint64_t)ret_var.inner;
-if (ret_var.is_owned) {
- ret_ref |= 1;
-}
- return ret_ref;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
- LDKMonitorUpdateError arg_conv;
- arg_conv.inner = (void*)(arg & (~1));
- arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
- int64_t ret_val = MonitorUpdateError_clone_ptr(&arg_conv);
- return ret_val;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKMonitorUpdateError orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
- LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
*ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
return (uint64_t)ret_conv;
}
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = InMemorySigner_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) {
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKChannelDetails this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int64_t ret_val = ChannelDetails_get_balance_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKChannelDetails this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ChannelDetails_set_balance_msat(&this_ptr_conv, val);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ChannelDetails_set_is_public(&this_ptr_conv, val);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t short_channel_id_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t short_channel_id_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, int64_t confirmations_required_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) {
LDKThirtyTwoBytes channel_id_arg_ref;
CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
(*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
CHECK_ACCESS(force_close_spend_delay_arg_ptr);
LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1));
- LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
+ LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (uint64_t)ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
+ ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t user_payment_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
CHECK_ACCESS(min_value_msat_ptr);
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
- LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
- *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
- return ((uint64_t)ret_conv);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
+ min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+ (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
+ min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t user_payment_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash_1legacy(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t min_value_msat, int32_t invoice_expiry_delta_secs) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
- *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
+ *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+ (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+ LDKThirtyTwoBytes payment_secret_ref;
+ CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
+ (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
return (uint64_t)ret_conv;
}
OpenChannel_set_channel_flags(&this_ptr_conv, val);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKOpenChannel this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
+ uint64_t ret_ref = 0;
+ if ((uint64_t)ret_var.inner > 4096) {
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ }
+ return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKOpenChannel this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKChannelTypeFeatures val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
+ val_conv = ChannelTypeFeatures_clone(&val_conv);
+ OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
+}
+
static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
LDKOpenChannel ret_var = OpenChannel_clone(arg);
uint64_t ret_ref = 0;
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
- LDKTenBytes addr_ref;
- CHECK((*env)->GetArrayLength(env, addr) == 10);
- (*env)->GetByteArrayRegion(env, addr, 0, 10, addr_ref.data);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray a) {
+ LDKTwelveBytes a_ref;
+ CHECK((*env)->GetArrayLength(env, a) == 12);
+ (*env)->GetByteArrayRegion(env, a, 0, 12, a_ref.data);
LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
- *ret_copy = NetAddress_onion_v2(addr_ref, port);
+ *ret_copy = NetAddress_onion_v2(a_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip(JNIEnv *env, jclass clz) {
+ LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+ *ret_copy = ErrorAction_ignore_duplicate_gossip();
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) {
LDKErrorMessage msg_conv;
msg_conv.inner = (void*)(msg & (~1));
PeerManager_timer_tick_occurred(&this_arg_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
+ int64_t ret_val = htlc_success_tx_weight(opt_anchors);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
+ int64_t ret_val = htlc_timeout_tx_weight(opt_anchors);
+ return ret_val;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) {
unsigned char commitment_seed_arr[32];
CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
return (uint64_t)ret_conv;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv *env, jclass clz, int64_t htlc, int64_t keys) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv *env, jclass clz, int64_t htlc, jboolean opt_anchors, int64_t keys) {
LDKHTLCOutputInCommitment htlc_conv;
htlc_conv.inner = (void*)(htlc & (~1));
htlc_conv.is_owned = false;
keys_conv.inner = (void*)(keys & (~1));
keys_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
- LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv);
+ LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
CVec_u8Z_free(ret_var);
return ret_arr;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
unsigned char commitment_txid_arr[32];
CHECK((*env)->GetArrayLength(env, commitment_txid) == 32);
(*env)->GetByteArrayRegion(env, commitment_txid, 0, 32, commitment_txid_arr);
LDKPublicKey revocation_key_ref;
CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
(*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
- LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref);
+ LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
Transaction_free(ret_var);
return ret_arr;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript(JNIEnv *env, jclass clz, int8_tArray funding_pubkey) {
+ LDKPublicKey funding_pubkey_ref;
+ CHECK((*env)->GetArrayLength(env, funding_pubkey) == 33);
+ (*env)->GetByteArrayRegion(env, funding_pubkey, 0, 33, funding_pubkey_ref.compressed_form);
+ LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelTransactionParameters this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg) {
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKChannelTransactionParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
+ LDKChannelTransactionParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val);
+ ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg, jclass opt_anchors_arg) {
LDKChannelPublicKeys holder_pubkeys_arg_conv;
holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1));
holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0);
funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
- LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv);
+ LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_anchors_arg);
+ LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKDirectedChannelTransactionParameters this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKHolderCommitmentTransaction this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKTrustedCommitmentTransaction this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1get_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_base_key, int64_t channel_parameters) {
LDKTrustedCommitmentTransaction this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return ret_val;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelTypeFeatures a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ LDKChannelTypeFeatures b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ jboolean ret_val = ChannelTypeFeatures_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
LDKInitFeatures ret_var = InitFeatures_clone(arg);
uint64_t ret_ref = 0;
return ret_ref;
}
+static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+ ret_ref |= 1;
+}
+ return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKChannelTypeFeatures arg_conv;
+ arg_conv.inner = (void*)(arg & (~1));
+ arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ int64_t ret_val = ChannelTypeFeatures_clone_ptr(&arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKChannelTypeFeatures orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKInitFeatures this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
InvoiceFeatures_free(this_obj_conv);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKChannelTypeFeatures this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ ChannelTypeFeatures_free(this_obj_conv);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) {
LDKInitFeatures ret_var = InitFeatures_empty();
uint64_t ret_ref = 0;
return ret_val;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInitFeatures this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = InitFeatures_supports_payment_secret(&this_arg_conv);
- return ret_val;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKNodeFeatures this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = NodeFeatures_supports_payment_secret(&this_arg_conv);
- return ret_val;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known(JNIEnv *env, jclass clz) {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInvoiceFeatures this_arg_conv;
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKChannelTypeFeatures this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
+ jboolean ret_val = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
return ret_val;
}
return ret_arr;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKNodeFeatures obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
- int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
- CVec_u8Z_free(ret_var);
- return ret_arr;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*env)->GetArrayLength(env, ser);
+ ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = InitFeatures_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
return ret_arr;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKInvoiceFeatures obj_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*env)->GetArrayLength(env, ser);
+ ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
+ LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
+ *ret_conv = ChannelFeatures_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKNodeFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
+ LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
CVec_u8Z_free(ret_var);
return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
- LDKu8slice ser_ref;
- ser_ref.datalen = (*env)->GetArrayLength(env, ser);
- ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = InitFeatures_read(ser_ref);
- (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
- return (uint64_t)ret_conv;
-}
-
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKInvoiceFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
- LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
- *ret_conv = ChannelFeatures_read(ser_ref);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = InvoiceFeatures_read(ser_ref);
(*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKChannelTypeFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = InvoiceFeatures_read(ser_ref);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = ChannelTypeFeatures_read(ser_ref);
(*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
return (uint64_t)ret_conv;
}
Type_free(this_ptr_conv);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
- if ((this_ptr & 1) != 0) return;
- void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
- CHECK_ACCESS(this_ptr_ptr);
- LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
- FREE((void*)this_ptr);
- Score_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
- LDKLockableScore this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- LockableScore_free(this_obj_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1new(JNIEnv *env, jclass clz, int64_t score) {
- void* score_ptr = (void*)(((uint64_t)score) & ~1);
- CHECK_ACCESS(score_ptr);
- LDKScore score_conv = *(LDKScore*)(score_ptr);
- if (score_conv.free == LDKScore_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKScore_JCalls_cloned(&score_conv);
- }
- LDKLockableScore ret_var = LockableScore_new(score_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKLockableScore obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = LockableScore_write(&obj_conv);
- int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
- CVec_u8Z_free(ret_var);
- return ret_arr;
-}
-
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKNodeId this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *env, jclass clz, int64_t features_arg, int64_t node_one_arg, int64_t one_to_two_arg, int64_t node_two_arg, int64_t two_to_one_arg, int64_t capacity_sats_arg, int64_t announcement_message_arg) {
- LDKChannelFeatures features_arg_conv;
- features_arg_conv.inner = (void*)(features_arg & (~1));
- features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
- features_arg_conv = ChannelFeatures_clone(&features_arg_conv);
- LDKNodeId node_one_arg_conv;
- node_one_arg_conv.inner = (void*)(node_one_arg & (~1));
- node_one_arg_conv.is_owned = (node_one_arg & 1) || (node_one_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(node_one_arg_conv);
- node_one_arg_conv = NodeId_clone(&node_one_arg_conv);
- LDKDirectionalChannelInfo one_to_two_arg_conv;
- one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1));
- one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(one_to_two_arg_conv);
- one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv);
- LDKNodeId node_two_arg_conv;
- node_two_arg_conv.inner = (void*)(node_two_arg & (~1));
- node_two_arg_conv.is_owned = (node_two_arg & 1) || (node_two_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(node_two_arg_conv);
- node_two_arg_conv = NodeId_clone(&node_two_arg_conv);
- LDKDirectionalChannelInfo two_to_one_arg_conv;
- two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1));
- two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(two_to_one_arg_conv);
- two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv);
- void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1);
- CHECK_ACCESS(capacity_sats_arg_ptr);
- LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(capacity_sats_arg_ptr);
- capacity_sats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1));
- LDKChannelAnnouncement announcement_message_arg_conv;
- announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
- announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
- announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv);
- LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_conv, one_to_two_arg_conv, node_two_arg_conv, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
LDKChannelInfo ret_var = ChannelInfo_clone(arg);
uint64_t ret_ref = 0;
NetworkGraph_fail_node(&this_arg_conv, _node_id_ref, is_permanent);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) {
+ LDKNetworkGraph this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return (uint64_t)ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if ((this_ptr & 1) != 0) return;
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Score_free(this_ptr_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if ((this_ptr & 1) != 0) return;
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ LockableScore_free(this_ptr_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKMultiThreadedLockableScore this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ MultiThreadedLockableScore_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) {
+ void* score_ptr = (void*)(((uint64_t)score) & ~1);
+ CHECK_ACCESS(score_ptr);
+ LDKScore score_conv = *(LDKScore*)(score_ptr);
+ if (score_conv.free == LDKScore_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKScore_JCalls_cloned(&score_conv);
+ }
+ LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Scorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKScorer this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val);
}
+JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1start_11024th(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int16_t ret_val = ScoringParameters_get_overuse_penalty_start_1024th(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1start_11024th(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ScoringParameters_set_overuse_penalty_start_1024th(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1msat_1per_11024th(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int64_t ret_val = ScoringParameters_get_overuse_penalty_msat_per_1024th(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1msat_1per_11024th(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ScoringParameters_set_overuse_penalty_msat_per_1024th(&this_ptr_conv, val);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKScoringParameters this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIEnv *env, jclass clz, int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int64_t failure_penalty_half_life_arg) {
- LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, failure_penalty_half_life_arg);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIEnv *env, jclass clz, int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int16_t overuse_penalty_start_1024th_arg, int64_t overuse_penalty_msat_per_1024th_arg, int64_t failure_penalty_half_life_arg) {
+ LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return ret_conv;
}
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1invalid_1amount(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKCreationError_to_java(env, CreationError_invalid_amount());
+ return ret_conv;
+}
+
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
LDKCreationError* a_conv = (LDKCreationError*)(a & ~1);
LDKCreationError* b_conv = (LDKCreationError*)(b & ~1);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKRouter_JCalls_cloned(&router_conv);
}
- LDKLockableScore scorer_conv;
+ LDKMultiThreadedLockableScore scorer_conv;
scorer_conv.inner = (void*)(scorer & (~1));
scorer_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
return (uint64_t)ret_conv;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int64_t amount_msats, int32_t final_cltv_expiry_delta) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKPublicKey pubkey_ref;
+ CHECK((*env)->GetArrayLength(env, pubkey) == 33);
+ (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
+ LDKThirtyTwoBytes payment_preimage_ref;
+ CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
+ (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) {
LDKInvoicePayer this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_enums_COption_NoneZ */
+
+#ifndef _Included_org_ldk_enums_COption_NoneZ
+#define _Included_org_ldk_enums_COption_NoneZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_enums_COption_NoneZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_enums_COption_1NoneZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_InitFeaturesDecodeErrorZ_get_ok
+ * Method: LDKCResult_ScoringParametersDecodeErrorZ_get_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_InitFeaturesDecodeErrorZ_get_err
+ * Method: LDKCResult_ScoringParametersDecodeErrorZ_get_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_NodeFeaturesDecodeErrorZ_get_ok
+ * Method: LDKCResult_ScorerDecodeErrorZ_get_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_NodeFeaturesDecodeErrorZ_get_err
+ * Method: LDKCResult_ScorerDecodeErrorZ_get_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_InitFeaturesDecodeErrorZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_InitFeaturesDecodeErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
/*
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok
+ * Method: LDKCResult_NodeFeaturesDecodeErrorZ_get_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err
+ * Method: LDKCResult_NodeFeaturesDecodeErrorZ_get_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_ScoringParametersDecodeErrorZ_get_ok
+ * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_ScoringParametersDecodeErrorZ_get_err
+ * Method: LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_ScorerDecodeErrorZ_get_ok
+ * Method: LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_ScorerDecodeErrorZ_get_err
+ * Method: LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
/*
JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1get_1b
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_PaymentSecretNoneZ_get_ok
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretNoneZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_PaymentSecretNoneZ_get_err
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretNoneZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKCResult_PaymentSecretAPIErrorZ_get_ok
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_PaymentPreimageAPIErrorZ_get_ok
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentPreimageAPIErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_PaymentPreimageAPIErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentPreimageAPIErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKWatch_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1sign_1invoice
(JNIEnv *, jclass, jlong, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: KeysInterface_get_inbound_payment_key_material
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1inbound_1payment_1key_1material
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKFeeEstimator_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_NoneMonitorUpdateErrorZ_get_ok
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_NoneMonitorUpdateErrorZ_get_err
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1err
- (JNIEnv *, jclass, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_OutPointScriptZ_get_a
/*
* Class: org_ldk_impl_bindings
* Method: Score_channel_penalty_msat
- * Signature: (JJJJ)J
+ * Signature: (JJJJJJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat
- (JNIEnv *, jclass, jlong, jlong, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed
(JNIEnv *, jclass, jlong, jlongArray, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Score_payment_path_successful
+ * Signature: (J[J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful
+ (JNIEnv *, jclass, jlong, jlongArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: Score_write
JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Score_1write
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKLockableScore_new
+ * Signature: (Lorg/ldk/impl/bindings/LDKLockableScore;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLockableScore_1new
+ (JNIEnv *, jclass, jobject);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LockableScore_lock
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockableScore_1lock
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKChannelManagerPersister_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payer_1send_1payment
(JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payer_send_spontaneous_payment
+ * Signature: (JJ[B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payer_1send_1spontaneous_1payment
+ (JNIEnv *, jclass, jlong, jlong, jbyteArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: Payer_retry_payment
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment
(JNIEnv *, jclass, jlong, jlong, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payer_abandon_payment
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1abandon_1payment
+ (JNIEnv *, jclass, jlong, jbyteArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKRouter_new
/*
* Class: org_ldk_impl_bindings
* Method: Router_find_route
- * Signature: (J[BJ[JJ)J
+ * Signature: (J[BJ[B[JJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1find_1route
- (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlongArray, jlong);
+ (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlongArray, jlong);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: COption_NoneZ_some
+ * Signature: ()Lorg/ldk/enums/COption_NoneZ;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1some
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: COption_NoneZ_none
+ * Signature: ()Lorg/ldk/enums/COption_NoneZ;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1none
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: COption_NoneZ_free
+ * Signature: (Lorg/ldk/enums/COption_NoneZ;)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1free
+ (JNIEnv *, jclass, jobject);
+
/*
* Class: org_ldk_impl_bindings
* Method: CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InitFeaturesDecodeErrorZ_ok
+ * Method: CResult_ScoringParametersDecodeErrorZ_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InitFeaturesDecodeErrorZ_err
+ * Method: CResult_ScoringParametersDecodeErrorZ_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InitFeaturesDecodeErrorZ_is_ok
+ * Method: CResult_ScoringParametersDecodeErrorZ_is_ok
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InitFeaturesDecodeErrorZ_free
+ * Method: CResult_ScoringParametersDecodeErrorZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_NodeFeaturesDecodeErrorZ_ok
+ * Method: CResult_ScorerDecodeErrorZ_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_NodeFeaturesDecodeErrorZ_err
+ * Method: CResult_ScorerDecodeErrorZ_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_NodeFeaturesDecodeErrorZ_is_ok
+ * Method: CResult_ScorerDecodeErrorZ_is_ok
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_NodeFeaturesDecodeErrorZ_free
+ * Method: CResult_ScorerDecodeErrorZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_InitFeaturesDecodeErrorZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_InitFeaturesDecodeErrorZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_InitFeaturesDecodeErrorZ_is_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_InitFeaturesDecodeErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
/*
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InvoiceFeaturesDecodeErrorZ_ok
+ * Method: CResult_NodeFeaturesDecodeErrorZ_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InvoiceFeaturesDecodeErrorZ_err
+ * Method: CResult_NodeFeaturesDecodeErrorZ_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InvoiceFeaturesDecodeErrorZ_is_ok
+ * Method: CResult_NodeFeaturesDecodeErrorZ_is_ok
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InvoiceFeaturesDecodeErrorZ_free
+ * Method: CResult_NodeFeaturesDecodeErrorZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ScoringParametersDecodeErrorZ_ok
+ * Method: CResult_InvoiceFeaturesDecodeErrorZ_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ScoringParametersDecodeErrorZ_err
+ * Method: CResult_InvoiceFeaturesDecodeErrorZ_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ScoringParametersDecodeErrorZ_is_ok
+ * Method: CResult_InvoiceFeaturesDecodeErrorZ_is_ok
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ScoringParametersDecodeErrorZ_free
+ * Method: CResult_InvoiceFeaturesDecodeErrorZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ScorerDecodeErrorZ_ok
+ * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ScorerDecodeErrorZ_err
+ * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ScorerDecodeErrorZ_is_ok
+ * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ScorerDecodeErrorZ_free
+ * Method: CResult_ChannelTypeFeaturesDecodeErrorZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
/*
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_NonePaymentSendFailureZ_err
- * Signature: (J)J
+ * Method: CResult_NonePaymentSendFailureZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_NonePaymentSendFailureZ_is_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_NonePaymentSendFailureZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_NonePaymentSendFailureZ_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_NonePaymentSendFailureZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: C2Tuple_PaymentHashPaymentIdZ_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: C2Tuple_PaymentHashPaymentIdZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: C2Tuple_PaymentHashPaymentIdZ_new
+ * Signature: ([B[B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new
+ (JNIEnv *, jclass, jbyteArray, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: C2Tuple_PaymentHashPaymentIdZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CVec_NetAddressZ_free
+ * Signature: ([J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free
+ (JNIEnv *, jclass, jlongArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: C2Tuple_PaymentHashPaymentSecretZ_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: C2Tuple_PaymentHashPaymentSecretZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: C2Tuple_PaymentHashPaymentSecretZ_new
+ * Signature: ([B[B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new
+ (JNIEnv *, jclass, jbyteArray, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: C2Tuple_PaymentHashPaymentSecretZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err
+ * Signature: ()J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err
- (JNIEnv *, jclass, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err
+ (JNIEnv *, jclass);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_NonePaymentSendFailureZ_is_ok
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_NonePaymentSendFailureZ_free
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_NonePaymentSendFailureZ_clone_ptr
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_NonePaymentSendFailureZ_clone
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: C2Tuple_PaymentHashPaymentIdZ_clone_ptr
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: C2Tuple_PaymentHashPaymentIdZ_clone
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: C2Tuple_PaymentHashPaymentIdZ_new
- * Signature: ([B[B)J
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok
+ * Signature: (J)Z
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new
- (JNIEnv *, jclass, jbyteArray, jbyteArray);
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok
+ (JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: C2Tuple_PaymentHashPaymentIdZ_free
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err
+ * Method: CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok
+ * Method: CResult_PaymentSecretNoneZ_ok
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1ok
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PaymentSecretNoneZ_err
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PaymentSecretNoneZ_is_ok
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free
+ * Method: CResult_PaymentSecretNoneZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr
+ * Method: CResult_PaymentSecretNoneZ_clone_ptr
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone
+ * Method: CResult_PaymentSecretNoneZ_clone
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CVec_NetAddressZ_free
- * Signature: ([J)V
+ * Method: CResult_PaymentSecretAPIErrorZ_ok
+ * Signature: ([B)J
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free
- (JNIEnv *, jclass, jlongArray);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1ok
+ (JNIEnv *, jclass, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: C2Tuple_PaymentHashPaymentSecretZ_clone_ptr
+ * Method: CResult_PaymentSecretAPIErrorZ_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: C2Tuple_PaymentHashPaymentSecretZ_clone
- * Signature: (J)J
+ * Method: CResult_PaymentSecretAPIErrorZ_is_ok
+ * Signature: (J)Z
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: C2Tuple_PaymentHashPaymentSecretZ_new
- * Signature: ([B[B)J
+ * Method: CResult_PaymentSecretAPIErrorZ_free
+ * Signature: (J)V
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new
- (JNIEnv *, jclass, jbyteArray, jbyteArray);
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free
+ (JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: C2Tuple_PaymentHashPaymentSecretZ_free
- * Signature: (J)V
+ * Method: CResult_PaymentSecretAPIErrorZ_clone_ptr
+ * Signature: (J)J
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_PaymentSecretAPIErrorZ_ok
+ * Method: CResult_PaymentSecretAPIErrorZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PaymentPreimageAPIErrorZ_ok
* Signature: ([B)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1ok
(JNIEnv *, jclass, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_PaymentSecretAPIErrorZ_err
+ * Method: CResult_PaymentPreimageAPIErrorZ_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_PaymentSecretAPIErrorZ_is_ok
+ * Method: CResult_PaymentPreimageAPIErrorZ_is_ok
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_PaymentSecretAPIErrorZ_free
+ * Method: CResult_PaymentPreimageAPIErrorZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_PaymentSecretAPIErrorZ_clone_ptr
+ * Method: CResult_PaymentPreimageAPIErrorZ_clone_ptr
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_PaymentSecretAPIErrorZ_clone
+ * Method: CResult_PaymentPreimageAPIErrorZ_clone
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone
(JNIEnv *, jclass, jlong);
/*
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneMonitorUpdateErrorZ_ok
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok
- (JNIEnv *, jclass);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneMonitorUpdateErrorZ_err
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneMonitorUpdateErrorZ_is_ok
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1is_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneMonitorUpdateErrorZ_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneMonitorUpdateErrorZ_clone_ptr
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone_1ptr
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneMonitorUpdateErrorZ_clone
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone
- (JNIEnv *, jclass, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_OutPointScriptZ_clone_ptr
/*
* Class: org_ldk_impl_bindings
* Method: PaymentPurpose_invoice_payment
- * Signature: ([B[BJ)J
+ * Signature: ([B[B)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1invoice_1payment
- (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong);
+ (JNIEnv *, jclass, jbyteArray, jbyteArray);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed
(JNIEnv *, jclass);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ClosureReason_funding_timed_out
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out
+ (JNIEnv *, jclass);
+
/*
* Class: org_ldk_impl_bindings
* Method: ClosureReason_processing_error
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed
(JNIEnv *, jclass, jbyteArray, jbyteArray, jboolean, jlong, jboolean, jlongArray, jlong, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Event_payment_failed
+ * Signature: ([B[B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed
+ (JNIEnv *, jclass, jbyteArray, jbyteArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: Event_pending_htlcs_forwardable
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding
(JNIEnv *, jclass, jbyteArray, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Event_payment_path_successful
+ * Signature: ([B[B[J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1successful
+ (JNIEnv *, jclass, jbyteArray, jbyteArray, jlongArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: Event_write
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Level_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Level_gossip
+ * Signature: ()Lorg/ldk/enums/Level;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Level_1gossip
+ (JNIEnv *, jclass);
+
/*
* Class: org_ldk_impl_bindings
* Method: Level_trace
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwards_1to_1priv_1channels
(JNIEnv *, jclass, jlong, jboolean);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: UserConfig_get_accept_inbound_channels
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: UserConfig_set_accept_inbound_channels
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels
+ (JNIEnv *, jclass, jlong, jboolean);
+
/*
* Class: org_ldk_impl_bindings
* Method: UserConfig_new
- * Signature: (JJJZ)J
+ * Signature: (JJJZZ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1new
- (JNIEnv *, jclass, jlong, jlong, jlong, jboolean);
+ (JNIEnv *, jclass, jlong, jlong, jlong, jboolean, jboolean);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read
(JNIEnv *, jclass, jbyteArray);
-/*
- * Class: org_ldk_impl_bindings
- * Method: MonitorUpdateError_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: MonitorUpdateError_get_a
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1get_1a
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: MonitorUpdateError_set_a
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1set_1a
- (JNIEnv *, jclass, jlong, jstring);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: MonitorUpdateError_new
- * Signature: (Ljava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new
- (JNIEnv *, jclass, jstring);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: MonitorUpdateError_clone_ptr
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone_1ptr
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: MonitorUpdateError_clone
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone
- (JNIEnv *, jclass, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: MonitorEvent_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InMemorySigner_opt_anchors
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: InMemorySigner_sign_counterparty_payment_input
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id
(JNIEnv *, jclass, jlong, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelDetails_get_balance_msat
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelDetails_set_balance_msat
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1balance_1msat
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelDetails_get_outbound_capacity_msat
/*
* Class: org_ldk_impl_bindings
* Method: ChannelDetails_new
- * Signature: ([BJJJJJJJJJJZZZZ)J
+ * Signature: ([BJJJJJJJJJJJZZZZ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new
- (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean);
+ (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment
(JNIEnv *, jclass, jlong, jlong, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelManager_abandon_payment
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment
+ (JNIEnv *, jclass, jlong, jbyteArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelManager_send_spontaneous_payment
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelManager_get_our_node_id
- * Signature: (J)[B
+ * Method: ChannelManager_get_our_node_id
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelManager_create_inbound_payment
+ * Signature: (JJI)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment
+ (JNIEnv *, jclass, jlong, jlong, jint);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelManager_create_inbound_payment_legacy
+ * Signature: (JJI)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1legacy
+ (JNIEnv *, jclass, jlong, jlong, jint);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelManager_create_inbound_payment_for_hash
+ * Signature: (J[BJI)J
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id
- (JNIEnv *, jclass, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash
+ (JNIEnv *, jclass, jlong, jbyteArray, jlong, jint);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelManager_create_inbound_payment
- * Signature: (JJIJ)J
+ * Method: ChannelManager_create_inbound_payment_for_hash_legacy
+ * Signature: (J[BJI)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment
- (JNIEnv *, jclass, jlong, jlong, jint, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash_1legacy
+ (JNIEnv *, jclass, jlong, jbyteArray, jlong, jint);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelManager_create_inbound_payment_for_hash
- * Signature: (J[BJIJ)J
+ * Method: ChannelManager_get_payment_preimage
+ * Signature: (J[B[B)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inbound_1payment_1for_1hash
- (JNIEnv *, jclass, jlong, jbyteArray, jlong, jint, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1payment_1preimage
+ (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags
(JNIEnv *, jclass, jlong, jbyte);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: OpenChannel_get_channel_type
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: OpenChannel_set_channel_type
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1type
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: OpenChannel_clone_ptr
/*
* Class: org_ldk_impl_bindings
* Method: NetAddress_onion_v2
- * Signature: ([BS)J
+ * Signature: ([B)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2
- (JNIEnv *, jclass, jbyteArray, jshort);
+ (JNIEnv *, jclass, jbyteArray);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1and_1log
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ErrorAction_ignore_duplicate_gossip
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip
+ (JNIEnv *, jclass);
+
/*
* Class: org_ldk_impl_bindings
* Method: ErrorAction_send_error_message
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: htlc_success_tx_weight
+ * Signature: (Z)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight
+ (JNIEnv *, jclass, jboolean);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: htlc_timeout_tx_weight
+ * Signature: (Z)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight
+ (JNIEnv *, jclass, jboolean);
+
/*
* Class: org_ldk_impl_bindings
* Method: build_commitment_secret
/*
* Class: org_ldk_impl_bindings
* Method: get_htlc_redeemscript
- * Signature: (JJ)[B
+ * Signature: (JZJ)[B
*/
JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript
- (JNIEnv *, jclass, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jboolean, jlong);
/*
* Class: org_ldk_impl_bindings
/*
* Class: org_ldk_impl_bindings
* Method: build_htlc_transaction
- * Signature: ([BISJ[B[B)[B
+ * Signature: ([BISJZ[B[B)[B
*/
JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction
- (JNIEnv *, jclass, jbyteArray, jint, jshort, jlong, jbyteArray, jbyteArray);
+ (JNIEnv *, jclass, jbyteArray, jint, jshort, jlong, jboolean, jbyteArray, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: get_anchor_redeemscript
+ * Signature: ([B)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript
+ (JNIEnv *, jclass, jbyteArray);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1funding_1outpoint
(JNIEnv *, jclass, jlong, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelTransactionParameters_get_opt_anchors
+ * Signature: (J)Lorg/ldk/enums/COption_NoneZ;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelTransactionParameters_set_opt_anchors
+ * Signature: (JLorg/ldk/enums/COption_NoneZ;)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors
+ (JNIEnv *, jclass, jlong, jobject);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelTransactionParameters_new
- * Signature: (JSZJJ)J
+ * Signature: (JSZJJLorg/ldk/enums/COption_NoneZ;)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new
- (JNIEnv *, jclass, jlong, jshort, jboolean, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jshort, jboolean, jlong, jlong, jobject);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DirectedChannelTransactionParameters_opt_anchors
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: HolderCommitmentTransaction_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: TrustedCommitmentTransaction_opt_anchors
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: TrustedCommitmentTransaction_get_htlc_sigs
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq
(JNIEnv *, jclass, jlong, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelTypeFeatures_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: InitFeatures_clone_ptr
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelTypeFeatures_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelTypeFeatures_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: InitFeatures_free
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelTypeFeatures_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: InitFeatures_empty
/*
* Class: org_ldk_impl_bindings
- * Method: InitFeatures_supports_payment_secret
- * Signature: (J)Z
+ * Method: ChannelTypeFeatures_empty
+ * Signature: ()J
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret
- (JNIEnv *, jclass, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty
+ (JNIEnv *, jclass);
/*
* Class: org_ldk_impl_bindings
- * Method: NodeFeatures_supports_payment_secret
- * Signature: (J)Z
+ * Method: ChannelTypeFeatures_known
+ * Signature: ()J
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret
- (JNIEnv *, jclass, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known
+ (JNIEnv *, jclass);
/*
* Class: org_ldk_impl_bindings
- * Method: InvoiceFeatures_supports_payment_secret
+ * Method: ChannelTypeFeatures_requires_unknown_bits
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1secret
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits
(JNIEnv *, jclass, jlong);
/*
/*
* Class: org_ldk_impl_bindings
- * Method: NodeFeatures_write
- * Signature: (J)[B
+ * Method: InitFeatures_read
+ * Signature: ([B)J
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write
- (JNIEnv *, jclass, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read
+ (JNIEnv *, jclass, jbyteArray);
/*
* Class: org_ldk_impl_bindings
/*
* Class: org_ldk_impl_bindings
- * Method: InvoiceFeatures_write
- * Signature: (J)[B
+ * Method: ChannelFeatures_read
+ * Signature: ([B)J
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write
- (JNIEnv *, jclass, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read
+ (JNIEnv *, jclass, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: InitFeatures_read
- * Signature: ([B)J
+ * Method: NodeFeatures_write
+ * Signature: (J)[B
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read
- (JNIEnv *, jclass, jbyteArray);
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write
+ (JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelFeatures_read
- * Signature: ([B)J
+ * Method: InvoiceFeatures_write
+ * Signature: (J)[B
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read
- (JNIEnv *, jclass, jbyteArray);
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write
+ (JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read
(JNIEnv *, jclass, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelTypeFeatures_write
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelTypeFeatures_read
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read
+ (JNIEnv *, jclass, jbyteArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: ShutdownScript_free
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: Score_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LockableScore_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LockableScore_new
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockableScore_1new
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LockableScore_write
- * Signature: (J)[B
- */
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LockableScore_1write
- (JNIEnv *, jclass, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: NodeId_free
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message
(JNIEnv *, jclass, jlong, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: ChannelInfo_new
- * Signature: (JJJJJJJ)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new
- (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: ChannelInfo_clone_ptr
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1fail_1node
(JNIEnv *, jclass, jlong, jbyteArray, jboolean);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: NetworkGraph_remove_stale_channels_with_time
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1with_1time
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: NetworkGraph_update_channel
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_find_1route
(JNIEnv *, jclass, jbyteArray, jlong, jlong, jlongArray, jlong, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Score_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LockableScore_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MultiThreadedLockableScore_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MultiThreadedLockableScore_new
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Scorer_free
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1msat
(JNIEnv *, jclass, jlong, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_get_overuse_penalty_start_1024th
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1start_11024th
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_set_overuse_penalty_start_1024th
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1start_11024th
+ (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_get_overuse_penalty_msat_per_1024th
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1overuse_1penalty_1msat_1per_11024th
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_set_overuse_penalty_msat_per_1024th
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1overuse_1penalty_1msat_1per_11024th
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ScoringParameters_get_failure_penalty_half_life
/*
* Class: org_ldk_impl_bindings
* Method: ScoringParameters_new
- * Signature: (JJJ)J
+ * Signature: (JJSJJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new
- (JNIEnv *, jclass, jlong, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jlong, jshort, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CreationError_1expiry_1time_1out_1of_1bounds
(JNIEnv *, jclass);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CreationError_invalid_amount
+ * Signature: ()Lorg/ldk/enums/CreationError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CreationError_1invalid_1amount
+ (JNIEnv *, jclass);
+
/*
* Class: org_ldk_impl_bindings
* Method: CreationError_eq
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1value_1invoice
(JNIEnv *, jclass, jlong, jlong, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoicePayer_pay_pubkey
+ * Signature: (J[B[BJI)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey
+ (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong, jint);
+
/*
* Class: org_ldk_impl_bindings
* Method: InvoicePayer_remove_cached_payment
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKCOption_ClosureReasonZ */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKCOption_ClosureReasonZ
+#define _Included_org_ldk_impl_bindings_LDKCOption_ClosureReasonZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKCOption_ClosureReasonZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKCOption_EventZ */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKCOption_EventZ
+#define _Included_org_ldk_impl_bindings_LDKCOption_EventZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKCOption_EventZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKCOption_MonitorEventZ */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKCOption_MonitorEventZ
+#define _Included_org_ldk_impl_bindings_LDKCOption_MonitorEventZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKCOption_MonitorEventZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
default: abort();
}
}
+static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_js(int32_t ord) {
+ switch (ord) {
+ case 0: return LDKCOption_NoneZ_Some;
+ case 1: return LDKCOption_NoneZ_None;
+ }
+ abort();
+}
+static inline int32_t LDKCOption_NoneZ_to_js(LDKCOption_NoneZ val) {
+ switch (val) {
+ case LDKCOption_NoneZ_Some: return 0;
+ case LDKCOption_NoneZ_None: return 1;
+ default: abort();
+ }
+}
static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_js(int32_t ord) {
switch (ord) {
case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
case 1: return LDKCreationError_RouteTooLong;
case 2: return LDKCreationError_TimestampOutOfBounds;
case 3: return LDKCreationError_ExpiryTimeOutOfBounds;
+ case 4: return LDKCreationError_InvalidAmount;
}
abort();
}
case LDKCreationError_RouteTooLong: return 1;
case LDKCreationError_TimestampOutOfBounds: return 2;
case LDKCreationError_ExpiryTimeOutOfBounds: return 3;
+ case LDKCreationError_InvalidAmount: return 4;
default: abort();
}
}
}
static inline LDKLevel LDKLevel_from_js(int32_t ord) {
switch (ord) {
- case 0: return LDKLevel_Trace;
- case 1: return LDKLevel_Debug;
- case 2: return LDKLevel_Info;
- case 3: return LDKLevel_Warn;
- case 4: return LDKLevel_Error;
+ case 0: return LDKLevel_Gossip;
+ case 1: return LDKLevel_Trace;
+ case 2: return LDKLevel_Debug;
+ case 3: return LDKLevel_Info;
+ case 4: return LDKLevel_Warn;
+ case 5: return LDKLevel_Error;
}
abort();
}
static inline int32_t LDKLevel_to_js(LDKLevel val) {
switch (val) {
- case LDKLevel_Trace: return 0;
- case LDKLevel_Debug: return 1;
- case LDKLevel_Info: return 2;
- case LDKLevel_Warn: return 3;
- case LDKLevel_Error: return 4;
+ case LDKLevel_Gossip: return 0;
+ case LDKLevel_Trace: return 1;
+ case LDKLevel_Debug: return 2;
+ case LDKLevel_Info: return 3;
+ case LDKLevel_Warn: return 4;
+ case LDKLevel_Error: return 5;
default: abort();
}
}
case LDKClosureReason_CommitmentTxConfirmed: {
return 0 /* LDKClosureReason - CommitmentTxConfirmed */;
}
+ case LDKClosureReason_FundingTimedOut: {
+ return 0 /* LDKClosureReason - FundingTimedOut */;
+ }
case LDKClosureReason_ProcessingError: {
LDKStr err_str = obj->processing_error.err;
jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
memcpy((uint8_t*)(payment_preimage_arr + 4), obj->invoice_payment.payment_preimage.data, 32);
int8_tArray payment_secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(payment_secret_arr + 4), obj->invoice_payment.payment_secret.data, 32);
- return 0 /* LDKPaymentPurpose - InvoicePayment */; (void) payment_preimage_arr; (void) payment_secret_arr; (void) obj->invoice_payment.user_payment_id;
+ return 0 /* LDKPaymentPurpose - InvoicePayment */; (void) payment_preimage_arr; (void) payment_secret_arr;
}
case LDKPaymentPurpose_SpontaneousPayment: {
int8_tArray spontaneous_payment_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
}
return 0 /* LDKEvent - PaymentPathFailed */; (void) payment_id_arr; (void) payment_hash_arr; (void) obj->payment_path_failed.rejected_by_dest; (void) network_update_ref; (void) obj->payment_path_failed.all_paths_failed; (void) path_arr; (void) short_channel_id_ref; (void) retry_ref;
}
+ case LDKEvent_PaymentFailed: {
+ int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_failed.payment_id.data, 32);
+ int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_failed.payment_hash.data, 32);
+ return 0 /* LDKEvent - PaymentFailed */; (void) payment_id_arr; (void) payment_hash_arr;
+ }
case LDKEvent_PendingHTLCsForwardable: {
return 0 /* LDKEvent - PendingHTLCsForwardable */; (void) obj->pending_htl_cs_forwardable.time_forwardable;
}
memcpy((uint8_t*)(transaction_arr + 4), transaction_var.data, transaction_var.datalen);
return 0 /* LDKEvent - DiscardFunding */; (void) channel_id_arr; (void) transaction_arr;
}
+ case LDKEvent_PaymentPathSuccessful: {
+ int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_path_successful.payment_id.data, 32);
+ int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_path_successful.payment_hash.data, 32);
+ LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
+ uint32_tArray path_arr = NULL;
+ path_arr = init_arr(path_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *path_arr_ptr = (uint32_t*)(path_arr + 4);
+ for (size_t k = 0; k < path_var.datalen; k++) {
+ LDKRouteHop path_conv_10_var = path_var.data[k];
+ uint64_t path_conv_10_ref = 0;
+ CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
+ path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
+ path_arr_ptr[k] = path_conv_10_ref;
+ }
+
+ return 0 /* LDKEvent - PaymentPathSuccessful */; (void) payment_id_arr; (void) payment_hash_arr; (void) path_arr;
+ }
default: abort();
}
}
uint32_t ignore_and_log_conv = LDKLevel_to_js(obj->ignore_and_log);
return 0 /* LDKErrorAction - IgnoreAndLog */; (void) ignore_and_log_conv;
}
+ case LDKErrorAction_IgnoreDuplicateGossip: {
+ return 0 /* LDKErrorAction - IgnoreDuplicateGossip */;
+ }
case LDKErrorAction_SendErrorMessage: {
LDKErrorMessage msg_var = obj->send_error_message.msg;
uint64_t msg_ref = 0;
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKInitFeatures res_var = (*val->contents.result);
+ LDKScoringParameters res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKNodeFeatures res_var = (*val->contents.result);
+ LDKScorer res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ LDKDecodeError err_var = (*val->contents.err);
+ uint64_t err_ref = 0;
+ CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKInitFeatures res_var = (*val->contents.result);
+ uint64_t res_ref = 0;
+ CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
+ res_ref = (uint64_t)res_var.inner & ~1;
+ return res_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKInvoiceFeatures res_var = (*val->contents.result);
+ LDKNodeFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKScoringParameters res_var = (*val->contents.result);
+ LDKInvoiceFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ *val = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKScorer res_var = (*val->contents.result);
+ LDKChannelTypeFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ *val = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
return 0 /* LDKNetAddress - IPv6 */; (void) addr_arr; (void) obj->i_pv6.port;
}
case LDKNetAddress_OnionV2: {
- int8_tArray addr_arr = init_arr(10, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(addr_arr + 4), obj->onion_v2.addr.data, 10);
- return 0 /* LDKNetAddress - OnionV2 */; (void) addr_arr; (void) obj->onion_v2.port;
+ int8_tArray onion_v2_arr = init_arr(12, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(onion_v2_arr + 4), obj->onion_v2.data, 12);
+ return 0 /* LDKNetAddress - OnionV2 */; (void) onion_v2_arr;
}
case LDKNetAddress_OnionV3: {
int8_tArray ed25519_pubkey_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
return ret_arr;
}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKC2Tuple_PaymentHashPaymentSecretZ* res_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
+ *res_conv = (*val->contents.result);
+ *res_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(res_conv);
+ return ((uint64_t)res_conv);
+}
+void __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKC2Tuple_PaymentHashPaymentSecretZ* res_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
+ *res_conv = (*val->contents.result);
+ *res_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(res_conv);
+ return ((uint64_t)res_conv);
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+ return err_ref;
+}
+int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretNoneZ_get_ok(uint32_t arg) {
+ LDKCResult_PaymentSecretNoneZ *val = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ int8_tArray res_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(res_arr + 4), (*val->contents.result).data, 32);
+ return res_arr;
+}
+void __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretNoneZ_get_err(uint32_t arg) {
+ LDKCResult_PaymentSecretNoneZ *val = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretAPIErrorZ_get_ok(uint32_t arg) {
LDKCResult_PaymentSecretAPIErrorZ *val = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1);
CHECK(val->result_ok);
uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
+int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentPreimageAPIErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ *val = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ int8_tArray res_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(res_arr + 4), (*val->contents.result).data, 32);
+ return res_arr;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentPreimageAPIErrorZ_get_err(uint32_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ *val = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+ return err_ref;
+}
static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
uint32_t get_secure_random_bytes_meth;
uint32_t read_chan_signer_meth;
uint32_t sign_invoice_meth;
+ uint32_t get_inbound_payment_key_material_meth;
} LDKKeysInterface_JCalls;
static void LDKKeysInterface_JCalls_free(void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
js_free(j_calls->get_secure_random_bytes_meth);
js_free(j_calls->read_chan_signer_meth);
js_free(j_calls->sign_invoice_meth);
+ js_free(j_calls->get_inbound_payment_key_material_meth);
FREE(j_calls);
}
}
FREE((void*)ret);
return ret_conv;
}
+LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
+ LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+ int8_tArray ret = js_invoke_function_0(j_calls->get_inbound_payment_key_material_meth);
+ LDKThirtyTwoBytes ret_ref;
+ CHECK(*((uint32_t*)ret) == 32);
+ memcpy(ret_ref.data, (uint8_t*)(ret + 4), 32);
+ return ret_ref;
+}
static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
.get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
.read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
.sign_invoice = sign_invoice_LDKKeysInterface_jcall,
+ .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
.free = LDKKeysInterface_JCalls_free,
};
return ret;
return (uint64_t)ret_conv;
}
+int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_inbound_payment_key_material(uint32_t this_arg) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32);
+ return ret_arr;
+}
+
typedef struct LDKFeeEstimator_JCalls {
atomic_size_t refcnt;
uint32_t get_est_sat_per_1000_weight_meth;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-void __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdateErrorZ_get_ok(uint32_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- return *val->contents.result;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdateErrorZ_get_err(uint32_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKMonitorUpdateError err_var = (*val->contents.err);
- uint64_t err_ref = 0;
- CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
- err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
return OutPoint_clone(&tuple->a);
}
atomic_size_t refcnt;
uint32_t channel_penalty_msat_meth;
uint32_t payment_path_failed_meth;
+ uint32_t payment_path_successful_meth;
uint32_t write_meth;
} LDKScore_JCalls;
static void LDKScore_JCalls_free(void* this_arg) {
if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
js_free(j_calls->channel_penalty_msat_meth);
js_free(j_calls->payment_path_failed_meth);
+ js_free(j_calls->payment_path_successful_meth);
js_free(j_calls->write_meth);
FREE(j_calls);
}
}
-uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target) {
+uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, LDKCOption_u64Z channel_capacity_msat, const LDKNodeId * source, const LDKNodeId * target) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
+ LDKCOption_u64Z *channel_capacity_msat_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *channel_capacity_msat_copy = channel_capacity_msat;
+ uint64_t channel_capacity_msat_ref = (uint64_t)channel_capacity_msat_copy;
LDKNodeId source_var = *source;
uint64_t source_ref = 0;
source_var = NodeId_clone(source);
if (target_var.is_owned) {
target_ref |= 1;
}
- return js_invoke_function_3(j_calls->channel_penalty_msat_meth, short_channel_id, source_ref, target_ref);
+ return js_invoke_function_5(j_calls->channel_penalty_msat_meth, short_channel_id, send_amt_msat, channel_capacity_msat_ref, source_ref, target_ref);
}
void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
FREE(path_var.data);
js_invoke_function_2(j_calls->payment_path_failed_meth, path_arr, short_channel_id);
}
+void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
+ LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
+ LDKCVec_RouteHopZ path_var = path;
+ uint32_tArray path_arr = NULL;
+ path_arr = init_arr(path_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *path_arr_ptr = (uint32_t*)(path_arr + 4);
+ for (size_t k = 0; k < path_var.datalen; k++) {
+ LDKRouteHop path_conv_10_var = path_var.data[k];
+ uint64_t path_conv_10_ref = 0;
+ CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
+ path_conv_10_ref = (uint64_t)path_conv_10_var.inner;
+ if (path_conv_10_var.is_owned) {
+ path_conv_10_ref |= 1;
+ }
+ path_arr_ptr[k] = path_conv_10_ref;
+ }
+
+ FREE(path_var.data);
+ js_invoke_function_1(j_calls->payment_path_successful_meth, path_arr);
+}
LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->write_meth);
.this_arg = (void*) calls,
.channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
.payment_path_failed = payment_path_failed_LDKScore_jcall,
+ .payment_path_successful = payment_path_successful_LDKScore_jcall,
.write = write_LDKScore_jcall,
.free = LDKScore_JCalls_free,
};
*res_ptr = LDKScore_init(o);
return (long)res_ptr;
}
-int64_t __attribute__((visibility("default"))) TS_Score_channel_penalty_msat(uint32_t this_arg, int64_t short_channel_id, uint32_t source, uint32_t target) {
+int64_t __attribute__((visibility("default"))) TS_Score_channel_penalty_msat(uint32_t this_arg, int64_t short_channel_id, int64_t send_amt_msat, uint32_t channel_capacity_msat, uint32_t source, uint32_t target) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ void* channel_capacity_msat_ptr = (void*)(((uint64_t)channel_capacity_msat) & ~1);
+ CHECK_ACCESS(channel_capacity_msat_ptr);
+ LDKCOption_u64Z channel_capacity_msat_conv = *(LDKCOption_u64Z*)(channel_capacity_msat_ptr);
+ channel_capacity_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)channel_capacity_msat) & ~1));
LDKNodeId source_conv;
source_conv.inner = (void*)(source & (~1));
source_conv.is_owned = false;
target_conv.inner = (void*)(target & (~1));
target_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
- int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv);
+ int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, send_amt_msat, channel_capacity_msat_conv, &source_conv, &target_conv);
return ret_val;
}
(this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
}
+void __attribute__((visibility("default"))) TS_Score_payment_path_successful(uint32_t this_arg, uint32_tArray path) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ LDKCVec_RouteHopZ path_constr;
+ path_constr.datalen = *((uint32_t*)path);
+ if (path_constr.datalen > 0)
+ path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ else
+ path_constr.data = NULL;
+ uint32_t* path_vals = (uint32_t*)(path + 4);
+ for (size_t k = 0; k < path_constr.datalen; k++) {
+ uint32_t path_conv_10 = path_vals[k];
+ LDKRouteHop path_conv_10_conv;
+ path_conv_10_conv.inner = (void*)(path_conv_10 & (~1));
+ path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
+ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
+ path_constr.data[k] = path_conv_10_conv;
+ }
+ (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
+}
+
int8_tArray __attribute__((visibility("default"))) TS_Score_write(uint32_t this_arg) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
return ret_arr;
}
+typedef struct LDKLockableScore_JCalls {
+ atomic_size_t refcnt;
+ uint32_t lock_meth;
+} LDKLockableScore_JCalls;
+static void LDKLockableScore_JCalls_free(void* this_arg) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ js_free(j_calls->lock_meth);
+ FREE(j_calls);
+ }
+}
+LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
+ uint32_t ret = js_invoke_function_0(j_calls->lock_meth);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKScore ret_conv = *(LDKScore*)(ret_ptr);// Warning: we may need a move here but no clone is available for LDKScore
+
+ return ret_conv;
+}
+static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKLockableScore LDKLockableScore_init (/*TODO: JS Object Reference */void* o) {
+ LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ //TODO: Assign calls->o from o
+
+ LDKLockableScore ret = {
+ .this_arg = (void*) calls,
+ .lock = lock_LDKLockableScore_jcall,
+ .free = LDKLockableScore_JCalls_free,
+ };
+ return ret;
+}
+long __attribute__((visibility("default"))) TS_LDKLockableScore_new(/*TODO: JS Object Reference */void* o) {
+ LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
+ *res_ptr = LDKLockableScore_init(o);
+ return (long)res_ptr;
+}
+uint32_t __attribute__((visibility("default"))) TS_LockableScore_lock(uint32_t this_arg) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
+ *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
+ return (uint64_t)ret_ret;
+}
+
typedef struct LDKChannelManagerPersister_JCalls {
atomic_size_t refcnt;
uint32_t persist_manager_meth;
uint32_t node_id_meth;
uint32_t first_hops_meth;
uint32_t send_payment_meth;
+ uint32_t send_spontaneous_payment_meth;
uint32_t retry_payment_meth;
+ uint32_t abandon_payment_meth;
} LDKPayer_JCalls;
static void LDKPayer_JCalls_free(void* this_arg) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
js_free(j_calls->node_id_meth);
js_free(j_calls->first_hops_meth);
js_free(j_calls->send_payment_meth);
+ js_free(j_calls->send_spontaneous_payment_meth);
js_free(j_calls->retry_payment_meth);
+ js_free(j_calls->abandon_payment_meth);
FREE(j_calls);
}
}
FREE((void*)ret);
return ret_conv;
}
+LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ LDKRoute route_var = *route;
+ uint64_t route_ref = 0;
+ route_var = Route_clone(route);
+ CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_ref |= 1;
+ }
+ int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_preimage_arr + 4), payment_preimage.data, 32);
+ uint32_t ret = js_invoke_function_2(j_calls->send_spontaneous_payment_meth, route_ref, payment_preimage_arr);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
+ FREE((void*)ret);
+ return ret_conv;
+}
LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
LDKRoute route_var = *route;
FREE((void*)ret);
return ret_conv;
}
+void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_id_arr + 4), payment_id.data, 32);
+ js_invoke_function_1(j_calls->abandon_payment_meth, payment_id_arr);
+}
static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
.node_id = node_id_LDKPayer_jcall,
.first_hops = first_hops_LDKPayer_jcall,
.send_payment = send_payment_LDKPayer_jcall,
+ .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
.retry_payment = retry_payment_LDKPayer_jcall,
+ .abandon_payment = abandon_payment_LDKPayer_jcall,
.free = LDKPayer_JCalls_free,
};
return ret;
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_Payer_send_spontaneous_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_preimage) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKRoute route_conv;
+ route_conv.inner = (void*)(route & (~1));
+ route_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
+ LDKThirtyTwoBytes payment_preimage_ref;
+ CHECK(*((uint32_t*)payment_preimage) == 32);
+ memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+ LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
+ return (uint64_t)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_Payer_retry_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
return (uint64_t)ret_conv;
}
+void __attribute__((visibility("default"))) TS_Payer_abandon_payment(uint32_t this_arg, int8_tArray payment_id) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
+ (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
+}
+
typedef struct LDKRouter_JCalls {
atomic_size_t refcnt;
uint32_t find_route_meth;
FREE(j_calls);
}
}
-LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * params, LDKCVec_ChannelDetailsZ * first_hops, const LDKScore * scorer) {
+LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * params, const uint8_t (* payment_hash)[32], LDKCVec_ChannelDetailsZ * first_hops, const LDKScore * scorer) {
LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
int8_tArray payer_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(payer_arr + 4), payer.compressed_form, 33);
if (params_var.is_owned) {
params_ref |= 1;
}
+ int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_hash_arr + 4), *payment_hash, 32);
LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
uint32_tArray first_hops_arr = NULL;
if (first_hops != NULL) {
}
// WARNING: This object doesn't live past this scope, needs clone!
uint64_t ret_scorer = ((uint64_t)scorer) | 1;
- uint32_t ret = js_invoke_function_4(j_calls->find_route_meth, payer_arr, params_ref, first_hops_arr, ret_scorer);
+ uint32_t ret = js_invoke_function_5(j_calls->find_route_meth, payer_arr, params_ref, payment_hash_arr, first_hops_arr, ret_scorer);
void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
*res_ptr = LDKRouter_init(o);
return (long)res_ptr;
}
-uint32_t __attribute__((visibility("default"))) TS_Router_find_route(uint32_t this_arg, int8_tArray payer, uint32_t params, uint32_tArray first_hops, uint32_t scorer) {
+uint32_t __attribute__((visibility("default"))) TS_Router_find_route(uint32_t this_arg, int8_tArray payer, uint32_t params, int8_tArray payment_hash, uint32_tArray first_hops, uint32_t scorer) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
params_conv.inner = (void*)(params & (~1));
params_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
+ unsigned char payment_hash_arr[32];
+ CHECK(*((uint32_t*)payment_hash) == 32);
+ memcpy(payment_hash_arr, (uint8_t*)(payment_hash + 4), 32);
+ unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
LDKCVec_ChannelDetailsZ first_hops_constr;
LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
if (first_hops != 0) {
if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, ¶ms_conv, first_hops_ptr, scorer_conv);
+ *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, ¶ms_conv, payment_hash_ref, first_hops_ptr, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
return (uint64_t)ret_conv;
}
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_COption_NoneZ_some() {
+ uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_some());
+ return ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_COption_NoneZ_none() {
+ uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_none());
+ return ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_COption_NoneZ_free(uint32_t _res) {
+ LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_js(_res);
+ COption_NoneZ_free(_res_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(uint32_t o) {
LDKCounterpartyChannelTransactionParameters o_conv;
o_conv.inner = (void*)(o & (~1));
CVec_MessageSendEventZ_free(_res_constr);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint32_t o) {
- LDKInitFeatures o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_ok(uint32_t o) {
+ LDKScoringParameters o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = InitFeatures_clone(&o_conv);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
+ // Warning: we need a move here but no clone is available for LDKScoringParameters
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-jboolean __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint32_t o) {
- LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_ScoringParametersDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint32_t o) {
- LDKNodeFeatures o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_ok(uint32_t o) {
+ LDKScorer o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = NodeFeatures_clone(&o_conv);
- LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
- *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
+ // Warning: we need a move here but no clone is available for LDKScorer
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
- *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-jboolean __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint32_t o) {
- LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_ScorerDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint32_t o) {
+ LDKInitFeatures o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = InitFeatures_clone(&o_conv);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+jboolean __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecodeErrorZ_ok(uint32_t o) {
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint32_t o) {
- LDKInvoiceFeatures o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint32_t o) {
+ LDKNodeFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = InvoiceFeatures_clone(&o_conv);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
+ o_conv = NodeFeatures_clone(&o_conv);
+ LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint32_t o) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_ok(uint32_t o) {
- LDKScoringParameters o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint32_t o) {
+ LDKInvoiceFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- // Warning: we need a move here but no clone is available for LDKScoringParameters
- LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
- *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv);
+ o_conv = InvoiceFeatures_clone(&o_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
- *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-jboolean __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_is_ok(uint32_t o) {
- LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_ScoringParametersDecodeErrorZ_free(_res_conv);
+ CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_ok(uint32_t o) {
- LDKScorer o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok(uint32_t o) {
+ LDKChannelTypeFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- // Warning: we need a move here but no clone is available for LDKScorer
- LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
- *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv);
+ o_conv = ChannelTypeFeatures_clone(&o_conv);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
- *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-jboolean __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_is_ok(uint32_t o) {
- LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((visibility("default"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_ScorerDecodeErrorZ_free(_res_conv);
+ CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint32_t o) {
C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(uint32_t o) {
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
+ o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
+ return (uint64_t)ret_conv;
+}
+
+jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(uint32_t o) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(o & ~1);
+ jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+int64_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(uint32_t orig) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(orig & ~1);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(uint32_t o) {
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
+ o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(uint32_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
+ e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(uint32_t o) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+int64_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(uint32_t orig) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(orig & ~1);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(*((uint32_t*)o) == 32);
+ memcpy(o_ref.data, (uint8_t*)(o + 4), 32);
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_err() {
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_err();
+ return (uint64_t)ret_conv;
+}
+
+jboolean __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_is_ok(uint32_t o) {
+ LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)(o & ~1);
+ jboolean ret_val = CResult_PaymentSecretNoneZ_is_ok(o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentSecretNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+int64_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint32_t arg) {
+ LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ int64_t ret_val = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_clone(uint32_t orig) {
+ LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)(orig & ~1);
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_ok(int8_tArray o) {
LDKThirtyTwoBytes o_ref;
CHECK(*((uint32_t*)o) == 32);
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(*((uint32_t*)o) == 32);
+ memcpy(o_ref.data, (uint8_t*)(o + 4), 32);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_err(uint32_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
+ e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+jboolean __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_is_ok(uint32_t o) {
+ LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+int64_t __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint32_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ int64_t ret_val = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_clone(uint32_t orig) {
+ LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(orig & ~1);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
void __attribute__((visibility("default"))) TS_CVec_ChannelMonitorZ_free(uint32_tArray _res) {
LDKCVec_ChannelMonitorZ _res_constr;
_res_constr.datalen = *((uint32_t*)_res);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_ok() {
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_ok();
- return (uint64_t)ret_conv;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_err(uint32_t e) {
- LDKMonitorUpdateError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = MonitorUpdateError_clone(&e_conv);
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-jboolean __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_is_ok(uint32_t o) {
- LDKCResult_NoneMonitorUpdateErrorZ* o_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(o & ~1);
- jboolean ret_val = CResult_NoneMonitorUpdateErrorZ_is_ok(o_conv);
- return ret_val;
-}
-
-void __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_free(uint32_t _res) {
- if ((_res & 1) != 0) return;
- void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_NoneMonitorUpdateErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg) {
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(arg);
- return (uint64_t)ret_conv;
-}
-int64_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_clone_ptr(uint32_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ* arg_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- int64_t ret_val = CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg_conv);
- return ret_val;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_clone(uint32_t orig) {
- LDKCResult_NoneMonitorUpdateErrorZ* orig_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(orig & ~1);
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
*ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret, int64_t user_payment_id) {
+uint32_t __attribute__((visibility("default"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) {
LDKThirtyTwoBytes payment_preimage_ref;
CHECK(*((uint32_t*)payment_preimage) == 32);
memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
CHECK(*((uint32_t*)payment_secret) == 32);
memcpy(payment_secret_ref.data, (uint8_t*)(payment_secret + 4), 32);
LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
- *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref, user_payment_id);
+ *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_ClosureReason_funding_timed_out() {
+ LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
+ *ret_copy = ClosureReason_funding_timed_out();
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_ClosureReason_processing_error(jstring err) {
LDKStr err_conv = str_ref_to_owned_c(err);
LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(*((uint32_t*)payment_hash) == 32);
+ memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+ LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) {
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_Event_payment_path_successful(int8_tArray payment_id, int8_tArray payment_hash, uint32_tArray path) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(*((uint32_t*)payment_hash) == 32);
+ memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+ LDKCVec_RouteHopZ path_constr;
+ path_constr.datalen = *((uint32_t*)path);
+ if (path_constr.datalen > 0)
+ path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ else
+ path_constr.data = NULL;
+ uint32_t* path_vals = (uint32_t*)(path + 4);
+ for (size_t k = 0; k < path_constr.datalen; k++) {
+ uint32_t path_conv_10 = path_vals[k];
+ LDKRouteHop path_conv_10_conv;
+ path_conv_10_conv.inner = (void*)(path_conv_10 & (~1));
+ path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
+ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
+ path_constr.data[k] = path_conv_10_conv;
+ }
+ LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
int8_tArray __attribute__((visibility("default"))) TS_Event_write(uint32_t obj) {
LDKEvent* obj_conv = (LDKEvent*)obj;
LDKCVec_u8Z ret_var = Event_write(obj_conv);
return ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_Level_gossip() {
+ uint32_t ret_conv = LDKLevel_to_js(Level_gossip());
+ return ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_Level_trace() {
uint32_t ret_conv = LDKLevel_to_js(Level_trace());
return ret_conv;
UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
}
-uint32_t __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_channel_config_arg, uint32_t peer_channel_config_limits_arg, uint32_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg) {
+jboolean __attribute__((visibility("default"))) TS_UserConfig_get_accept_inbound_channels(uint32_t this_ptr) {
+ LDKUserConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ jboolean ret_val = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_UserConfig_set_accept_inbound_channels(uint32_t this_ptr, jboolean val) {
+ LDKUserConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_channel_config_arg, uint32_t peer_channel_config_limits_arg, uint32_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg) {
LDKChannelHandshakeConfig own_channel_config_arg_conv;
own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1));
own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0);
channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv);
channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv);
- LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg);
+ LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (uint64_t)ret_conv;
}
-void __attribute__((visibility("default"))) TS_MonitorUpdateError_free(uint32_t this_obj) {
- LDKMonitorUpdateError this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- MonitorUpdateError_free(this_obj_conv);
-}
-
-jstring __attribute__((visibility("default"))) TS_MonitorUpdateError_get_a(uint32_t this_ptr) {
- LDKMonitorUpdateError this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- LDKStr ret_str = MonitorUpdateError_get_a(&this_ptr_conv);
- jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
- Str_free(ret_str);
- return ret_conv;
-}
-
-void __attribute__((visibility("default"))) TS_MonitorUpdateError_set_a(uint32_t this_ptr, jstring val) {
- LDKMonitorUpdateError this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- LDKStr val_conv = str_ref_to_owned_c(val);
- MonitorUpdateError_set_a(&this_ptr_conv, val_conv);
-}
-
-uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_new(jstring a_arg) {
- LDKStr a_arg_conv = str_ref_to_owned_c(a_arg);
- LDKMonitorUpdateError ret_var = MonitorUpdateError_new(a_arg_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-static inline uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg) {
- LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(arg);
-uint64_t ret_ref = 0;
-CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
-CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
-ret_ref = (uint64_t)ret_var.inner;
-if (ret_var.is_owned) {
- ret_ref |= 1;
-}
- return ret_ref;
-}
-int64_t __attribute__((visibility("default"))) TS_MonitorUpdateError_clone_ptr(uint32_t arg) {
- LDKMonitorUpdateError arg_conv;
- arg_conv.inner = (void*)(arg & (~1));
- arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
- int64_t ret_val = MonitorUpdateError_clone_ptr(&arg_conv);
- return ret_val;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_clone(uint32_t orig) {
- LDKMonitorUpdateError orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
- LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
void __attribute__((visibility("default"))) TS_MonitorEvent_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
*ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
return (uint64_t)ret_conv;
}
return ret_ref;
}
+jboolean __attribute__((visibility("default"))) TS_InMemorySigner_opt_anchors(uint32_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = InMemorySigner_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_counterparty_payment_input(uint32_t this_arg, int8_tArray spend_tx, int64_t input_idx, uint32_t descriptor) {
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
}
+int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_balance_msat(uint32_t this_ptr) {
+ LDKChannelDetails this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int64_t ret_val = ChannelDetails_get_balance_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelDetails_set_balance_msat(uint32_t this_ptr, int64_t val) {
+ LDKChannelDetails this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ChannelDetails_set_balance_msat(&this_ptr_conv, val);
+}
+
int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_outbound_capacity_msat(uint32_t this_ptr) {
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ChannelDetails_set_is_public(&this_ptr_conv, val);
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_new(int8_tArray channel_id_arg, uint32_t counterparty_arg, uint32_t funding_txo_arg, uint32_t short_channel_id_arg, int64_t channel_value_satoshis_arg, uint32_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, uint32_t confirmations_required_arg, uint32_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) {
+uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_new(int8_tArray channel_id_arg, uint32_t counterparty_arg, uint32_t funding_txo_arg, uint32_t short_channel_id_arg, int64_t channel_value_satoshis_arg, uint32_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, uint32_t confirmations_required_arg, uint32_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) {
LDKThirtyTwoBytes channel_id_arg_ref;
CHECK(*((uint32_t*)channel_id_arg) == 32);
memcpy(channel_id_arg_ref.data, (uint8_t*)(channel_id_arg + 4), 32);
CHECK_ACCESS(force_close_spend_delay_arg_ptr);
LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1));
- LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
+ LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (uint64_t)ret_conv;
}
+void __attribute__((visibility("default"))) TS_ChannelManager_abandon_payment(uint32_t this_arg, int8_tArray payment_id) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
+ ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
+}
+
uint32_t __attribute__((visibility("default"))) TS_ChannelManager_send_spontaneous_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_preimage) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment(uint32_t this_arg, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t user_payment_id) {
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment(uint32_t this_arg, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
CHECK_ACCESS(min_value_msat_ptr);
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
- LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
- *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
- return ((uint64_t)ret_conv);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment_legacy(uint32_t this_arg, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
+ min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment_for_hash(uint32_t this_arg, int8_tArray payment_hash, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(*((uint32_t*)payment_hash) == 32);
+ memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
+ min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment_for_hash(uint32_t this_arg, int8_tArray payment_hash, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t user_payment_id) {
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment_for_hash_legacy(uint32_t this_arg, int8_tArray payment_hash, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
- *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
+ *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_get_payment_preimage(uint32_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(*((uint32_t*)payment_hash) == 32);
+ memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+ LDKThirtyTwoBytes payment_secret_ref;
+ CHECK(*((uint32_t*)payment_secret) == 32);
+ memcpy(payment_secret_ref.data, (uint8_t*)(payment_secret + 4), 32);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
return (uint64_t)ret_conv;
}
OpenChannel_set_channel_flags(&this_ptr_conv, val);
}
+uint32_t __attribute__((visibility("default"))) TS_OpenChannel_get_channel_type(uint32_t this_ptr) {
+ LDKOpenChannel this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
+ uint64_t ret_ref = 0;
+ if ((uint64_t)ret_var.inner > 4096) {
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_OpenChannel_set_channel_type(uint32_t this_ptr, uint32_t val) {
+ LDKOpenChannel this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKChannelTypeFeatures val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
+ val_conv = ChannelTypeFeatures_clone(&val_conv);
+ OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
+}
+
static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
LDKOpenChannel ret_var = OpenChannel_clone(arg);
uint64_t ret_ref = 0;
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_NetAddress_onion_v2(int8_tArray addr, int16_t port) {
- LDKTenBytes addr_ref;
- CHECK(*((uint32_t*)addr) == 10);
- memcpy(addr_ref.data, (uint8_t*)(addr + 4), 10);
+uint32_t __attribute__((visibility("default"))) TS_NetAddress_onion_v2(int8_tArray a) {
+ LDKTwelveBytes a_ref;
+ CHECK(*((uint32_t*)a) == 12);
+ memcpy(a_ref.data, (uint8_t*)(a + 4), 12);
LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
- *ret_copy = NetAddress_onion_v2(addr_ref, port);
+ *ret_copy = NetAddress_onion_v2(a_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_ErrorAction_ignore_duplicate_gossip() {
+ LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+ *ret_copy = ErrorAction_ignore_duplicate_gossip();
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_ErrorAction_send_error_message(uint32_t msg) {
LDKErrorMessage msg_conv;
msg_conv.inner = (void*)(msg & (~1));
PeerManager_timer_tick_occurred(&this_arg_conv);
}
+int64_t __attribute__((visibility("default"))) TS_htlc_success_tx_weight(jboolean opt_anchors) {
+ int64_t ret_val = htlc_success_tx_weight(opt_anchors);
+ return ret_val;
+}
+
+int64_t __attribute__((visibility("default"))) TS_htlc_timeout_tx_weight(jboolean opt_anchors) {
+ int64_t ret_val = htlc_timeout_tx_weight(opt_anchors);
+ return ret_val;
+}
+
int8_tArray __attribute__((visibility("default"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) {
unsigned char commitment_seed_arr[32];
CHECK(*((uint32_t*)commitment_seed) == 32);
return (uint64_t)ret_conv;
}
-int8_tArray __attribute__((visibility("default"))) TS_get_htlc_redeemscript(uint32_t htlc, uint32_t keys) {
+int8_tArray __attribute__((visibility("default"))) TS_get_htlc_redeemscript(uint32_t htlc, jboolean opt_anchors, uint32_t keys) {
LDKHTLCOutputInCommitment htlc_conv;
htlc_conv.inner = (void*)(htlc & (~1));
htlc_conv.is_owned = false;
keys_conv.inner = (void*)(keys & (~1));
keys_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
- LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv);
+ LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
CVec_u8Z_free(ret_var);
return ret_arr;
}
-int8_tArray __attribute__((visibility("default"))) TS_build_htlc_transaction(int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, uint32_t htlc, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
+int8_tArray __attribute__((visibility("default"))) TS_build_htlc_transaction(int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, uint32_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
unsigned char commitment_txid_arr[32];
CHECK(*((uint32_t*)commitment_txid) == 32);
memcpy(commitment_txid_arr, (uint8_t*)(commitment_txid + 4), 32);
LDKPublicKey revocation_key_ref;
CHECK(*((uint32_t*)revocation_key) == 33);
memcpy(revocation_key_ref.compressed_form, (uint8_t*)(revocation_key + 4), 33);
- LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref);
+ LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
Transaction_free(ret_var);
return ret_arr;
}
+int8_tArray __attribute__((visibility("default"))) TS_get_anchor_redeemscript(int8_tArray funding_pubkey) {
+ LDKPublicKey funding_pubkey_ref;
+ CHECK(*((uint32_t*)funding_pubkey) == 33);
+ memcpy(funding_pubkey_ref.compressed_form, (uint8_t*)(funding_pubkey + 4), 33);
+ LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_free(uint32_t this_obj) {
LDKChannelTransactionParameters this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_new(uint32_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, uint32_t counterparty_parameters_arg, uint32_t funding_outpoint_arg) {
+uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_get_opt_anchors(uint32_t this_ptr) {
+ LDKChannelTransactionParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ uint32_t ret_conv = LDKCOption_NoneZ_to_js(ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
+ return ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set_opt_anchors(uint32_t this_ptr, uint32_t val) {
+ LDKChannelTransactionParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_js(val);
+ ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_new(uint32_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, uint32_t counterparty_parameters_arg, uint32_t funding_outpoint_arg, uint32_t opt_anchors_arg) {
LDKChannelPublicKeys holder_pubkeys_arg_conv;
holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1));
holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0);
funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
- LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv);
+ LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_anchors_arg);
+ LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return ret_ref;
}
+jboolean __attribute__((visibility("default"))) TS_DirectedChannelTransactionParameters_opt_anchors(uint32_t this_arg) {
+ LDKDirectedChannelTransactionParameters this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_free(uint32_t this_obj) {
LDKHolderCommitmentTransaction this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
return ret_ref;
}
+jboolean __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction_opt_anchors(uint32_t this_arg) {
+ LDKTrustedCommitmentTransaction this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction_get_htlc_sigs(uint32_t this_arg, int8_tArray htlc_base_key, uint32_t channel_parameters) {
LDKTrustedCommitmentTransaction this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return ret_val;
}
+jboolean __attribute__((visibility("default"))) TS_ChannelTypeFeatures_eq(uint32_t a, uint32_t b) {
+ LDKChannelTypeFeatures a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ LDKChannelTypeFeatures b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ jboolean ret_val = ChannelTypeFeatures_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
LDKInitFeatures ret_var = InitFeatures_clone(arg);
uint64_t ret_ref = 0;
return ret_ref;
}
+static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+ ret_ref |= 1;
+}
+ return ret_ref;
+}
+int64_t __attribute__((visibility("default"))) TS_ChannelTypeFeatures_clone_ptr(uint32_t arg) {
+ LDKChannelTypeFeatures arg_conv;
+ arg_conv.inner = (void*)(arg & (~1));
+ arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ int64_t ret_val = ChannelTypeFeatures_clone_ptr(&arg_conv);
+ return ret_val;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelTypeFeatures_clone(uint32_t orig) {
+ LDKChannelTypeFeatures orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
void __attribute__((visibility("default"))) TS_InitFeatures_free(uint32_t this_obj) {
LDKInitFeatures this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
InvoiceFeatures_free(this_obj_conv);
}
+void __attribute__((visibility("default"))) TS_ChannelTypeFeatures_free(uint32_t this_obj) {
+ LDKChannelTypeFeatures this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ ChannelTypeFeatures_free(this_obj_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_InitFeatures_empty() {
LDKInitFeatures ret_var = InitFeatures_empty();
uint64_t ret_ref = 0;
return ret_val;
}
-jboolean __attribute__((visibility("default"))) TS_InitFeatures_supports_payment_secret(uint32_t this_arg) {
- LDKInitFeatures this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = InitFeatures_supports_payment_secret(&this_arg_conv);
- return ret_val;
+uint32_t __attribute__((visibility("default"))) TS_ChannelTypeFeatures_empty() {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
}
-jboolean __attribute__((visibility("default"))) TS_NodeFeatures_supports_payment_secret(uint32_t this_arg) {
- LDKNodeFeatures this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = NodeFeatures_supports_payment_secret(&this_arg_conv);
- return ret_val;
+uint32_t __attribute__((visibility("default"))) TS_ChannelTypeFeatures_known() {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
}
-jboolean __attribute__((visibility("default"))) TS_InvoiceFeatures_supports_payment_secret(uint32_t this_arg) {
- LDKInvoiceFeatures this_arg_conv;
+jboolean __attribute__((visibility("default"))) TS_ChannelTypeFeatures_requires_unknown_bits(uint32_t this_arg) {
+ LDKChannelTypeFeatures this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
+ jboolean ret_val = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
return ret_val;
}
return ret_arr;
}
-int8_tArray __attribute__((visibility("default"))) TS_NodeFeatures_write(uint32_t obj) {
- LDKNodeFeatures obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
- int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
- CVec_u8Z_free(ret_var);
- return ret_arr;
+uint32_t __attribute__((visibility("default"))) TS_InitFeatures_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = InitFeatures_read(ser_ref);
+ return (uint64_t)ret_conv;
}
int8_tArray __attribute__((visibility("default"))) TS_ChannelFeatures_write(uint32_t obj) {
return ret_arr;
}
-int8_tArray __attribute__((visibility("default"))) TS_InvoiceFeatures_write(uint32_t obj) {
- LDKInvoiceFeatures obj_conv;
+uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
+ *ret_conv = ChannelFeatures_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_NodeFeatures_write(uint32_t obj) {
+ LDKNodeFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
+ LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
CVec_u8Z_free(ret_var);
return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_InitFeatures_read(int8_tArray ser) {
- LDKu8slice ser_ref;
- ser_ref.datalen = *((uint32_t*)ser);
- ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = InitFeatures_read(ser_ref);
- return (uint64_t)ret_conv;
-}
-
uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_read(int8_tArray ser) {
+int8_tArray __attribute__((visibility("default"))) TS_InvoiceFeatures_write(uint32_t obj) {
+ LDKInvoiceFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
- *ret_conv = ChannelFeatures_read(ser_ref);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = InvoiceFeatures_read(ser_ref);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_read(int8_tArray ser) {
+int8_tArray __attribute__((visibility("default"))) TS_ChannelTypeFeatures_write(uint32_t obj) {
+ LDKChannelTypeFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelTypeFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = InvoiceFeatures_read(ser_ref);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = ChannelTypeFeatures_read(ser_ref);
return (uint64_t)ret_conv;
}
Type_free(this_ptr_conv);
}
-void __attribute__((visibility("default"))) TS_Score_free(uint32_t this_ptr) {
- if ((this_ptr & 1) != 0) return;
- void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
- CHECK_ACCESS(this_ptr_ptr);
- LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
- FREE((void*)this_ptr);
- Score_free(this_ptr_conv);
-}
-
-void __attribute__((visibility("default"))) TS_LockableScore_free(uint32_t this_obj) {
- LDKLockableScore this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- LockableScore_free(this_obj_conv);
-}
-
-uint32_t __attribute__((visibility("default"))) TS_LockableScore_new(uint32_t score) {
- void* score_ptr = (void*)(((uint64_t)score) & ~1);
- CHECK_ACCESS(score_ptr);
- LDKScore score_conv = *(LDKScore*)(score_ptr);
- LDKLockableScore ret_var = LockableScore_new(score_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-int8_tArray __attribute__((visibility("default"))) TS_LockableScore_write(uint32_t obj) {
- LDKLockableScore obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = LockableScore_write(&obj_conv);
- int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
- CVec_u8Z_free(ret_var);
- return ret_arr;
-}
-
void __attribute__((visibility("default"))) TS_NodeId_free(uint32_t this_obj) {
LDKNodeId this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_new(uint32_t features_arg, uint32_t node_one_arg, uint32_t one_to_two_arg, uint32_t node_two_arg, uint32_t two_to_one_arg, uint32_t capacity_sats_arg, uint32_t announcement_message_arg) {
- LDKChannelFeatures features_arg_conv;
- features_arg_conv.inner = (void*)(features_arg & (~1));
- features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
- features_arg_conv = ChannelFeatures_clone(&features_arg_conv);
- LDKNodeId node_one_arg_conv;
- node_one_arg_conv.inner = (void*)(node_one_arg & (~1));
- node_one_arg_conv.is_owned = (node_one_arg & 1) || (node_one_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(node_one_arg_conv);
- node_one_arg_conv = NodeId_clone(&node_one_arg_conv);
- LDKDirectionalChannelInfo one_to_two_arg_conv;
- one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1));
- one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(one_to_two_arg_conv);
- one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv);
- LDKNodeId node_two_arg_conv;
- node_two_arg_conv.inner = (void*)(node_two_arg & (~1));
- node_two_arg_conv.is_owned = (node_two_arg & 1) || (node_two_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(node_two_arg_conv);
- node_two_arg_conv = NodeId_clone(&node_two_arg_conv);
- LDKDirectionalChannelInfo two_to_one_arg_conv;
- two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1));
- two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(two_to_one_arg_conv);
- two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv);
- void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1);
- CHECK_ACCESS(capacity_sats_arg_ptr);
- LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(capacity_sats_arg_ptr);
- capacity_sats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1));
- LDKChannelAnnouncement announcement_message_arg_conv;
- announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
- announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
- announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv);
- LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_conv, one_to_two_arg_conv, node_two_arg_conv, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
LDKChannelInfo ret_var = ChannelInfo_clone(arg);
uint64_t ret_ref = 0;
NetworkGraph_fail_node(&this_arg_conv, _node_id_ref, is_permanent);
}
+void __attribute__((visibility("default"))) TS_NetworkGraph_remove_stale_channels_with_time(uint32_t this_arg, int64_t current_time_unix) {
+ LDKNetworkGraph this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
+}
+
uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel(uint32_t this_arg, uint32_t msg) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return (uint64_t)ret_conv;
}
+void __attribute__((visibility("default"))) TS_Score_free(uint32_t this_ptr) {
+ if ((this_ptr & 1) != 0) return;
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Score_free(this_ptr_conv);
+}
+
+void __attribute__((visibility("default"))) TS_LockableScore_free(uint32_t this_ptr) {
+ if ((this_ptr & 1) != 0) return;
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ LockableScore_free(this_ptr_conv);
+}
+
+void __attribute__((visibility("default"))) TS_MultiThreadedLockableScore_free(uint32_t this_obj) {
+ LDKMultiThreadedLockableScore this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ MultiThreadedLockableScore_free(this_obj_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_MultiThreadedLockableScore_new(uint32_t score) {
+ void* score_ptr = (void*)(((uint64_t)score) & ~1);
+ CHECK_ACCESS(score_ptr);
+ LDKScore score_conv = *(LDKScore*)(score_ptr);
+ LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
void __attribute__((visibility("default"))) TS_Scorer_free(uint32_t this_obj) {
LDKScorer this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val);
}
+int16_t __attribute__((visibility("default"))) TS_ScoringParameters_get_overuse_penalty_start_1024th(uint32_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int16_t ret_val = ScoringParameters_get_overuse_penalty_start_1024th(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ScoringParameters_set_overuse_penalty_start_1024th(uint32_t this_ptr, int16_t val) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ScoringParameters_set_overuse_penalty_start_1024th(&this_ptr_conv, val);
+}
+
+int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_overuse_penalty_msat_per_1024th(uint32_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int64_t ret_val = ScoringParameters_get_overuse_penalty_msat_per_1024th(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ScoringParameters_set_overuse_penalty_msat_per_1024th(uint32_t this_ptr, int64_t val) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ScoringParameters_set_overuse_penalty_msat_per_1024th(&this_ptr_conv, val);
+}
+
int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_failure_penalty_half_life(uint32_t this_ptr) {
LDKScoringParameters this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val);
}
-uint32_t __attribute__((visibility("default"))) TS_ScoringParameters_new(int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int64_t failure_penalty_half_life_arg) {
- LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, failure_penalty_half_life_arg);
+uint32_t __attribute__((visibility("default"))) TS_ScoringParameters_new(int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int16_t overuse_penalty_start_1024th_arg, int64_t overuse_penalty_msat_per_1024th_arg, int64_t failure_penalty_half_life_arg) {
+ LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_CreationError_invalid_amount() {
+ uint32_t ret_conv = LDKCreationError_to_js(CreationError_invalid_amount());
+ return ret_conv;
+}
+
jboolean __attribute__((visibility("default"))) TS_CreationError_eq(uint32_t a, uint32_t b) {
LDKCreationError* a_conv = (LDKCreationError*)(a & ~1);
LDKCreationError* b_conv = (LDKCreationError*)(b & ~1);
void* router_ptr = (void*)(((uint64_t)router) & ~1);
CHECK_ACCESS(router_ptr);
LDKRouter router_conv = *(LDKRouter*)(router_ptr);
- LDKLockableScore scorer_conv;
+ LDKMultiThreadedLockableScore scorer_conv;
scorer_conv.inner = (void*)(scorer & (~1));
scorer_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_pay_pubkey(uint32_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int64_t amount_msats, int32_t final_cltv_expiry_delta) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKPublicKey pubkey_ref;
+ CHECK(*((uint32_t*)pubkey) == 33);
+ memcpy(pubkey_ref.compressed_form, (uint8_t*)(pubkey + 4), 33);
+ LDKThirtyTwoBytes payment_preimage_ref;
+ CHECK(*((uint32_t*)payment_preimage) == 32);
+ memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
+ return (uint64_t)ret_conv;
+}
+
void __attribute__((visibility("default"))) TS_InvoicePayer_remove_cached_payment(uint32_t this_arg, int8_tArray payment_hash) {
LDKInvoicePayer this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
default: abort();
}
}
+static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_js(int32_t ord) {
+ switch (ord) {
+ case 0: return LDKCOption_NoneZ_Some;
+ case 1: return LDKCOption_NoneZ_None;
+ }
+ abort();
+}
+static inline int32_t LDKCOption_NoneZ_to_js(LDKCOption_NoneZ val) {
+ switch (val) {
+ case LDKCOption_NoneZ_Some: return 0;
+ case LDKCOption_NoneZ_None: return 1;
+ default: abort();
+ }
+}
static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_js(int32_t ord) {
switch (ord) {
case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
case 1: return LDKCreationError_RouteTooLong;
case 2: return LDKCreationError_TimestampOutOfBounds;
case 3: return LDKCreationError_ExpiryTimeOutOfBounds;
+ case 4: return LDKCreationError_InvalidAmount;
}
abort();
}
case LDKCreationError_RouteTooLong: return 1;
case LDKCreationError_TimestampOutOfBounds: return 2;
case LDKCreationError_ExpiryTimeOutOfBounds: return 3;
+ case LDKCreationError_InvalidAmount: return 4;
default: abort();
}
}
}
static inline LDKLevel LDKLevel_from_js(int32_t ord) {
switch (ord) {
- case 0: return LDKLevel_Trace;
- case 1: return LDKLevel_Debug;
- case 2: return LDKLevel_Info;
- case 3: return LDKLevel_Warn;
- case 4: return LDKLevel_Error;
+ case 0: return LDKLevel_Gossip;
+ case 1: return LDKLevel_Trace;
+ case 2: return LDKLevel_Debug;
+ case 3: return LDKLevel_Info;
+ case 4: return LDKLevel_Warn;
+ case 5: return LDKLevel_Error;
}
abort();
}
static inline int32_t LDKLevel_to_js(LDKLevel val) {
switch (val) {
- case LDKLevel_Trace: return 0;
- case LDKLevel_Debug: return 1;
- case LDKLevel_Info: return 2;
- case LDKLevel_Warn: return 3;
- case LDKLevel_Error: return 4;
+ case LDKLevel_Gossip: return 0;
+ case LDKLevel_Trace: return 1;
+ case LDKLevel_Debug: return 2;
+ case LDKLevel_Info: return 3;
+ case LDKLevel_Warn: return 4;
+ case LDKLevel_Error: return 5;
default: abort();
}
}
case LDKClosureReason_CommitmentTxConfirmed: {
return 0 /* LDKClosureReason - CommitmentTxConfirmed */;
}
+ case LDKClosureReason_FundingTimedOut: {
+ return 0 /* LDKClosureReason - FundingTimedOut */;
+ }
case LDKClosureReason_ProcessingError: {
LDKStr err_str = obj->processing_error.err;
jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
memcpy((uint8_t*)(payment_preimage_arr + 4), obj->invoice_payment.payment_preimage.data, 32);
int8_tArray payment_secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(payment_secret_arr + 4), obj->invoice_payment.payment_secret.data, 32);
- return 0 /* LDKPaymentPurpose - InvoicePayment */; (void) payment_preimage_arr; (void) payment_secret_arr; (void) obj->invoice_payment.user_payment_id;
+ return 0 /* LDKPaymentPurpose - InvoicePayment */; (void) payment_preimage_arr; (void) payment_secret_arr;
}
case LDKPaymentPurpose_SpontaneousPayment: {
int8_tArray spontaneous_payment_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
}
return 0 /* LDKEvent - PaymentPathFailed */; (void) payment_id_arr; (void) payment_hash_arr; (void) obj->payment_path_failed.rejected_by_dest; (void) network_update_ref; (void) obj->payment_path_failed.all_paths_failed; (void) path_arr; (void) short_channel_id_ref; (void) retry_ref;
}
+ case LDKEvent_PaymentFailed: {
+ int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_failed.payment_id.data, 32);
+ int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_failed.payment_hash.data, 32);
+ return 0 /* LDKEvent - PaymentFailed */; (void) payment_id_arr; (void) payment_hash_arr;
+ }
case LDKEvent_PendingHTLCsForwardable: {
return 0 /* LDKEvent - PendingHTLCsForwardable */; (void) obj->pending_htl_cs_forwardable.time_forwardable;
}
memcpy((uint8_t*)(transaction_arr + 4), transaction_var.data, transaction_var.datalen);
return 0 /* LDKEvent - DiscardFunding */; (void) channel_id_arr; (void) transaction_arr;
}
+ case LDKEvent_PaymentPathSuccessful: {
+ int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_path_successful.payment_id.data, 32);
+ int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_path_successful.payment_hash.data, 32);
+ LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
+ uint32_tArray path_arr = NULL;
+ path_arr = init_arr(path_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *path_arr_ptr = (uint32_t*)(path_arr + 4);
+ for (size_t k = 0; k < path_var.datalen; k++) {
+ LDKRouteHop path_conv_10_var = path_var.data[k];
+ uint64_t path_conv_10_ref = 0;
+ CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
+ path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
+ path_arr_ptr[k] = path_conv_10_ref;
+ }
+
+ return 0 /* LDKEvent - PaymentPathSuccessful */; (void) payment_id_arr; (void) payment_hash_arr; (void) path_arr;
+ }
default: abort();
}
}
uint32_t ignore_and_log_conv = LDKLevel_to_js(obj->ignore_and_log);
return 0 /* LDKErrorAction - IgnoreAndLog */; (void) ignore_and_log_conv;
}
+ case LDKErrorAction_IgnoreDuplicateGossip: {
+ return 0 /* LDKErrorAction - IgnoreDuplicateGossip */;
+ }
case LDKErrorAction_SendErrorMessage: {
LDKErrorMessage msg_var = obj->send_error_message.msg;
uint64_t msg_ref = 0;
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKInitFeatures res_var = (*val->contents.result);
+ LDKScoringParameters res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKNodeFeatures res_var = (*val->contents.result);
+ LDKScorer res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ LDKDecodeError err_var = (*val->contents.err);
+ uint64_t err_ref = 0;
+ CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKInitFeatures res_var = (*val->contents.result);
+ uint64_t res_ref = 0;
+ CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var);
+ res_ref = (uint64_t)res_var.inner & ~1;
+ return res_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitFeaturesDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKInvoiceFeatures res_var = (*val->contents.result);
+ LDKNodeFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKScoringParameters res_var = (*val->contents.result);
+ LDKInvoiceFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ *val = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKScorer res_var = (*val->contents.result);
+ LDKChannelTypeFeatures res_var = (*val->contents.result);
uint64_t res_ref = 0;
CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ *val = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
uint64_t err_ref = 0;
return 0 /* LDKNetAddress - IPv6 */; (void) addr_arr; (void) obj->i_pv6.port;
}
case LDKNetAddress_OnionV2: {
- int8_tArray addr_arr = init_arr(10, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(addr_arr + 4), obj->onion_v2.addr.data, 10);
- return 0 /* LDKNetAddress - OnionV2 */; (void) addr_arr; (void) obj->onion_v2.port;
+ int8_tArray onion_v2_arr = init_arr(12, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(onion_v2_arr + 4), obj->onion_v2.data, 12);
+ return 0 /* LDKNetAddress - OnionV2 */; (void) onion_v2_arr;
}
case LDKNetAddress_OnionV3: {
int8_tArray ed25519_pubkey_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
return ret_arr;
}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKC2Tuple_PaymentHashPaymentSecretZ* res_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
+ *res_conv = (*val->contents.result);
+ *res_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(res_conv);
+ return ((uint64_t)res_conv);
+}
+void __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKC2Tuple_PaymentHashPaymentSecretZ* res_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
+ *res_conv = (*val->contents.result);
+ *res_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(res_conv);
+ return ((uint64_t)res_conv);
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+ return err_ref;
+}
+int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretNoneZ_get_ok(uint32_t arg) {
+ LDKCResult_PaymentSecretNoneZ *val = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ int8_tArray res_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(res_arr + 4), (*val->contents.result).data, 32);
+ return res_arr;
+}
+void __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretNoneZ_get_err(uint32_t arg) {
+ LDKCResult_PaymentSecretNoneZ *val = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentSecretAPIErrorZ_get_ok(uint32_t arg) {
LDKCResult_PaymentSecretAPIErrorZ *val = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1);
CHECK(val->result_ok);
uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
+int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentPreimageAPIErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ *val = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ int8_tArray res_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(res_arr + 4), (*val->contents.result).data, 32);
+ return res_arr;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentPreimageAPIErrorZ_get_err(uint32_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ *val = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+ return err_ref;
+}
static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
uint32_t get_secure_random_bytes_meth;
uint32_t read_chan_signer_meth;
uint32_t sign_invoice_meth;
+ uint32_t get_inbound_payment_key_material_meth;
} LDKKeysInterface_JCalls;
static void LDKKeysInterface_JCalls_free(void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
js_free(j_calls->get_secure_random_bytes_meth);
js_free(j_calls->read_chan_signer_meth);
js_free(j_calls->sign_invoice_meth);
+ js_free(j_calls->get_inbound_payment_key_material_meth);
FREE(j_calls);
}
}
FREE((void*)ret);
return ret_conv;
}
+LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
+ LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+ int8_tArray ret = js_invoke_function_0(j_calls->get_inbound_payment_key_material_meth);
+ LDKThirtyTwoBytes ret_ref;
+ CHECK(*((uint32_t*)ret) == 32);
+ memcpy(ret_ref.data, (uint8_t*)(ret + 4), 32);
+ return ret_ref;
+}
static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
.get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
.read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
.sign_invoice = sign_invoice_LDKKeysInterface_jcall,
+ .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
.free = LDKKeysInterface_JCalls_free,
};
return ret;
return (uint64_t)ret_conv;
}
+int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_inbound_payment_key_material(uint32_t this_arg) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32);
+ return ret_arr;
+}
+
typedef struct LDKFeeEstimator_JCalls {
atomic_size_t refcnt;
uint32_t get_est_sat_per_1000_weight_meth;
err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-void __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdateErrorZ_get_ok(uint32_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- return *val->contents.result;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdateErrorZ_get_err(uint32_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKMonitorUpdateError err_var = (*val->contents.err);
- uint64_t err_ref = 0;
- CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var);
- err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
return OutPoint_clone(&tuple->a);
}
atomic_size_t refcnt;
uint32_t channel_penalty_msat_meth;
uint32_t payment_path_failed_meth;
+ uint32_t payment_path_successful_meth;
uint32_t write_meth;
} LDKScore_JCalls;
static void LDKScore_JCalls_free(void* this_arg) {
if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
js_free(j_calls->channel_penalty_msat_meth);
js_free(j_calls->payment_path_failed_meth);
+ js_free(j_calls->payment_path_successful_meth);
js_free(j_calls->write_meth);
FREE(j_calls);
}
}
-uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target) {
+uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, LDKCOption_u64Z channel_capacity_msat, const LDKNodeId * source, const LDKNodeId * target) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
+ LDKCOption_u64Z *channel_capacity_msat_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *channel_capacity_msat_copy = channel_capacity_msat;
+ uint64_t channel_capacity_msat_ref = (uint64_t)channel_capacity_msat_copy;
LDKNodeId source_var = *source;
uint64_t source_ref = 0;
source_var = NodeId_clone(source);
if (target_var.is_owned) {
target_ref |= 1;
}
- return js_invoke_function_3(j_calls->channel_penalty_msat_meth, short_channel_id, source_ref, target_ref);
+ return js_invoke_function_5(j_calls->channel_penalty_msat_meth, short_channel_id, send_amt_msat, channel_capacity_msat_ref, source_ref, target_ref);
}
void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
FREE(path_var.data);
js_invoke_function_2(j_calls->payment_path_failed_meth, path_arr, short_channel_id);
}
+void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
+ LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
+ LDKCVec_RouteHopZ path_var = path;
+ uint32_tArray path_arr = NULL;
+ path_arr = init_arr(path_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *path_arr_ptr = (uint32_t*)(path_arr + 4);
+ for (size_t k = 0; k < path_var.datalen; k++) {
+ LDKRouteHop path_conv_10_var = path_var.data[k];
+ uint64_t path_conv_10_ref = 0;
+ CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
+ path_conv_10_ref = (uint64_t)path_conv_10_var.inner;
+ if (path_conv_10_var.is_owned) {
+ path_conv_10_ref |= 1;
+ }
+ path_arr_ptr[k] = path_conv_10_ref;
+ }
+
+ FREE(path_var.data);
+ js_invoke_function_1(j_calls->payment_path_successful_meth, path_arr);
+}
LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->write_meth);
.this_arg = (void*) calls,
.channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
.payment_path_failed = payment_path_failed_LDKScore_jcall,
+ .payment_path_successful = payment_path_successful_LDKScore_jcall,
.write = write_LDKScore_jcall,
.free = LDKScore_JCalls_free,
};
*res_ptr = LDKScore_init(o);
return (long)res_ptr;
}
-int64_t __attribute__((visibility("default"))) TS_Score_channel_penalty_msat(uint32_t this_arg, int64_t short_channel_id, uint32_t source, uint32_t target) {
+int64_t __attribute__((visibility("default"))) TS_Score_channel_penalty_msat(uint32_t this_arg, int64_t short_channel_id, int64_t send_amt_msat, uint32_t channel_capacity_msat, uint32_t source, uint32_t target) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ void* channel_capacity_msat_ptr = (void*)(((uint64_t)channel_capacity_msat) & ~1);
+ CHECK_ACCESS(channel_capacity_msat_ptr);
+ LDKCOption_u64Z channel_capacity_msat_conv = *(LDKCOption_u64Z*)(channel_capacity_msat_ptr);
+ channel_capacity_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)channel_capacity_msat) & ~1));
LDKNodeId source_conv;
source_conv.inner = (void*)(source & (~1));
source_conv.is_owned = false;
target_conv.inner = (void*)(target & (~1));
target_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
- int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv);
+ int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, send_amt_msat, channel_capacity_msat_conv, &source_conv, &target_conv);
return ret_val;
}
(this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
}
+void __attribute__((visibility("default"))) TS_Score_payment_path_successful(uint32_t this_arg, uint32_tArray path) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ LDKCVec_RouteHopZ path_constr;
+ path_constr.datalen = *((uint32_t*)path);
+ if (path_constr.datalen > 0)
+ path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ else
+ path_constr.data = NULL;
+ uint32_t* path_vals = (uint32_t*)(path + 4);
+ for (size_t k = 0; k < path_constr.datalen; k++) {
+ uint32_t path_conv_10 = path_vals[k];
+ LDKRouteHop path_conv_10_conv;
+ path_conv_10_conv.inner = (void*)(path_conv_10 & (~1));
+ path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
+ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
+ path_constr.data[k] = path_conv_10_conv;
+ }
+ (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
+}
+
int8_tArray __attribute__((visibility("default"))) TS_Score_write(uint32_t this_arg) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
return ret_arr;
}
+typedef struct LDKLockableScore_JCalls {
+ atomic_size_t refcnt;
+ uint32_t lock_meth;
+} LDKLockableScore_JCalls;
+static void LDKLockableScore_JCalls_free(void* this_arg) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ js_free(j_calls->lock_meth);
+ FREE(j_calls);
+ }
+}
+LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
+ uint32_t ret = js_invoke_function_0(j_calls->lock_meth);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKScore ret_conv = *(LDKScore*)(ret_ptr);// Warning: we may need a move here but no clone is available for LDKScore
+
+ return ret_conv;
+}
+static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
+ LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKLockableScore LDKLockableScore_init (/*TODO: JS Object Reference */void* o) {
+ LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ //TODO: Assign calls->o from o
+
+ LDKLockableScore ret = {
+ .this_arg = (void*) calls,
+ .lock = lock_LDKLockableScore_jcall,
+ .free = LDKLockableScore_JCalls_free,
+ };
+ return ret;
+}
+long __attribute__((visibility("default"))) TS_LDKLockableScore_new(/*TODO: JS Object Reference */void* o) {
+ LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
+ *res_ptr = LDKLockableScore_init(o);
+ return (long)res_ptr;
+}
+uint32_t __attribute__((visibility("default"))) TS_LockableScore_lock(uint32_t this_arg) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
+ *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
+ return (uint64_t)ret_ret;
+}
+
typedef struct LDKChannelManagerPersister_JCalls {
atomic_size_t refcnt;
uint32_t persist_manager_meth;
uint32_t node_id_meth;
uint32_t first_hops_meth;
uint32_t send_payment_meth;
+ uint32_t send_spontaneous_payment_meth;
uint32_t retry_payment_meth;
+ uint32_t abandon_payment_meth;
} LDKPayer_JCalls;
static void LDKPayer_JCalls_free(void* this_arg) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
js_free(j_calls->node_id_meth);
js_free(j_calls->first_hops_meth);
js_free(j_calls->send_payment_meth);
+ js_free(j_calls->send_spontaneous_payment_meth);
js_free(j_calls->retry_payment_meth);
+ js_free(j_calls->abandon_payment_meth);
FREE(j_calls);
}
}
FREE((void*)ret);
return ret_conv;
}
+LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ LDKRoute route_var = *route;
+ uint64_t route_ref = 0;
+ route_var = Route_clone(route);
+ CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_ref |= 1;
+ }
+ int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_preimage_arr + 4), payment_preimage.data, 32);
+ uint32_t ret = js_invoke_function_2(j_calls->send_spontaneous_payment_meth, route_ref, payment_preimage_arr);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
+ FREE((void*)ret);
+ return ret_conv;
+}
LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
LDKRoute route_var = *route;
FREE((void*)ret);
return ret_conv;
}
+void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_id_arr + 4), payment_id.data, 32);
+ js_invoke_function_1(j_calls->abandon_payment_meth, payment_id_arr);
+}
static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
.node_id = node_id_LDKPayer_jcall,
.first_hops = first_hops_LDKPayer_jcall,
.send_payment = send_payment_LDKPayer_jcall,
+ .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
.retry_payment = retry_payment_LDKPayer_jcall,
+ .abandon_payment = abandon_payment_LDKPayer_jcall,
.free = LDKPayer_JCalls_free,
};
return ret;
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_Payer_send_spontaneous_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_preimage) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKRoute route_conv;
+ route_conv.inner = (void*)(route & (~1));
+ route_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
+ LDKThirtyTwoBytes payment_preimage_ref;
+ CHECK(*((uint32_t*)payment_preimage) == 32);
+ memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+ LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
+ return (uint64_t)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_Payer_retry_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
return (uint64_t)ret_conv;
}
+void __attribute__((visibility("default"))) TS_Payer_abandon_payment(uint32_t this_arg, int8_tArray payment_id) {
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
+ (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
+}
+
typedef struct LDKRouter_JCalls {
atomic_size_t refcnt;
uint32_t find_route_meth;
FREE(j_calls);
}
}
-LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * params, LDKCVec_ChannelDetailsZ * first_hops, const LDKScore * scorer) {
+LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * params, const uint8_t (* payment_hash)[32], LDKCVec_ChannelDetailsZ * first_hops, const LDKScore * scorer) {
LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
int8_tArray payer_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(payer_arr + 4), payer.compressed_form, 33);
if (params_var.is_owned) {
params_ref |= 1;
}
+ int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_hash_arr + 4), *payment_hash, 32);
LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
uint32_tArray first_hops_arr = NULL;
if (first_hops != NULL) {
}
// WARNING: This object doesn't live past this scope, needs clone!
uint64_t ret_scorer = ((uint64_t)scorer) | 1;
- uint32_t ret = js_invoke_function_4(j_calls->find_route_meth, payer_arr, params_ref, first_hops_arr, ret_scorer);
+ uint32_t ret = js_invoke_function_5(j_calls->find_route_meth, payer_arr, params_ref, payment_hash_arr, first_hops_arr, ret_scorer);
void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
*res_ptr = LDKRouter_init(o);
return (long)res_ptr;
}
-uint32_t __attribute__((visibility("default"))) TS_Router_find_route(uint32_t this_arg, int8_tArray payer, uint32_t params, uint32_tArray first_hops, uint32_t scorer) {
+uint32_t __attribute__((visibility("default"))) TS_Router_find_route(uint32_t this_arg, int8_tArray payer, uint32_t params, int8_tArray payment_hash, uint32_tArray first_hops, uint32_t scorer) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
params_conv.inner = (void*)(params & (~1));
params_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
+ unsigned char payment_hash_arr[32];
+ CHECK(*((uint32_t*)payment_hash) == 32);
+ memcpy(payment_hash_arr, (uint8_t*)(payment_hash + 4), 32);
+ unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
LDKCVec_ChannelDetailsZ first_hops_constr;
LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
if (first_hops != 0) {
if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, ¶ms_conv, first_hops_ptr, scorer_conv);
+ *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, ¶ms_conv, payment_hash_ref, first_hops_ptr, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
return (uint64_t)ret_conv;
}
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_COption_NoneZ_some() {
+ uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_some());
+ return ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_COption_NoneZ_none() {
+ uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_none());
+ return ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_COption_NoneZ_free(uint32_t _res) {
+ LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_js(_res);
+ COption_NoneZ_free(_res_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(uint32_t o) {
LDKCounterpartyChannelTransactionParameters o_conv;
o_conv.inner = (void*)(o & (~1));
CVec_MessageSendEventZ_free(_res_constr);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint32_t o) {
- LDKInitFeatures o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_ok(uint32_t o) {
+ LDKScoringParameters o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = InitFeatures_clone(&o_conv);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
+ // Warning: we need a move here but no clone is available for LDKScoringParameters
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-jboolean __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint32_t o) {
- LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_ScoringParametersDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint32_t o) {
- LDKNodeFeatures o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_ok(uint32_t o) {
+ LDKScorer o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = NodeFeatures_clone(&o_conv);
- LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
- *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
+ // Warning: we need a move here but no clone is available for LDKScorer
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
- *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-jboolean __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint32_t o) {
- LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_ScorerDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint32_t o) {
+ LDKInitFeatures o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
+ o_conv = InitFeatures_clone(&o_conv);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+jboolean __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecodeErrorZ_ok(uint32_t o) {
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint32_t o) {
- LDKInvoiceFeatures o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint32_t o) {
+ LDKNodeFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- o_conv = InvoiceFeatures_clone(&o_conv);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
+ o_conv = NodeFeatures_clone(&o_conv);
+ LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
+ LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint32_t o) {
- LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
+ LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
+ CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_ok(uint32_t o) {
- LDKScoringParameters o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint32_t o) {
+ LDKInvoiceFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- // Warning: we need a move here but no clone is available for LDKScoringParameters
- LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
- *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv);
+ o_conv = InvoiceFeatures_clone(&o_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
- *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-jboolean __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_is_ok(uint32_t o) {
- LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_CResult_ScoringParametersDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_ScoringParametersDecodeErrorZ_free(_res_conv);
+ CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_ok(uint32_t o) {
- LDKScorer o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok(uint32_t o) {
+ LDKChannelTypeFeatures o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
- // Warning: we need a move here but no clone is available for LDKScorer
- LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
- *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv);
+ o_conv = ChannelTypeFeatures_clone(&o_conv);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
- *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-jboolean __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_is_ok(uint32_t o) {
- LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1);
- jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv);
+jboolean __attribute__((visibility("default"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint32_t o) {
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_CResult_ScorerDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_ScorerDecodeErrorZ_free(_res_conv);
+ CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint32_t o) {
C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(uint32_t o) {
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
+ o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
+ return (uint64_t)ret_conv;
+}
+
+jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(uint32_t o) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(o & ~1);
+ jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+int64_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1);
+ int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(uint32_t orig) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(orig & ~1);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(uint32_t o) {
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
+ o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(uint32_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
+ e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+jboolean __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(uint32_t o) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+int64_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint32_t arg) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1);
+ int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(uint32_t orig) {
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(orig & ~1);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(*((uint32_t*)o) == 32);
+ memcpy(o_ref.data, (uint8_t*)(o + 4), 32);
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_err() {
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_err();
+ return (uint64_t)ret_conv;
+}
+
+jboolean __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_is_ok(uint32_t o) {
+ LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)(o & ~1);
+ jboolean ret_val = CResult_PaymentSecretNoneZ_is_ok(o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentSecretNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+int64_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint32_t arg) {
+ LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1);
+ int64_t ret_val = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretNoneZ_clone(uint32_t orig) {
+ LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)(orig & ~1);
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_ok(int8_tArray o) {
LDKThirtyTwoBytes o_ref;
CHECK(*((uint32_t*)o) == 32);
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(*((uint32_t*)o) == 32);
+ memcpy(o_ref.data, (uint8_t*)(o + 4), 32);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_err(uint32_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
+ e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+jboolean __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_is_ok(uint32_t o) {
+ LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(o & ~1);
+ jboolean ret_val = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
+ return (uint64_t)ret_conv;
+}
+int64_t __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint32_t arg) {
+ LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1);
+ int64_t ret_val = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
+ return ret_val;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentPreimageAPIErrorZ_clone(uint32_t orig) {
+ LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(orig & ~1);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
void __attribute__((visibility("default"))) TS_CVec_ChannelMonitorZ_free(uint32_tArray _res) {
LDKCVec_ChannelMonitorZ _res_constr;
_res_constr.datalen = *((uint32_t*)_res);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_ok() {
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_ok();
- return (uint64_t)ret_conv;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_err(uint32_t e) {
- LDKMonitorUpdateError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = MonitorUpdateError_clone(&e_conv);
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-jboolean __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_is_ok(uint32_t o) {
- LDKCResult_NoneMonitorUpdateErrorZ* o_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(o & ~1);
- jboolean ret_val = CResult_NoneMonitorUpdateErrorZ_is_ok(o_conv);
- return ret_val;
-}
-
-void __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_free(uint32_t _res) {
- if ((_res & 1) != 0) return;
- void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_NoneMonitorUpdateErrorZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg) {
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(arg);
- return (uint64_t)ret_conv;
-}
-int64_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_clone_ptr(uint32_t arg) {
- LDKCResult_NoneMonitorUpdateErrorZ* arg_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1);
- int64_t ret_val = CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg_conv);
- return ret_val;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_clone(uint32_t orig) {
- LDKCResult_NoneMonitorUpdateErrorZ* orig_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(orig & ~1);
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
*ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret, int64_t user_payment_id) {
+uint32_t __attribute__((visibility("default"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) {
LDKThirtyTwoBytes payment_preimage_ref;
CHECK(*((uint32_t*)payment_preimage) == 32);
memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
CHECK(*((uint32_t*)payment_secret) == 32);
memcpy(payment_secret_ref.data, (uint8_t*)(payment_secret + 4), 32);
LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
- *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref, user_payment_id);
+ *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_ClosureReason_funding_timed_out() {
+ LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
+ *ret_copy = ClosureReason_funding_timed_out();
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_ClosureReason_processing_error(jstring err) {
LDKStr err_conv = str_ref_to_owned_c(err);
LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(*((uint32_t*)payment_hash) == 32);
+ memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+ LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) {
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_Event_payment_path_successful(int8_tArray payment_id, int8_tArray payment_hash, uint32_tArray path) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(*((uint32_t*)payment_hash) == 32);
+ memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+ LDKCVec_RouteHopZ path_constr;
+ path_constr.datalen = *((uint32_t*)path);
+ if (path_constr.datalen > 0)
+ path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ else
+ path_constr.data = NULL;
+ uint32_t* path_vals = (uint32_t*)(path + 4);
+ for (size_t k = 0; k < path_constr.datalen; k++) {
+ uint32_t path_conv_10 = path_vals[k];
+ LDKRouteHop path_conv_10_conv;
+ path_conv_10_conv.inner = (void*)(path_conv_10 & (~1));
+ path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
+ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
+ path_constr.data[k] = path_conv_10_conv;
+ }
+ LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
int8_tArray __attribute__((visibility("default"))) TS_Event_write(uint32_t obj) {
LDKEvent* obj_conv = (LDKEvent*)obj;
LDKCVec_u8Z ret_var = Event_write(obj_conv);
return ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_Level_gossip() {
+ uint32_t ret_conv = LDKLevel_to_js(Level_gossip());
+ return ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_Level_trace() {
uint32_t ret_conv = LDKLevel_to_js(Level_trace());
return ret_conv;
UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
}
-uint32_t __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_channel_config_arg, uint32_t peer_channel_config_limits_arg, uint32_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg) {
+jboolean __attribute__((visibility("default"))) TS_UserConfig_get_accept_inbound_channels(uint32_t this_ptr) {
+ LDKUserConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ jboolean ret_val = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_UserConfig_set_accept_inbound_channels(uint32_t this_ptr, jboolean val) {
+ LDKUserConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_channel_config_arg, uint32_t peer_channel_config_limits_arg, uint32_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg) {
LDKChannelHandshakeConfig own_channel_config_arg_conv;
own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1));
own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0);
channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv);
channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv);
- LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg);
+ LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (uint64_t)ret_conv;
}
-void __attribute__((visibility("default"))) TS_MonitorUpdateError_free(uint32_t this_obj) {
- LDKMonitorUpdateError this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- MonitorUpdateError_free(this_obj_conv);
-}
-
-jstring __attribute__((visibility("default"))) TS_MonitorUpdateError_get_a(uint32_t this_ptr) {
- LDKMonitorUpdateError this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- LDKStr ret_str = MonitorUpdateError_get_a(&this_ptr_conv);
- jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
- Str_free(ret_str);
- return ret_conv;
-}
-
-void __attribute__((visibility("default"))) TS_MonitorUpdateError_set_a(uint32_t this_ptr, jstring val) {
- LDKMonitorUpdateError this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
- LDKStr val_conv = str_ref_to_owned_c(val);
- MonitorUpdateError_set_a(&this_ptr_conv, val_conv);
-}
-
-uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_new(jstring a_arg) {
- LDKStr a_arg_conv = str_ref_to_owned_c(a_arg);
- LDKMonitorUpdateError ret_var = MonitorUpdateError_new(a_arg_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-static inline uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg) {
- LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(arg);
-uint64_t ret_ref = 0;
-CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
-CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
-ret_ref = (uint64_t)ret_var.inner;
-if (ret_var.is_owned) {
- ret_ref |= 1;
-}
- return ret_ref;
-}
-int64_t __attribute__((visibility("default"))) TS_MonitorUpdateError_clone_ptr(uint32_t arg) {
- LDKMonitorUpdateError arg_conv;
- arg_conv.inner = (void*)(arg & (~1));
- arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
- int64_t ret_val = MonitorUpdateError_clone_ptr(&arg_conv);
- return ret_val;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateError_clone(uint32_t orig) {
- LDKMonitorUpdateError orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
- LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
void __attribute__((visibility("default"))) TS_MonitorEvent_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
- LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
*ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
return (uint64_t)ret_conv;
}
return ret_ref;
}
+jboolean __attribute__((visibility("default"))) TS_InMemorySigner_opt_anchors(uint32_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = InMemorySigner_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_counterparty_payment_input(uint32_t this_arg, int8_tArray spend_tx, int64_t input_idx, uint32_t descriptor) {
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
}
+int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_balance_msat(uint32_t this_ptr) {
+ LDKChannelDetails this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int64_t ret_val = ChannelDetails_get_balance_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelDetails_set_balance_msat(uint32_t this_ptr, int64_t val) {
+ LDKChannelDetails this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ChannelDetails_set_balance_msat(&this_ptr_conv, val);
+}
+
int64_t __attribute__((visibility("default"))) TS_ChannelDetails_get_outbound_capacity_msat(uint32_t this_ptr) {
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ChannelDetails_set_is_public(&this_ptr_conv, val);
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_new(int8_tArray channel_id_arg, uint32_t counterparty_arg, uint32_t funding_txo_arg, uint32_t short_channel_id_arg, int64_t channel_value_satoshis_arg, uint32_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, uint32_t confirmations_required_arg, uint32_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) {
+uint32_t __attribute__((visibility("default"))) TS_ChannelDetails_new(int8_tArray channel_id_arg, uint32_t counterparty_arg, uint32_t funding_txo_arg, uint32_t short_channel_id_arg, int64_t channel_value_satoshis_arg, uint32_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, uint32_t confirmations_required_arg, uint32_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) {
LDKThirtyTwoBytes channel_id_arg_ref;
CHECK(*((uint32_t*)channel_id_arg) == 32);
memcpy(channel_id_arg_ref.data, (uint8_t*)(channel_id_arg + 4), 32);
CHECK_ACCESS(force_close_spend_delay_arg_ptr);
LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1));
- LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
+ LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (uint64_t)ret_conv;
}
+void __attribute__((visibility("default"))) TS_ChannelManager_abandon_payment(uint32_t this_arg, int8_tArray payment_id) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
+ ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
+}
+
uint32_t __attribute__((visibility("default"))) TS_ChannelManager_send_spontaneous_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_preimage) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment(uint32_t this_arg, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t user_payment_id) {
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment(uint32_t this_arg, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
CHECK_ACCESS(min_value_msat_ptr);
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
- LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
- *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
- return ((uint64_t)ret_conv);
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
+ *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment_legacy(uint32_t this_arg, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
+ min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
+ LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
+ *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment_for_hash(uint32_t this_arg, int8_tArray payment_hash, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(*((uint32_t*)payment_hash) == 32);
+ memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
+ min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
+ LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
+ *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment_for_hash(uint32_t this_arg, int8_tArray payment_hash, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs, int64_t user_payment_id) {
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_create_inbound_payment_for_hash_legacy(uint32_t this_arg, int8_tArray payment_hash, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
- *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
+ *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_get_payment_preimage(uint32_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKThirtyTwoBytes payment_hash_ref;
+ CHECK(*((uint32_t*)payment_hash) == 32);
+ memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+ LDKThirtyTwoBytes payment_secret_ref;
+ CHECK(*((uint32_t*)payment_secret) == 32);
+ memcpy(payment_secret_ref.data, (uint8_t*)(payment_secret + 4), 32);
+ LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
+ *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
return (uint64_t)ret_conv;
}
OpenChannel_set_channel_flags(&this_ptr_conv, val);
}
+uint32_t __attribute__((visibility("default"))) TS_OpenChannel_get_channel_type(uint32_t this_ptr) {
+ LDKOpenChannel this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
+ uint64_t ret_ref = 0;
+ if ((uint64_t)ret_var.inner > 4096) {
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_OpenChannel_set_channel_type(uint32_t this_ptr, uint32_t val) {
+ LDKOpenChannel this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKChannelTypeFeatures val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
+ val_conv = ChannelTypeFeatures_clone(&val_conv);
+ OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
+}
+
static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
LDKOpenChannel ret_var = OpenChannel_clone(arg);
uint64_t ret_ref = 0;
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_NetAddress_onion_v2(int8_tArray addr, int16_t port) {
- LDKTenBytes addr_ref;
- CHECK(*((uint32_t*)addr) == 10);
- memcpy(addr_ref.data, (uint8_t*)(addr + 4), 10);
+uint32_t __attribute__((visibility("default"))) TS_NetAddress_onion_v2(int8_tArray a) {
+ LDKTwelveBytes a_ref;
+ CHECK(*((uint32_t*)a) == 12);
+ memcpy(a_ref.data, (uint8_t*)(a + 4), 12);
LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
- *ret_copy = NetAddress_onion_v2(addr_ref, port);
+ *ret_copy = NetAddress_onion_v2(a_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_ErrorAction_ignore_duplicate_gossip() {
+ LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+ *ret_copy = ErrorAction_ignore_duplicate_gossip();
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_ErrorAction_send_error_message(uint32_t msg) {
LDKErrorMessage msg_conv;
msg_conv.inner = (void*)(msg & (~1));
PeerManager_timer_tick_occurred(&this_arg_conv);
}
+int64_t __attribute__((visibility("default"))) TS_htlc_success_tx_weight(jboolean opt_anchors) {
+ int64_t ret_val = htlc_success_tx_weight(opt_anchors);
+ return ret_val;
+}
+
+int64_t __attribute__((visibility("default"))) TS_htlc_timeout_tx_weight(jboolean opt_anchors) {
+ int64_t ret_val = htlc_timeout_tx_weight(opt_anchors);
+ return ret_val;
+}
+
int8_tArray __attribute__((visibility("default"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) {
unsigned char commitment_seed_arr[32];
CHECK(*((uint32_t*)commitment_seed) == 32);
return (uint64_t)ret_conv;
}
-int8_tArray __attribute__((visibility("default"))) TS_get_htlc_redeemscript(uint32_t htlc, uint32_t keys) {
+int8_tArray __attribute__((visibility("default"))) TS_get_htlc_redeemscript(uint32_t htlc, jboolean opt_anchors, uint32_t keys) {
LDKHTLCOutputInCommitment htlc_conv;
htlc_conv.inner = (void*)(htlc & (~1));
htlc_conv.is_owned = false;
keys_conv.inner = (void*)(keys & (~1));
keys_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
- LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv);
+ LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
CVec_u8Z_free(ret_var);
return ret_arr;
}
-int8_tArray __attribute__((visibility("default"))) TS_build_htlc_transaction(int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, uint32_t htlc, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
+int8_tArray __attribute__((visibility("default"))) TS_build_htlc_transaction(int8_tArray commitment_txid, int32_t feerate_per_kw, int16_t contest_delay, uint32_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
unsigned char commitment_txid_arr[32];
CHECK(*((uint32_t*)commitment_txid) == 32);
memcpy(commitment_txid_arr, (uint8_t*)(commitment_txid + 4), 32);
LDKPublicKey revocation_key_ref;
CHECK(*((uint32_t*)revocation_key) == 33);
memcpy(revocation_key_ref.compressed_form, (uint8_t*)(revocation_key + 4), 33);
- LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref);
+ LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, broadcaster_delayed_payment_key_ref, revocation_key_ref);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
Transaction_free(ret_var);
return ret_arr;
}
+int8_tArray __attribute__((visibility("default"))) TS_get_anchor_redeemscript(int8_tArray funding_pubkey) {
+ LDKPublicKey funding_pubkey_ref;
+ CHECK(*((uint32_t*)funding_pubkey) == 33);
+ memcpy(funding_pubkey_ref.compressed_form, (uint8_t*)(funding_pubkey + 4), 33);
+ LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_free(uint32_t this_obj) {
LDKChannelTransactionParameters this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_new(uint32_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, uint32_t counterparty_parameters_arg, uint32_t funding_outpoint_arg) {
+uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_get_opt_anchors(uint32_t this_ptr) {
+ LDKChannelTransactionParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ uint32_t ret_conv = LDKCOption_NoneZ_to_js(ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
+ return ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_set_opt_anchors(uint32_t this_ptr, uint32_t val) {
+ LDKChannelTransactionParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_js(val);
+ ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_new(uint32_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, uint32_t counterparty_parameters_arg, uint32_t funding_outpoint_arg, uint32_t opt_anchors_arg) {
LDKChannelPublicKeys holder_pubkeys_arg_conv;
holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1));
holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0);
funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0);
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
- LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv);
+ LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_anchors_arg);
+ LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv, opt_anchors_arg_conv);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return ret_ref;
}
+jboolean __attribute__((visibility("default"))) TS_DirectedChannelTransactionParameters_opt_anchors(uint32_t this_arg) {
+ LDKDirectedChannelTransactionParameters this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_free(uint32_t this_obj) {
LDKHolderCommitmentTransaction this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
return ret_ref;
}
+jboolean __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction_opt_anchors(uint32_t this_arg) {
+ LDKTrustedCommitmentTransaction this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ jboolean ret_val = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
+ return ret_val;
+}
+
uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction_get_htlc_sigs(uint32_t this_arg, int8_tArray htlc_base_key, uint32_t channel_parameters) {
LDKTrustedCommitmentTransaction this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return ret_val;
}
+jboolean __attribute__((visibility("default"))) TS_ChannelTypeFeatures_eq(uint32_t a, uint32_t b) {
+ LDKChannelTypeFeatures a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ LDKChannelTypeFeatures b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ jboolean ret_val = ChannelTypeFeatures_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
LDKInitFeatures ret_var = InitFeatures_clone(arg);
uint64_t ret_ref = 0;
return ret_ref;
}
+static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
+uint64_t ret_ref = 0;
+CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ret_ref = (uint64_t)ret_var.inner;
+if (ret_var.is_owned) {
+ ret_ref |= 1;
+}
+ return ret_ref;
+}
+int64_t __attribute__((visibility("default"))) TS_ChannelTypeFeatures_clone_ptr(uint32_t arg) {
+ LDKChannelTypeFeatures arg_conv;
+ arg_conv.inner = (void*)(arg & (~1));
+ arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
+ int64_t ret_val = ChannelTypeFeatures_clone_ptr(&arg_conv);
+ return ret_val;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelTypeFeatures_clone(uint32_t orig) {
+ LDKChannelTypeFeatures orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
void __attribute__((visibility("default"))) TS_InitFeatures_free(uint32_t this_obj) {
LDKInitFeatures this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
InvoiceFeatures_free(this_obj_conv);
}
+void __attribute__((visibility("default"))) TS_ChannelTypeFeatures_free(uint32_t this_obj) {
+ LDKChannelTypeFeatures this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ ChannelTypeFeatures_free(this_obj_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_InitFeatures_empty() {
LDKInitFeatures ret_var = InitFeatures_empty();
uint64_t ret_ref = 0;
return ret_val;
}
-jboolean __attribute__((visibility("default"))) TS_InitFeatures_supports_payment_secret(uint32_t this_arg) {
- LDKInitFeatures this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = InitFeatures_supports_payment_secret(&this_arg_conv);
- return ret_val;
+uint32_t __attribute__((visibility("default"))) TS_ChannelTypeFeatures_empty() {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
}
-jboolean __attribute__((visibility("default"))) TS_NodeFeatures_supports_payment_secret(uint32_t this_arg) {
- LDKNodeFeatures this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = NodeFeatures_supports_payment_secret(&this_arg_conv);
- return ret_val;
+uint32_t __attribute__((visibility("default"))) TS_ChannelTypeFeatures_known() {
+ LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
}
-jboolean __attribute__((visibility("default"))) TS_InvoiceFeatures_supports_payment_secret(uint32_t this_arg) {
- LDKInvoiceFeatures this_arg_conv;
+jboolean __attribute__((visibility("default"))) TS_ChannelTypeFeatures_requires_unknown_bits(uint32_t this_arg) {
+ LDKChannelTypeFeatures this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- jboolean ret_val = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
+ jboolean ret_val = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
return ret_val;
}
return ret_arr;
}
-int8_tArray __attribute__((visibility("default"))) TS_NodeFeatures_write(uint32_t obj) {
- LDKNodeFeatures obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
- int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
- CVec_u8Z_free(ret_var);
- return ret_arr;
+uint32_t __attribute__((visibility("default"))) TS_InitFeatures_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
+ *ret_conv = InitFeatures_read(ser_ref);
+ return (uint64_t)ret_conv;
}
int8_tArray __attribute__((visibility("default"))) TS_ChannelFeatures_write(uint32_t obj) {
return ret_arr;
}
-int8_tArray __attribute__((visibility("default"))) TS_InvoiceFeatures_write(uint32_t obj) {
- LDKInvoiceFeatures obj_conv;
+uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
+ *ret_conv = ChannelFeatures_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_NodeFeatures_write(uint32_t obj) {
+ LDKNodeFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
+ LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
CVec_u8Z_free(ret_var);
return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_InitFeatures_read(int8_tArray ser) {
- LDKu8slice ser_ref;
- ser_ref.datalen = *((uint32_t*)ser);
- ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
- *ret_conv = InitFeatures_read(ser_ref);
- return (uint64_t)ret_conv;
-}
-
uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_read(int8_tArray ser) {
+int8_tArray __attribute__((visibility("default"))) TS_InvoiceFeatures_write(uint32_t obj) {
+ LDKInvoiceFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
- *ret_conv = ChannelFeatures_read(ser_ref);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = InvoiceFeatures_read(ser_ref);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_read(int8_tArray ser) {
+int8_tArray __attribute__((visibility("default"))) TS_ChannelTypeFeatures_write(uint32_t obj) {
+ LDKChannelTypeFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
+ LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelTypeFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
- *ret_conv = InvoiceFeatures_read(ser_ref);
+ LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
+ *ret_conv = ChannelTypeFeatures_read(ser_ref);
return (uint64_t)ret_conv;
}
Type_free(this_ptr_conv);
}
-void __attribute__((visibility("default"))) TS_Score_free(uint32_t this_ptr) {
- if ((this_ptr & 1) != 0) return;
- void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
- CHECK_ACCESS(this_ptr_ptr);
- LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
- FREE((void*)this_ptr);
- Score_free(this_ptr_conv);
-}
-
-void __attribute__((visibility("default"))) TS_LockableScore_free(uint32_t this_obj) {
- LDKLockableScore this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- LockableScore_free(this_obj_conv);
-}
-
-uint32_t __attribute__((visibility("default"))) TS_LockableScore_new(uint32_t score) {
- void* score_ptr = (void*)(((uint64_t)score) & ~1);
- CHECK_ACCESS(score_ptr);
- LDKScore score_conv = *(LDKScore*)(score_ptr);
- LDKLockableScore ret_var = LockableScore_new(score_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-int8_tArray __attribute__((visibility("default"))) TS_LockableScore_write(uint32_t obj) {
- LDKLockableScore obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
- LDKCVec_u8Z ret_var = LockableScore_write(&obj_conv);
- int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
- CVec_u8Z_free(ret_var);
- return ret_arr;
-}
-
void __attribute__((visibility("default"))) TS_NodeId_free(uint32_t this_obj) {
LDKNodeId this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_new(uint32_t features_arg, uint32_t node_one_arg, uint32_t one_to_two_arg, uint32_t node_two_arg, uint32_t two_to_one_arg, uint32_t capacity_sats_arg, uint32_t announcement_message_arg) {
- LDKChannelFeatures features_arg_conv;
- features_arg_conv.inner = (void*)(features_arg & (~1));
- features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
- features_arg_conv = ChannelFeatures_clone(&features_arg_conv);
- LDKNodeId node_one_arg_conv;
- node_one_arg_conv.inner = (void*)(node_one_arg & (~1));
- node_one_arg_conv.is_owned = (node_one_arg & 1) || (node_one_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(node_one_arg_conv);
- node_one_arg_conv = NodeId_clone(&node_one_arg_conv);
- LDKDirectionalChannelInfo one_to_two_arg_conv;
- one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1));
- one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(one_to_two_arg_conv);
- one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv);
- LDKNodeId node_two_arg_conv;
- node_two_arg_conv.inner = (void*)(node_two_arg & (~1));
- node_two_arg_conv.is_owned = (node_two_arg & 1) || (node_two_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(node_two_arg_conv);
- node_two_arg_conv = NodeId_clone(&node_two_arg_conv);
- LDKDirectionalChannelInfo two_to_one_arg_conv;
- two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1));
- two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(two_to_one_arg_conv);
- two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv);
- void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1);
- CHECK_ACCESS(capacity_sats_arg_ptr);
- LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(capacity_sats_arg_ptr);
- capacity_sats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1));
- LDKChannelAnnouncement announcement_message_arg_conv;
- announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
- announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
- announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv);
- LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_conv, one_to_two_arg_conv, node_two_arg_conv, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv);
- uint64_t ret_ref = 0;
- CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
LDKChannelInfo ret_var = ChannelInfo_clone(arg);
uint64_t ret_ref = 0;
NetworkGraph_fail_node(&this_arg_conv, _node_id_ref, is_permanent);
}
+void __attribute__((visibility("default"))) TS_NetworkGraph_remove_stale_channels_with_time(uint32_t this_arg, int64_t current_time_unix) {
+ LDKNetworkGraph this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
+}
+
uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_update_channel(uint32_t this_arg, uint32_t msg) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
return (uint64_t)ret_conv;
}
+void __attribute__((visibility("default"))) TS_Score_free(uint32_t this_ptr) {
+ if ((this_ptr & 1) != 0) return;
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Score_free(this_ptr_conv);
+}
+
+void __attribute__((visibility("default"))) TS_LockableScore_free(uint32_t this_ptr) {
+ if ((this_ptr & 1) != 0) return;
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ LockableScore_free(this_ptr_conv);
+}
+
+void __attribute__((visibility("default"))) TS_MultiThreadedLockableScore_free(uint32_t this_obj) {
+ LDKMultiThreadedLockableScore this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
+ MultiThreadedLockableScore_free(this_obj_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_MultiThreadedLockableScore_new(uint32_t score) {
+ void* score_ptr = (void*)(((uint64_t)score) & ~1);
+ CHECK_ACCESS(score_ptr);
+ LDKScore score_conv = *(LDKScore*)(score_ptr);
+ LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
+ uint64_t ret_ref = 0;
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
void __attribute__((visibility("default"))) TS_Scorer_free(uint32_t this_obj) {
LDKScorer this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val);
}
+int16_t __attribute__((visibility("default"))) TS_ScoringParameters_get_overuse_penalty_start_1024th(uint32_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int16_t ret_val = ScoringParameters_get_overuse_penalty_start_1024th(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ScoringParameters_set_overuse_penalty_start_1024th(uint32_t this_ptr, int16_t val) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ScoringParameters_set_overuse_penalty_start_1024th(&this_ptr_conv, val);
+}
+
+int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_overuse_penalty_msat_per_1024th(uint32_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ int64_t ret_val = ScoringParameters_get_overuse_penalty_msat_per_1024th(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ScoringParameters_set_overuse_penalty_msat_per_1024th(uint32_t this_ptr, int64_t val) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ ScoringParameters_set_overuse_penalty_msat_per_1024th(&this_ptr_conv, val);
+}
+
int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_failure_penalty_half_life(uint32_t this_ptr) {
LDKScoringParameters this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val);
}
-uint32_t __attribute__((visibility("default"))) TS_ScoringParameters_new(int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int64_t failure_penalty_half_life_arg) {
- LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, failure_penalty_half_life_arg);
+uint32_t __attribute__((visibility("default"))) TS_ScoringParameters_new(int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int16_t overuse_penalty_start_1024th_arg, int64_t overuse_penalty_msat_per_1024th_arg, int64_t failure_penalty_half_life_arg) {
+ LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg);
uint64_t ret_ref = 0;
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_CreationError_invalid_amount() {
+ uint32_t ret_conv = LDKCreationError_to_js(CreationError_invalid_amount());
+ return ret_conv;
+}
+
jboolean __attribute__((visibility("default"))) TS_CreationError_eq(uint32_t a, uint32_t b) {
LDKCreationError* a_conv = (LDKCreationError*)(a & ~1);
LDKCreationError* b_conv = (LDKCreationError*)(b & ~1);
void* router_ptr = (void*)(((uint64_t)router) & ~1);
CHECK_ACCESS(router_ptr);
LDKRouter router_conv = *(LDKRouter*)(router_ptr);
- LDKLockableScore scorer_conv;
+ LDKMultiThreadedLockableScore scorer_conv;
scorer_conv.inner = (void*)(scorer & (~1));
scorer_conv.is_owned = false;
CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_pay_pubkey(uint32_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int64_t amount_msats, int32_t final_cltv_expiry_delta) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ LDKPublicKey pubkey_ref;
+ CHECK(*((uint32_t*)pubkey) == 33);
+ memcpy(pubkey_ref.compressed_form, (uint8_t*)(pubkey + 4), 33);
+ LDKThirtyTwoBytes payment_preimage_ref;
+ CHECK(*((uint32_t*)payment_preimage) == 32);
+ memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
+ return (uint64_t)ret_conv;
+}
+
void __attribute__((visibility("default"))) TS_InvoicePayer_remove_cached_payment(uint32_t this_arg, int8_tArray payment_hash) {
LDKInvoicePayer this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
export class CommitmentTxConfirmed extends LDKClosureReason {
CommitmentTxConfirmed() { }
}
+ export class FundingTimedOut extends LDKClosureReason {
+ FundingTimedOut() { }
+ }
export class ProcessingError extends LDKClosureReason {
public String err;
ProcessingError(String err) { this.err = err; }
export class InvoicePayment extends LDKPaymentPurpose {
public Uint8Array payment_preimage;
public Uint8Array payment_secret;
- public number user_payment_id;
- InvoicePayment(Uint8Array payment_preimage, Uint8Array payment_secret, number user_payment_id) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; this.user_payment_id = user_payment_id; }
+ InvoicePayment(Uint8Array payment_preimage, Uint8Array payment_secret) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; }
}
export class SpontaneousPayment extends LDKPaymentPurpose {
public Uint8Array spontaneous_payment;
public number retry;
PaymentPathFailed(Uint8Array payment_id, Uint8Array payment_hash, boolean rejected_by_dest, number network_update, boolean all_paths_failed, number[] path, number short_channel_id, number retry) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; this.network_update = network_update; this.all_paths_failed = all_paths_failed; this.path = path; this.short_channel_id = short_channel_id; this.retry = retry; }
}
+ export class PaymentFailed extends LDKEvent {
+ public Uint8Array payment_id;
+ public Uint8Array payment_hash;
+ PaymentFailed(Uint8Array payment_id, Uint8Array payment_hash) { this.payment_id = payment_id; this.payment_hash = payment_hash; }
+ }
export class PendingHTLCsForwardable extends LDKEvent {
public number time_forwardable;
PendingHTLCsForwardable(number time_forwardable) { this.time_forwardable = time_forwardable; }
public Uint8Array transaction;
DiscardFunding(Uint8Array channel_id, Uint8Array transaction) { this.channel_id = channel_id; this.transaction = transaction; }
}
+ export class PaymentPathSuccessful extends LDKEvent {
+ public Uint8Array payment_id;
+ public Uint8Array payment_hash;
+ public number[] path;
+ PaymentPathSuccessful(Uint8Array payment_id, Uint8Array payment_hash, number[] path) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.path = path; }
+ }
static native void init();
}
static { LDKEvent.init(); }
public Level ignore_and_log;
IgnoreAndLog(Level ignore_and_log) { this.ignore_and_log = ignore_and_log; }
}
+ export class IgnoreDuplicateGossip extends LDKErrorAction {
+ IgnoreDuplicateGossip() { }
+ }
export class SendErrorMessage extends LDKErrorAction {
public number msg;
SendErrorMessage(number msg) { this.msg = msg; }
}
static { LDKMessageSendEvent.init(); }
public static native LDKMessageSendEvent LDKMessageSendEvent_ref_from_ptr(long ptr);
+ public static native number LDKCResult_ScoringParametersDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_ScoringParametersDecodeErrorZ_get_err(long arg);
+ public static native number LDKCResult_ScorerDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_ScorerDecodeErrorZ_get_err(long arg);
public static native number LDKCResult_InitFeaturesDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_InitFeaturesDecodeErrorZ_get_err(long arg);
- public static native number LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(long arg);
- public static native number LDKCResult_NodeFeaturesDecodeErrorZ_get_err(long arg);
public static native number LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(long arg);
+ public static native number LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_NodeFeaturesDecodeErrorZ_get_err(long arg);
public static native number LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(long arg);
- public static native number LDKCResult_ScoringParametersDecodeErrorZ_get_ok(long arg);
- public static native number LDKCResult_ScoringParametersDecodeErrorZ_get_err(long arg);
- public static native number LDKCResult_ScorerDecodeErrorZ_get_ok(long arg);
- public static native number LDKCResult_ScorerDecodeErrorZ_get_err(long arg);
+ public static native number LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_err(long arg);
public static native number LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(long arg);
public static native number LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(long arg);
IPv6(Uint8Array addr, number port) { this.addr = addr; this.port = port; }
}
export class OnionV2 extends LDKNetAddress {
- public Uint8Array addr;
- public number port;
- OnionV2(Uint8Array addr, number port) { this.addr = addr; this.port = port; }
+ public Uint8Array onion_v2;
+ OnionV2(Uint8Array onion_v2) { this.onion_v2 = onion_v2; }
}
export class OnionV3 extends LDKNetAddress {
public Uint8Array ed25519_pubkey;
const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentSecretZ_get_b(tuple);
return decodeArray(nativeResponseValue);
}
+ public static native number LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(long arg);
+ public static native void LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(long arg);
+ public static native number LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(long arg);
+ public static native number LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(long arg);
+ public static native Uint8Array LDKCResult_PaymentSecretNoneZ_get_ok(long arg);
+ public static native void LDKCResult_PaymentSecretNoneZ_get_err(long arg);
public static native Uint8Array LDKCResult_PaymentSecretAPIErrorZ_get_ok(long arg);
public static native number LDKCResult_PaymentSecretAPIErrorZ_get_err(long arg);
+ public static native Uint8Array LDKCResult_PaymentPreimageAPIErrorZ_get_ok(long arg);
+ public static native number LDKCResult_PaymentPreimageAPIErrorZ_get_err(long arg);
get_secure_random_bytes (): Uint8Array;
read_chan_signer (reader: Uint8Array): number;
sign_invoice (invoice_preimage: Uint8Array): number;
+ get_inbound_payment_key_material (): Uint8Array;
}
export function LDKKeysInterface_new(impl: LDKKeysInterface): number {
const nativeResponseValue = wasm.KeysInterface_sign_invoice(this_arg, encodeArray(invoice_preimage));
return nativeResponseValue;
}
+ // LDKThirtyTwoBytes KeysInterface_get_inbound_payment_key_material LDKKeysInterface *NONNULL_PTR this_arg
+ export function KeysInterface_get_inbound_payment_key_material(this_arg: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.KeysInterface_get_inbound_payment_key_material(this_arg);
+ return decodeArray(nativeResponseValue);
+ }
public static native number LDKCResult_COption_MonitorEventZDecodeErrorZ_get_err(long arg);
public static native number LDKCResult_HTLCUpdateDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_HTLCUpdateDecodeErrorZ_get_err(long arg);
- public static native void LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg);
- public static native number LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg);
// struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple);
export function C2Tuple_OutPointScriptZ_get_a(tuple: number): number {
if(!isWasmInitialized) {
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
export interface LDKScore {
- channel_penalty_msat (short_channel_id: number, source: number, target: number): number;
+ channel_penalty_msat (short_channel_id: number, send_amt_msat: number, channel_capacity_msat: number, source: number, target: number): number;
payment_path_failed (path: number[], short_channel_id: number): void;
+ payment_path_successful (path: number[]): void;
write (): Uint8Array;
}
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END
- // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target
- export function Score_channel_penalty_msat(this_arg: number, short_channel_id: number, source: number, target: number): number {
+ // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, struct LDKCOption_u64Z channel_capacity_msat, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target
+ export function Score_channel_penalty_msat(this_arg: number, short_channel_id: number, send_amt_msat: number, channel_capacity_msat: number, source: number, target: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.Score_channel_penalty_msat(this_arg, short_channel_id, source, target);
+ const nativeResponseValue = wasm.Score_channel_penalty_msat(this_arg, short_channel_id, send_amt_msat, channel_capacity_msat, source, target);
return nativeResponseValue;
}
// void Score_payment_path_failed LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id
const nativeResponseValue = wasm.Score_payment_path_failed(this_arg, path, short_channel_id);
// debug statements here
}
+ // void Score_payment_path_successful LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path
+ export function Score_payment_path_successful(this_arg: number, path: number[]): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Score_payment_path_successful(this_arg, path);
+ // debug statements here
+ }
// LDKCVec_u8Z Score_write LDKScore *NONNULL_PTR this_arg
export function Score_write(this_arg: number): Uint8Array {
if(!isWasmInitialized) {
+// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
+
+ export interface LDKLockableScore {
+ lock (): number;
+ }
+
+ export function LDKLockableScore_new(impl: LDKLockableScore): number {
+ throw new Error('unimplemented'); // TODO: bind to WASM
+ }
+
+// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END
+
+
+ // LDKScore LockableScore_lock LDKLockableScore *NONNULL_PTR this_arg
+ export function LockableScore_lock(this_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.LockableScore_lock(this_arg);
+ return nativeResponseValue;
+ }
+
+
+
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
export interface LDKChannelManagerPersister {
node_id (): Uint8Array;
first_hops (): number[];
send_payment (route: number, payment_hash: Uint8Array, payment_secret: Uint8Array): number;
+ send_spontaneous_payment (route: number, payment_preimage: Uint8Array): number;
retry_payment (route: number, payment_id: Uint8Array): number;
+ abandon_payment (payment_id: Uint8Array): void;
}
export function LDKPayer_new(impl: LDKPayer): number {
const nativeResponseValue = wasm.Payer_send_payment(this_arg, route, encodeArray(payment_hash), encodeArray(payment_secret));
return nativeResponseValue;
}
+ // LDKCResult_PaymentIdPaymentSendFailureZ Payer_send_spontaneous_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage
+ export function Payer_send_spontaneous_payment(this_arg: number, route: number, payment_preimage: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payer_send_spontaneous_payment(this_arg, route, encodeArray(payment_preimage));
+ return nativeResponseValue;
+ }
// LDKCResult_NonePaymentSendFailureZ Payer_retry_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id
export function Payer_retry_payment(this_arg: number, route: number, payment_id: Uint8Array): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.Payer_retry_payment(this_arg, route, encodeArray(payment_id));
return nativeResponseValue;
}
+ // void Payer_abandon_payment LDKPayer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id
+ export function Payer_abandon_payment(this_arg: number, payment_id: Uint8Array): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payer_abandon_payment(this_arg, encodeArray(payment_id));
+ // debug statements here
+ }
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
export interface LDKRouter {
- find_route (payer: Uint8Array, params: number, first_hops: number[], scorer: number): number;
+ find_route (payer: Uint8Array, params: number, payment_hash: Uint8Array, first_hops: number[], scorer: number): number;
}
export function LDKRouter_new(impl: LDKRouter): number {
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END
- // LDKCResult_RouteLightningErrorZ Router_find_route LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer
- export function Router_find_route(this_arg: number, payer: Uint8Array, params: number, first_hops: number[], scorer: number): number {
+ // LDKCResult_RouteLightningErrorZ Router_find_route LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer
+ export function Router_find_route(this_arg: number, payer: Uint8Array, params: number, payment_hash: Uint8Array, first_hops: number[], scorer: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.Router_find_route(this_arg, encodeArray(payer), params, first_hops, scorer);
+ const nativeResponseValue = wasm.Router_find_route(this_arg, encodeArray(payer), params, encodeArray(payment_hash), first_hops, scorer);
return nativeResponseValue;
}
// struct LDKStr _ldk_get_compiled_version(void);
const nativeResponseValue = wasm.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig);
return nativeResponseValue;
}
+ // enum LDKCOption_NoneZ COption_NoneZ_some(void);
+ export function COption_NoneZ_some(): COption_NoneZ {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.COption_NoneZ_some();
+ return nativeResponseValue;
+ }
+ // enum LDKCOption_NoneZ COption_NoneZ_none(void);
+ export function COption_NoneZ_none(): COption_NoneZ {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.COption_NoneZ_none();
+ return nativeResponseValue;
+ }
+ // void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
+ export function COption_NoneZ_free(_res: COption_NoneZ): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.COption_NoneZ_free(_res);
+ // debug statements here
+ }
// struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CVec_MessageSendEventZ_free(_res);
// debug statements here
}
- // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
- export function CResult_InitFeaturesDecodeErrorZ_ok(o: number): number {
+ // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o);
+ export function CResult_ScoringParametersDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InitFeaturesDecodeErrorZ_ok(o);
+ const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_ok(o);
return nativeResponseValue;
}
- // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
- export function CResult_InitFeaturesDecodeErrorZ_err(e: number): number {
+ // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_ScoringParametersDecodeErrorZ_err(e: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InitFeaturesDecodeErrorZ_err(e);
+ const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_err(e);
return nativeResponseValue;
}
- // bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
- export function CResult_InitFeaturesDecodeErrorZ_is_ok(o: number): boolean {
+ // bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o);
+ export function CResult_ScoringParametersDecodeErrorZ_is_ok(o: number): boolean {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InitFeaturesDecodeErrorZ_is_ok(o);
+ const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_is_ok(o);
return nativeResponseValue;
}
- // void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
- export function CResult_InitFeaturesDecodeErrorZ_free(_res: number): void {
+ // void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res);
+ export function CResult_ScoringParametersDecodeErrorZ_free(_res: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InitFeaturesDecodeErrorZ_free(_res);
+ const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_free(_res);
// debug statements here
}
- // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
- export function CResult_NodeFeaturesDecodeErrorZ_ok(o: number): number {
+ // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o);
+ export function CResult_ScorerDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_NodeFeaturesDecodeErrorZ_ok(o);
+ const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_ok(o);
return nativeResponseValue;
}
- // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
- export function CResult_NodeFeaturesDecodeErrorZ_err(e: number): number {
+ // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_ScorerDecodeErrorZ_err(e: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_NodeFeaturesDecodeErrorZ_err(e);
+ const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_err(e);
return nativeResponseValue;
}
- // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
- export function CResult_NodeFeaturesDecodeErrorZ_is_ok(o: number): boolean {
+ // bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o);
+ export function CResult_ScorerDecodeErrorZ_is_ok(o: number): boolean {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_NodeFeaturesDecodeErrorZ_is_ok(o);
+ const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_is_ok(o);
return nativeResponseValue;
}
- // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
- export function CResult_NodeFeaturesDecodeErrorZ_free(_res: number): void {
+ // void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res);
+ export function CResult_ScorerDecodeErrorZ_free(_res: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_NodeFeaturesDecodeErrorZ_free(_res);
+ const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_free(_res);
+ // debug statements here
+ }
+ // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
+ export function CResult_InitFeaturesDecodeErrorZ_ok(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_InitFeaturesDecodeErrorZ_ok(o);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_InitFeaturesDecodeErrorZ_err(e: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_InitFeaturesDecodeErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
+ export function CResult_InitFeaturesDecodeErrorZ_is_ok(o: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_InitFeaturesDecodeErrorZ_is_ok(o);
+ return nativeResponseValue;
+ }
+ // void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
+ export function CResult_InitFeaturesDecodeErrorZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_InitFeaturesDecodeErrorZ_free(_res);
// debug statements here
}
// struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
const nativeResponseValue = wasm.CResult_ChannelFeaturesDecodeErrorZ_free(_res);
// debug statements here
}
- // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
- export function CResult_InvoiceFeaturesDecodeErrorZ_ok(o: number): number {
+ // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
+ export function CResult_NodeFeaturesDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_ok(o);
+ const nativeResponseValue = wasm.CResult_NodeFeaturesDecodeErrorZ_ok(o);
return nativeResponseValue;
}
- // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
- export function CResult_InvoiceFeaturesDecodeErrorZ_err(e: number): number {
+ // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_NodeFeaturesDecodeErrorZ_err(e: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_err(e);
+ const nativeResponseValue = wasm.CResult_NodeFeaturesDecodeErrorZ_err(e);
return nativeResponseValue;
}
- // bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
- export function CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o: number): boolean {
+ // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
+ export function CResult_NodeFeaturesDecodeErrorZ_is_ok(o: number): boolean {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o);
+ const nativeResponseValue = wasm.CResult_NodeFeaturesDecodeErrorZ_is_ok(o);
return nativeResponseValue;
}
- // void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
- export function CResult_InvoiceFeaturesDecodeErrorZ_free(_res: number): void {
+ // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
+ export function CResult_NodeFeaturesDecodeErrorZ_free(_res: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_free(_res);
+ const nativeResponseValue = wasm.CResult_NodeFeaturesDecodeErrorZ_free(_res);
// debug statements here
}
- // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o);
- export function CResult_ScoringParametersDecodeErrorZ_ok(o: number): number {
+ // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
+ export function CResult_InvoiceFeaturesDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_ok(o);
+ const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_ok(o);
return nativeResponseValue;
}
- // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e);
- export function CResult_ScoringParametersDecodeErrorZ_err(e: number): number {
+ // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_InvoiceFeaturesDecodeErrorZ_err(e: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_err(e);
+ const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_err(e);
return nativeResponseValue;
}
- // bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o);
- export function CResult_ScoringParametersDecodeErrorZ_is_ok(o: number): boolean {
+ // bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
+ export function CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o: number): boolean {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_is_ok(o);
+ const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o);
return nativeResponseValue;
}
- // void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res);
- export function CResult_ScoringParametersDecodeErrorZ_free(_res: number): void {
+ // void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
+ export function CResult_InvoiceFeaturesDecodeErrorZ_free(_res: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_free(_res);
+ const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_free(_res);
// debug statements here
}
- // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o);
- export function CResult_ScorerDecodeErrorZ_ok(o: number): number {
+ // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
+ export function CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_ok(o);
+ const nativeResponseValue = wasm.CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o);
return nativeResponseValue;
}
- // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e);
- export function CResult_ScorerDecodeErrorZ_err(e: number): number {
+ // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_ChannelTypeFeaturesDecodeErrorZ_err(e: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_err(e);
+ const nativeResponseValue = wasm.CResult_ChannelTypeFeaturesDecodeErrorZ_err(e);
return nativeResponseValue;
}
- // bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o);
- export function CResult_ScorerDecodeErrorZ_is_ok(o: number): boolean {
+ // bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
+ export function CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o: number): boolean {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_is_ok(o);
+ const nativeResponseValue = wasm.CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o);
return nativeResponseValue;
}
- // void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res);
- export function CResult_ScorerDecodeErrorZ_free(_res: number): void {
+ // void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
+ export function CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_free(_res);
+ const nativeResponseValue = wasm.CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res);
// debug statements here
}
// struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentSecretZ_free(_res);
// debug statements here
}
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
+ return nativeResponseValue;
+ }
+ // bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o);
+ return nativeResponseValue;
+ }
+ // void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res);
+ // debug statements here
+ }
+ // uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o);
+ return nativeResponseValue;
+ }
+ // void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res);
+ // debug statements here
+ }
+ // uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
+ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
+ export function CResult_PaymentSecretNoneZ_ok(o: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentSecretNoneZ_ok(encodeArray(o));
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
+ export function CResult_PaymentSecretNoneZ_err(): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentSecretNoneZ_err();
+ return nativeResponseValue;
+ }
+ // bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
+ export function CResult_PaymentSecretNoneZ_is_ok(o: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentSecretNoneZ_is_ok(o);
+ return nativeResponseValue;
+ }
+ // void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
+ export function CResult_PaymentSecretNoneZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentSecretNoneZ_free(_res);
+ // debug statements here
+ }
+ // uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg);
+ export function CResult_PaymentSecretNoneZ_clone_ptr(arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentSecretNoneZ_clone_ptr(arg);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
+ export function CResult_PaymentSecretNoneZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentSecretNoneZ_clone(orig);
+ return nativeResponseValue;
+ }
// struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
export function CResult_PaymentSecretAPIErrorZ_ok(o: Uint8Array): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CResult_PaymentSecretAPIErrorZ_clone(orig);
return nativeResponseValue;
}
+ // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
+ export function CResult_PaymentPreimageAPIErrorZ_ok(o: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentPreimageAPIErrorZ_ok(encodeArray(o));
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
+ export function CResult_PaymentPreimageAPIErrorZ_err(e: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentPreimageAPIErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
+ export function CResult_PaymentPreimageAPIErrorZ_is_ok(o: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentPreimageAPIErrorZ_is_ok(o);
+ return nativeResponseValue;
+ }
+ // void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
+ export function CResult_PaymentPreimageAPIErrorZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentPreimageAPIErrorZ_free(_res);
+ // debug statements here
+ }
+ // uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg);
+ export function CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
+ export function CResult_PaymentPreimageAPIErrorZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentPreimageAPIErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
// void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
export function CVec_ChannelMonitorZ_free(_res: number[]): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CResult_HTLCUpdateDecodeErrorZ_clone(orig);
return nativeResponseValue;
}
- // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
- export function CResult_NoneMonitorUpdateErrorZ_ok(): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_ok();
- return nativeResponseValue;
- }
- // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
- export function CResult_NoneMonitorUpdateErrorZ_err(e: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_err(e);
- return nativeResponseValue;
- }
- // bool CResult_NoneMonitorUpdateErrorZ_is_ok(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR o);
- export function CResult_NoneMonitorUpdateErrorZ_is_ok(o: number): boolean {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_is_ok(o);
- return nativeResponseValue;
- }
- // void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
- export function CResult_NoneMonitorUpdateErrorZ_free(_res: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_free(_res);
- // debug statements here
- }
- // uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg);
- export function CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg);
- return nativeResponseValue;
- }
- // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
- export function CResult_NoneMonitorUpdateErrorZ_clone(orig: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_NoneMonitorUpdateErrorZ_clone(orig);
- return nativeResponseValue;
- }
// uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg);
export function C2Tuple_OutPointScriptZ_clone_ptr(arg: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.PaymentPurpose_clone(orig);
return nativeResponseValue;
}
- // struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t user_payment_id);
- export function PaymentPurpose_invoice_payment(payment_preimage: Uint8Array, payment_secret: Uint8Array, user_payment_id: number): number {
+ // struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
+ export function PaymentPurpose_invoice_payment(payment_preimage: Uint8Array, payment_secret: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.PaymentPurpose_invoice_payment(encodeArray(payment_preimage), encodeArray(payment_secret), user_payment_id);
+ const nativeResponseValue = wasm.PaymentPurpose_invoice_payment(encodeArray(payment_preimage), encodeArray(payment_secret));
return nativeResponseValue;
}
// struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
const nativeResponseValue = wasm.ClosureReason_commitment_tx_confirmed();
return nativeResponseValue;
}
+ // struct LDKClosureReason ClosureReason_funding_timed_out(void);
+ export function ClosureReason_funding_timed_out(): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ClosureReason_funding_timed_out();
+ return nativeResponseValue;
+ }
// struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
export function ClosureReason_processing_error(err: String): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.Event_payment_path_failed(encodeArray(payment_id), encodeArray(payment_hash), rejected_by_dest, network_update, all_paths_failed, path, short_channel_id, retry);
return nativeResponseValue;
}
+ // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
+ export function Event_payment_failed(payment_id: Uint8Array, payment_hash: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Event_payment_failed(encodeArray(payment_id), encodeArray(payment_hash));
+ return nativeResponseValue;
+ }
// struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
export function Event_pending_htlcs_forwardable(time_forwardable: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.Event_discard_funding(encodeArray(channel_id), encodeArray(transaction));
return nativeResponseValue;
}
+ // struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
+ export function Event_payment_path_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: number[]): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Event_payment_path_successful(encodeArray(payment_id), encodeArray(payment_hash), path);
+ return nativeResponseValue;
+ }
// struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
export function Event_write(obj: number): Uint8Array {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.Level_clone(orig);
return nativeResponseValue;
}
+ // enum LDKLevel Level_gossip(void);
+ export function Level_gossip(): Level {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Level_gossip();
+ return nativeResponseValue;
+ }
// enum LDKLevel Level_trace(void);
export function Level_trace(): Level {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.UserConfig_set_accept_forwards_to_priv_channels(this_ptr, val);
// debug statements here
}
- // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg);
- export function UserConfig_new(own_channel_config_arg: number, peer_channel_config_limits_arg: number, channel_options_arg: number, accept_forwards_to_priv_channels_arg: boolean): number {
+ // bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+ export function UserConfig_get_accept_inbound_channels(this_ptr: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.UserConfig_get_accept_inbound_channels(this_ptr);
+ return nativeResponseValue;
+ }
+ // void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+ export function UserConfig_set_accept_inbound_channels(this_ptr: number, val: boolean): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.UserConfig_set_accept_inbound_channels(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg);
+ export function UserConfig_new(own_channel_config_arg: number, peer_channel_config_limits_arg: number, channel_options_arg: number, accept_forwards_to_priv_channels_arg: boolean, accept_inbound_channels_arg: boolean): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.UserConfig_new(own_channel_config_arg, peer_channel_config_limits_arg, channel_options_arg, accept_forwards_to_priv_channels_arg);
+ const nativeResponseValue = wasm.UserConfig_new(own_channel_config_arg, peer_channel_config_limits_arg, channel_options_arg, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg);
return nativeResponseValue;
}
// uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg);
const nativeResponseValue = wasm.ChannelMonitorUpdate_free(this_obj);
// debug statements here
}
- // uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
- export function ChannelMonitorUpdate_get_update_id(this_ptr: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.ChannelMonitorUpdate_get_update_id(this_ptr);
- return nativeResponseValue;
- }
- // void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
- export function ChannelMonitorUpdate_set_update_id(this_ptr: number, val: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.ChannelMonitorUpdate_set_update_id(this_ptr, val);
- // debug statements here
- }
- // uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg);
- export function ChannelMonitorUpdate_clone_ptr(arg: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.ChannelMonitorUpdate_clone_ptr(arg);
- return nativeResponseValue;
- }
- // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
- export function ChannelMonitorUpdate_clone(orig: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.ChannelMonitorUpdate_clone(orig);
- return nativeResponseValue;
- }
- // struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
- export function ChannelMonitorUpdate_write(obj: number): Uint8Array {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.ChannelMonitorUpdate_write(obj);
- return decodeArray(nativeResponseValue);
- }
- // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
- export function ChannelMonitorUpdate_read(ser: Uint8Array): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.ChannelMonitorUpdate_read(encodeArray(ser));
- return nativeResponseValue;
- }
- // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
- export function MonitorUpdateError_free(this_obj: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.MonitorUpdateError_free(this_obj);
- // debug statements here
- }
- // struct LDKStr MonitorUpdateError_get_a(const struct LDKMonitorUpdateError *NONNULL_PTR this_ptr);
- export function MonitorUpdateError_get_a(this_ptr: number): String {
+ // uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
+ export function ChannelMonitorUpdate_get_update_id(this_ptr: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.MonitorUpdateError_get_a(this_ptr);
+ const nativeResponseValue = wasm.ChannelMonitorUpdate_get_update_id(this_ptr);
return nativeResponseValue;
}
- // void MonitorUpdateError_set_a(struct LDKMonitorUpdateError *NONNULL_PTR this_ptr, struct LDKStr val);
- export function MonitorUpdateError_set_a(this_ptr: number, val: String): void {
+ // void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
+ export function ChannelMonitorUpdate_set_update_id(this_ptr: number, val: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.MonitorUpdateError_set_a(this_ptr, val);
+ const nativeResponseValue = wasm.ChannelMonitorUpdate_set_update_id(this_ptr, val);
// debug statements here
}
- // MUST_USE_RES struct LDKMonitorUpdateError MonitorUpdateError_new(struct LDKStr a_arg);
- export function MonitorUpdateError_new(a_arg: String): number {
+ // uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg);
+ export function ChannelMonitorUpdate_clone_ptr(arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.MonitorUpdateError_new(a_arg);
+ const nativeResponseValue = wasm.ChannelMonitorUpdate_clone_ptr(arg);
return nativeResponseValue;
}
- // uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg);
- export function MonitorUpdateError_clone_ptr(arg: number): number {
+ // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
+ export function ChannelMonitorUpdate_clone(orig: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.MonitorUpdateError_clone_ptr(arg);
+ const nativeResponseValue = wasm.ChannelMonitorUpdate_clone(orig);
return nativeResponseValue;
}
- // struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
- export function MonitorUpdateError_clone(orig: number): number {
+ // struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
+ export function ChannelMonitorUpdate_write(obj: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelMonitorUpdate_write(obj);
+ return decodeArray(nativeResponseValue);
+ }
+ // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
+ export function ChannelMonitorUpdate_read(ser: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.MonitorUpdateError_clone(orig);
+ const nativeResponseValue = wasm.ChannelMonitorUpdate_read(encodeArray(ser));
return nativeResponseValue;
}
// void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
const nativeResponseValue = wasm.ChannelMonitor_write(obj);
return decodeArray(nativeResponseValue);
}
- // MUST_USE_RES struct LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+ // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
export function ChannelMonitor_update_monitor(this_arg: number, updates: number, broadcaster: number, fee_estimator: number, logger: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
const nativeResponseValue = wasm.InMemorySigner_get_channel_parameters(this_arg);
return nativeResponseValue;
}
+ // MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ export function InMemorySigner_opt_anchors(this_arg: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InMemorySigner_opt_anchors(this_arg);
+ return nativeResponseValue;
+ }
// MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
export function InMemorySigner_sign_counterparty_payment_input(this_arg: number, spend_tx: Uint8Array, input_idx: number, descriptor: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelDetails_set_user_channel_id(this_ptr, val);
// debug statements here
}
+ // uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+ export function ChannelDetails_get_balance_msat(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelDetails_get_balance_msat(this_ptr);
+ return nativeResponseValue;
+ }
+ // void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+ export function ChannelDetails_set_balance_msat(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelDetails_set_balance_msat(this_ptr, val);
+ // debug statements here
+ }
// uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
export function ChannelDetails_get_outbound_capacity_msat(this_ptr: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelDetails_set_is_public(this_ptr, val);
// debug statements here
}
- // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
- export function ChannelDetails_new(channel_id_arg: Uint8Array, counterparty_arg: number, funding_txo_arg: number, short_channel_id_arg: number, channel_value_satoshis_arg: number, unspendable_punishment_reserve_arg: number, user_channel_id_arg: number, outbound_capacity_msat_arg: number, inbound_capacity_msat_arg: number, confirmations_required_arg: number, force_close_spend_delay_arg: number, is_outbound_arg: boolean, is_funding_locked_arg: boolean, is_usable_arg: boolean, is_public_arg: boolean): number {
+ // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
+ export function ChannelDetails_new(channel_id_arg: Uint8Array, counterparty_arg: number, funding_txo_arg: number, short_channel_id_arg: number, channel_value_satoshis_arg: number, unspendable_punishment_reserve_arg: number, user_channel_id_arg: number, balance_msat_arg: number, outbound_capacity_msat_arg: number, inbound_capacity_msat_arg: number, confirmations_required_arg: number, force_close_spend_delay_arg: number, is_outbound_arg: boolean, is_funding_locked_arg: boolean, is_usable_arg: boolean, is_public_arg: boolean): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelDetails_new(encodeArray(channel_id_arg), counterparty_arg, funding_txo_arg, short_channel_id_arg, channel_value_satoshis_arg, unspendable_punishment_reserve_arg, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg, force_close_spend_delay_arg, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
+ const nativeResponseValue = wasm.ChannelDetails_new(encodeArray(channel_id_arg), counterparty_arg, funding_txo_arg, short_channel_id_arg, channel_value_satoshis_arg, unspendable_punishment_reserve_arg, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg, force_close_spend_delay_arg, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
return nativeResponseValue;
}
// uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg);
const nativeResponseValue = wasm.ChannelManager_retry_payment(this_arg, route, encodeArray(payment_id));
return nativeResponseValue;
}
+ // void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
+ export function ChannelManager_abandon_payment(this_arg: number, payment_id: Uint8Array): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelManager_abandon_payment(this_arg, encodeArray(payment_id));
+ // debug statements here
+ }
// MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
export function ChannelManager_send_spontaneous_payment(this_arg: number, route: number, payment_preimage: Uint8Array): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelManager_get_our_node_id(this_arg);
return decodeArray(nativeResponseValue);
}
- // MUST_USE_RES struct LDKC2Tuple_PaymentHashPaymentSecretZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, uint64_t user_payment_id);
- export function ChannelManager_create_inbound_payment(this_arg: number, min_value_msat: number, invoice_expiry_delta_secs: number, user_payment_id: number): number {
+ // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+ export function ChannelManager_create_inbound_payment(this_arg: number, min_value_msat: number, invoice_expiry_delta_secs: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelManager_create_inbound_payment(this_arg, min_value_msat, invoice_expiry_delta_secs);
+ return nativeResponseValue;
+ }
+ // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ChannelManager_create_inbound_payment_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+ export function ChannelManager_create_inbound_payment_legacy(this_arg: number, min_value_msat: number, invoice_expiry_delta_secs: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelManager_create_inbound_payment(this_arg, min_value_msat, invoice_expiry_delta_secs, user_payment_id);
+ const nativeResponseValue = wasm.ChannelManager_create_inbound_payment_legacy(this_arg, min_value_msat, invoice_expiry_delta_secs);
return nativeResponseValue;
}
- // MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, uint64_t user_payment_id);
- export function ChannelManager_create_inbound_payment_for_hash(this_arg: number, payment_hash: Uint8Array, min_value_msat: number, invoice_expiry_delta_secs: number, user_payment_id: number): number {
+ // MUST_USE_RES struct LDKCResult_PaymentSecretNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+ export function ChannelManager_create_inbound_payment_for_hash(this_arg: number, payment_hash: Uint8Array, min_value_msat: number, invoice_expiry_delta_secs: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelManager_create_inbound_payment_for_hash(this_arg, encodeArray(payment_hash), min_value_msat, invoice_expiry_delta_secs, user_payment_id);
+ const nativeResponseValue = wasm.ChannelManager_create_inbound_payment_for_hash(this_arg, encodeArray(payment_hash), min_value_msat, invoice_expiry_delta_secs);
+ return nativeResponseValue;
+ }
+ // MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
+ export function ChannelManager_create_inbound_payment_for_hash_legacy(this_arg: number, payment_hash: Uint8Array, min_value_msat: number, invoice_expiry_delta_secs: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelManager_create_inbound_payment_for_hash_legacy(this_arg, encodeArray(payment_hash), min_value_msat, invoice_expiry_delta_secs);
+ return nativeResponseValue;
+ }
+ // MUST_USE_RES struct LDKCResult_PaymentPreimageAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
+ export function ChannelManager_get_payment_preimage(this_arg: number, payment_hash: Uint8Array, payment_secret: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelManager_get_payment_preimage(this_arg, encodeArray(payment_hash), encodeArray(payment_secret));
return nativeResponseValue;
}
// struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
const nativeResponseValue = wasm.OpenChannel_set_channel_flags(this_ptr, val);
// debug statements here
}
+ // struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+ export function OpenChannel_get_channel_type(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.OpenChannel_get_channel_type(this_ptr);
+ return nativeResponseValue;
+ }
+ // void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+ export function OpenChannel_set_channel_type(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.OpenChannel_set_channel_type(this_ptr, val);
+ // debug statements here
+ }
// uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg);
export function OpenChannel_clone_ptr(arg: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.NetAddress_ipv6(encodeArray(addr), port);
return nativeResponseValue;
}
- // struct LDKNetAddress NetAddress_onion_v2(struct LDKTenBytes addr, uint16_t port);
- export function NetAddress_onion_v2(addr: Uint8Array, port: number): number {
+ // struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
+ export function NetAddress_onion_v2(a: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.NetAddress_onion_v2(encodeArray(addr), port);
+ const nativeResponseValue = wasm.NetAddress_onion_v2(encodeArray(a));
return nativeResponseValue;
}
// struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
const nativeResponseValue = wasm.ErrorAction_ignore_and_log(a);
return nativeResponseValue;
}
+ // struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
+ export function ErrorAction_ignore_duplicate_gossip(): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ErrorAction_ignore_duplicate_gossip();
+ return nativeResponseValue;
+ }
// struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
export function ErrorAction_send_error_message(msg: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.PeerManager_timer_tick_occurred(this_arg);
// debug statements here
}
+ // uint64_t htlc_success_tx_weight(bool opt_anchors);
+ export function htlc_success_tx_weight(opt_anchors: boolean): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.htlc_success_tx_weight(opt_anchors);
+ return nativeResponseValue;
+ }
+ // uint64_t htlc_timeout_tx_weight(bool opt_anchors);
+ export function htlc_timeout_tx_weight(opt_anchors: boolean): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.htlc_timeout_tx_weight(opt_anchors);
+ return nativeResponseValue;
+ }
// struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
export function build_commitment_secret(commitment_seed: Uint8Array, idx: number): Uint8Array {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.HTLCOutputInCommitment_read(encodeArray(ser));
return nativeResponseValue;
}
- // struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
- export function get_htlc_redeemscript(htlc: number, keys: number): Uint8Array {
+ // struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
+ export function get_htlc_redeemscript(htlc: number, opt_anchors: boolean, keys: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.get_htlc_redeemscript(htlc, keys);
+ const nativeResponseValue = wasm.get_htlc_redeemscript(htlc, opt_anchors, keys);
return decodeArray(nativeResponseValue);
}
// struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
const nativeResponseValue = wasm.make_funding_redeemscript(encodeArray(broadcaster), encodeArray(countersignatory));
return decodeArray(nativeResponseValue);
}
- // struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
- export function build_htlc_transaction(commitment_txid: Uint8Array, feerate_per_kw: number, contest_delay: number, htlc: number, broadcaster_delayed_payment_key: Uint8Array, revocation_key: Uint8Array): Uint8Array {
+ // struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
+ export function build_htlc_transaction(commitment_txid: Uint8Array, feerate_per_kw: number, contest_delay: number, htlc: number, opt_anchors: boolean, broadcaster_delayed_payment_key: Uint8Array, revocation_key: Uint8Array): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.build_htlc_transaction(encodeArray(commitment_txid), feerate_per_kw, contest_delay, htlc, opt_anchors, encodeArray(broadcaster_delayed_payment_key), encodeArray(revocation_key));
+ return decodeArray(nativeResponseValue);
+ }
+ // struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
+ export function get_anchor_redeemscript(funding_pubkey: Uint8Array): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.build_htlc_transaction(encodeArray(commitment_txid), feerate_per_kw, contest_delay, htlc, encodeArray(broadcaster_delayed_payment_key), encodeArray(revocation_key));
+ const nativeResponseValue = wasm.get_anchor_redeemscript(encodeArray(funding_pubkey));
return decodeArray(nativeResponseValue);
}
// void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
const nativeResponseValue = wasm.ChannelTransactionParameters_set_funding_outpoint(this_ptr, val);
// debug statements here
}
- // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg);
- export function ChannelTransactionParameters_new(holder_pubkeys_arg: number, holder_selected_contest_delay_arg: number, is_outbound_from_holder_arg: boolean, counterparty_parameters_arg: number, funding_outpoint_arg: number): number {
+ // enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
+ export function ChannelTransactionParameters_get_opt_anchors(this_ptr: number): COption_NoneZ {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelTransactionParameters_get_opt_anchors(this_ptr);
+ return nativeResponseValue;
+ }
+ // void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
+ export function ChannelTransactionParameters_set_opt_anchors(this_ptr: number, val: COption_NoneZ): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelTransactionParameters_set_opt_anchors(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, enum LDKCOption_NoneZ opt_anchors_arg);
+ export function ChannelTransactionParameters_new(holder_pubkeys_arg: number, holder_selected_contest_delay_arg: number, is_outbound_from_holder_arg: boolean, counterparty_parameters_arg: number, funding_outpoint_arg: number, opt_anchors_arg: COption_NoneZ): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelTransactionParameters_new(holder_pubkeys_arg, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg, funding_outpoint_arg);
+ const nativeResponseValue = wasm.ChannelTransactionParameters_new(holder_pubkeys_arg, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg, funding_outpoint_arg, opt_anchors_arg);
return nativeResponseValue;
}
// uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg);
const nativeResponseValue = wasm.DirectedChannelTransactionParameters_funding_outpoint(this_arg);
return nativeResponseValue;
}
+ // MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
+ export function DirectedChannelTransactionParameters_opt_anchors(this_arg: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DirectedChannelTransactionParameters_opt_anchors(this_arg);
+ return nativeResponseValue;
+ }
// void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
export function HolderCommitmentTransaction_free(this_obj: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.TrustedCommitmentTransaction_keys(this_arg);
return nativeResponseValue;
}
+ // MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
+ export function TrustedCommitmentTransaction_opt_anchors(this_arg: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.TrustedCommitmentTransaction_opt_anchors(this_arg);
+ return nativeResponseValue;
+ }
// MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters);
export function TrustedCommitmentTransaction_get_htlc_sigs(this_arg: number, htlc_base_key: Uint8Array, channel_parameters: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.InvoiceFeatures_eq(a, b);
return nativeResponseValue;
}
+ // bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
+ export function ChannelTypeFeatures_eq(a: number, b: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelTypeFeatures_eq(a, b);
+ return nativeResponseValue;
+ }
// uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg);
export function InitFeatures_clone_ptr(arg: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.InvoiceFeatures_clone(orig);
return nativeResponseValue;
}
+ // uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg);
+ export function ChannelTypeFeatures_clone_ptr(arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelTypeFeatures_clone_ptr(arg);
+ return nativeResponseValue;
+ }
+ // struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
+ export function ChannelTypeFeatures_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelTypeFeatures_clone(orig);
+ return nativeResponseValue;
+ }
// void InitFeatures_free(struct LDKInitFeatures this_obj);
export function InitFeatures_free(this_obj: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.InvoiceFeatures_free(this_obj);
// debug statements here
}
+ // void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
+ export function ChannelTypeFeatures_free(this_obj: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelTypeFeatures_free(this_obj);
+ // debug statements here
+ }
// MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
export function InitFeatures_empty(): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.InvoiceFeatures_requires_unknown_bits(this_arg);
return nativeResponseValue;
}
- // MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
- export function InitFeatures_supports_payment_secret(this_arg: number): boolean {
+ // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
+ export function ChannelTypeFeatures_empty(): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InitFeatures_supports_payment_secret(this_arg);
+ const nativeResponseValue = wasm.ChannelTypeFeatures_empty();
return nativeResponseValue;
}
- // MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
- export function NodeFeatures_supports_payment_secret(this_arg: number): boolean {
+ // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
+ export function ChannelTypeFeatures_known(): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.NodeFeatures_supports_payment_secret(this_arg);
+ const nativeResponseValue = wasm.ChannelTypeFeatures_known();
return nativeResponseValue;
}
- // MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
- export function InvoiceFeatures_supports_payment_secret(this_arg: number): boolean {
+ // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
+ export function ChannelTypeFeatures_requires_unknown_bits(this_arg: number): boolean {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InvoiceFeatures_supports_payment_secret(this_arg);
+ const nativeResponseValue = wasm.ChannelTypeFeatures_requires_unknown_bits(this_arg);
return nativeResponseValue;
}
// struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
const nativeResponseValue = wasm.InitFeatures_write(obj);
return decodeArray(nativeResponseValue);
}
- // struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
- export function NodeFeatures_write(obj: number): Uint8Array {
+ // struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
+ export function InitFeatures_read(ser: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.NodeFeatures_write(obj);
- return decodeArray(nativeResponseValue);
+ const nativeResponseValue = wasm.InitFeatures_read(encodeArray(ser));
+ return nativeResponseValue;
}
// struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
export function ChannelFeatures_write(obj: number): Uint8Array {
const nativeResponseValue = wasm.ChannelFeatures_write(obj);
return decodeArray(nativeResponseValue);
}
- // struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
- export function InvoiceFeatures_write(obj: number): Uint8Array {
+ // struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
+ export function ChannelFeatures_read(ser: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InvoiceFeatures_write(obj);
- return decodeArray(nativeResponseValue);
+ const nativeResponseValue = wasm.ChannelFeatures_read(encodeArray(ser));
+ return nativeResponseValue;
}
- // struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
- export function InitFeatures_read(ser: Uint8Array): number {
+ // struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
+ export function NodeFeatures_write(obj: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InitFeatures_read(encodeArray(ser));
- return nativeResponseValue;
+ const nativeResponseValue = wasm.NodeFeatures_write(obj);
+ return decodeArray(nativeResponseValue);
}
// struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
export function NodeFeatures_read(ser: Uint8Array): number {
const nativeResponseValue = wasm.NodeFeatures_read(encodeArray(ser));
return nativeResponseValue;
}
- // struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
- export function ChannelFeatures_read(ser: Uint8Array): number {
+ // struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
+ export function InvoiceFeatures_write(obj: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelFeatures_read(encodeArray(ser));
- return nativeResponseValue;
+ const nativeResponseValue = wasm.InvoiceFeatures_write(obj);
+ return decodeArray(nativeResponseValue);
}
// struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
export function InvoiceFeatures_read(ser: Uint8Array): number {
const nativeResponseValue = wasm.InvoiceFeatures_read(encodeArray(ser));
return nativeResponseValue;
}
+ // struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
+ export function ChannelTypeFeatures_write(obj: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelTypeFeatures_write(obj);
+ return decodeArray(nativeResponseValue);
+ }
+ // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
+ export function ChannelTypeFeatures_read(ser: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelTypeFeatures_read(encodeArray(ser));
+ return nativeResponseValue;
+ }
// void ShutdownScript_free(struct LDKShutdownScript this_obj);
export function ShutdownScript_free(this_obj: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.Type_free(this_ptr);
// debug statements here
}
- // void Score_free(struct LDKScore this_ptr);
- export function Score_free(this_ptr: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.Score_free(this_ptr);
- // debug statements here
- }
- // void LockableScore_free(struct LDKLockableScore this_obj);
- export function LockableScore_free(this_obj: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.LockableScore_free(this_obj);
- // debug statements here
- }
- // MUST_USE_RES struct LDKLockableScore LockableScore_new(struct LDKScore score);
- export function LockableScore_new(score: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.LockableScore_new(score);
- return nativeResponseValue;
- }
- // struct LDKCVec_u8Z LockableScore_write(const struct LDKLockableScore *NONNULL_PTR obj);
- export function LockableScore_write(obj: number): Uint8Array {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.LockableScore_write(obj);
- return decodeArray(nativeResponseValue);
- }
// void NodeId_free(struct LDKNodeId this_obj);
export function NodeId_free(this_obj: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelInfo_set_announcement_message(this_ptr, val);
// debug statements here
}
- // MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKNodeId node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKNodeId node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg);
- export function ChannelInfo_new(features_arg: number, node_one_arg: number, one_to_two_arg: number, node_two_arg: number, two_to_one_arg: number, capacity_sats_arg: number, announcement_message_arg: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.ChannelInfo_new(features_arg, node_one_arg, one_to_two_arg, node_two_arg, two_to_one_arg, capacity_sats_arg, announcement_message_arg);
- return nativeResponseValue;
- }
// uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg);
export function ChannelInfo_clone_ptr(arg: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.NetworkGraph_fail_node(this_arg, encodeArray(_node_id), is_permanent);
// debug statements here
}
+ // void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
+ export function NetworkGraph_remove_stale_channels_with_time(this_arg: number, current_time_unix: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.NetworkGraph_remove_stale_channels_with_time(this_arg, current_time_unix);
+ // debug statements here
+ }
// MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
export function NetworkGraph_update_channel(this_arg: number, msg: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.find_route(encodeArray(our_node_pubkey), params, network, first_hops, logger, scorer);
return nativeResponseValue;
}
+ // void Score_free(struct LDKScore this_ptr);
+ export function Score_free(this_ptr: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Score_free(this_ptr);
+ // debug statements here
+ }
+ // void LockableScore_free(struct LDKLockableScore this_ptr);
+ export function LockableScore_free(this_ptr: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.LockableScore_free(this_ptr);
+ // debug statements here
+ }
+ // void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
+ export function MultiThreadedLockableScore_free(this_obj: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MultiThreadedLockableScore_free(this_obj);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
+ export function MultiThreadedLockableScore_new(score: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MultiThreadedLockableScore_new(score);
+ return nativeResponseValue;
+ }
// void Scorer_free(struct LDKScorer this_obj);
export function Scorer_free(this_obj: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ScoringParameters_set_failure_penalty_msat(this_ptr, val);
// debug statements here
}
+ // uint16_t ScoringParameters_get_overuse_penalty_start_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+ export function ScoringParameters_get_overuse_penalty_start_1024th(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_get_overuse_penalty_start_1024th(this_ptr);
+ return nativeResponseValue;
+ }
+ // void ScoringParameters_set_overuse_penalty_start_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint16_t val);
+ export function ScoringParameters_set_overuse_penalty_start_1024th(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_set_overuse_penalty_start_1024th(this_ptr, val);
+ // debug statements here
+ }
+ // uint64_t ScoringParameters_get_overuse_penalty_msat_per_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+ export function ScoringParameters_get_overuse_penalty_msat_per_1024th(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_get_overuse_penalty_msat_per_1024th(this_ptr);
+ return nativeResponseValue;
+ }
+ // void ScoringParameters_set_overuse_penalty_msat_per_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+ export function ScoringParameters_set_overuse_penalty_msat_per_1024th(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_set_overuse_penalty_msat_per_1024th(this_ptr, val);
+ // debug statements here
+ }
// uint64_t ScoringParameters_get_failure_penalty_half_life(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
export function ScoringParameters_get_failure_penalty_half_life(this_ptr: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ScoringParameters_set_failure_penalty_half_life(this_ptr, val);
// debug statements here
}
- // MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint64_t failure_penalty_half_life_arg);
- export function ScoringParameters_new(base_penalty_msat_arg: number, failure_penalty_msat_arg: number, failure_penalty_half_life_arg: number): number {
+ // MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint16_t overuse_penalty_start_1024th_arg, uint64_t overuse_penalty_msat_per_1024th_arg, uint64_t failure_penalty_half_life_arg);
+ export function ScoringParameters_new(base_penalty_msat_arg: number, failure_penalty_msat_arg: number, overuse_penalty_start_1024th_arg: number, overuse_penalty_msat_per_1024th_arg: number, failure_penalty_half_life_arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, failure_penalty_half_life_arg);
+ const nativeResponseValue = wasm.ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg);
return nativeResponseValue;
}
// struct LDKCVec_u8Z ScoringParameters_write(const struct LDKScoringParameters *NONNULL_PTR obj);
const nativeResponseValue = wasm.CreationError_expiry_time_out_of_bounds();
return nativeResponseValue;
}
+ // enum LDKCreationError CreationError_invalid_amount(void);
+ export function CreationError_invalid_amount(): CreationError {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CreationError_invalid_amount();
+ return nativeResponseValue;
+ }
// bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
export function CreationError_eq(a: number, b: number): boolean {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.PaymentError_sending(a);
return nativeResponseValue;
}
- // MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts);
+ // MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts);
export function InvoicePayer_new(payer: number, router: number, scorer: number, logger: number, event_handler: number, retry_attempts: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
const nativeResponseValue = wasm.InvoicePayer_pay_zero_value_invoice(this_arg, invoice, amount_msats);
return nativeResponseValue;
}
+ // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_pubkey(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, uint64_t amount_msats, uint32_t final_cltv_expiry_delta);
+ export function InvoicePayer_pay_pubkey(this_arg: number, pubkey: Uint8Array, payment_preimage: Uint8Array, amount_msats: number, final_cltv_expiry_delta: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoicePayer_pay_pubkey(this_arg, encodeArray(pubkey), encodeArray(payment_preimage), amount_msats, final_cltv_expiry_delta);
+ return nativeResponseValue;
+ }
// void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
export function InvoicePayer_remove_cached_payment(this_arg: number, payment_hash: Uint8Array): void {
if(!isWasmInitialized) {
--- /dev/null
+
+ export enum COption_NoneZ {
+ /**
+ * When we're in this state, this COption_NoneZ contains a
+ */
+LDKCOption_NoneZ_Some,
+ /**
+ * When we're in this state, this COption_NoneZ contains nothing
+ */
+LDKCOption_NoneZ_None,
+
+ }
* The supplied expiry time could cause an overflow if added to a `PositiveTimestamp`
*/
LDKCreationError_ExpiryTimeOutOfBounds,
+ /**
+ * The supplied millisatoshi amount was greater than the total bitcoin supply.
+ */
+LDKCreationError_InvalidAmount,
}
export enum Level {
/**
+ * Designates extremely verbose information, including gossip-induced messages
+ */
+LDKLevel_Gossip,
+ /**
* Designates very low priority, often extremely verbose, information
*/
LDKLevel_Trace,
bindings.ChannelDetails_set_user_channel_id(this.ptr, val);
}
+ public number get_balance_msat() {
+ number ret = bindings.ChannelDetails_get_balance_msat(this.ptr);
+ return ret;
+ }
+
+ public void set_balance_msat(number val) {
+ bindings.ChannelDetails_set_balance_msat(this.ptr, val);
+ }
+
public number get_outbound_capacity_msat() {
number ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr);
return ret;
bindings.ChannelDetails_set_is_public(this.ptr, val);
}
- public static ChannelDetails constructor_new(Uint8Array channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, Option_u64Z short_channel_id_arg, number channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, number user_channel_id_arg, number outbound_capacity_msat_arg, number inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg) {
- number ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, short_channel_id_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
+ public static ChannelDetails constructor_new(Uint8Array channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, Option_u64Z short_channel_id_arg, number channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, number user_channel_id_arg, number balance_msat_arg, number outbound_capacity_msat_arg, number inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg) {
+ number ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, short_channel_id_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
}
- public static ChannelInfo constructor_new(ChannelFeatures features_arg, NodeId node_one_arg, DirectionalChannelInfo one_to_two_arg, NodeId node_two_arg, DirectionalChannelInfo two_to_one_arg, Option_u64Z capacity_sats_arg, ChannelAnnouncement announcement_message_arg) {
- number ret = bindings.ChannelInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, node_one_arg == null ? 0 : node_one_arg.ptr & ~1, one_to_two_arg == null ? 0 : one_to_two_arg.ptr & ~1, node_two_arg == null ? 0 : node_two_arg.ptr & ~1, two_to_one_arg == null ? 0 : two_to_one_arg.ptr & ~1, capacity_sats_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
- const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- return ret_hu_conv;
- }
-
public number clone_ptr() {
number ret = bindings.ChannelInfo_clone_ptr(this.ptr);
return ret;
return ret_hu_conv;
}
+ public void abandon_payment(Uint8Array payment_id) {
+ bindings.ChannelManager_abandon_payment(this.ptr, InternalUtils.check_arr_len(payment_id, 32));
+ }
+
public Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ send_spontaneous_payment(Route route, Uint8Array payment_preimage) {
number ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_preimage, 32));
Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret);
return ret;
}
- public TwoTuple_PaymentHashPaymentSecretZ create_inbound_payment(Option_u64Z min_value_msat, number invoice_expiry_delta_secs, number user_payment_id) {
- number ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id);
- TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret);
- ret_hu_conv.ptrs_to.add(this);
+ public Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create_inbound_payment(Option_u64Z min_value_msat, number invoice_expiry_delta_secs) {
+ number ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs);
+ Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ create_inbound_payment_legacy(Option_u64Z min_value_msat, number invoice_expiry_delta_secs) {
+ number ret = bindings.ChannelManager_create_inbound_payment_legacy(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs);
+ Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
- public Result_PaymentSecretAPIErrorZ create_inbound_payment_for_hash(Uint8Array payment_hash, Option_u64Z min_value_msat, number invoice_expiry_delta_secs, number user_payment_id) {
- number ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id);
+ public Result_PaymentSecretNoneZ create_inbound_payment_for_hash(Uint8Array payment_hash, Option_u64Z min_value_msat, number invoice_expiry_delta_secs) {
+ number ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs);
+ Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public Result_PaymentSecretAPIErrorZ create_inbound_payment_for_hash_legacy(Uint8Array payment_hash, Option_u64Z min_value_msat, number invoice_expiry_delta_secs) {
+ number ret = bindings.ChannelManager_create_inbound_payment_for_hash_legacy(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs);
Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
+ public Result_PaymentPreimageAPIErrorZ get_payment_preimage(Uint8Array payment_hash, Uint8Array payment_secret) {
+ number ret = bindings.ChannelManager_get_payment_preimage(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32));
+ Result_PaymentPreimageAPIErrorZ ret_hu_conv = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
public MessageSendEventsProvider as_MessageSendEventsProvider() {
number ret = bindings.ChannelManager_as_MessageSendEventsProvider(this.ptr);
MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
return ret;
}
- public Result_NoneMonitorUpdateErrorZ update_monitor(ChannelMonitorUpdate updates, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
+ public Result_NoneNoneZ update_monitor(ChannelMonitorUpdate updates, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
number ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr & ~1, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
- Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
+ Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(updates);
this.ptrs_to.add(broadcaster);
this.ptrs_to.add(fee_estimator);
bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
}
- public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, number holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) {
- number ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1);
+ public COption_NoneZ get_opt_anchors() {
+ COption_NoneZ ret = bindings.ChannelTransactionParameters_get_opt_anchors(this.ptr);
+ return ret;
+ }
+
+ public void set_opt_anchors(COption_NoneZ val) {
+ bindings.ChannelTransactionParameters_set_opt_anchors(this.ptr, val);
+ }
+
+ public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, number holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg, COption_NoneZ opt_anchors_arg) {
+ number ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1, opt_anchors_arg);
const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class ChannelTypeFeatures extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.ChannelTypeFeatures_free(this.ptr);
+ }
+ }
+ public boolean eq(ChannelTypeFeatures b) {
+ boolean ret = bindings.ChannelTypeFeatures_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ this.ptrs_to.add(b);
+ return ret;
+ }
+
+ public number clone_ptr() {
+ number ret = bindings.ChannelTypeFeatures_clone_ptr(this.ptr);
+ return ret;
+ }
+
+ public ChannelTypeFeatures clone() {
+ number ret = bindings.ChannelTypeFeatures_clone(this.ptr);
+ const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public static ChannelTypeFeatures constructor_empty() {
+ number ret = bindings.ChannelTypeFeatures_empty();
+ const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public static ChannelTypeFeatures constructor_known() {
+ number ret = bindings.ChannelTypeFeatures_known();
+ const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public boolean requires_unknown_bits() {
+ boolean ret = bindings.ChannelTypeFeatures_requires_unknown_bits(this.ptr);
+ return ret;
+ }
+
+ public Uint8Array write() {
+ Uint8Array ret = bindings.ChannelTypeFeatures_write(this.ptr);
+ return ret;
+ }
+
+ public static Result_ChannelTypeFeaturesDecodeErrorZ constructor_read(Uint8Array ser) {
+ number ret = bindings.ChannelTypeFeatures_read(ser);
+ Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
if (raw_val instanceof bindings.LDKClosureReason.CommitmentTxConfirmed) {
return new CommitmentTxConfirmed(this.ptr, raw_val);
}
+ if (raw_val instanceof bindings.LDKClosureReason.FundingTimedOut) {
+ return new FundingTimedOut(this.ptr, raw_val);
+ }
if (raw_val instanceof bindings.LDKClosureReason.ProcessingError) {
return new ProcessingError(this.ptr, raw_val);
}
super(null, ptr);
}
}
+export class FundingTimedOut extends ClosureReason {
+ private constructor(ptr: number, obj: bindings.LDKClosureReason.FundingTimedOut) {
+ super(null, ptr);
+ }
+}
export class ProcessingError extends ClosureReason {
public err: String;
private constructor(ptr: number, obj: bindings.LDKClosureReason.ProcessingError) {
return ret_hu_conv;
}
+ public static ClosureReason constructor_funding_timed_out() {
+ number ret = bindings.ClosureReason_funding_timed_out();
+ ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
public static ClosureReason constructor_processing_error(String err) {
number ret = bindings.ClosureReason_processing_error(err);
ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
return ret_hu_conv;
}
+ public boolean opt_anchors() {
+ boolean ret = bindings.DirectedChannelTransactionParameters_opt_anchors(this.ptr);
+ return ret;
+ }
+
}
if (raw_val instanceof bindings.LDKErrorAction.IgnoreAndLog) {
return new IgnoreAndLog(this.ptr, raw_val);
}
+ if (raw_val instanceof bindings.LDKErrorAction.IgnoreDuplicateGossip) {
+ return new IgnoreDuplicateGossip(this.ptr, raw_val);
+ }
if (raw_val instanceof bindings.LDKErrorAction.SendErrorMessage) {
return new SendErrorMessage(this.ptr, raw_val);
}
this.ignore_and_log = obj.ignore_and_log;
}
}
+export class IgnoreDuplicateGossip extends ErrorAction {
+ private constructor(ptr: number, obj: bindings.LDKErrorAction.IgnoreDuplicateGossip) {
+ super(null, ptr);
+ }
+}
export class SendErrorMessage extends ErrorAction {
public msg: ErrorMessage;
private constructor(ptr: number, obj: bindings.LDKErrorAction.SendErrorMessage) {
return ret_hu_conv;
}
+ public static ErrorAction constructor_ignore_duplicate_gossip() {
+ number ret = bindings.ErrorAction_ignore_duplicate_gossip();
+ ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
public static ErrorAction constructor_send_error_message(ErrorMessage msg) {
number ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr & ~1);
ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
if (raw_val instanceof bindings.LDKEvent.PaymentPathFailed) {
return new PaymentPathFailed(this.ptr, raw_val);
}
+ if (raw_val instanceof bindings.LDKEvent.PaymentFailed) {
+ return new PaymentFailed(this.ptr, raw_val);
+ }
if (raw_val instanceof bindings.LDKEvent.PendingHTLCsForwardable) {
return new PendingHTLCsForwardable(this.ptr, raw_val);
}
if (raw_val instanceof bindings.LDKEvent.DiscardFunding) {
return new DiscardFunding(this.ptr, raw_val);
}
+ if (raw_val instanceof bindings.LDKEvent.PaymentPathSuccessful) {
+ return new PaymentPathSuccessful(this.ptr, raw_val);
+ }
throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
}
this.retry = retry_hu_conv;
}
}
+export class PaymentFailed extends Event {
+ public payment_id: Uint8Array;
+ public payment_hash: Uint8Array;
+ private constructor(ptr: number, obj: bindings.LDKEvent.PaymentFailed) {
+ super(null, ptr);
+ this.payment_id = obj.payment_id;
+ this.payment_hash = obj.payment_hash;
+ }
+}
export class PendingHTLCsForwardable extends Event {
public time_forwardable: number;
private constructor(ptr: number, obj: bindings.LDKEvent.PendingHTLCsForwardable) {
this.channel_id = obj.channel_id;
this.transaction = obj.transaction;
}
+}
+export class PaymentPathSuccessful extends Event {
+ public payment_id: Uint8Array;
+ public payment_hash: Uint8Array;
+ public path: RouteHop[];
+ private constructor(ptr: number, obj: bindings.LDKEvent.PaymentPathSuccessful) {
+ super(null, ptr);
+ this.payment_id = obj.payment_id;
+ this.payment_hash = obj.payment_hash;
+ const path: number[] = obj.path;
+ RouteHop[] path_conv_10_arr = new RouteHop[path.length];
+ for (int k = 0; k < path.length; k++) {
+ number path_conv_10 = path[k];
+ const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
+ path_conv_10_hu_conv.ptrs_to.add(this);
+ path_conv_10_arr[k] = path_conv_10_hu_conv;
+ }
+ this.path = path_conv_10_arr;
+ }
}
public number clone_ptr() {
number ret = bindings.Event_clone_ptr(this.ptr);
return ret_hu_conv;
}
+ public static Event constructor_payment_failed(Uint8Array payment_id, Uint8Array payment_hash) {
+ number ret = bindings.Event_payment_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32));
+ 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);
return ret_hu_conv;
}
+ public static Event constructor_payment_path_successful(Uint8Array payment_id, Uint8Array payment_hash, RouteHop[] path) {
+ number ret = bindings.Event_payment_path_successful(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), path != null ? Arrays.stream(path).map(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray(number[]::new) : null);
+ 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;
return ret_hu_conv;
}
+ public boolean opt_anchors() {
+ boolean ret = bindings.InMemorySigner_opt_anchors(this.ptr);
+ return ret;
+ }
+
public Result_CVec_CVec_u8ZZNoneZ sign_counterparty_payment_input(Uint8Array spend_tx, number input_idx, StaticPaymentOutputDescriptor descriptor) {
number ret = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1);
Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
return ret;
}
- public boolean supports_payment_secret() {
- boolean ret = bindings.InitFeatures_supports_payment_secret(this.ptr);
- return ret;
- }
-
public Uint8Array write() {
Uint8Array ret = bindings.InitFeatures_write(this.ptr);
return ret;
return ret;
}
- public boolean supports_payment_secret() {
- boolean ret = bindings.InvoiceFeatures_supports_payment_secret(this.ptr);
- return ret;
- }
-
public Uint8Array write() {
Uint8Array ret = bindings.InvoiceFeatures_write(this.ptr);
return ret;
bindings.InvoicePayer_free(this.ptr);
}
}
- public static InvoicePayer constructor_new(Payer payer, Router router, LockableScore scorer, Logger logger, EventHandler event_handler, RetryAttempts retry_attempts) {
+ public static InvoicePayer constructor_new(Payer payer, Router router, MultiThreadedLockableScore scorer, Logger logger, EventHandler event_handler, RetryAttempts retry_attempts) {
number ret = bindings.InvoicePayer_new(payer == null ? 0 : payer.ptr, router == null ? 0 : router.ptr, scorer == null ? 0 : scorer.ptr & ~1, logger == null ? 0 : logger.ptr, event_handler == null ? 0 : event_handler.ptr, retry_attempts == null ? 0 : retry_attempts.ptr & ~1);
const ret_hu_conv: InvoicePayer = new InvoicePayer(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
+ public Result_PaymentIdPaymentErrorZ pay_pubkey(Uint8Array pubkey, Uint8Array payment_preimage, number amount_msats, number final_cltv_expiry_delta) {
+ number ret = bindings.InvoicePayer_pay_pubkey(this.ptr, InternalUtils.check_arr_len(pubkey, 33), InternalUtils.check_arr_len(payment_preimage, 32), amount_msats, final_cltv_expiry_delta);
+ Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
public void remove_cached_payment(Uint8Array payment_hash) {
bindings.InvoicePayer_remove_cached_payment(this.ptr, InternalUtils.check_arr_len(payment_hash, 32));
}
return result;
},
+ get_inbound_payment_key_material (): Uint8Array {
+ Uint8Array ret = arg.get_inbound_payment_key_material();
+ result: Uint8Array = InternalUtils.check_arr_len(ret, 32);
+ return result;
+ },
+
};
impl_holder.held = new KeysInterface (null, structImplementation);
get_secure_random_bytes(): Uint8Array;
read_chan_signer(reader: Uint8Array): Result_SignDecodeErrorZ;
sign_invoice(invoice_preimage: Uint8Array): Result_RecoverableSignatureNoneZ;
+ get_inbound_payment_key_material(): Uint8Array;
}
return ret_hu_conv;
}
+ public Uint8Array get_inbound_payment_key_material() {
+ Uint8Array ret = bindings.KeysInterface_get_inbound_payment_key_material(this.ptr);
+ return ret;
+ }
+
}
- export default class LockableScore extends CommonBase {
- constructor(_dummy: object, ptr: number) {
- super(ptr);
+ export class LockableScore extends CommonBase {
+
+ bindings_instance?: bindings.LDKLockableScore;
+
+ constructor(ptr?: number, arg?: bindings.LDKLockableScore) {
+ if (Number.isFinite(ptr)) {
+ super(ptr);
+ this.bindings_instance = null;
+ } else {
+ // TODO: private constructor instantiation
+ super(bindings.LDKLockableScore_new(arg));
+ this.ptrs_to.push(arg);
+
+ }
}
-
protected finalize() {
- super.finalize();
-
if (this.ptr != 0) {
bindings.LockableScore_free(this.ptr);
}
+ super.finalize();
}
- public static LockableScore constructor_new(Score score) {
- number ret = bindings.LockableScore_new(score == null ? 0 : score.ptr);
- const ret_hu_conv: LockableScore = new LockableScore(null, ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- ret_hu_conv.ptrs_to.add(score);
- return ret_hu_conv;
- }
- public Uint8Array write() {
- Uint8Array ret = bindings.LockableScore_write(this.ptr);
- return ret;
+ static new_impl(arg: LockableScoreInterface): LockableScore {
+ const impl_holder: LDKLockableScoreHolder = new LDKLockableScoreHolder();
+ let structImplementation = <bindings.LDKLockableScore>{
+ // todo: in-line interface filling
+ lock (): number {
+ Score ret = arg.lock();
+ result: number = ret == null ? 0 : ret.ptr;
+ impl_holder.held.ptrs_to.add(ret);
+ return result;
+ },
+
+
+ };
+ impl_holder.held = new LockableScore (null, structImplementation);
+ }
+ }
+
+ export interface LockableScoreInterface {
+ lock(): Score;
+
+ }
+
+ class LDKLockableScoreHolder {
+ held: LockableScore;
+ }
+ public Score lock() {
+ number ret = bindings.LockableScore_lock(this.ptr);
+ Score ret_hu_conv = new Score(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
}
}
+++ /dev/null
-
-
-import CommonBase from './CommonBase';
-import * as bindings from '../bindings' // TODO: figure out location
-
-
-
- export default class MonitorUpdateError extends CommonBase {
- constructor(_dummy: object, ptr: number) {
- super(ptr);
- }
-
-
- protected finalize() {
- super.finalize();
-
- if (this.ptr != 0) {
- bindings.MonitorUpdateError_free(this.ptr);
- }
- }
- public String get_a() {
- String ret = bindings.MonitorUpdateError_get_a(this.ptr);
- return ret;
- }
-
- public void set_a(String val) {
- bindings.MonitorUpdateError_set_a(this.ptr, val);
- }
-
- public static MonitorUpdateError constructor_new(String a_arg) {
- number ret = bindings.MonitorUpdateError_new(a_arg);
- const ret_hu_conv: MonitorUpdateError = new MonitorUpdateError(null, ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- return ret_hu_conv;
- }
-
- public number clone_ptr() {
- number ret = bindings.MonitorUpdateError_clone_ptr(this.ptr);
- return ret;
- }
-
- public MonitorUpdateError clone() {
- number ret = bindings.MonitorUpdateError_clone(this.ptr);
- const ret_hu_conv: MonitorUpdateError = new MonitorUpdateError(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
-}
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class MultiThreadedLockableScore extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.MultiThreadedLockableScore_free(this.ptr);
+ }
+ }
+ public static MultiThreadedLockableScore constructor_new(Score score) {
+ number ret = bindings.MultiThreadedLockableScore_new(score == null ? 0 : score.ptr);
+ const ret_hu_conv: MultiThreadedLockableScore = new MultiThreadedLockableScore(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(score);
+ return ret_hu_conv;
+ }
+
+}
}
}
export class OnionV2 extends NetAddress {
- public addr: Uint8Array;
- public port: number;
+ public onion_v2: Uint8Array;
private constructor(ptr: number, obj: bindings.LDKNetAddress.OnionV2) {
super(null, ptr);
- this.addr = obj.addr;
- this.port = obj.port;
+ this.onion_v2 = obj.onion_v2;
}
}
export class OnionV3 extends NetAddress {
return ret_hu_conv;
}
- public static NetAddress constructor_onion_v2(Uint8Array addr, number port) {
- number ret = bindings.NetAddress_onion_v2(InternalUtils.check_arr_len(addr, 10), port);
+ public static NetAddress constructor_onion_v2(Uint8Array a) {
+ number ret = bindings.NetAddress_onion_v2(InternalUtils.check_arr_len(a, 12));
NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
bindings.NetworkGraph_fail_node(this.ptr, InternalUtils.check_arr_len(_node_id, 33), is_permanent);
}
+ public void remove_stale_channels_with_time(number current_time_unix) {
+ bindings.NetworkGraph_remove_stale_channels_with_time(this.ptr, current_time_unix);
+ }
+
public Result_NoneLightningErrorZ update_channel(ChannelUpdate msg) {
number ret = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : msg.ptr & ~1);
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
return ret;
}
- public boolean supports_payment_secret() {
- boolean ret = bindings.NodeFeatures_supports_payment_secret(this.ptr);
- return ret;
- }
-
public Uint8Array write() {
Uint8Array ret = bindings.NodeFeatures_write(this.ptr);
return ret;
bindings.OpenChannel_set_channel_flags(this.ptr, val);
}
+ public ChannelTypeFeatures get_channel_type() {
+ number ret = bindings.OpenChannel_get_channel_type(this.ptr);
+ const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_channel_type(ChannelTypeFeatures val) {
+ bindings.OpenChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr & ~1);
+ }
+
public number clone_ptr() {
number ret = bindings.OpenChannel_clone_ptr(this.ptr);
return ret;
return result;
},
+ send_spontaneous_payment (route: number, payment_preimage: Uint8Array): number {
+ const route_hu_conv: Route = new Route(null, route);
+ Result_PaymentIdPaymentSendFailureZ ret = arg.send_spontaneous_payment(route_hu_conv, payment_preimage);
+ result: number = ret == null ? 0 : ret.clone_ptr();
+ return result;
+ },
+
retry_payment (route: number, payment_id: Uint8Array): number {
const route_hu_conv: Route = new Route(null, route);
Result_NonePaymentSendFailureZ ret = arg.retry_payment(route_hu_conv, payment_id);
return result;
},
+ abandon_payment (payment_id: Uint8Array): void {
+ arg.abandon_payment(payment_id);
+ },
+
};
impl_holder.held = new Payer (null, structImplementation);
node_id(): Uint8Array;
first_hops(): ChannelDetails[];
send_payment(route: Route, payment_hash: Uint8Array, payment_secret: Uint8Array): Result_PaymentIdPaymentSendFailureZ;
+ send_spontaneous_payment(route: Route, payment_preimage: Uint8Array): Result_PaymentIdPaymentSendFailureZ;
retry_payment(route: Route, payment_id: Uint8Array): Result_NonePaymentSendFailureZ;
+ abandon_payment(payment_id: Uint8Array): void;
}
return ret_hu_conv;
}
+ public Result_PaymentIdPaymentSendFailureZ send_spontaneous_payment(Route route, Uint8Array payment_preimage) {
+ number ret = bindings.Payer_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_preimage, 32));
+ Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
+ this.ptrs_to.add(route);
+ return ret_hu_conv;
+ }
+
public Result_NonePaymentSendFailureZ retry_payment(Route route, Uint8Array payment_id) {
number ret = bindings.Payer_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, InternalUtils.check_arr_len(payment_id, 32));
Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
}
+ public void abandon_payment(Uint8Array payment_id) {
+ bindings.Payer_abandon_payment(this.ptr, InternalUtils.check_arr_len(payment_id, 32));
+ }
+
}
export class InvoicePayment extends PaymentPurpose {
public payment_preimage: Uint8Array;
public payment_secret: Uint8Array;
- public user_payment_id: number;
private constructor(ptr: number, obj: bindings.LDKPaymentPurpose.InvoicePayment) {
super(null, ptr);
this.payment_preimage = obj.payment_preimage;
this.payment_secret = obj.payment_secret;
- this.user_payment_id = obj.user_payment_id;
}
}
export class SpontaneousPayment extends PaymentPurpose {
return ret_hu_conv;
}
- public static PaymentPurpose constructor_invoice_payment(Uint8Array payment_preimage, Uint8Array payment_secret, number user_payment_id) {
- number ret = bindings.PaymentPurpose_invoice_payment(InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_secret, 32), user_payment_id);
+ public static PaymentPurpose constructor_invoice_payment(Uint8Array payment_preimage, Uint8Array payment_secret) {
+ number ret = bindings.PaymentPurpose_invoice_payment(InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_secret, 32));
PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ extends CommonBase {
+ private Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(ptr)) {
+ return new Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK(null, ptr);
+ } else {
+ return new Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK extends Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+ public final TwoTuple_PaymentHashPaymentSecretZ res;
+ private Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(ptr);
+ TwoTuple_PaymentHashPaymentSecretZ res_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err extends Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
+ public final APIError err;
+ private Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(ptr);
+ APIError err_hu_conv = APIError.constr_from_ptr(err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ }
+
+ public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ constructor_ok(TwoTuple_PaymentHashPaymentSecretZ o) {
+ number ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o != null ? o.ptr : 0);
+ Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ constructor_err(APIError e) {
+ number ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e.ptr);
+ Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(this.ptr);
+ return ret;
+ }
+
+ public number clone_ptr() {
+ number ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(this.ptr);
+ return ret;
+ }
+
+ public Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ clone() {
+ number ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(this.ptr);
+ Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_C2Tuple_PaymentHashPaymentSecretZNoneZ extends CommonBase {
+ private Result_C2Tuple_PaymentHashPaymentSecretZNoneZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(ptr); } super.finalize();
+ }
+
+ static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(ptr)) {
+ return new Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_OK(null, ptr);
+ } else {
+ return new Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_OK extends Result_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+ public final TwoTuple_PaymentHashPaymentSecretZ res;
+ private Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(ptr);
+ TwoTuple_PaymentHashPaymentSecretZ res_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_Err extends Result_C2Tuple_PaymentHashPaymentSecretZNoneZ {
+ private Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ }
+ }
+
+ public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ constructor_ok(TwoTuple_PaymentHashPaymentSecretZ o) {
+ number ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o != null ? o.ptr : 0);
+ Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ constructor_err() {
+ number ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
+ Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(this.ptr);
+ return ret;
+ }
+
+ public number clone_ptr() {
+ number ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(this.ptr);
+ return ret;
+ }
+
+ public Result_C2Tuple_PaymentHashPaymentSecretZNoneZ clone() {
+ number ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(this.ptr);
+ Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_ChannelTypeFeaturesDecodeErrorZ extends CommonBase {
+ private Result_ChannelTypeFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelTypeFeaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(ptr)) {
+ return new Result_ChannelTypeFeaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelTypeFeaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelTypeFeaturesDecodeErrorZ_OK extends Result_ChannelTypeFeaturesDecodeErrorZ {
+ public final ChannelTypeFeatures res;
+ private Result_ChannelTypeFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_ChannelTypeFeaturesDecodeErrorZ_Err extends Result_ChannelTypeFeaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelTypeFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_ChannelTypeFeaturesDecodeErrorZ_get_err(ptr);
+ const err_hu_conv: DecodeError = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ }
+
+ public static Result_ChannelTypeFeaturesDecodeErrorZ constructor_ok(ChannelTypeFeatures o) {
+ number ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Result_ChannelTypeFeaturesDecodeErrorZ constructor_err(DecodeError e) {
+ number ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(this.ptr);
+ return ret;
+ }
+
+}
+++ /dev/null
-
-import CommonBase from './CommonBase';
-import * as bindings from '../bindings' // TODO: figure out location
-
-public class Result_NoneMonitorUpdateErrorZ extends CommonBase {
- private Result_NoneMonitorUpdateErrorZ(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_NoneMonitorUpdateErrorZ_free(ptr); } super.finalize();
- }
-
- static Result_NoneMonitorUpdateErrorZ constr_from_ptr(long ptr) {
- if (bindings.CResult_NoneMonitorUpdateErrorZ_is_ok(ptr)) {
- return new Result_NoneMonitorUpdateErrorZ_OK(null, ptr);
- } else {
- return new Result_NoneMonitorUpdateErrorZ_Err(null, ptr);
- }
- }
- public static final class Result_NoneMonitorUpdateErrorZ_OK extends Result_NoneMonitorUpdateErrorZ {
- private Result_NoneMonitorUpdateErrorZ_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- }
- }
-
- public static final class Result_NoneMonitorUpdateErrorZ_Err extends Result_NoneMonitorUpdateErrorZ {
- public final MonitorUpdateError err;
- private Result_NoneMonitorUpdateErrorZ_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- number err = bindings.LDKCResult_NoneMonitorUpdateErrorZ_get_err(ptr);
- const err_hu_conv: MonitorUpdateError = new MonitorUpdateError(null, err);
- err_hu_conv.ptrs_to.add(this);
- this.err = err_hu_conv;
- }
- }
-
- public static Result_NoneMonitorUpdateErrorZ constructor_ok() {
- number ret = bindings.CResult_NoneMonitorUpdateErrorZ_ok();
- Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- public static Result_NoneMonitorUpdateErrorZ constructor_err(MonitorUpdateError e) {
- number ret = bindings.CResult_NoneMonitorUpdateErrorZ_err(e == null ? 0 : e.ptr & ~1);
- Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- public boolean is_ok() {
- boolean ret = bindings.CResult_NoneMonitorUpdateErrorZ_is_ok(this.ptr);
- return ret;
- }
-
- public number clone_ptr() {
- number ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone_ptr(this.ptr);
- return ret;
- }
-
- public Result_NoneMonitorUpdateErrorZ clone() {
- number ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone(this.ptr);
- Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
-}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_PaymentPreimageAPIErrorZ extends CommonBase {
+ private Result_PaymentPreimageAPIErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PaymentPreimageAPIErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PaymentPreimageAPIErrorZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_PaymentPreimageAPIErrorZ_is_ok(ptr)) {
+ return new Result_PaymentPreimageAPIErrorZ_OK(null, ptr);
+ } else {
+ return new Result_PaymentPreimageAPIErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PaymentPreimageAPIErrorZ_OK extends Result_PaymentPreimageAPIErrorZ {
+ public final Uint8Array res;
+ private Result_PaymentPreimageAPIErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_PaymentPreimageAPIErrorZ_get_ok(ptr);
+ }
+ }
+
+ public static final class Result_PaymentPreimageAPIErrorZ_Err extends Result_PaymentPreimageAPIErrorZ {
+ public final APIError err;
+ private Result_PaymentPreimageAPIErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_PaymentPreimageAPIErrorZ_get_err(ptr);
+ APIError err_hu_conv = APIError.constr_from_ptr(err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ }
+
+ public static Result_PaymentPreimageAPIErrorZ constructor_ok(Uint8Array o) {
+ number ret = bindings.CResult_PaymentPreimageAPIErrorZ_ok(InternalUtils.check_arr_len(o, 32));
+ Result_PaymentPreimageAPIErrorZ ret_hu_conv = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Result_PaymentPreimageAPIErrorZ constructor_err(APIError e) {
+ number ret = bindings.CResult_PaymentPreimageAPIErrorZ_err(e.ptr);
+ Result_PaymentPreimageAPIErrorZ ret_hu_conv = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_PaymentPreimageAPIErrorZ_is_ok(this.ptr);
+ return ret;
+ }
+
+ public number clone_ptr() {
+ number ret = bindings.CResult_PaymentPreimageAPIErrorZ_clone_ptr(this.ptr);
+ return ret;
+ }
+
+ public Result_PaymentPreimageAPIErrorZ clone() {
+ number ret = bindings.CResult_PaymentPreimageAPIErrorZ_clone(this.ptr);
+ Result_PaymentPreimageAPIErrorZ ret_hu_conv = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_PaymentSecretNoneZ extends CommonBase {
+ private Result_PaymentSecretNoneZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PaymentSecretNoneZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PaymentSecretNoneZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_PaymentSecretNoneZ_is_ok(ptr)) {
+ return new Result_PaymentSecretNoneZ_OK(null, ptr);
+ } else {
+ return new Result_PaymentSecretNoneZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PaymentSecretNoneZ_OK extends Result_PaymentSecretNoneZ {
+ public final Uint8Array res;
+ private Result_PaymentSecretNoneZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_PaymentSecretNoneZ_get_ok(ptr);
+ }
+ }
+
+ public static final class Result_PaymentSecretNoneZ_Err extends Result_PaymentSecretNoneZ {
+ private Result_PaymentSecretNoneZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ }
+ }
+
+ public static Result_PaymentSecretNoneZ constructor_ok(Uint8Array o) {
+ number ret = bindings.CResult_PaymentSecretNoneZ_ok(InternalUtils.check_arr_len(o, 32));
+ Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Result_PaymentSecretNoneZ constructor_err() {
+ number ret = bindings.CResult_PaymentSecretNoneZ_err();
+ Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_PaymentSecretNoneZ_is_ok(this.ptr);
+ return ret;
+ }
+
+ public number clone_ptr() {
+ number ret = bindings.CResult_PaymentSecretNoneZ_clone_ptr(this.ptr);
+ return ret;
+ }
+
+ public Result_PaymentSecretNoneZ clone() {
+ number ret = bindings.CResult_PaymentSecretNoneZ_clone(this.ptr);
+ Result_PaymentSecretNoneZ ret_hu_conv = Result_PaymentSecretNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
}
}
- public static Result_ScoringParametersDecodeErrorZ constructor_ok(number o_base_penalty_msat_arg, number o_failure_penalty_msat_arg, number o_failure_penalty_half_life_arg) {
- number ret = bindings.CResult_ScoringParametersDecodeErrorZ_ok(bindings.ScoringParameters_new(o_base_penalty_msat_arg, o_failure_penalty_msat_arg, o_failure_penalty_half_life_arg));
+ public static Result_ScoringParametersDecodeErrorZ constructor_ok(number o_base_penalty_msat_arg, number o_failure_penalty_msat_arg, number o_overuse_penalty_start_1024th_arg, number o_overuse_penalty_msat_per_1024th_arg, number o_failure_penalty_half_life_arg) {
+ number ret = bindings.CResult_ScoringParametersDecodeErrorZ_ok(bindings.ScoringParameters_new(o_base_penalty_msat_arg, o_failure_penalty_msat_arg, o_overuse_penalty_start_1024th_arg, o_overuse_penalty_msat_per_1024th_arg, o_failure_penalty_half_life_arg));
Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
const impl_holder: LDKRouterHolder = new LDKRouterHolder();
let structImplementation = <bindings.LDKRouter>{
// todo: in-line interface filling
- find_route (payer: Uint8Array, params: number, first_hops: number[], scorer: number): number {
+ find_route (payer: Uint8Array, params: number, payment_hash: Uint8Array, first_hops: number[], scorer: number): number {
const params_hu_conv: RouteParameters = new RouteParameters(null, params);
ChannelDetails[] first_hops_conv_16_arr = new ChannelDetails[first_hops.length];
for (int q = 0; q < first_hops.length; q++) {
}
Score ret_hu_conv = new Score(null, scorer);
ret_hu_conv.ptrs_to.add(this);
- Result_RouteLightningErrorZ ret = arg.find_route(payer, params_hu_conv, first_hops_conv_16_arr, ret_hu_conv);
+ Result_RouteLightningErrorZ ret = arg.find_route(payer, params_hu_conv, payment_hash, first_hops_conv_16_arr, ret_hu_conv);
result: number = ret == null ? 0 : ret.clone_ptr();
return result;
},
}
export interface RouterInterface {
- find_route(payer: Uint8Array, params: RouteParameters, first_hops: ChannelDetails[], scorer: Score): Result_RouteLightningErrorZ;
+ find_route(payer: Uint8Array, params: RouteParameters, payment_hash: Uint8Array, first_hops: ChannelDetails[], scorer: Score): Result_RouteLightningErrorZ;
}
class LDKRouterHolder {
held: Router;
}
- public Result_RouteLightningErrorZ find_route(Uint8Array payer, RouteParameters params, ChannelDetails[] first_hops, Score scorer) {
- number ret = bindings.Router_find_route(this.ptr, InternalUtils.check_arr_len(payer, 33), params == null ? 0 : params.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).map(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(number[]::new) : null, scorer == null ? 0 : scorer.ptr);
+ public Result_RouteLightningErrorZ find_route(Uint8Array payer, RouteParameters params, Uint8Array payment_hash, ChannelDetails[] first_hops, Score scorer) {
+ number ret = bindings.Router_find_route(this.ptr, InternalUtils.check_arr_len(payer, 33), params == null ? 0 : params.ptr & ~1, InternalUtils.check_arr_len(payment_hash, 32), first_hops != null ? Arrays.stream(first_hops).map(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(number[]::new) : null, scorer == null ? 0 : scorer.ptr);
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(params);
for (ChannelDetails first_hops_conv_16: first_hops) { this.ptrs_to.add(first_hops_conv_16); };
const impl_holder: LDKScoreHolder = new LDKScoreHolder();
let structImplementation = <bindings.LDKScore>{
// todo: in-line interface filling
- channel_penalty_msat (short_channel_id: number, source: number, target: number): number {
+ channel_penalty_msat (short_channel_id: number, send_amt_msat: number, channel_capacity_msat: number, source: number, target: number): number {
+ Option_u64Z channel_capacity_msat_hu_conv = Option_u64Z.constr_from_ptr(channel_capacity_msat);
+ channel_capacity_msat_hu_conv.ptrs_to.add(this);
const source_hu_conv: NodeId = new NodeId(null, source);
const target_hu_conv: NodeId = new NodeId(null, target);
- number ret = arg.channel_penalty_msat(short_channel_id, source_hu_conv, target_hu_conv);
+ number ret = arg.channel_penalty_msat(short_channel_id, send_amt_msat, channel_capacity_msat_hu_conv, source_hu_conv, target_hu_conv);
return ret;
},
arg.payment_path_failed(path_conv_10_arr, short_channel_id);
},
+ payment_path_successful (path: number[]): void {
+ RouteHop[] path_conv_10_arr = new RouteHop[path.length];
+ for (int k = 0; k < path.length; k++) {
+ number path_conv_10 = path[k];
+ const path_conv_10_hu_conv: RouteHop = new RouteHop(null, path_conv_10);
+ path_conv_10_hu_conv.ptrs_to.add(this);
+ path_conv_10_arr[k] = path_conv_10_hu_conv;
+ }
+ arg.payment_path_successful(path_conv_10_arr);
+ },
+
write (): Uint8Array {
Uint8Array ret = arg.write();
return ret;
}
export interface ScoreInterface {
- channel_penalty_msat(short_channel_id: number, source: NodeId, target: NodeId): number;
+ channel_penalty_msat(short_channel_id: number, send_amt_msat: number, channel_capacity_msat: Option_u64Z, source: NodeId, target: NodeId): number;
payment_path_failed(path: RouteHop[], short_channel_id: number): void;
+ payment_path_successful(path: RouteHop[]): void;
write(): Uint8Array;
}
class LDKScoreHolder {
held: Score;
}
- public number channel_penalty_msat(number short_channel_id, NodeId source, NodeId target) {
- number ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, source == null ? 0 : source.ptr & ~1, target == null ? 0 : target.ptr & ~1);
+ public number channel_penalty_msat(number short_channel_id, number send_amt_msat, Option_u64Z channel_capacity_msat, NodeId source, NodeId target) {
+ number ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, send_amt_msat, channel_capacity_msat.ptr, source == null ? 0 : source.ptr & ~1, target == null ? 0 : target.ptr & ~1);
this.ptrs_to.add(source);
this.ptrs_to.add(target);
return ret;
bindings.Score_payment_path_failed(this.ptr, path != null ? Arrays.stream(path).map(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray(number[]::new) : null, short_channel_id);
}
+ public void payment_path_successful(RouteHop[] path) {
+ bindings.Score_payment_path_successful(this.ptr, path != null ? Arrays.stream(path).map(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr & ~1).toArray(number[]::new) : null);
+ }
+
public Uint8Array write() {
Uint8Array ret = bindings.Score_write(this.ptr);
return ret;
bindings.Scorer_free(this.ptr);
}
}
- public static Scorer constructor_new(number params_base_penalty_msat_arg, number params_failure_penalty_msat_arg, number params_failure_penalty_half_life_arg) {
- number ret = bindings.Scorer_new(bindings.ScoringParameters_new(params_base_penalty_msat_arg, params_failure_penalty_msat_arg, params_failure_penalty_half_life_arg));
+ public static Scorer constructor_new(number params_base_penalty_msat_arg, number params_failure_penalty_msat_arg, number params_overuse_penalty_start_1024th_arg, number params_overuse_penalty_msat_per_1024th_arg, number params_failure_penalty_half_life_arg) {
+ number ret = bindings.Scorer_new(bindings.ScoringParameters_new(params_base_penalty_msat_arg, params_failure_penalty_msat_arg, params_overuse_penalty_start_1024th_arg, params_overuse_penalty_msat_per_1024th_arg, params_failure_penalty_half_life_arg));
const ret_hu_conv: Scorer = new Scorer(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
bindings.ScoringParameters_set_failure_penalty_msat(this.ptr, val);
}
+ public number get_overuse_penalty_start_1024th() {
+ number ret = bindings.ScoringParameters_get_overuse_penalty_start_1024th(this.ptr);
+ return ret;
+ }
+
+ public void set_overuse_penalty_start_1024th(number val) {
+ bindings.ScoringParameters_set_overuse_penalty_start_1024th(this.ptr, val);
+ }
+
+ public number get_overuse_penalty_msat_per_1024th() {
+ number ret = bindings.ScoringParameters_get_overuse_penalty_msat_per_1024th(this.ptr);
+ return ret;
+ }
+
+ public void set_overuse_penalty_msat_per_1024th(number val) {
+ bindings.ScoringParameters_set_overuse_penalty_msat_per_1024th(this.ptr, val);
+ }
+
public number get_failure_penalty_half_life() {
number ret = bindings.ScoringParameters_get_failure_penalty_half_life(this.ptr);
return ret;
bindings.ScoringParameters_set_failure_penalty_half_life(this.ptr, val);
}
- public static ScoringParameters constructor_new(number base_penalty_msat_arg, number failure_penalty_msat_arg, number failure_penalty_half_life_arg) {
- number ret = bindings.ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, failure_penalty_half_life_arg);
+ public static ScoringParameters constructor_new(number base_penalty_msat_arg, number failure_penalty_msat_arg, number overuse_penalty_start_1024th_arg, number overuse_penalty_msat_per_1024th_arg, number failure_penalty_half_life_arg) {
+ number ret = bindings.ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg);
const ret_hu_conv: ScoringParameters = new ScoringParameters(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
return ret_hu_conv;
}
+ public boolean opt_anchors() {
+ boolean ret = bindings.TrustedCommitmentTransaction_opt_anchors(this.ptr);
+ return ret;
+ }
+
public Result_CVec_SignatureZNoneZ get_htlc_sigs(Uint8Array htlc_base_key, DirectedChannelTransactionParameters channel_parameters) {
number ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
bindings.UserConfig_set_accept_forwards_to_priv_channels(this.ptr, val);
}
- public static UserConfig constructor_new(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg, boolean accept_forwards_to_priv_channels_arg) {
- number ret = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1, accept_forwards_to_priv_channels_arg);
+ public boolean get_accept_inbound_channels() {
+ boolean ret = bindings.UserConfig_get_accept_inbound_channels(this.ptr);
+ return ret;
+ }
+
+ public void set_accept_inbound_channels(boolean val) {
+ bindings.UserConfig_set_accept_inbound_channels(this.ptr, val);
+ }
+
+ public static UserConfig constructor_new(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg) {
+ number ret = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg);
const ret_hu_conv: UserConfig = new UserConfig(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
+ public static COption_NoneZ constructor_COption_NoneZ_some() {
+ COption_NoneZ ret = bindings.COption_NoneZ_some();
+ return ret;
+ }
+
+ public static COption_NoneZ constructor_COption_NoneZ_none() {
+ COption_NoneZ ret = bindings.COption_NoneZ_none();
+ return ret;
+ }
+
public static Result_COption_ClosureReasonZDecodeErrorZ constructor_ClosureReason_read(Uint8Array ser) {
number ret = bindings.ClosureReason_read(ser);
Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
+ public static number constructor_htlc_success_tx_weight(boolean opt_anchors) {
+ number ret = bindings.htlc_success_tx_weight(opt_anchors);
+ return ret;
+ }
+
+ public static number constructor_htlc_timeout_tx_weight(boolean opt_anchors) {
+ number ret = bindings.htlc_timeout_tx_weight(opt_anchors);
+ return ret;
+ }
+
public static Uint8Array constructor_build_commitment_secret(Uint8Array commitment_seed, number idx) {
Uint8Array ret = bindings.build_commitment_secret(InternalUtils.check_arr_len(commitment_seed, 32), idx);
return ret;
return ret;
}
- public static Uint8Array constructor_get_htlc_redeemscript(HTLCOutputInCommitment htlc, TxCreationKeys keys) {
- Uint8Array ret = bindings.get_htlc_redeemscript(htlc == null ? 0 : htlc.ptr & ~1, keys == null ? 0 : keys.ptr & ~1);
+ public static Uint8Array constructor_get_htlc_redeemscript(HTLCOutputInCommitment htlc, boolean opt_anchors, TxCreationKeys keys) {
+ Uint8Array ret = bindings.get_htlc_redeemscript(htlc == null ? 0 : htlc.ptr & ~1, opt_anchors, keys == null ? 0 : keys.ptr & ~1);
// this.ptrs_to.add(htlc);
// this.ptrs_to.add(keys);
return ret;
return ret;
}
- public static Uint8Array constructor_build_htlc_transaction(Uint8Array commitment_txid, number feerate_per_kw, number contest_delay, HTLCOutputInCommitment htlc, Uint8Array broadcaster_delayed_payment_key, Uint8Array revocation_key) {
- Uint8Array ret = bindings.build_htlc_transaction(InternalUtils.check_arr_len(commitment_txid, 32), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr & ~1, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33), InternalUtils.check_arr_len(revocation_key, 33));
+ public static Uint8Array constructor_build_htlc_transaction(Uint8Array commitment_txid, number feerate_per_kw, number contest_delay, HTLCOutputInCommitment htlc, boolean opt_anchors, Uint8Array broadcaster_delayed_payment_key, Uint8Array revocation_key) {
+ Uint8Array ret = bindings.build_htlc_transaction(InternalUtils.check_arr_len(commitment_txid, 32), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr & ~1, opt_anchors, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33), InternalUtils.check_arr_len(revocation_key, 33));
// this.ptrs_to.add(htlc);
return ret;
}
+ public static Uint8Array constructor_get_anchor_redeemscript(Uint8Array funding_pubkey) {
+ Uint8Array ret = bindings.get_anchor_redeemscript(InternalUtils.check_arr_len(funding_pubkey, 33));
+ return ret;
+ }
+
public static number constructor_get_commitment_transaction_number_obscure_factor(Uint8Array broadcaster_payment_basepoint, Uint8Array countersignatory_payment_basepoint, boolean outbound_from_broadcaster) {
number ret = bindings.get_commitment_transaction_number_obscure_factor(InternalUtils.check_arr_len(broadcaster_payment_basepoint, 33), InternalUtils.check_arr_len(countersignatory_payment_basepoint, 33), outbound_from_broadcaster);
return ret;